@wjarka/cezarion 0.14.1 → 0.14.2

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.
Files changed (32) hide show
  1. package/package.json +3 -3
  2. package/web/dist/assets/{agent-accounts-MT-jtwOU.js → agent-accounts-BP0XBzQP.js} +1 -1
  3. package/web/dist/assets/alert-dialog-Bv9zV9w1.js +43 -0
  4. package/web/dist/assets/{collapsible-CkSaP6_n.js → collapsible-D7QXWXZq.js} +1 -1
  5. package/web/dist/assets/{commit-list-B47VXJez.js → commit-list-AwLNQE91.js} +1 -1
  6. package/web/dist/assets/{compare-variants-DNqtPFUv.js → compare-variants-CBggabVc.js} +1 -1
  7. package/web/dist/assets/{diff-controls-D5b8ocJ0.js → diff-controls-74Z0C3ay.js} +1 -1
  8. package/web/dist/assets/{dropdown-menu-xYcDecNM.js → dropdown-menu-DkzcT6aO.js} +1 -1
  9. package/web/dist/assets/{git-toolbar-C4zVVSpl.js → git-toolbar-Dntzprrr.js} +1 -1
  10. package/web/dist/assets/{github-D97-DHsF.js → github-CBYawanT.js} +1 -1
  11. package/web/dist/assets/{index-ujHRHX5o.js → index-BpI26cbM.js} +3 -3
  12. package/web/dist/assets/{index-hcgmKBPj.css → index-CG0CPeOx.css} +1 -1
  13. package/web/dist/assets/{markdown-CIi0LXvU.js → markdown-BssEOroY.js} +1 -1
  14. package/web/dist/assets/pill-C7gWe96Z.js +1 -0
  15. package/web/dist/assets/{project-router-BOglfKgF.js → project-router-a1gx3dfP.js} +1 -1
  16. package/web/dist/assets/{prompt-templates-DTSPmJP-.js → prompt-templates-B4eJ8kQZ.js} +1 -1
  17. package/web/dist/assets/{repo-git-DvxUSPot.js → repo-git-D8GN9ork.js} +1 -1
  18. package/web/dist/assets/{run-diff-DEVs-zV1.js → run-diff-CHDwMBEQ.js} +1 -1
  19. package/web/dist/assets/{run-header-Dvb1P3Ge.js → run-header-BlqnTQeP.js} +1 -1
  20. package/web/dist/assets/{skills-DJ06RZbi.js → skills-CkWBfIfQ.js} +1 -1
  21. package/web/dist/assets/{tab-link-ChqeHA8K.js → tab-link-DRP4FV8D.js} +1 -1
  22. package/web/dist/assets/{task-changes-CIN0MkJE.js → task-changes-CEyHhiK1.js} +1 -1
  23. package/web/dist/assets/{task-commits-BRZshVHV.js → task-commits-DTdRtZur.js} +1 -1
  24. package/web/dist/assets/{task-files-BZTNbpcP.js → task-files-Cr2qKUk2.js} +1 -1
  25. package/web/dist/assets/{task-thread-D_N6ELtr.js → task-thread-C8XeQXO4.js} +1 -1
  26. package/web/dist/assets/{textarea-DdKiIORK.js → textarea-DAHMUyAp.js} +1 -1
  27. package/web/dist/assets/{thread-loading-BRM8kyKz.js → thread-loading-OtvWGq9Y.js} +1 -1
  28. package/web/dist/assets/{token-metrics-DDvhrHmK.js → token-metrics-Q0paVq5n.js} +1 -1
  29. package/web/dist/assets/{workflows-CplF7YNk.js → workflows-uDL1z3Qp.js} +1 -1
  30. package/web/dist/index.html +12 -12
  31. package/web/dist/assets/alert-dialog-KUiPIBmb.js +0 -43
  32. package/web/dist/assets/pill-DDhByAhe.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Jt as i,Qn as a,U as o,Zn as s,d as c,ei as l,er as u,gt as d,l as f,st as p,xa as m}from"./alert-dialog-KUiPIBmb.js";import{u as h}from"./pill-DDhByAhe.js";import{n as g}from"./diff-controls-D5b8ocJ0.js";import{t as _}from"./run-header-Dvb1P3Ge.js";import{t as v}from"./project-router-BOglfKgF.js";import{t as y}from"./search-x-I9Q8pgUa.js";import{t as b}from"./diff-stat-B7f-F8cC.js";import{n as x,r as S}from"./index-ujHRHX5o.js";import{t as C}from"./diff-C4aSZfrQ2.js";import{t as w}from"./use-desktop-BaYgO7YW.js";import{t as T}from"./commit-list-B47VXJez.js";var E=e(t(),1),D=n();function O(){let{id:e}=m(),t=s(e);return t.isPending?(0,D.jsx)(S,{tab:`changes`}):t.isError?(0,D.jsx)(x,{tab:`changes`,error:t.error}):(0,D.jsx)(k,{run:t.data})}function k({run:e}){let{sha:t}=m(),n=u(e.id,h(e.status));return(0,D.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,D.jsx)(_,{run:e,tab:`commits`}),t?(0,D.jsx)(A,{runId:e.id,sha:t}):n.isPending?(0,D.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,D.jsx)(f,{icon:(0,D.jsx)(d,{size:16}),tone:n.error instanceof l&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof l&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,D.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,D.jsx)(T,{slot:`task-commits`,heading:(0,D.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,D.jsx)(j,{run:e})]})]})}function A({runId:e,sha:t}){let n=r(e,t),a=w(),[s,u]=(0,E.useState)(`unified`),[p,m]=(0,E.useState)(!1),h=n.isError&&n.error instanceof l&&n.error.status===409,_=a?s:`unified`,x=!a||p;return(0,D.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,D.jsx)(c,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,D.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,D.jsx)(o,{size:16,"aria-hidden":`true`}),`All commits`]})}),n.data?(0,D.jsx)(b,{stat:n.data.stat}):null,(0,D.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,D.jsx)(g,{mode:s,wrap:p,onModeChange:u,onWrapChange:m})})]}),n.isPending?(0,D.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,D.jsx)(f,{icon:h?(0,D.jsx)(y,{}):(0,D.jsx)(i,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,D.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,D.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,D.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,D.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`,children:(0,D.jsx)(C,{files:n.data.files,mode:_,wrap:x,className:`min-w-0`})})]})]})}function j({run:e}){let t=a(e.id,h(e.status));return t.isPending?(0,D.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,D.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,D.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,D.jsxs)(`h2`,{className:`mb-4 text-[15px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,D.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(v,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,D.jsx)(p,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,D.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{O as TaskCommitsRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$n as r,Jt as i,Qn as a,U as o,Zn as s,d as c,ei as l,er as u,gt as d,l as f,st as p,xa as m}from"./alert-dialog-Bv9zV9w1.js";import{u as h}from"./pill-C7gWe96Z.js";import{n as g}from"./diff-controls-74Z0C3ay.js";import{t as _}from"./run-header-BlqnTQeP.js";import{t as v}from"./project-router-a1gx3dfP.js";import{t as y}from"./search-x-I9Q8pgUa.js";import{t as b}from"./diff-stat-B7f-F8cC.js";import{n as x,r as S}from"./index-BpI26cbM.js";import{t as C}from"./diff-C4aSZfrQ2.js";import{t as w}from"./use-desktop-BaYgO7YW.js";import{t as T}from"./commit-list-AwLNQE91.js";var E=e(t(),1),D=n();function O(){let{id:e}=m(),t=s(e);return t.isPending?(0,D.jsx)(S,{tab:`changes`}):t.isError?(0,D.jsx)(x,{tab:`changes`,error:t.error}):(0,D.jsx)(k,{run:t.data})}function k({run:e}){let{sha:t}=m(),n=u(e.id,h(e.status));return(0,D.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,D.jsx)(_,{run:e,tab:`commits`}),t?(0,D.jsx)(A,{runId:e.id,sha:t}):n.isPending?(0,D.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,D.jsx)(f,{icon:(0,D.jsx)(d,{size:16}),tone:n.error instanceof l&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof l&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,D.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,D.jsx)(T,{slot:`task-commits`,heading:(0,D.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,D.jsx)(j,{run:e})]})]})}function A({runId:e,sha:t}){let n=r(e,t),a=w(),[s,u]=(0,E.useState)(`unified`),[p,m]=(0,E.useState)(!1),h=n.isError&&n.error instanceof l&&n.error.status===409,_=a?s:`unified`,x=!a||p;return(0,D.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,D.jsx)(c,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,D.jsxs)(v,{to:`/tasks/${e}/commits`,children:[(0,D.jsx)(o,{size:16,"aria-hidden":`true`}),`All commits`]})}),n.data?(0,D.jsx)(b,{stat:n.data.stat}):null,(0,D.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,D.jsx)(g,{mode:s,wrap:p,onModeChange:u,onWrapChange:m})})]}),n.isPending?(0,D.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,D.jsx)(f,{icon:h?(0,D.jsx)(y,{}):(0,D.jsx)(i,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,D.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,D.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,D.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,D.jsx)(f,{icon:(0,D.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,D.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`,children:(0,D.jsx)(C,{files:n.data.files,mode:_,wrap:x,className:`min-w-0`})})]})]})}function j({run:e}){let t=a(e.id,h(e.status));return t.isPending?(0,D.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,D.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,D.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,D.jsxs)(`h2`,{className:`mb-4 text-[15px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,D.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(v,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,D.jsx)(p,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,D.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{O as TaskCommitsRoute};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Jt as r,Lt as i,Qi as a,X as o,Zn as s,d as c,ei as l,l as u,lt as d,nr as f,st as p,ut as m,xa as h}from"./alert-dialog-KUiPIBmb.js";import{t as g}from"./utils-CG8vWc5K.js";import{t as _}from"./createLucideIcon-BHp8sXmF.js";import{t as v}from"./run-header-Dvb1P3Ge.js";import{a as y,i as b,r as x}from"./highlighter-CdHqIwFr.js";import{h as S,n as C,r as w}from"./index-ujHRHX5o.js";var T=_(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=_(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=_(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=_(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),k=_(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),A=e(t(),1),j=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function M(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:j.has(t.slice(n+1).toLowerCase())}function N(e){return e.tooLarge?`too-large`:M(e.path)?`image`:e.binary?`binary`:`text`}function P(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var F=n();function I({runId:e,path:t,className:n}){let i=f(e,t??void 0);if(t===null)return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(u,{icon:(0,F.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(i.isPending)return(0,F.jsx)(R,{className:n,children:(0,F.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(i.isError){let e=i.error instanceof l&&i.error.status===409;return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(u,{icon:e?(0,F.jsx)(D,{}):(0,F.jsx)(r,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:i.error.message})})}return i.data.type===`file`?(0,F.jsx)(L,{runId:e,entry:i.data,className:n}):(0,F.jsx)(R,{className:n,children:(0,F.jsx)(u,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function L({runId:e,entry:t,className:n}){let r=N(t);return(0,F.jsxs)(R,{className:n,children:[(0,F.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:P(t.size)})]}),r===`image`?(0,F.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,F.jsx)(`img`,{"data-slot":`file-preview-image`,src:a(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,F.jsx)(u,{icon:(0,F.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${P(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,F.jsx)(u,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${P(t.size)} of binary data — no text preview.`}):(0,F.jsx)(V,{path:t.path,text:t.content??``})]})}function R({className:e,children:t}){return(0,F.jsx)(`section`,{"data-slot":`file-preview`,className:g(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,A.useMemo)(()=>t.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Jt as r,Lt as i,Qi as a,X as o,Zn as s,d as c,ei as l,l as u,lt as d,nr as f,st as p,ut as m,xa as h}from"./alert-dialog-Bv9zV9w1.js";import{t as g}from"./utils-CG8vWc5K.js";import{t as _}from"./createLucideIcon-BHp8sXmF.js";import{t as v}from"./run-header-BlqnTQeP.js";import{a as y,i as b,r as x}from"./highlighter-CdHqIwFr.js";import{h as S,n as C,r as w}from"./index-BpI26cbM.js";var T=_(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=_(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=_(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=_(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),k=_(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),A=e(t(),1),j=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function M(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:j.has(t.slice(n+1).toLowerCase())}function N(e){return e.tooLarge?`too-large`:M(e.path)?`image`:e.binary?`binary`:`text`}function P(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var F=n();function I({runId:e,path:t,className:n}){let i=f(e,t??void 0);if(t===null)return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(u,{icon:(0,F.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(i.isPending)return(0,F.jsx)(R,{className:n,children:(0,F.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(i.isError){let e=i.error instanceof l&&i.error.status===409;return(0,F.jsx)(R,{className:n,children:(0,F.jsx)(u,{icon:e?(0,F.jsx)(D,{}):(0,F.jsx)(r,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:i.error.message})})}return i.data.type===`file`?(0,F.jsx)(L,{runId:e,entry:i.data,className:n}):(0,F.jsx)(R,{className:n,children:(0,F.jsx)(u,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function L({runId:e,entry:t,className:n}){let r=N(t);return(0,F.jsxs)(R,{className:n,children:[(0,F.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,F.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:P(t.size)})]}),r===`image`?(0,F.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,F.jsx)(`img`,{"data-slot":`file-preview-image`,src:a(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,F.jsx)(u,{icon:(0,F.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${P(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,F.jsx)(u,{icon:(0,F.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${P(t.size)} of binary data — no text preview.`}):(0,F.jsx)(V,{path:t.path,text:t.content??``})]})}function R({className:e,children:t}){return(0,F.jsx)(`section`,{"data-slot":`file-preview`,className:g(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var z=1500;function B(e,t){let n=(0,A.useMemo)(()=>t.split(`
2
2
  `).map(e=>[{content:e}]),[t]),r=(0,A.useMemo)(()=>y(e),[e]),i=n.length>z,[a,o]=(0,A.useState)(null);return(0,A.useEffect)(()=>{if(r===null||i)return;let n=!1;return x(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:b(t,r)?.tokens??n}function V({path:e,text:t}){let n=B(e,t);return(0,F.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":y(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex px-4`,children:[(0,F.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,F.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function H({runId:e,selected:t,onSelect:n}){return(0,F.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,F.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,F.jsx)(U,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function U({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=f(e,t);return a.isPending?(0,F.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):a.isError?(0,F.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:a.error.message}):a.data.type===`dir`?a.data.entries.length===0?(0,F.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,F.jsx)(F.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,F.jsx)(W,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,F.jsx)(G,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function W({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let[s,c]=(0,A.useState)(!1);return(0,F.jsxs)(`li`,{children:[(0,F.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":s?`open`:`closed`,"aria-expanded":s,onClick:()=>c(e=>!e),className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,F.jsx)(o,{size:16,"aria-hidden":`true`,className:g(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,s&&`rotate-90`)}),(0,F.jsx)(m,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),s?(0,F.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,F.jsx)(U,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function G({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=M(t)?k:p;return(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:g(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+r*14}px`},children:[(0,F.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,F.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:P(n)})]})})}function K(){let{id:e}=h(),t=s(e);return t.isPending?(0,F.jsx)(w,{tab:`files`}):t.isError?(0,F.jsx)(C,{tab:`files`,error:t.error}):(0,F.jsx)(q,{run:t.data})}function q({run:e}){let t=f(e.id,``),[n,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(``),d=t.isError&&t.error instanceof l&&t.error.status===409;return(0,F.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,F.jsx)(v,{run:e,tab:`files`}),t.isSuccess?(0,F.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),o.trim()&&a(o.trim())},children:[(0,F.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,F.jsx)(i,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,F.jsx)(S,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:o,onChange:e=>s(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,F.jsx)(c,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!o.trim(),children:`Open file`})]}):null,t.isPending?(0,F.jsx)(`p`,{"data-slot":`files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading files…`}):t.isError?(0,F.jsx)(u,{icon:d?(0,F.jsx)(O,{}):(0,F.jsx)(r,{size:16}),tone:d?`neutral`:`danger`,heading:`h2`,title:d?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,F.jsxs)(`aside`,{"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,F.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),(0,F.jsx)(H,{runId:e.id,selected:n,onSelect:a})]}),(0,F.jsx)(I,{runId:e.id,path:n,className:`min-h-[200px] min-w-0 flex-1 bg-card md:min-h-[400px]`})]}),(0,F.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout.`})]})}export{K as TaskFilesRoute};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,Aa as i,Ai as a,Ca as o,Dn as s,Et as c,H as l,J as u,Jr as d,Kn as f,Kt as p,Ln as m,Lt as h,Ma as g,Na as _,Nn as v,Nr as y,Nt as b,Oa as x,Pr as S,Ta as C,X as w,Y as T,Zn as E,aa as D,ai as O,bt as k,d as A,di as j,dn as M,ei as N,fa as P,hi as F,hn as ee,it as te,ji as I,jn as L,l as ne,mt as re,oi as R,or as ie,q as z,qt as B,rn as V,rt as ae,sr as oe,u as se,ua as H,ur as ce,wa as le,xa as ue,ya as de}from"./alert-dialog-KUiPIBmb.js";import{C as fe,S as pe,T as me,c as he,i as ge,n as _e,s as ve,t as U,w as ye,x as be,y as xe}from"./utils-CG8vWc5K.js";import{n as W,r as G,t as Se}from"./collapsible-CkSaP6_n.js";import{n as Ce,s as we,t as Te}from"./agent-accounts-MT-jtwOU.js";import{t as Ee}from"./textarea-DdKiIORK.js";import{t as K}from"./createLucideIcon-BHp8sXmF.js";import{A as De,E as Oe,O as ke,b as Ae,d as je,g as Me,l as Ne,m as Pe,s as Fe,u as Ie}from"./pill-DDhByAhe.js";import{t as Le}from"./external-link-BE6y205O.js";import{I as Re,S as ze,_ as Be,b as Ve,c as He,g as Ue,l as We,v as Ge,x as Ke}from"./prompt-templates-DTSPmJP-.js";import{i as qe,n as Je,r as Ye,t as Xe}from"./run-header-Dvb1P3Ge.js";import{s as Ze,t as q,u as Qe}from"./project-router-BOglfKgF.js";import{t as $e}from"./message-square-B-MD-8rD.js";import{t as et}from"./search-x-I9Q8pgUa.js";import{t as tt}from"./square-terminal-B6RYYieR.js";import{t as nt}from"./markdown-CIi0LXvU.js";import{c as rt,i as it,l as at,n as ot,o as st,s as ct,t as lt}from"./thread-loading-BRM8kyKz.js";import{t as ut}from"./use-submit-shortcut-KWJsC906.js";import{t as dt}from"./lib-BQXq3kEf.js";import{t as ft}from"./zoomable-image-BXioMWqb.js";import{t as pt}from"./run-diff-DEVs-zV1.js";var mt=120;function ht(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gt(e){let t=e.replace(/\s+/g,` `).trim();return t.length>mt?`${t.slice(0,mt-1)}…`:t}function J(e,...t){if(ht(e))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim()!==``)return gt(t)}}function _t(e){if(!ht(e))return;let t=e.command;if(typeof t==`string`&&t.trim()!==``)return gt(t);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return gt(e.join(` `))}}function vt(e){if(!ht(e)||!Array.isArray(e.changes))return[];let t=[];for(let n of e.changes)ht(n)&&typeof n.path==`string`&&n.path.trim()!==``&&t.push(n.path);return t}function yt(e){return J(e,`description`,`query`,`url`,`filePath`,`file_path`,`path`,`pattern`,`name`)}function Y(e,t){return t?`${e} ${t}`:e}function bt(e,t){let n=typeof e==`string`?e.toLowerCase():``;switch(n){case`bash`:case`commandexecution`:return{toolKind:`execute`,title:Y(`Ran`,_t(t)),subtitle:J(t,`description`)};case`edit`:case`multiedit`:return{toolKind:`edit`,title:Y(`Edit`,J(t,`file_path`,`filePath`,`path`))};case`write`:return{toolKind:`edit`,title:Y(`Write`,J(t,`file_path`,`filePath`,`path`))};case`notebookedit`:return{toolKind:`edit`,title:Y(`Edit`,J(t,`notebook_path`,`notebookPath`,`file_path`,`filePath`,`path`))};case`filechange`:{let e=vt(t);return{toolKind:`edit`,title:Y(`Edit`,e.length===1?e[0]:e.length>1?`${e.length} files`:void 0)}}case`read`:return{toolKind:`read`,title:Y(`Read`,J(t,`file_path`,`filePath`,`path`))};case`imageview`:return{toolKind:`read`,title:Y(`View image`,J(t,`path`))};case`glob`:case`grep`:return{toolKind:`search`,title:Y(`Search`,J(t,`pattern`,`query`)),subtitle:J(t,`path`)};case`webfetch`:return{toolKind:`fetch`,title:Y(`Fetch`,J(t,`url`))};case`websearch`:return{toolKind:`fetch`,title:Y(`Web search`,J(t,`query`))};case`task`:case`agent`:{let e=n===`agent`?`Agent`:`Task`,r=J(t,`subagent_type`,`subagentType`),i=J(t,`description`,`prompt`)??r;return{toolKind:`task`,title:i?`${e}: ${i}`:e,subtitle:i===r?void 0:r}}case`skill`:{let e=J(t,`skill`,`name`,`command`);return{toolKind:`task`,title:e?`Skill: ${e}`:`Skill`,subtitle:J(t,`args`,`description`)}}case`todowrite`:case`todolist`:case`plan`:case`taskcreate`:case`taskupdate`:case`tasklist`:return{toolKind:`plan`,title:`Update plan`};case`contextcompaction`:return{toolKind:`other`,title:`Compacted context`};case`mcptoolcall`:{let e=J(t,`server`),n=J(t,`tool`);return e&&n?{toolKind:`other`,title:`${e}.${n}`}:{toolKind:`other`,title:`MCP tool`,subtitle:yt(t)}}}if(n.startsWith(`mcp__`)){let t=e.split(`__`).filter(e=>e!==``);if(t.length>=3)return{toolKind:`other`,title:`${t[1]}.${t.slice(2).join(`__`)}`}}return{toolKind:`other`,title:typeof e==`string`&&e.trim()!==``?gt(e):`Tool`,subtitle:yt(t)}}var xt=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:g(t,n.data),hasPreviousPage:_(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function St(e,t){return C(e,xt,t)}var Ct=K(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),wt=K(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Tt=K(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Et=K(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Dt=K(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),X=e(t(),1),Ot=[`run-event`,`ui-event`];function kt(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let{seq:n,type:r}=t;return typeof n!=`number`||typeof r!=`string`||r===``?null:t}function At(e,t={}){let[n,r]=(0,X.useState)([]),{cursor:i,afterSeq:a=0,maxEvents:o,compactAt:s,onCompact:c}=t;return(0,X.useEffect)(()=>{if(r([]),!e)return;let t=globalThis.EventSource;if(typeof t!=`function`)return;let n=a,l=null,u,d=!1,f=!1,p=Date.now(),m,h=e=>{p=Date.now();let t=kt(e.data);!t||!(t.seq>n)||(n=t.seq,r(e=>{let n=[...e,t];return!f&&s!==void 0&&n.length>=s&&(f=!0,queueMicrotask(()=>{d||c?.()})),o===void 0||n.length<=o?n:n.slice(-o)}))},g=()=>{p=Date.now()},_=()=>{d||u!==void 0||(u=setTimeout(()=>{u=void 0,d||v()},1500))},v=()=>{l?.close(),p=Date.now();let r=new URLSearchParams;i!==void 0&&r.set(`cursor`,i),(i!==void 0||a>0)&&r.set(`afterSeq`,String(n));let o=r.size>0?`?${r.toString()}`:``;l=new t(ge(`/runs/${encodeURIComponent(e)}/events${o}`),{withCredentials:!0});for(let e of Ot)l.addEventListener(e,h);l.addEventListener(`ping`,g),l.addEventListener(`error`,()=>{l?.readyState===2&&_()})},y=()=>{document.visibilityState===`visible`&&(!l||l.readyState===2)&&(clearTimeout(u),u=void 0,v())},b=()=>{clearTimeout(u),u=void 0,l?.close()},x=e=>{e.persisted&&v()};return m=setInterval(()=>{d||document.visibilityState!==`visible`||Date.now()-p<=4e4||(clearTimeout(u),u=void 0,v())},1e4),document.addEventListener(`visibilitychange`,y),window.addEventListener(`pagehide`,b),window.addEventListener(`pageshow`,x),v(),()=>{d=!0,clearTimeout(u),clearInterval(m),document.removeEventListener(`visibilitychange`,y),window.removeEventListener(`pagehide`,b),window.removeEventListener(`pageshow`,x),l?.close()}},[e,i,a,o,s,c]),n}var jt=5,Mt=200,Nt=5e3;function Pt(...e){let t=new Map;for(let n of e)for(let e of n)t.set(e.seq,e);return[...t.values()].sort((e,t)=>e.seq-t.seq)}function Ft(e){let t=ve(),n=x(),r=[`run-history`,t,e],i=[`run-history-context`,t,e],o=St({queryKey:r,enabled:e!==void 0,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>a(e,t,{signal:n}),getPreviousPageParam:e=>e.olderCursor,getNextPageParam:e=>e.newerCursor,maxPages:jt,retry:1}),s=le({queryKey:i,enabled:e!==void 0,queryFn:({signal:t})=>I(e,{signal:t}),retry:1}),c=o.isError||s.isError,l=At(c?e:void 0),u=o.data?.pages??[],d=u.reduce((e,t)=>t.newerCursor===void 0?t:e??t,void 0),f=(0,X.useRef)(!1),p=(0,X.useCallback)(()=>{e===void 0||f.current||(f.current=!0,a(e,void 0).then(r=>{n.setQueryData([`run-history`,t,e],e=>{if(!e)return{pages:[r],pageParams:[void 0]};let t=[...e.pages],n=[...e.pageParams],i=-1;for(let e=0;e<t.length;e+=1)(i===-1||t[e].asOfSeq>t[i].asOfSeq)&&(i=e);for(i>=0&&t[i].newerCursor===void 0?(t[i]=r,n[i]=void 0):(t.push(r),n.push(void 0));t.length>jt;)t.shift(),n.shift();return{pages:t,pageParams:n}})}).catch(()=>{}).finally(()=>{f.current=!1}))},[n,e,t]),m=At(!c&&d?e:void 0,{cursor:d?.liveCursor,afterSeq:d?.asOfSeq,maxEvents:Nt,compactAt:Mt,onCompact:p}),h=(0,X.useMemo)(()=>Pt(...u.map(e=>e.events)),[u]),g=(0,X.useMemo)(()=>c?l:Pt(h,m),[c,l,h,m]),_=(0,X.useMemo)(()=>{if(c)return l;let e=s.data?.contextEvents??[],t=s.data?.asOfSeq??0;return Pt(e,g.filter(({seq:e})=>e>t))},[s.data,c,l,g]),v=(0,X.useCallback)(async()=>{await o.fetchPreviousPage()},[o.fetchPreviousPage]),y=(0,X.useCallback)(async()=>{c||await n.resetQueries({queryKey:r,exact:!0})},[c,r,n]);return{visibleEvents:g,currentEvents:_,isPending:!c&&o.isPending,contextPending:!c&&s.isPending,fallback:c,hasOlder:!c&&!!o.hasPreviousPage,isFetchingOlder:o.isFetchingPreviousPage,olderError:o.isFetchPreviousPageError?o.error instanceof Error?o.error.message:`Could not load earlier items`:void 0,loadOlder:v,jumpToLatest:y,retainedPages:u.length}}var Z=n();function It({run:e}){let t=x(),n=o({mutationFn:()=>O(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:V.runs.detail(e.id)}),t.invalidateQueries({queryKey:V.runs.list()}),D(`This task will not resume itself`)},onError:e=>D(e.message,{tone:`danger`})});if(e.status!==`failed`||!e.autoResumeAt)return null;let r=new Date(e.autoResumeAt);if(!Number.isFinite(r.getTime()))return null;let i=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(r);return(0,Z.jsxs)(`div`,{"data-slot":`auto-resume-hint`,role:`status`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(ke,{tone:`pending`,pulse:!0}),(0,Z.jsxs)(`span`,{children:[`Usage limit reached — this task resumes automatically at`,` `,(0,Z.jsx)(`time`,{dateTime:e.autoResumeAt,className:`font-medium text-foreground`,children:i})]}),(0,Z.jsx)(`button`,{type:`button`,"data-action":`auto-resume-cancel`,disabled:n.isPending,onClick:()=>n.mutate(),className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground disabled:opacity-50`,children:`Don’t resume`}),(0,Z.jsx)(P,{to:`/settings/global/resources`,"data-slot":`auto-resume-settings-link`,className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,children:`Auto-resume settings`})]})}var Lt=e=>e.kind===`tool`,Rt=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,zt=(e,t,n)=>`${e} ${e===1?t:n}`;function Bt(e,t){let n=[];return e>0&&n.push(zt(e,`file`,`files`)),t>0&&n.push(zt(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function Vt(e){return`${e} earlier tool call${e===1?``:`s`}`}var Ht=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function Ut(e){for(let t of Ht)if(e.startsWith(`${t} `)&&e.length>t.length+1)return{verb:t===`Task:`?`Task`:t,detail:e.slice(t.length+1)};return{verb:e}}function Wt(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)&&!(e.kind===`reasoning`&&e.text.trim()===``)),n=new Set(t.filter(Lt).map(e=>e.id)),r=new Map,i=[];for(let e of t){let t=(e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`)&&e.parentItemId!==void 0&&e.parentItemId!==e.id&&n.has(e.parentItemId)?e.parentItemId:void 0;if(t===void 0)i.push(e);else{let n=r.get(t);n?n.push(e):r.set(t,[e])}}let a=[],o=[],s=()=>{if(o.length>=2){let e=o.filter(e=>e.toolKind===`read`).length;a.push({kind:`context-group`,id:`group:${o[0].id}`,tools:o,files:e,searches:o.length-e,label:Bt(e,o.length-e)})}else for(let e of o)a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]});o=[]};for(let e of i)Lt(e)&&Rt(e)&&!r.has(e.id)?o.push(e):(s(),Lt(e)?a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]}):a.push({kind:`entry`,id:e.id,entry:e}));s();let c=e=>e.kind===`context-group`||e.kind===`tool-card`&&e.item.status===`completed`,l=e=>e.kind===`context-group`?e.tools.length:1,u=[],d=[],f=()=>{if(d.length>3){let e=d.slice(0,d.length-3);u.push({kind:`streak`,id:`streak:${e[0].id}`,count:e.reduce((e,t)=>e+l(t),0),blocks:e}),u.push(...d.slice(d.length-3))}else u.push(...d);d=[]};for(let e of a)c(e)?d.push(e):(f(),u.push(e));return f(),u}var Gt=new Map,Kt=(0,X.createContext)(null);function qt(){return(0,X.useContext)(Kt)}function Jt({runId:e,children:t}){let n=(0,X.useMemo)(()=>({get:t=>Gt.get(e)?.get(t),set:(t,n)=>{let r=Gt.get(e)??new Map;r.set(t,n),Gt.set(e,r)}}),[e]);return(0,Z.jsx)(Kt.Provider,{value:n,children:t})}function Yt(e){return e.scrollTop<Math.max(600,e.clientHeight)}function Xt(e,t){let n=t.find(({bottom:t})=>t>e);return n===void 0?void 0:{key:n.key,offset:n.top-e}}function Zt(e,t,n,r,i){if(n===void 0)return i;let a=r.find(({key:e})=>e===n.key);return a===void 0?i:e+(a.top-t-n.offset)}function Qt(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function $t(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var en=new Map;function tn(e,t){en.set(e,t)}function nn(e){return en.get(e)}var rn=new Map;function an(e,t){rn.set(e,t)}function on(e,t){let n=rn.get(e);return n!==void 0&&n.rows===t?n.cache:void 0}var sn={user:{label:`YOUR MESSAGE`,speaker:`Your message`,classes:`border-message-user-border bg-message-user-bg`,accent:`text-message-user-accent`,body:`max-md:text-[12px]`},agent:{label:`AGENT RESPONSE`,speaker:`Agent response`,classes:`border-message-agent-border bg-message-agent-bg`,accent:`text-message-agent-accent`,body:`max-md:text-[13px]`}};function cn({role:e,children:t,className:n,...r}){let i=sn[e];return(0,Z.jsxs)(`article`,{...r,"data-role":e,"aria-label":i.speaker,className:U(`flex w-full min-w-0 flex-col gap-2 self-stretch rounded-[8px] border p-3 md:px-4 md:py-[14px]`,i.classes,n),children:[(0,Z.jsxs)(`p`,{className:U(`m-0 flex items-center gap-2 text-[11px] leading-none font-semibold tracking-[0.6px] uppercase`,i.accent),children:[(0,Z.jsx)($e,{"aria-hidden":`true`,className:`size-4 shrink-0`}),i.label]}),(0,Z.jsx)(`div`,{className:U(`min-w-0 break-words text-[14px] leading-[1.6] text-foreground select-text [overflow-wrap:anywhere]`,i.body),children:t})]})}function ln({text:e,imageCount:t=0,images:n=[],onEdit:r,onRemove:i,editLabel:a=`Edit message`,removeLabel:o=`Remove message`}){let s=t-n.length,[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(e),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(),g=()=>{d(e),h(void 0),l(!0)},_=async()=>{let t=u.trim();if(!t||t===e){l(!1);return}p(!0),h(void 0);try{await r?.(t),l(!1)}catch(e){h(e instanceof Error?e.message:`Could not save the message`)}finally{p(!1)}},v=async()=>{p(!0),h(void 0);try{await i?.()}catch(e){h(e instanceof Error?e.message:`Could not remove the message`)}finally{p(!1)}};return c?(0,Z.jsxs)(cn,{role:`user`,"data-slot":`user-bubble`,"data-editing":`true`,children:[(0,Z.jsx)(`textarea`,{autoFocus:!0,"aria-label":`Edit the message`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),l(!1)):e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},className:`block max-h-[220px] min-h-[60px] w-full resize-none rounded-md bg-background px-2 py-1.5 text-[13.5px] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`}),(0,Z.jsxs)(`span`,{className:`mt-1.5 flex justify-end gap-1.5`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>l(!1),disabled:f,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm px-2 text-xs font-medium text-muted-foreground hover:bg-background hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:`Cancel`}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void _(),disabled:f,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm bg-action px-2 text-xs font-semibold text-action-foreground hover:brightness-[0.96] focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:f?(0,Z.jsx)(Qe,{className:`size-3.5 animate-spin`}):`Save`})]}),m?(0,Z.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-xs text-danger`,children:m}):null]}):(0,Z.jsxs)(cn,{role:`user`,"data-slot":`user-bubble`,className:`group`,children:[r||i?(0,Z.jsxs)(`span`,{"data-slot":`bubble-actions`,className:`mb-1 flex justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[r?(0,Z.jsx)(`button`,{type:`button`,"aria-label":a,onClick:g,disabled:f,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Dt,{className:`size-3.5`})}):null,i?(0,Z.jsx)(`button`,{type:`button`,"aria-label":o,onClick:()=>void v(),disabled:f,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-danger focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(B,{className:`size-3.5`})}):null]}):null,m?(0,Z.jsx)(`p`,{role:`alert`,className:`mb-1 text-xs text-danger`,children:m}):null,(0,Z.jsx)(nt,{breaks:!0,children:e}),n.length>0?(0,Z.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap items-center justify-end gap-1.5`,children:n.map(e=>xe(e.split(`/`).pop()??``)?(0,Z.jsx)(ft,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e):(0,Z.jsxs)(`a`,{href:he(e),download:!0,"data-slot":`user-file`,className:`inline-flex min-h-11 min-w-11 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background/60 px-2 py-1 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(b,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()})]},e))}):null,s>0?(0,Z.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[s,` image`,s>1?`s`:``,` attached`]}):null]})}function un({text:e}){return(0,Z.jsx)(cn,{role:`agent`,"data-slot":`assistant-message`,children:(0,Z.jsx)(nt,{children:e})})}function dn({note:e}){return(0,Z.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:U(`px-0.5 text-xs`,e.tone===`danger`?`text-danger [.light_&]:text-red-700`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:`· `,e.text]})}var fn={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`,pi:`pi`,cursor:`Cursor`};function pn({incident:e}){let t=fn[e.provider];return(0,Z.jsxs)(`div`,{role:`alert`,"data-slot":`provider-auth-required`,className:`rounded-md border border-danger/30 bg-danger/5 px-3.5 py-3`,children:[(0,Z.jsxs)(`p`,{className:`text-[13px] font-semibold text-foreground`,children:[`This run needed `,t,` authorization`]}),(0,Z.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Review `,t,` settings before retrying.`]}),(0,Z.jsx)(q,{to:`/settings/agents#providers`,className:`mt-2 inline-flex text-xs font-medium text-foreground underline-offset-2 hover:underline`,children:`Open provider settings`})]})}function mn({text:e}){let t=(0,X.useId)();if(e.trim()===``)return null;let n=e.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,Aa as i,Ai as a,Ca as o,Dn as s,Et as c,H as l,J as u,Jr as d,Kn as f,Kt as p,Ln as m,Lt as h,Ma as g,Na as _,Nn as v,Nr as y,Nt as b,Oa as x,Pr as S,Ta as C,X as w,Y as T,Zn as E,aa as D,ai as O,bt as k,d as A,di as j,dn as M,ei as N,fa as P,hi as F,hn as ee,it as te,ji as I,jn as L,l as ne,mt as re,oi as R,or as ie,q as z,qt as B,rn as V,rt as ae,sr as oe,u as se,ua as H,ur as ce,wa as le,xa as ue,ya as de}from"./alert-dialog-Bv9zV9w1.js";import{C as fe,S as pe,T as me,c as he,i as ge,n as _e,s as ve,t as U,w as ye,x as be,y as xe}from"./utils-CG8vWc5K.js";import{n as W,r as G,t as Se}from"./collapsible-D7QXWXZq.js";import{n as Ce,s as we,t as Te}from"./agent-accounts-BP0XBzQP.js";import{t as Ee}from"./textarea-DAHMUyAp.js";import{t as K}from"./createLucideIcon-BHp8sXmF.js";import{A as De,E as Oe,O as ke,b as Ae,d as je,g as Me,l as Ne,m as Pe,s as Fe,u as Ie}from"./pill-C7gWe96Z.js";import{t as Le}from"./external-link-BE6y205O.js";import{I as Re,S as ze,_ as Be,b as Ve,c as He,g as Ue,l as We,v as Ge,x as Ke}from"./prompt-templates-B4eJ8kQZ.js";import{i as qe,n as Je,r as Ye,t as Xe}from"./run-header-BlqnTQeP.js";import{s as Ze,t as q,u as Qe}from"./project-router-a1gx3dfP.js";import{t as $e}from"./message-square-B-MD-8rD.js";import{t as et}from"./search-x-I9Q8pgUa.js";import{t as tt}from"./square-terminal-B6RYYieR.js";import{t as nt}from"./markdown-BssEOroY.js";import{c as rt,i as it,l as at,n as ot,o as st,s as ct,t as lt}from"./thread-loading-OtvWGq9Y.js";import{t as ut}from"./use-submit-shortcut-KWJsC906.js";import{t as dt}from"./lib-BQXq3kEf.js";import{t as ft}from"./zoomable-image-BXioMWqb.js";import{t as pt}from"./run-diff-CHDwMBEQ.js";var mt=120;function ht(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gt(e){let t=e.replace(/\s+/g,` `).trim();return t.length>mt?`${t.slice(0,mt-1)}…`:t}function J(e,...t){if(ht(e))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim()!==``)return gt(t)}}function _t(e){if(!ht(e))return;let t=e.command;if(typeof t==`string`&&t.trim()!==``)return gt(t);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return gt(e.join(` `))}}function vt(e){if(!ht(e)||!Array.isArray(e.changes))return[];let t=[];for(let n of e.changes)ht(n)&&typeof n.path==`string`&&n.path.trim()!==``&&t.push(n.path);return t}function yt(e){return J(e,`description`,`query`,`url`,`filePath`,`file_path`,`path`,`pattern`,`name`)}function Y(e,t){return t?`${e} ${t}`:e}function bt(e,t){let n=typeof e==`string`?e.toLowerCase():``;switch(n){case`bash`:case`commandexecution`:return{toolKind:`execute`,title:Y(`Ran`,_t(t)),subtitle:J(t,`description`)};case`edit`:case`multiedit`:return{toolKind:`edit`,title:Y(`Edit`,J(t,`file_path`,`filePath`,`path`))};case`write`:return{toolKind:`edit`,title:Y(`Write`,J(t,`file_path`,`filePath`,`path`))};case`notebookedit`:return{toolKind:`edit`,title:Y(`Edit`,J(t,`notebook_path`,`notebookPath`,`file_path`,`filePath`,`path`))};case`filechange`:{let e=vt(t);return{toolKind:`edit`,title:Y(`Edit`,e.length===1?e[0]:e.length>1?`${e.length} files`:void 0)}}case`read`:return{toolKind:`read`,title:Y(`Read`,J(t,`file_path`,`filePath`,`path`))};case`imageview`:return{toolKind:`read`,title:Y(`View image`,J(t,`path`))};case`glob`:case`grep`:return{toolKind:`search`,title:Y(`Search`,J(t,`pattern`,`query`)),subtitle:J(t,`path`)};case`webfetch`:return{toolKind:`fetch`,title:Y(`Fetch`,J(t,`url`))};case`websearch`:return{toolKind:`fetch`,title:Y(`Web search`,J(t,`query`))};case`task`:case`agent`:{let e=n===`agent`?`Agent`:`Task`,r=J(t,`subagent_type`,`subagentType`),i=J(t,`description`,`prompt`)??r;return{toolKind:`task`,title:i?`${e}: ${i}`:e,subtitle:i===r?void 0:r}}case`skill`:{let e=J(t,`skill`,`name`,`command`);return{toolKind:`task`,title:e?`Skill: ${e}`:`Skill`,subtitle:J(t,`args`,`description`)}}case`todowrite`:case`todolist`:case`plan`:case`taskcreate`:case`taskupdate`:case`tasklist`:return{toolKind:`plan`,title:`Update plan`};case`contextcompaction`:return{toolKind:`other`,title:`Compacted context`};case`mcptoolcall`:{let e=J(t,`server`),n=J(t,`tool`);return e&&n?{toolKind:`other`,title:`${e}.${n}`}:{toolKind:`other`,title:`MCP tool`,subtitle:yt(t)}}}if(n.startsWith(`mcp__`)){let t=e.split(`__`).filter(e=>e!==``);if(t.length>=3)return{toolKind:`other`,title:`${t[1]}.${t.slice(2).join(`__`)}`}}return{toolKind:`other`,title:typeof e==`string`&&e.trim()!==``?gt(e):`Tool`,subtitle:yt(t)}}var xt=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:g(t,n.data),hasPreviousPage:_(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function St(e,t){return C(e,xt,t)}var Ct=K(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),wt=K(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Tt=K(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Et=K(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Dt=K(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),X=e(t(),1),Ot=[`run-event`,`ui-event`];function kt(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let{seq:n,type:r}=t;return typeof n!=`number`||typeof r!=`string`||r===``?null:t}function At(e,t={}){let[n,r]=(0,X.useState)([]),{cursor:i,afterSeq:a=0,maxEvents:o,compactAt:s,onCompact:c}=t;return(0,X.useEffect)(()=>{if(r([]),!e)return;let t=globalThis.EventSource;if(typeof t!=`function`)return;let n=a,l=null,u,d=!1,f=!1,p=Date.now(),m,h=e=>{p=Date.now();let t=kt(e.data);!t||!(t.seq>n)||(n=t.seq,r(e=>{let n=[...e,t];return!f&&s!==void 0&&n.length>=s&&(f=!0,queueMicrotask(()=>{d||c?.()})),o===void 0||n.length<=o?n:n.slice(-o)}))},g=()=>{p=Date.now()},_=()=>{d||u!==void 0||(u=setTimeout(()=>{u=void 0,d||v()},1500))},v=()=>{l?.close(),p=Date.now();let r=new URLSearchParams;i!==void 0&&r.set(`cursor`,i),(i!==void 0||a>0)&&r.set(`afterSeq`,String(n));let o=r.size>0?`?${r.toString()}`:``;l=new t(ge(`/runs/${encodeURIComponent(e)}/events${o}`),{withCredentials:!0});for(let e of Ot)l.addEventListener(e,h);l.addEventListener(`ping`,g),l.addEventListener(`error`,()=>{l?.readyState===2&&_()})},y=()=>{document.visibilityState===`visible`&&(!l||l.readyState===2)&&(clearTimeout(u),u=void 0,v())},b=()=>{clearTimeout(u),u=void 0,l?.close()},x=e=>{e.persisted&&v()};return m=setInterval(()=>{d||document.visibilityState!==`visible`||Date.now()-p<=4e4||(clearTimeout(u),u=void 0,v())},1e4),document.addEventListener(`visibilitychange`,y),window.addEventListener(`pagehide`,b),window.addEventListener(`pageshow`,x),v(),()=>{d=!0,clearTimeout(u),clearInterval(m),document.removeEventListener(`visibilitychange`,y),window.removeEventListener(`pagehide`,b),window.removeEventListener(`pageshow`,x),l?.close()}},[e,i,a,o,s,c]),n}var jt=5,Mt=200,Nt=5e3;function Pt(...e){let t=new Map;for(let n of e)for(let e of n)t.set(e.seq,e);return[...t.values()].sort((e,t)=>e.seq-t.seq)}function Ft(e){let t=ve(),n=x(),r=[`run-history`,t,e],i=[`run-history-context`,t,e],o=St({queryKey:r,enabled:e!==void 0,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>a(e,t,{signal:n}),getPreviousPageParam:e=>e.olderCursor,getNextPageParam:e=>e.newerCursor,maxPages:jt,retry:1}),s=le({queryKey:i,enabled:e!==void 0,queryFn:({signal:t})=>I(e,{signal:t}),retry:1}),c=o.isError||s.isError,l=At(c?e:void 0),u=o.data?.pages??[],d=u.reduce((e,t)=>t.newerCursor===void 0?t:e??t,void 0),f=(0,X.useRef)(!1),p=(0,X.useCallback)(()=>{e===void 0||f.current||(f.current=!0,a(e,void 0).then(r=>{n.setQueryData([`run-history`,t,e],e=>{if(!e)return{pages:[r],pageParams:[void 0]};let t=[...e.pages],n=[...e.pageParams],i=-1;for(let e=0;e<t.length;e+=1)(i===-1||t[e].asOfSeq>t[i].asOfSeq)&&(i=e);for(i>=0&&t[i].newerCursor===void 0?(t[i]=r,n[i]=void 0):(t.push(r),n.push(void 0));t.length>jt;)t.shift(),n.shift();return{pages:t,pageParams:n}})}).catch(()=>{}).finally(()=>{f.current=!1}))},[n,e,t]),m=At(!c&&d?e:void 0,{cursor:d?.liveCursor,afterSeq:d?.asOfSeq,maxEvents:Nt,compactAt:Mt,onCompact:p}),h=(0,X.useMemo)(()=>Pt(...u.map(e=>e.events)),[u]),g=(0,X.useMemo)(()=>c?l:Pt(h,m),[c,l,h,m]),_=(0,X.useMemo)(()=>{if(c)return l;let e=s.data?.contextEvents??[],t=s.data?.asOfSeq??0;return Pt(e,g.filter(({seq:e})=>e>t))},[s.data,c,l,g]),v=(0,X.useCallback)(async()=>{await o.fetchPreviousPage()},[o.fetchPreviousPage]),y=(0,X.useCallback)(async()=>{c||await n.resetQueries({queryKey:r,exact:!0})},[c,r,n]);return{visibleEvents:g,currentEvents:_,isPending:!c&&o.isPending,contextPending:!c&&s.isPending,fallback:c,hasOlder:!c&&!!o.hasPreviousPage,isFetchingOlder:o.isFetchingPreviousPage,olderError:o.isFetchPreviousPageError?o.error instanceof Error?o.error.message:`Could not load earlier items`:void 0,loadOlder:v,jumpToLatest:y,retainedPages:u.length}}var Z=n();function It({run:e}){let t=x(),n=o({mutationFn:()=>O(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:V.runs.detail(e.id)}),t.invalidateQueries({queryKey:V.runs.list()}),D(`This task will not resume itself`)},onError:e=>D(e.message,{tone:`danger`})});if(e.status!==`failed`||!e.autoResumeAt)return null;let r=new Date(e.autoResumeAt);if(!Number.isFinite(r.getTime()))return null;let i=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(r);return(0,Z.jsxs)(`div`,{"data-slot":`auto-resume-hint`,role:`status`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 px-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(ke,{tone:`pending`,pulse:!0}),(0,Z.jsxs)(`span`,{children:[`Usage limit reached — this task resumes automatically at`,` `,(0,Z.jsx)(`time`,{dateTime:e.autoResumeAt,className:`font-medium text-foreground`,children:i})]}),(0,Z.jsx)(`button`,{type:`button`,"data-action":`auto-resume-cancel`,disabled:n.isPending,onClick:()=>n.mutate(),className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground disabled:opacity-50`,children:`Don’t resume`}),(0,Z.jsx)(P,{to:`/settings/global/resources`,"data-slot":`auto-resume-settings-link`,className:`font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground`,children:`Auto-resume settings`})]})}var Lt=e=>e.kind===`tool`,Rt=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,zt=(e,t,n)=>`${e} ${e===1?t:n}`;function Bt(e,t){let n=[];return e>0&&n.push(zt(e,`file`,`files`)),t>0&&n.push(zt(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function Vt(e){return`${e} earlier tool call${e===1?``:`s`}`}var Ht=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function Ut(e){for(let t of Ht)if(e.startsWith(`${t} `)&&e.length>t.length+1)return{verb:t===`Task:`?`Task`:t,detail:e.slice(t.length+1)};return{verb:e}}function Wt(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)&&!(e.kind===`reasoning`&&e.text.trim()===``)),n=new Set(t.filter(Lt).map(e=>e.id)),r=new Map,i=[];for(let e of t){let t=(e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`)&&e.parentItemId!==void 0&&e.parentItemId!==e.id&&n.has(e.parentItemId)?e.parentItemId:void 0;if(t===void 0)i.push(e);else{let n=r.get(t);n?n.push(e):r.set(t,[e])}}let a=[],o=[],s=()=>{if(o.length>=2){let e=o.filter(e=>e.toolKind===`read`).length;a.push({kind:`context-group`,id:`group:${o[0].id}`,tools:o,files:e,searches:o.length-e,label:Bt(e,o.length-e)})}else for(let e of o)a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]});o=[]};for(let e of i)Lt(e)&&Rt(e)&&!r.has(e.id)?o.push(e):(s(),Lt(e)?a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]}):a.push({kind:`entry`,id:e.id,entry:e}));s();let c=e=>e.kind===`context-group`||e.kind===`tool-card`&&e.item.status===`completed`,l=e=>e.kind===`context-group`?e.tools.length:1,u=[],d=[],f=()=>{if(d.length>3){let e=d.slice(0,d.length-3);u.push({kind:`streak`,id:`streak:${e[0].id}`,count:e.reduce((e,t)=>e+l(t),0),blocks:e}),u.push(...d.slice(d.length-3))}else u.push(...d);d=[]};for(let e of a)c(e)?d.push(e):(f(),u.push(e));return f(),u}var Gt=new Map,Kt=(0,X.createContext)(null);function qt(){return(0,X.useContext)(Kt)}function Jt({runId:e,children:t}){let n=(0,X.useMemo)(()=>({get:t=>Gt.get(e)?.get(t),set:(t,n)=>{let r=Gt.get(e)??new Map;r.set(t,n),Gt.set(e,r)}}),[e]);return(0,Z.jsx)(Kt.Provider,{value:n,children:t})}function Yt(e){return e.scrollTop<Math.max(600,e.clientHeight)}function Xt(e,t){let n=t.find(({bottom:t})=>t>e);return n===void 0?void 0:{key:n.key,offset:n.top-e}}function Zt(e,t,n,r,i){if(n===void 0)return i;let a=r.find(({key:e})=>e===n.key);return a===void 0?i:e+(a.top-t-n.offset)}function Qt(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function $t(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var en=new Map;function tn(e,t){en.set(e,t)}function nn(e){return en.get(e)}var rn=new Map;function an(e,t){rn.set(e,t)}function on(e,t){let n=rn.get(e);return n!==void 0&&n.rows===t?n.cache:void 0}var sn={user:{label:`YOUR MESSAGE`,speaker:`Your message`,classes:`border-message-user-border bg-message-user-bg`,accent:`text-message-user-accent`,body:`max-md:text-[12px]`},agent:{label:`AGENT RESPONSE`,speaker:`Agent response`,classes:`border-message-agent-border bg-message-agent-bg`,accent:`text-message-agent-accent`,body:`max-md:text-[13px]`}};function cn({role:e,children:t,className:n,...r}){let i=sn[e];return(0,Z.jsxs)(`article`,{...r,"data-role":e,"aria-label":i.speaker,className:U(`flex w-full min-w-0 flex-col gap-2 self-stretch rounded-[8px] border p-3 md:px-4 md:py-[14px]`,i.classes,n),children:[(0,Z.jsxs)(`p`,{className:U(`m-0 flex items-center gap-2 text-[11px] leading-none font-semibold tracking-[0.6px] uppercase`,i.accent),children:[(0,Z.jsx)($e,{"aria-hidden":`true`,className:`size-4 shrink-0`}),i.label]}),(0,Z.jsx)(`div`,{className:U(`min-w-0 break-words text-[14px] leading-[1.6] text-foreground select-text [overflow-wrap:anywhere]`,i.body),children:t})]})}function ln({text:e,imageCount:t=0,images:n=[],onEdit:r,onRemove:i,editLabel:a=`Edit message`,removeLabel:o=`Remove message`}){let s=t-n.length,[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(e),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(),g=()=>{d(e),h(void 0),l(!0)},_=async()=>{let t=u.trim();if(!t||t===e){l(!1);return}p(!0),h(void 0);try{await r?.(t),l(!1)}catch(e){h(e instanceof Error?e.message:`Could not save the message`)}finally{p(!1)}},v=async()=>{p(!0),h(void 0);try{await i?.()}catch(e){h(e instanceof Error?e.message:`Could not remove the message`)}finally{p(!1)}};return c?(0,Z.jsxs)(cn,{role:`user`,"data-slot":`user-bubble`,"data-editing":`true`,children:[(0,Z.jsx)(`textarea`,{autoFocus:!0,"aria-label":`Edit the message`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),l(!1)):e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},className:`block max-h-[220px] min-h-[60px] w-full resize-none rounded-md bg-background px-2 py-1.5 text-[13.5px] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`}),(0,Z.jsxs)(`span`,{className:`mt-1.5 flex justify-end gap-1.5`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>l(!1),disabled:f,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm px-2 text-xs font-medium text-muted-foreground hover:bg-background hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:`Cancel`}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void _(),disabled:f,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded-sm bg-action px-2 text-xs font-semibold text-action-foreground hover:brightness-[0.96] focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:f?(0,Z.jsx)(Qe,{className:`size-3.5 animate-spin`}):`Save`})]}),m?(0,Z.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-xs text-danger`,children:m}):null]}):(0,Z.jsxs)(cn,{role:`user`,"data-slot":`user-bubble`,className:`group`,children:[r||i?(0,Z.jsxs)(`span`,{"data-slot":`bubble-actions`,className:`mb-1 flex justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[r?(0,Z.jsx)(`button`,{type:`button`,"aria-label":a,onClick:g,disabled:f,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Dt,{className:`size-3.5`})}):null,i?(0,Z.jsx)(`button`,{type:`button`,"aria-label":o,onClick:()=>void v(),disabled:f,className:`inline-flex size-11 items-center justify-center rounded-sm text-soft-foreground hover:bg-background hover:text-danger focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(B,{className:`size-3.5`})}):null]}):null,m?(0,Z.jsx)(`p`,{role:`alert`,className:`mb-1 text-xs text-danger`,children:m}):null,(0,Z.jsx)(nt,{breaks:!0,children:e}),n.length>0?(0,Z.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap items-center justify-end gap-1.5`,children:n.map(e=>xe(e.split(`/`).pop()??``)?(0,Z.jsx)(ft,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e):(0,Z.jsxs)(`a`,{href:he(e),download:!0,"data-slot":`user-file`,className:`inline-flex min-h-11 min-w-11 max-w-[220px] items-center gap-1.5 rounded-md border border-border bg-background/60 px-2 py-1 text-xs text-muted-foreground hover:text-foreground`,children:[(0,Z.jsx)(b,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()})]},e))}):null,s>0?(0,Z.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[s,` image`,s>1?`s`:``,` attached`]}):null]})}function un({text:e}){return(0,Z.jsx)(cn,{role:`agent`,"data-slot":`assistant-message`,children:(0,Z.jsx)(nt,{children:e})})}function dn({note:e}){return(0,Z.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:U(`px-0.5 text-xs`,e.tone===`danger`?`text-danger [.light_&]:text-red-700`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:`· `,e.text]})}var fn={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`,pi:`pi`,cursor:`Cursor`};function pn({incident:e}){let t=fn[e.provider];return(0,Z.jsxs)(`div`,{role:`alert`,"data-slot":`provider-auth-required`,className:`rounded-md border border-danger/30 bg-danger/5 px-3.5 py-3`,children:[(0,Z.jsxs)(`p`,{className:`text-[13px] font-semibold text-foreground`,children:[`This run needed `,t,` authorization`]}),(0,Z.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Review `,t,` settings before retrying.`]}),(0,Z.jsx)(q,{to:`/settings/agents#providers`,className:`mt-2 inline-flex text-xs font-medium text-foreground underline-offset-2 hover:underline`,children:`Open provider settings`})]})}function mn({text:e}){let t=(0,X.useId)();if(e.trim()===``)return null;let n=e.split(`
2
2
  `,1)[0]??``,r=n.length<e.length;return(0,Z.jsxs)(Se,{"data-slot":`reasoning`,className:`group/reasoning min-w-0`,children:[(0,Z.jsxs)(`div`,{id:t,className:`relative flex w-full items-center gap-1.5 rounded-md p-0.5 text-left text-[13px] text-soft-foreground hover:text-muted-foreground`,children:[(0,Z.jsx)(w,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]/reasoning:rotate-90`}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`Thinking — `}),(0,Z.jsx)(`div`,{className:`min-w-0 truncate text-muted-foreground`,children:(0,Z.jsx)(nt,{inline:!0,children:n})}),r?(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`…`}):null,(0,Z.jsx)(G,{"aria-labelledby":t,className:`absolute inset-0 rounded-md focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`})]}),(0,Z.jsx)(W,{children:(0,Z.jsx)(`div`,{className:`px-6 py-1.5 text-[13px] leading-[1.6] text-soft-foreground`,children:(0,Z.jsx)(nt,{children:e})})})]})}function hn(){return(0,Z.jsxs)(`div`,{"data-slot":`working-indicator`,className:`flex items-center gap-2 py-1 text-[13px] text-soft-foreground`,children:[(0,Z.jsx)(Qe,{role:`status`,"aria-label":`Working`,className:`size-3.5 shrink-0 animate-spin`}),(0,Z.jsx)(`span`,{className:`shimmer font-medium`,children:`Working…`})]})}var gn={read:qe,edit:Dt,delete:B,move:Tt,search:h,execute:tt,think:Ct,fetch:De,task:z,plan:c,other:r},_n=e=>e.split(`
3
3
  `).length;function vn({text:e,streaming:t}){let[n,r]=(0,X.useState)(!1),i=(0,X.useRef)(null),a=(0,X.useRef)(!0);(0,X.useEffect)(()=>{let e=i.current;t&&e&&a.current&&(e.scrollTop=e.scrollHeight)},[e,t]);let o=_n(e),s=!t&&!n&&o>12;return(0,Z.jsxs)(`div`,{"data-slot":`tool-output`,"data-clamped":s?`true`:void 0,children:[(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{ref:i,onScroll:t?e=>{a.current=Qt(e.currentTarget)}:void 0,className:U(`overflow-x-auto`,t&&`max-h-[216px] overflow-y-auto`,s&&`max-h-[216px] overflow-y-hidden`),children:(0,Z.jsx)(`pre`,{className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre text-muted-foreground`,children:e})}),s?(0,Z.jsx)(`div`,{"data-slot":`tool-output-fade`,"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-b from-transparent to-card-2`}):null]}),!t&&o>12?(0,Z.jsx)(`button`,{type:`button`,"data-slot":`tool-output-toggle`,onClick:()=>r(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:n?`Show less`:`Show all ${o} lines`}):null]})}function yn({diffs:e}){return(0,Z.jsx)(Z.Fragment,{children:e.map((e,t)=>(0,Z.jsxs)(`div`,{"data-slot":`diff-preview`,className:`min-w-0`,children:[(0,Z.jsx)(`div`,{className:`border-b border-border/50 px-4 py-1.5 font-mono text-[11px] text-soft-foreground`,children:e.path}),(0,Z.jsx)(`pre`,{className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:e.unified===void 0?[...bn(e.oldText).map((e,t)=>(0,Z.jsxs)(`span`,{className:`block bg-diff-del px-4 text-muted-foreground`,children:[`- `,e]},`old-${t}`)),...bn(e.newText).map((e,t)=>(0,Z.jsxs)(`span`,{className:`block bg-diff-add px-4`,children:[`+ `,e]},`new-${t}`))]:e.unified.split(`
4
4
  `).map((e,t)=>(0,Z.jsx)(xn,{text:e},t))})]},`${e.path}:${t}`))})}function bn(e){return e==null||e===``?[]:e.replace(/\n$/,``).split(`
@@ -1 +1 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{_ as n,d as r,en as i,f as a,g as o,h as s,m as c,p as l,v as u}from"./alert-dialog-KUiPIBmb.js";import{t as d}from"./utils-CG8vWc5K.js";e();var f=t();function p({...e}){return(0,f.jsx)(a,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(n,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-overlay`,className:d(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:n=!0,...r}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{}),(0,f.jsxs)(c,{"data-slot":`dialog-content`,className:d(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,f.jsxs)(l,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:d(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function v({className:e,showCloseButton:t=!1,children:n,...i}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:d(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...i,children:[n,t&&(0,f.jsx)(l,{asChild:!0,children:(0,f.jsx)(r,{variant:`outline`,children:`Close`})})]})}function y({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:d(`text-lg leading-none font-semibold`,e),...t})}function b({className:e,...t}){return(0,f.jsx)(s,{"data-slot":`dialog-description`,className:d(`text-sm text-muted-foreground`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(`textarea`,{"data-slot":`textarea`,className:d(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-[var(--task-brand-bg)] px-3 py-2 text-base shadow-none transition-[color,box-shadow] outline-none placeholder:text-soft-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm`,e),...t})}export{v as a,b as i,p as n,_ as o,g as r,y as s,x as t};
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{_ as n,d as r,en as i,f as a,g as o,h as s,m as c,p as l,v as u}from"./alert-dialog-Bv9zV9w1.js";import{t as d}from"./utils-CG8vWc5K.js";e();var f=t();function p({...e}){return(0,f.jsx)(a,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(n,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-overlay`,className:d(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:n=!0,...r}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{}),(0,f.jsxs)(c,{"data-slot":`dialog-content`,className:d(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,f.jsxs)(l,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:d(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function v({className:e,showCloseButton:t=!1,children:n,...i}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:d(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...i,children:[n,t&&(0,f.jsx)(l,{asChild:!0,children:(0,f.jsx)(r,{variant:`outline`,children:`Close`})})]})}function y({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:d(`text-lg leading-none font-semibold`,e),...t})}function b({className:e,...t}){return(0,f.jsx)(s,{"data-slot":`dialog-description`,className:d(`text-sm text-muted-foreground`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(`textarea`,{"data-slot":`textarea`,className:d(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-[var(--task-brand-bg)] px-3 py-2 text-base shadow-none transition-[color,box-shadow] outline-none placeholder:text-soft-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm`,e),...t})}export{v as a,b as i,p as n,_ as o,g as r,y as s,x as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{G as r,Gi as i,J as a,Kt as o,Nt as s,Oa as ee,Wt as te,Y as ne,_ as c,aa as l,d as u,dr as re,en as ie,f as d,g as ae,h as oe,kt as se,l as ce,m as le,mr as ue,p as f,rn as de,v as p,y as fe}from"./alert-dialog-KUiPIBmb.js";import{_ as pe,b as me,t as m,v as h}from"./utils-CG8vWc5K.js";import{a as he,i as ge,r as _e}from"./agent-accounts-MT-jtwOU.js";import{E as ve,F as ye,M as be,j as xe,r as Se}from"./prompt-templates-DTSPmJP-.js";import{u as Ce}from"./project-router-BOglfKgF.js";import{i as we,n as Te,r as Ee,t as De}from"./skills-DFBiAuJG.js";import{t as Oe}from"./use-submit-shortcut-KWJsC906.js";var g=n(),_=e(t(),1);function v(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function ke(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function y(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat||v(e.target)&&!ke(e.target))}function b(e,t){let n=_.useRef(t);_.useLayoutEffect(()=>{n.current=t}),_.useEffect(()=>{let t=t=>{y(t,e)&&(t.preventDefault(),n.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Ae(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||v(e.target))}function x(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function je(e,t){let n=_.useRef(t);_.useLayoutEffect(()=>{n.current=t}),_.useEffect(()=>{let t=t=>{Ae(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Me({...e}){return(0,g.jsx)(d,{"data-slot":`sheet`,...e})}function S({...e}){return(0,g.jsx)(fe,{"data-slot":`sheet-trigger`,...e})}function Ne({...e}){return(0,g.jsx)(f,{"data-slot":`sheet-close`,...e})}function C({...e}){return(0,g.jsx)(c,{"data-slot":`sheet-portal`,...e})}function Pe({className:e,...t}){return(0,g.jsx)(ae,{"data-slot":`sheet-overlay`,className:m(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Fe({className:e,children:t,side:n=`right`,showCloseButton:r=!0,overlayClassName:i,...a}){return(0,g.jsxs)(C,{children:[(0,g.jsx)(Pe,{className:i}),(0,g.jsxs)(le,{"data-slot":`sheet-content`,className:m(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...a,children:[t,r&&(0,g.jsxs)(f,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,g.jsx)(ie,{className:`size-4`}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function w({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`sheet-header`,className:m(`flex flex-col gap-1.5 p-4`,e),...t})}function Ie({className:e,...t}){return(0,g.jsx)(p,{"data-slot":`sheet-title`,className:m(`font-semibold text-foreground`,e),...t})}function T({className:e,...t}){return(0,g.jsx)(oe,{"data-slot":`sheet-description`,className:m(`text-sm text-muted-foreground`,e),...t})}function Le(e){let[t,n]=_.useState(()=>Date.now());return _.useEffect(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Re={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,avif:`image/avif`,md:`text/markdown`,markdown:`text/markdown`,txt:`text/plain`,log:`text/plain`,pdf:`application/pdf`};function ze(e){return h(e.type)?e.type:Re[e.name.split(`.`).pop()?.toLowerCase()??``]??null}async function Be(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));let r=btoa(n),i=ze(e)??`application/octet-stream`,a=me(i);return{mediaType:i,data:r,...a?{preview:`data:${i};base64,${r}`}:{},name:e.name||(a?`pasted image`:`pasted.${pe(i)}`),isImage:a}}function Ve(e,t){let n=[],r=[],i=t;for(let t of e){let e=t.name||`attachment`;if(ze(t)===null){r.push(`${e} is not a supported attachment (images, PDF and plain-text files such as TXT or MD)`);continue}if(t.size>5242880){r.push(`${e} is too large (max 5 MB)`);continue}if(i>=4){r.push(`${e} skipped — max 4 attachments per message`);continue}n.push(t),i+=1}return{accepted:n,rejected:r}}var E=new Set([`/`,`@`]);function He(e,t){for(let n=t-1;n>=0;--n){let r=e[n];if(/\s/.test(r))return null;if(E.has(r))return n>0&&!/\s/.test(e[n-1])?null:{trigger:r,start:n,query:e.slice(n+1,t)}}return null}function Ue(e,t,n,r){let i=`${t.trigger}${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}function D(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function We(e,t){let n=e,r=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let i=t.results[e],a=i[0]?.transcript??``;i.isFinal?n+=a:r+=a}return{finalText:n,interim:r}}function Ge(e){let[t,n]=_.useState(null),r=_.useRef(null),i=_.useRef(``),[a]=_.useState(()=>D()!==void 0),o=_.useCallback(()=>{let e=r.current;r.current=null,i.current=``,n(null),e&&(e.onresult=null,e.onerror=null,e.onend=null,e.abort())},[]);return _.useEffect(()=>o,[o]),{supported:a,recording:t,start:_.useCallback(()=>{if(r.current)return;let t=D();if(!t)return;let a;try{a=new t,a.lang=navigator.language||`en-US`,a.continuous=!0,a.interimResults=!0;let s=Date.now();a.onresult=e=>{let t=We(i.current,e);i.current=t.finalText,n({transcript:t.finalText+t.interim,startedAt:s})},a.onerror=t=>{e(`Dictation failed${t.error?` — ${t.error}`:``}`),o()},a.start(),r.current=a,n({transcript:``,startedAt:s})}catch{e(`Dictation failed — the microphone could not be started`),o()}},[e,o]),cancel:_.useCallback(()=>o(),[o]),finish:_.useCallback(()=>{let e=r.current,a=(i.current+``).trim()===``?``:i.current,o=t?.transcript??a;return e&&(e.onresult=null,e.onerror=null,e.onend=null,e.stop()),r.current=null,i.current=``,n(null),o.trim()},[t])}}function O(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`}var Ke=new Map,qe={KeyA:`Yes, approved.`,KeyC:`Continue.`};function k({onSubmit:e,retainDraftUntilSuccess:t=!1,onStop:n,stopOnEmpty:a=!1,stopping:c=!1,emptySubmitLabel:d,compactFeedback:ae=!1,idleFeedback:oe,pendingLabel:ce=`Starting task…`,failureHint:le=`Could not confirm submission. Check Tasks before you retry. Your draft is kept.`,clearOnSuccess:f=!0,onPendingChange:p,value:fe,onValueChange:pe,autoFocus:me=!1,mobileCollapsible:h=!1,mobileDisclosureKey:Ce,footerStart:ke,footerEnd:y,sessionControls:b,sessionModel:Ae,executionOptions:x,agentOptions:je,sendAriaLabel:Me=`Send`,disabled:S=!1,disabledReason:Ne=`Session closed — Continue to reopen.`,allowEmptySubmit:C=!1,placeholder:Pe=`Reply — / for skills, @ for files…`,ariaLabel:Fe=`Reply to the agent`,autocompleteSkills:w=!0,quickReplies:Ie=!1,getMentionCandidates:T,ref:Le}){let[Re,ze]=(0,_.useState)(``),E=fe??Re,D=(0,_.useRef)(E);D.current=E;let We=(0,_.useRef)(pe);We.current=pe;let O=(0,_.useCallback)(e=>{let t=typeof e==`function`?e(D.current):e;ze(t),We.current?.(t)},[]),[k,A]=(0,_.useState)([]),j=(0,_.useRef)(k);j.current=k;let[Xe,Ze]=(0,_.useState)(!1),M=c||Xe,N=(0,_.useRef)(M);N.current=M;let P=E.trim()!==``||k.length>0,Qe=!P&&(n!==void 0&&a||M),$e=!P&&d?d:Me,[F,I]=(0,_.useState)(!1),L=(0,_.useRef)(!1),et=(0,_.useRef)(0),R=(0,_.useRef)(!0);(0,_.useEffect)(()=>(R.current=!0,()=>{R.current=!1}),[]);let[z,B]=(0,_.useState)(null),V=M||t&&F,H=()=>N.current||t&&L.current,[U,W]=(0,_.useState)(null),[tt,nt]=(0,_.useState)(``),[rt,it]=(0,_.useState)(!1),G=(0,_.useRef)(null),K=(0,_.useId)(),at=(0,_.useId)(),ot=(0,_.useRef)(new Map),st=Ce===void 0?ot.current:Ke,ct=Ce??`default`,[,lt]=(0,_.useReducer)(e=>e+1,0),q=st.get(ct)??!1,ut=h&&!q,dt=(0,_.useRef)(null),J=(0,_.useRef)(null),ft=re(w&&rt),Y=ue(),pt=ee(),X=Ge(e=>l(e,{tone:`danger`}));(0,_.useEffect)(()=>{me&&G.current?.focus()},[]),(0,_.useImperativeHandle)(Le,()=>({insertAtCaret:e=>{if(H())return;let t=G.current,n=Se(D.current,t?.selectionStart??D.current.length,e);O(n.text),J.current=n.caret,t?.focus()}}),[O,t]);let mt=(0,_.useCallback)(()=>{let e=G.current;if(!e||S||H()){W(null);return}let t=He(e.value,e.selectionStart??e.value.length);if(t?.trigger===`/`&&!w||t?.trigger===`@`&&T===void 0)return W(null);t?.trigger===`/`&&it(!0),W(t)},[w,S,T,t]),Z=(0,_.useMemo)(()=>U===null?[]:U.trigger===`/`?Te(ft.data??[],U.query,Y.data?.skillUsage).map(e=>({value:`${e.name} ${e.path}`,insert:e.name,label:e.name,description:e.description,emphasized:we(e)})):(T?.()??[]).filter(e=>Ee(e,U.query)).map(e=>({value:e,insert:e,label:e,emphasized:!1})),[T,ft.data,U,Y.data?.skillUsage]),ht=Z.some(e=>e.value===tt)?tt:Z[0]?.value,gt=U!==null,_t=(0,_.useCallback)(()=>W(null),[]),vt=e=>{let t=G.current;if(!t||U===null||H())return;let n=t.selectionStart??t.value.length,r=Ue(t.value,U,n,e.insert);U.trigger===`/`&&Y.data!==void 0&&i({skillUsage:De(Y.data.skillUsage,e.insert)}).then(()=>pt.invalidateQueries({queryKey:de.uiState})).catch(()=>{}),O(r.text),J.current=r.caret,W(null),t.focus()};(0,_.useLayoutEffect)(()=>{let e=J.current,t=G.current;e!==null&&t&&(t.setSelectionRange(e,e),J.current=null)},[E]),(0,_.useLayoutEffect)(()=>{let e=G.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)},[E,q]);let yt=(0,_.useCallback)(e=>{if(S||H())return;let n=et.current,r=Ve(e,j.current.length);for(let e of r.rejected)l(e,{tone:`danger`});for(let e of r.accepted)Be(e).then(e=>{!R.current||t&&L.current&&!N.current||n!==et.current||A(t=>t.length>=4?t:[...t,e])},()=>l(`${e.name||`Attachment`} could not be read — try attaching it again`,{tone:`danger`}))},[S,t]),bt=e=>{let t=[...e.clipboardData?.items??[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length!==0&&(e.preventDefault(),yt(t))},xt=e=>{let t=[...e.dataTransfer?.files??[]];t.length!==0&&(e.preventDefault(),yt(t))},Q=(0,_.useCallback)(async(n,r,i)=>{let a=n.trim();if(!(S||c||L.current)&&!(a===``&&r.length===0&&!C)){L.current=!0,t&&(et.current+=1),I(!0),B(null),p?.(!0),W(null),i&&!t&&(O(``),A([]));try{await e(a,r.map(({mediaType:e,data:t})=>({mediaType:e,data:t}))),R.current&&t&&f&&(D.current===n&&O(``),j.current===r&&A([]))}catch(e){if(!R.current&&t)return;let a=e instanceof Error?e.message:String(e);t?B(a):(l(a,{tone:`danger`}),i&&(O(e=>e===``?n:`${n}\n${e}`),A(e=>[...r,...e].slice(0,4))))}finally{L.current=!1,R.current&&(p?.(!1),I(!1))}}},[C,S,c,e,t,f,p,O]),St=(0,_.useCallback)(()=>{S||c||L.current||Q(D.current,j.current,!0)},[S,c,Q]),Ct=async()=>{if(!(!n||c||L.current)){L.current=!0,I(!0),Ze(!0),B(null);try{await n()}catch(e){R.current&&B(e instanceof Error?e.message:String(e))}finally{L.current=!1,R.current&&(I(!1),Ze(!1))}}},wt=e=>{if(gt){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),Z.length===0)return;let t=Z.findIndex(e=>e.value===ht),n=e.key===`ArrowDown`?1:-1,r=Z[(t+n+Z.length)%Z.length];nt(r.value);return}if(e.key===`Escape`){e.preventDefault(),_t();return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=Z.find(e=>e.value===ht);if(t){e.preventDefault(),vt(t);return}_t()}}Oe({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),St())};(0,_.useEffect)(()=>{if(!Ie||S)return;let e=e=>{if(!e.altKey||e.metaKey||e.ctrlKey||e.repeat||v(e.target))return;let t=qe[e.code];t!==void 0&&(e.preventDefault(),Q(t,[],!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[S,Ie,Q]);let Tt=e=>{if(S||N.current||L.current&&(e||t))return;let n=X.finish();if(n===``)return;let r=E.trim()===``?n:`${E.replace(/\s*$/,``)} ${n}`;if(e){t&&O(r),Q(r,k,!0);return}O(r),J.current=r.length,G.current?.focus()},$=X.recording,Et=X.supported?(0,g.jsxs)(u,{type:`button`,variant:`ghost`,size:`sm`,disabled:S||V,"aria-label":`Start dictation`,title:`Dictation`,className:m(`h-11 gap-1.5 px-2.5 text-xs font-medium text-muted-foreground md:h-8`,ut&&`hidden md:inline-flex`),onClick:()=>{H()||X.start()},children:[(0,g.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),x||b?null:`Dictation`]}):null,Dt=n||M?(0,g.jsxs)(u,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":M?`Stopping…`:`Stop`,"aria-busy":M||void 0,title:M?`Waiting for execution to stop`:`Stop execution; keep existing work`,disabled:F||M,className:m(`h-11 min-w-11 active:opacity-80`,Qe?`w-auto px-3`:`w-11`),onClick:()=>void Ct(),children:[(0,g.jsx)(te,{"aria-hidden":`true`,className:`size-3 fill-current`}),Qe?M?`Stopping…`:`Stop`:null]}):null,Ot=(0,g.jsx)(g.Fragment,{children:t||n||c?(0,g.jsx)(`div`,{className:m(`overflow-y-auto px-3 pb-2 text-xs leading-5 text-muted-foreground md:px-4`,ae?`min-h-6`:`h-24 md:h-20`),children:(0,g.jsx)(`div`,{id:`${K}-submission`,role:z===null?`status`:`alert`,"aria-atomic":`true`,tabIndex:z===null?void 0:0,className:`break-words`,children:M?`Stopping execution. Your draft is kept.`:F?ce:z===null?oe??null:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`font-medium text-foreground`,children:z}),(0,g.jsx)(`p`,{children:le})]})})}):null}),kt=(0,g.jsxs)(`div`,{"data-slot":`composer-submit-row`,className:m(`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1 md:flex-nowrap`,x&&`new-task-submission`),children:[x||b?null:Et,y?(0,g.jsx)(`div`,{id:at,"data-slot":`composer-footer-end`,className:m(`min-w-0 flex-wrap items-center gap-1.5 md:flex-nowrap`,x&&`mr-auto`,h&&`max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11`,ut?`hidden md:flex`:`flex`),children:(0,g.jsx)(`div`,{className:`contents`,inert:V||void 0,children:y})}):null,(0,g.jsxs)(`div`,{className:`flex min-w-[100px] items-center justify-end gap-1`,"data-slot":`composer-actions`,children:[Dt,Qe?null:(0,g.jsxs)(u,{type:`button`,size:`icon-sm`,"aria-label":$e,"aria-busy":F&&!M||void 0,disabled:S||F||M||!P&&!C,className:m(x?`h-12 w-full gap-2 px-6`:b?`h-11 w-auto gap-2 px-5`:`size-11`,!P&&d&&`w-auto px-3`,`active:opacity-80`),onClick:St,children:[!b&&!P&&d?(0,g.jsx)(ye,{"aria-hidden":`true`}):null,x||b||!P&&d?$e:null,b||P||!d?(0,g.jsx)(r,{"aria-hidden":`true`}):null]})]})]});return(0,g.jsxs)(_e,{open:gt,onOpenChange:e=>e?void 0:_t(),children:[(0,g.jsx)(ge,{asChild:!0,children:(0,g.jsxs)(`div`,{ref:dt,"data-slot":`composer`,"data-disabled":S||void 0,onDrop:xt,onDragOver:e=>e.preventDefault(),className:m(x&&`new-task-composer`,b&&`session-composer`,S&&`opacity-80`),children:[(0,g.jsxs)(`div`,{"data-slot":`composer-editor`,className:m(`rounded-xl border border-[var(--composer-border)] bg-card shadow-none transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/15`,x&&`new-task-editor`),children:[k.length>0?(0,g.jsx)(`div`,{"data-slot":`composer-thumbs`,className:`flex flex-nowrap items-center gap-2 overflow-x-auto px-4 pt-3 md:flex-wrap md:overflow-visible`,children:k.map((e,t)=>(0,g.jsxs)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,title:V?`Attachment submitted`:`Click to remove`,disabled:V,className:m(`group relative shrink-0 overflow-hidden rounded-md border border-border`,e.isImage?`size-12`:`flex h-12 min-w-11 max-w-[200px] items-center gap-1.5 bg-muted/40 px-2.5 text-xs text-muted-foreground`),onClick:()=>{H()||A(e=>e.filter((e,n)=>n!==t))},children:[e.isImage?(0,g.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover`}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,g.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,g.jsx)(`span`,{className:`absolute inset-0 hidden items-center justify-center bg-background/70 group-hover:flex group-focus-visible:flex`,children:(0,g.jsx)(ie,{"aria-hidden":`true`,className:`size-4`})})]},`${e.name}-${t}`))}):null,(0,g.jsx)(`label`,{htmlFor:K,className:x?`hidden px-5 pt-5 text-xs text-muted-foreground md:block`:`sr-only`,children:x?`Task description`:Fe}),(0,g.jsx)(`textarea`,{ref:G,id:K,autoComplete:`off`,rows:1,value:E,disabled:S,readOnly:V,"aria-busy":V||void 0,"aria-describedby":t?`${K}-submission`:void 0,"aria-label":Fe,placeholder:S?Ne:Pe,className:m(`block min-h-11 w-full resize-none bg-transparent px-3 pt-2.5 pb-1 text-base leading-normal outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:min-h-[54px] md:px-4 md:pt-3 md:text-sm`,ut?`max-h-11 md:max-h-[220px]`:`max-h-[220px]`),onChange:e=>{H()||(O(e.target.value),mt())},onKeyDown:wt,onSelect:mt,onPaste:bt}),x?(0,g.jsxs)(`p`,{"data-slot":`composer-skill-hint`,className:`flex items-center gap-2 px-5 pt-3 pb-2 text-xs text-muted-foreground`,children:[(0,g.jsx)(o,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),`Type / for a skill or workflow`]}):null,b&&$?(0,g.jsx)(`div`,{"data-slot":`session-controls`,inert:V||void 0,children:b}):null,$?(0,g.jsxs)(`div`,{children:[(0,g.jsx)(Ye,{transcript:$.transcript,startedAt:$.startedAt,insertionDisabled:V,onCancel:X.cancel,onInsert:()=>Tt(!1),onInsertAndSend:()=>Tt(!0)}),Dt?(0,g.jsx)(`div`,{className:`flex justify-end px-2 pb-2`,children:Dt}):null]}):(0,g.jsxs)(`div`,{"data-slot":`composer-toolbar`,className:`flex flex-wrap items-center gap-1 gap-y-1 px-1.5 pt-1 pb-1.5 md:gap-y-1.5 md:px-2 md:pt-1.5 md:pb-2`,children:[b?(0,g.jsx)(`div`,{"data-slot":`session-controls`,inert:V||void 0,children:b}):null,(0,g.jsxs)(`div`,{"data-slot":`composer-footer-start`,className:m(`flex min-w-0 flex-wrap items-center gap-1`,x&&`w-full`),children:[(0,g.jsx)(Je,{disabled:S||V,onFiles:yt}),h?(0,g.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":q?`Collapse composer`:`Expand composer`,"aria-expanded":q,"aria-controls":y?`${K} ${at}`:K,onClick:()=>{st.set(ct,!q),lt()},children:(0,g.jsx)(ne,{"aria-hidden":`true`,className:m(`transition-transform motion-reduce:transition-none`,!q&&`rotate-180`)})}):null,(0,g.jsx)(`div`,{className:`contents`,inert:V||void 0,children:ke}),x||b?(0,g.jsx)(`div`,{children:Et}):null]}),Ae?(0,g.jsx)(`div`,{"data-slot":`session-model`,inert:V||void 0,children:Ae}):null,x?null:kt]}),x?null:Ot]}),x?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{"data-slot":`composer-agent-options`,inert:V||void 0,children:je}),(0,g.jsx)(`div`,{"data-slot":`composer-execution-panel`,inert:V||void 0,children:x}),kt,(0,g.jsx)(`div`,{"data-slot":`composer-feedback`,children:Ot})]}):null]})}),(0,g.jsx)(he,{side:`top`,align:`start`,sideOffset:8,className:`w-80 max-w-[calc(100vw-2rem)] p-0`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{dt.current?.contains(e.target)&&e.preventDefault()},children:(0,g.jsx)(ve,{shouldFilter:!1,value:ht??``,onValueChange:nt,children:(0,g.jsx)(be,{"data-slot":`composer-menu`,"data-trigger":U?.trigger,className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] p-1`,children:Z.length===0?(0,g.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:U?.trigger===`@`?`No files seen in this session yet — full file search arrives with the Files tab.`:ft.isPending?`Loading skills…`:`No matching skills.`}):Z.map(e=>(0,g.jsxs)(xe,{value:e.value,"data-slot":`composer-menu-item`,"data-emphasized":e.emphasized||void 0,onSelect:()=>vt(e),children:[(0,g.jsx)(`span`,{className:m(`shrink-0 truncate`,e.emphasized&&`font-semibold`,U?.trigger===`@`&&`font-mono text-xs`),children:e.label}),e.description?(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.value))})})})]})}function Je({disabled:e,onFiles:t}){let n=(0,_.useRef)(null);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,title:`Attach an image, PDF, TXT or MD file (or paste a screenshot)`,disabled:e,className:`size-11 text-muted-foreground`,onClick:()=>n.current?.click(),children:(0,g.jsx)(s,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,g.jsx)(`input`,{ref:n,type:`file`,accept:`image/*,application/pdf,text/plain,text/markdown,.pdf,.txt,.md,.markdown,.log`,multiple:!0,className:`hidden`,"aria-hidden":`true`,tabIndex:-1,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function Ye({transcript:e,startedAt:t,insertionDisabled:n,onCancel:i,onInsert:o,onInsertAndSend:s}){let ee=Le(1e3);return(0,g.jsxs)(`div`,{"data-slot":`dictation-overlay`,role:`status`,"aria-label":`Dictation in progress`,className:`flex items-center gap-2.5 rounded-b-xl border-t border-border bg-muted/60 px-3 py-2`,children:[(0,g.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none animate-pulse rounded-full bg-danger motion-reduce:animate-none`}),(0,g.jsx)(`span`,{"data-slot":`dictation-timer`,className:`text-xs font-medium text-muted-foreground tabular-nums`,children:O(t,ee)}),(0,g.jsx)(`span`,{"data-slot":`dictation-transcript`,"aria-live":`polite`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e===``?(0,g.jsx)(`span`,{className:`text-muted-foreground`,children:`Listening…`}):e}),(0,g.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Cancel dictation`,className:`size-11 text-muted-foreground md:size-8`,onClick:i,children:(0,g.jsx)(ie,{"aria-hidden":`true`})}),(0,g.jsx)(u,{type:`button`,variant:`outline`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription`,className:`size-11 md:size-8`,onClick:o,children:(0,g.jsx)(a,{"aria-hidden":`true`})}),(0,g.jsx)(u,{type:`button`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription and send`,className:`size-11 md:size-8`,onClick:s,children:(0,g.jsx)(r,{"aria-hidden":`true`})})]})}function A(){return(0,g.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,g.jsx)(ce,{icon:(0,g.jsx)(Ce,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}export{Ne as a,w as c,x as d,b as f,Me as i,Ie as l,k as n,Fe as o,je as p,Le as r,T as s,A as t,S as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{G as r,Gi as i,J as a,Kt as o,Nt as s,Oa as ee,Wt as te,Y as ne,_ as c,aa as l,d as u,dr as re,en as ie,f as d,g as ae,h as oe,kt as se,l as ce,m as le,mr as ue,p as f,rn as de,v as p,y as fe}from"./alert-dialog-Bv9zV9w1.js";import{_ as pe,b as me,t as m,v as h}from"./utils-CG8vWc5K.js";import{a as he,i as ge,r as _e}from"./agent-accounts-BP0XBzQP.js";import{E as ve,F as ye,M as be,j as xe,r as Se}from"./prompt-templates-B4eJ8kQZ.js";import{u as Ce}from"./project-router-a1gx3dfP.js";import{i as we,n as Te,r as Ee,t as De}from"./skills-DFBiAuJG.js";import{t as Oe}from"./use-submit-shortcut-KWJsC906.js";var g=n(),_=e(t(),1);function v(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable?!0:e.closest(`[contenteditable=""], [contenteditable="true"]`)!==null}function ke(e){return e instanceof HTMLElement&&e.closest(`[cmdk-input]`)!==null}function y(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.repeat||v(e.target)&&!ke(e.target))}function b(e,t){let n=_.useRef(t);_.useLayoutEffect(()=>{n.current=t}),_.useEffect(()=>{let t=t=>{y(t,e)&&(t.preventDefault(),n.current(t))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Ae(e,t){return!(typeof e.key!=`string`||e.key.toLowerCase()!==t.toLowerCase()||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.repeat||v(e.target))}function x(e,t=typeof navigator>`u`?``:navigator.platform){let n=e.toUpperCase();return/mac|iphone|ipad|ipod/i.test(t)?`⌘${n}`:`Ctrl+${n}`}function je(e,t){let n=_.useRef(t);_.useLayoutEffect(()=>{n.current=t}),_.useEffect(()=>{let t=t=>{Ae(t,e)&&n.current(t)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function Me({...e}){return(0,g.jsx)(d,{"data-slot":`sheet`,...e})}function S({...e}){return(0,g.jsx)(fe,{"data-slot":`sheet-trigger`,...e})}function Ne({...e}){return(0,g.jsx)(f,{"data-slot":`sheet-close`,...e})}function C({...e}){return(0,g.jsx)(c,{"data-slot":`sheet-portal`,...e})}function Pe({className:e,...t}){return(0,g.jsx)(ae,{"data-slot":`sheet-overlay`,className:m(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Fe({className:e,children:t,side:n=`right`,showCloseButton:r=!0,overlayClassName:i,...a}){return(0,g.jsxs)(C,{children:[(0,g.jsx)(Pe,{className:i}),(0,g.jsxs)(le,{"data-slot":`sheet-content`,className:m(`fixed z-50 flex flex-col gap-4 bg-background shadow-modal transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...a,children:[t,r&&(0,g.jsxs)(f,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,g.jsx)(ie,{className:`size-4`}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function w({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`sheet-header`,className:m(`flex flex-col gap-1.5 p-4`,e),...t})}function Ie({className:e,...t}){return(0,g.jsx)(p,{"data-slot":`sheet-title`,className:m(`font-semibold text-foreground`,e),...t})}function T({className:e,...t}){return(0,g.jsx)(oe,{"data-slot":`sheet-description`,className:m(`text-sm text-muted-foreground`,e),...t})}function Le(e){let[t,n]=_.useState(()=>Date.now());return _.useEffect(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Re={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,avif:`image/avif`,md:`text/markdown`,markdown:`text/markdown`,txt:`text/plain`,log:`text/plain`,pdf:`application/pdf`};function ze(e){return h(e.type)?e.type:Re[e.name.split(`.`).pop()?.toLowerCase()??``]??null}async function Be(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));let r=btoa(n),i=ze(e)??`application/octet-stream`,a=me(i);return{mediaType:i,data:r,...a?{preview:`data:${i};base64,${r}`}:{},name:e.name||(a?`pasted image`:`pasted.${pe(i)}`),isImage:a}}function Ve(e,t){let n=[],r=[],i=t;for(let t of e){let e=t.name||`attachment`;if(ze(t)===null){r.push(`${e} is not a supported attachment (images, PDF and plain-text files such as TXT or MD)`);continue}if(t.size>5242880){r.push(`${e} is too large (max 5 MB)`);continue}if(i>=4){r.push(`${e} skipped — max 4 attachments per message`);continue}n.push(t),i+=1}return{accepted:n,rejected:r}}var E=new Set([`/`,`@`]);function He(e,t){for(let n=t-1;n>=0;--n){let r=e[n];if(/\s/.test(r))return null;if(E.has(r))return n>0&&!/\s/.test(e[n-1])?null:{trigger:r,start:n,query:e.slice(n+1,t)}}return null}function Ue(e,t,n,r){let i=`${t.trigger}${r} `;return{text:e.slice(0,t.start)+i+e.slice(n),caret:t.start+i.length}}function D(){let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition}function We(e,t){let n=e,r=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let i=t.results[e],a=i[0]?.transcript??``;i.isFinal?n+=a:r+=a}return{finalText:n,interim:r}}function Ge(e){let[t,n]=_.useState(null),r=_.useRef(null),i=_.useRef(``),[a]=_.useState(()=>D()!==void 0),o=_.useCallback(()=>{let e=r.current;r.current=null,i.current=``,n(null),e&&(e.onresult=null,e.onerror=null,e.onend=null,e.abort())},[]);return _.useEffect(()=>o,[o]),{supported:a,recording:t,start:_.useCallback(()=>{if(r.current)return;let t=D();if(!t)return;let a;try{a=new t,a.lang=navigator.language||`en-US`,a.continuous=!0,a.interimResults=!0;let s=Date.now();a.onresult=e=>{let t=We(i.current,e);i.current=t.finalText,n({transcript:t.finalText+t.interim,startedAt:s})},a.onerror=t=>{e(`Dictation failed${t.error?` — ${t.error}`:``}`),o()},a.start(),r.current=a,n({transcript:``,startedAt:s})}catch{e(`Dictation failed — the microphone could not be started`),o()}},[e,o]),cancel:_.useCallback(()=>o(),[o]),finish:_.useCallback(()=>{let e=r.current,a=(i.current+``).trim()===``?``:i.current,o=t?.transcript??a;return e&&(e.onresult=null,e.onerror=null,e.onend=null,e.stop()),r.current=null,i.current=``,n(null),o.trim()},[t])}}function O(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,`0`)}`}var Ke=new Map,qe={KeyA:`Yes, approved.`,KeyC:`Continue.`};function k({onSubmit:e,retainDraftUntilSuccess:t=!1,onStop:n,stopOnEmpty:a=!1,stopping:c=!1,emptySubmitLabel:d,compactFeedback:ae=!1,idleFeedback:oe,pendingLabel:ce=`Starting task…`,failureHint:le=`Could not confirm submission. Check Tasks before you retry. Your draft is kept.`,clearOnSuccess:f=!0,onPendingChange:p,value:fe,onValueChange:pe,autoFocus:me=!1,mobileCollapsible:h=!1,mobileDisclosureKey:Ce,footerStart:ke,footerEnd:y,sessionControls:b,sessionModel:Ae,executionOptions:x,agentOptions:je,sendAriaLabel:Me=`Send`,disabled:S=!1,disabledReason:Ne=`Session closed — Continue to reopen.`,allowEmptySubmit:C=!1,placeholder:Pe=`Reply — / for skills, @ for files…`,ariaLabel:Fe=`Reply to the agent`,autocompleteSkills:w=!0,quickReplies:Ie=!1,getMentionCandidates:T,ref:Le}){let[Re,ze]=(0,_.useState)(``),E=fe??Re,D=(0,_.useRef)(E);D.current=E;let We=(0,_.useRef)(pe);We.current=pe;let O=(0,_.useCallback)(e=>{let t=typeof e==`function`?e(D.current):e;ze(t),We.current?.(t)},[]),[k,A]=(0,_.useState)([]),j=(0,_.useRef)(k);j.current=k;let[Xe,Ze]=(0,_.useState)(!1),M=c||Xe,N=(0,_.useRef)(M);N.current=M;let P=E.trim()!==``||k.length>0,Qe=!P&&(n!==void 0&&a||M),$e=!P&&d?d:Me,[F,I]=(0,_.useState)(!1),L=(0,_.useRef)(!1),et=(0,_.useRef)(0),R=(0,_.useRef)(!0);(0,_.useEffect)(()=>(R.current=!0,()=>{R.current=!1}),[]);let[z,B]=(0,_.useState)(null),V=M||t&&F,H=()=>N.current||t&&L.current,[U,W]=(0,_.useState)(null),[tt,nt]=(0,_.useState)(``),[rt,it]=(0,_.useState)(!1),G=(0,_.useRef)(null),K=(0,_.useId)(),at=(0,_.useId)(),ot=(0,_.useRef)(new Map),st=Ce===void 0?ot.current:Ke,ct=Ce??`default`,[,lt]=(0,_.useReducer)(e=>e+1,0),q=st.get(ct)??!1,ut=h&&!q,dt=(0,_.useRef)(null),J=(0,_.useRef)(null),ft=re(w&&rt),Y=ue(),pt=ee(),X=Ge(e=>l(e,{tone:`danger`}));(0,_.useEffect)(()=>{me&&G.current?.focus()},[]),(0,_.useImperativeHandle)(Le,()=>({insertAtCaret:e=>{if(H())return;let t=G.current,n=Se(D.current,t?.selectionStart??D.current.length,e);O(n.text),J.current=n.caret,t?.focus()}}),[O,t]);let mt=(0,_.useCallback)(()=>{let e=G.current;if(!e||S||H()){W(null);return}let t=He(e.value,e.selectionStart??e.value.length);if(t?.trigger===`/`&&!w||t?.trigger===`@`&&T===void 0)return W(null);t?.trigger===`/`&&it(!0),W(t)},[w,S,T,t]),Z=(0,_.useMemo)(()=>U===null?[]:U.trigger===`/`?Te(ft.data??[],U.query,Y.data?.skillUsage).map(e=>({value:`${e.name} ${e.path}`,insert:e.name,label:e.name,description:e.description,emphasized:we(e)})):(T?.()??[]).filter(e=>Ee(e,U.query)).map(e=>({value:e,insert:e,label:e,emphasized:!1})),[T,ft.data,U,Y.data?.skillUsage]),ht=Z.some(e=>e.value===tt)?tt:Z[0]?.value,gt=U!==null,_t=(0,_.useCallback)(()=>W(null),[]),vt=e=>{let t=G.current;if(!t||U===null||H())return;let n=t.selectionStart??t.value.length,r=Ue(t.value,U,n,e.insert);U.trigger===`/`&&Y.data!==void 0&&i({skillUsage:De(Y.data.skillUsage,e.insert)}).then(()=>pt.invalidateQueries({queryKey:de.uiState})).catch(()=>{}),O(r.text),J.current=r.caret,W(null),t.focus()};(0,_.useLayoutEffect)(()=>{let e=J.current,t=G.current;e!==null&&t&&(t.setSelectionRange(e,e),J.current=null)},[E]),(0,_.useLayoutEffect)(()=>{let e=G.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,220)}px`)},[E,q]);let yt=(0,_.useCallback)(e=>{if(S||H())return;let n=et.current,r=Ve(e,j.current.length);for(let e of r.rejected)l(e,{tone:`danger`});for(let e of r.accepted)Be(e).then(e=>{!R.current||t&&L.current&&!N.current||n!==et.current||A(t=>t.length>=4?t:[...t,e])},()=>l(`${e.name||`Attachment`} could not be read — try attaching it again`,{tone:`danger`}))},[S,t]),bt=e=>{let t=[...e.clipboardData?.items??[]].filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);t.length!==0&&(e.preventDefault(),yt(t))},xt=e=>{let t=[...e.dataTransfer?.files??[]];t.length!==0&&(e.preventDefault(),yt(t))},Q=(0,_.useCallback)(async(n,r,i)=>{let a=n.trim();if(!(S||c||L.current)&&!(a===``&&r.length===0&&!C)){L.current=!0,t&&(et.current+=1),I(!0),B(null),p?.(!0),W(null),i&&!t&&(O(``),A([]));try{await e(a,r.map(({mediaType:e,data:t})=>({mediaType:e,data:t}))),R.current&&t&&f&&(D.current===n&&O(``),j.current===r&&A([]))}catch(e){if(!R.current&&t)return;let a=e instanceof Error?e.message:String(e);t?B(a):(l(a,{tone:`danger`}),i&&(O(e=>e===``?n:`${n}\n${e}`),A(e=>[...r,...e].slice(0,4))))}finally{L.current=!1,R.current&&(p?.(!1),I(!1))}}},[C,S,c,e,t,f,p,O]),St=(0,_.useCallback)(()=>{S||c||L.current||Q(D.current,j.current,!0)},[S,c,Q]),Ct=async()=>{if(!(!n||c||L.current)){L.current=!0,I(!0),Ze(!0),B(null);try{await n()}catch(e){R.current&&B(e instanceof Error?e.message:String(e))}finally{L.current=!1,R.current&&(I(!1),Ze(!1))}}},wt=e=>{if(gt){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),Z.length===0)return;let t=Z.findIndex(e=>e.value===ht),n=e.key===`ArrowDown`?1:-1,r=Z[(t+n+Z.length)%Z.length];nt(r.value);return}if(e.key===`Escape`){e.preventDefault(),_t();return}if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){let t=Z.find(e=>e.value===ht);if(t){e.preventDefault(),vt(t);return}_t()}}Oe({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.preventDefault(),St())};(0,_.useEffect)(()=>{if(!Ie||S)return;let e=e=>{if(!e.altKey||e.metaKey||e.ctrlKey||e.repeat||v(e.target))return;let t=qe[e.code];t!==void 0&&(e.preventDefault(),Q(t,[],!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[S,Ie,Q]);let Tt=e=>{if(S||N.current||L.current&&(e||t))return;let n=X.finish();if(n===``)return;let r=E.trim()===``?n:`${E.replace(/\s*$/,``)} ${n}`;if(e){t&&O(r),Q(r,k,!0);return}O(r),J.current=r.length,G.current?.focus()},$=X.recording,Et=X.supported?(0,g.jsxs)(u,{type:`button`,variant:`ghost`,size:`sm`,disabled:S||V,"aria-label":`Start dictation`,title:`Dictation`,className:m(`h-11 gap-1.5 px-2.5 text-xs font-medium text-muted-foreground md:h-8`,ut&&`hidden md:inline-flex`),onClick:()=>{H()||X.start()},children:[(0,g.jsx)(se,{"aria-hidden":`true`,className:`size-3.5`}),x||b?null:`Dictation`]}):null,Dt=n||M?(0,g.jsxs)(u,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":M?`Stopping…`:`Stop`,"aria-busy":M||void 0,title:M?`Waiting for execution to stop`:`Stop execution; keep existing work`,disabled:F||M,className:m(`h-11 min-w-11 active:opacity-80`,Qe?`w-auto px-3`:`w-11`),onClick:()=>void Ct(),children:[(0,g.jsx)(te,{"aria-hidden":`true`,className:`size-3 fill-current`}),Qe?M?`Stopping…`:`Stop`:null]}):null,Ot=(0,g.jsx)(g.Fragment,{children:t||n||c?(0,g.jsx)(`div`,{className:m(`overflow-y-auto px-3 pb-2 text-xs leading-5 text-muted-foreground md:px-4`,ae?`min-h-6`:`h-24 md:h-20`),children:(0,g.jsx)(`div`,{id:`${K}-submission`,role:z===null?`status`:`alert`,"aria-atomic":`true`,tabIndex:z===null?void 0:0,className:`break-words`,children:M?`Stopping execution. Your draft is kept.`:F?ce:z===null?oe??null:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`font-medium text-foreground`,children:z}),(0,g.jsx)(`p`,{children:le})]})})}):null}),kt=(0,g.jsxs)(`div`,{"data-slot":`composer-submit-row`,className:m(`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-1 md:flex-nowrap`,x&&`new-task-submission`),children:[x||b?null:Et,y?(0,g.jsx)(`div`,{id:at,"data-slot":`composer-footer-end`,className:m(`min-w-0 flex-wrap items-center gap-1.5 md:flex-nowrap`,x&&`mr-auto`,h&&`max-md:[&_button]:min-h-11 max-md:[&_button]:min-w-11`,ut?`hidden md:flex`:`flex`),children:(0,g.jsx)(`div`,{className:`contents`,inert:V||void 0,children:y})}):null,(0,g.jsxs)(`div`,{className:`flex min-w-[100px] items-center justify-end gap-1`,"data-slot":`composer-actions`,children:[Dt,Qe?null:(0,g.jsxs)(u,{type:`button`,size:`icon-sm`,"aria-label":$e,"aria-busy":F&&!M||void 0,disabled:S||F||M||!P&&!C,className:m(x?`h-12 w-full gap-2 px-6`:b?`h-11 w-auto gap-2 px-5`:`size-11`,!P&&d&&`w-auto px-3`,`active:opacity-80`),onClick:St,children:[!b&&!P&&d?(0,g.jsx)(ye,{"aria-hidden":`true`}):null,x||b||!P&&d?$e:null,b||P||!d?(0,g.jsx)(r,{"aria-hidden":`true`}):null]})]})]});return(0,g.jsxs)(_e,{open:gt,onOpenChange:e=>e?void 0:_t(),children:[(0,g.jsx)(ge,{asChild:!0,children:(0,g.jsxs)(`div`,{ref:dt,"data-slot":`composer`,"data-disabled":S||void 0,onDrop:xt,onDragOver:e=>e.preventDefault(),className:m(x&&`new-task-composer`,b&&`session-composer`,S&&`opacity-80`),children:[(0,g.jsxs)(`div`,{"data-slot":`composer-editor`,className:m(`rounded-xl border border-[var(--composer-border)] bg-card shadow-none transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/15`,x&&`new-task-editor`),children:[k.length>0?(0,g.jsx)(`div`,{"data-slot":`composer-thumbs`,className:`flex flex-nowrap items-center gap-2 overflow-x-auto px-4 pt-3 md:flex-wrap md:overflow-visible`,children:k.map((e,t)=>(0,g.jsxs)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,title:V?`Attachment submitted`:`Click to remove`,disabled:V,className:m(`group relative shrink-0 overflow-hidden rounded-md border border-border`,e.isImage?`size-12`:`flex h-12 min-w-11 max-w-[200px] items-center gap-1.5 bg-muted/40 px-2.5 text-xs text-muted-foreground`),onClick:()=>{H()||A(e=>e.filter((e,n)=>n!==t))},children:[e.isImage?(0,g.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover`}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,g.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,g.jsx)(`span`,{className:`absolute inset-0 hidden items-center justify-center bg-background/70 group-hover:flex group-focus-visible:flex`,children:(0,g.jsx)(ie,{"aria-hidden":`true`,className:`size-4`})})]},`${e.name}-${t}`))}):null,(0,g.jsx)(`label`,{htmlFor:K,className:x?`hidden px-5 pt-5 text-xs text-muted-foreground md:block`:`sr-only`,children:x?`Task description`:Fe}),(0,g.jsx)(`textarea`,{ref:G,id:K,autoComplete:`off`,rows:1,value:E,disabled:S,readOnly:V,"aria-busy":V||void 0,"aria-describedby":t?`${K}-submission`:void 0,"aria-label":Fe,placeholder:S?Ne:Pe,className:m(`block min-h-11 w-full resize-none bg-transparent px-3 pt-2.5 pb-1 text-base leading-normal outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed md:min-h-[54px] md:px-4 md:pt-3 md:text-sm`,ut?`max-h-11 md:max-h-[220px]`:`max-h-[220px]`),onChange:e=>{H()||(O(e.target.value),mt())},onKeyDown:wt,onSelect:mt,onPaste:bt}),x?(0,g.jsxs)(`p`,{"data-slot":`composer-skill-hint`,className:`flex items-center gap-2 px-5 pt-3 pb-2 text-xs text-muted-foreground`,children:[(0,g.jsx)(o,{"aria-hidden":`true`,className:`size-[15px] shrink-0`}),`Type / for a skill or workflow`]}):null,b&&$?(0,g.jsx)(`div`,{"data-slot":`session-controls`,inert:V||void 0,children:b}):null,$?(0,g.jsxs)(`div`,{children:[(0,g.jsx)(Ye,{transcript:$.transcript,startedAt:$.startedAt,insertionDisabled:V,onCancel:X.cancel,onInsert:()=>Tt(!1),onInsertAndSend:()=>Tt(!0)}),Dt?(0,g.jsx)(`div`,{className:`flex justify-end px-2 pb-2`,children:Dt}):null]}):(0,g.jsxs)(`div`,{"data-slot":`composer-toolbar`,className:`flex flex-wrap items-center gap-1 gap-y-1 px-1.5 pt-1 pb-1.5 md:gap-y-1.5 md:px-2 md:pt-1.5 md:pb-2`,children:[b?(0,g.jsx)(`div`,{"data-slot":`session-controls`,inert:V||void 0,children:b}):null,(0,g.jsxs)(`div`,{"data-slot":`composer-footer-start`,className:m(`flex min-w-0 flex-wrap items-center gap-1`,x&&`w-full`),children:[(0,g.jsx)(Je,{disabled:S||V,onFiles:yt}),h?(0,g.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-11 md:hidden`,"aria-label":q?`Collapse composer`:`Expand composer`,"aria-expanded":q,"aria-controls":y?`${K} ${at}`:K,onClick:()=>{st.set(ct,!q),lt()},children:(0,g.jsx)(ne,{"aria-hidden":`true`,className:m(`transition-transform motion-reduce:transition-none`,!q&&`rotate-180`)})}):null,(0,g.jsx)(`div`,{className:`contents`,inert:V||void 0,children:ke}),x||b?(0,g.jsx)(`div`,{children:Et}):null]}),Ae?(0,g.jsx)(`div`,{"data-slot":`session-model`,inert:V||void 0,children:Ae}):null,x?null:kt]}),x?null:Ot]}),x?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`div`,{"data-slot":`composer-agent-options`,inert:V||void 0,children:je}),(0,g.jsx)(`div`,{"data-slot":`composer-execution-panel`,inert:V||void 0,children:x}),kt,(0,g.jsx)(`div`,{"data-slot":`composer-feedback`,children:Ot})]}):null]})}),(0,g.jsx)(he,{side:`top`,align:`start`,sideOffset:8,className:`w-80 max-w-[calc(100vw-2rem)] p-0`,onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>{dt.current?.contains(e.target)&&e.preventDefault()},children:(0,g.jsx)(ve,{shouldFilter:!1,value:ht??``,onValueChange:nt,children:(0,g.jsx)(be,{"data-slot":`composer-menu`,"data-trigger":U?.trigger,className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] p-1`,children:Z.length===0?(0,g.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground`,children:U?.trigger===`@`?`No files seen in this session yet — full file search arrives with the Files tab.`:ft.isPending?`Loading skills…`:`No matching skills.`}):Z.map(e=>(0,g.jsxs)(xe,{value:e.value,"data-slot":`composer-menu-item`,"data-emphasized":e.emphasized||void 0,onSelect:()=>vt(e),children:[(0,g.jsx)(`span`,{className:m(`shrink-0 truncate`,e.emphasized&&`font-semibold`,U?.trigger===`@`&&`font-mono text-xs`),children:e.label}),e.description?(0,g.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null]},e.value))})})})]})}function Je({disabled:e,onFiles:t}){let n=(0,_.useRef)(null);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,title:`Attach an image, PDF, TXT or MD file (or paste a screenshot)`,disabled:e,className:`size-11 text-muted-foreground`,onClick:()=>n.current?.click(),children:(0,g.jsx)(s,{"aria-hidden":`true`,className:`size-[15px]`})}),(0,g.jsx)(`input`,{ref:n,type:`file`,accept:`image/*,application/pdf,text/plain,text/markdown,.pdf,.txt,.md,.markdown,.log`,multiple:!0,className:`hidden`,"aria-hidden":`true`,tabIndex:-1,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function Ye({transcript:e,startedAt:t,insertionDisabled:n,onCancel:i,onInsert:o,onInsertAndSend:s}){let ee=Le(1e3);return(0,g.jsxs)(`div`,{"data-slot":`dictation-overlay`,role:`status`,"aria-label":`Dictation in progress`,className:`flex items-center gap-2.5 rounded-b-xl border-t border-border bg-muted/60 px-3 py-2`,children:[(0,g.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none animate-pulse rounded-full bg-danger motion-reduce:animate-none`}),(0,g.jsx)(`span`,{"data-slot":`dictation-timer`,className:`text-xs font-medium text-muted-foreground tabular-nums`,children:O(t,ee)}),(0,g.jsx)(`span`,{"data-slot":`dictation-transcript`,"aria-live":`polite`,className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e===``?(0,g.jsx)(`span`,{className:`text-muted-foreground`,children:`Listening…`}):e}),(0,g.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Cancel dictation`,className:`size-11 text-muted-foreground md:size-8`,onClick:i,children:(0,g.jsx)(ie,{"aria-hidden":`true`})}),(0,g.jsx)(u,{type:`button`,variant:`outline`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription`,className:`size-11 md:size-8`,onClick:o,children:(0,g.jsx)(a,{"aria-hidden":`true`})}),(0,g.jsx)(u,{type:`button`,size:`icon-sm`,disabled:n,"aria-label":`Insert transcription and send`,className:`size-11 md:size-8`,onClick:s,children:(0,g.jsx)(r,{"aria-hidden":`true`})})]})}function A(){return(0,g.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,g.jsx)(ce,{icon:(0,g.jsx)(Ce,{className:`motion-safe:animate-spin`}),tone:`neutral`,title:`Loading task…`,subtitle:`Fetching the run and its session transcript.`})})}export{Ne as a,w as c,x as d,b as f,Me as i,Ie as l,k as n,Fe as o,je as p,Le as r,T as s,A as t,S as u};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-CG8vWc5K.js";import{n}from"./markdown-CIi0LXvU.js";var r=e();function i(e){return e===void 0?`unknown`:new Intl.NumberFormat().format(e)}function a(e,t){return`Input tokens: ${i(e)}; output tokens: ${i(t)}`}function o(e,t,r=`compact`){let i=e===void 0?`—`:n(e),a=t===void 0?`—`:n(t);return r===`table`?`${i} / ${a}`:`IN ${i} · OUT ${a}`}function s({inputTokens:e,outputTokens:n,variant:i=`compact`,omitWhenUnknown:s=!0,className:c,title:l}){return s&&e===void 0&&n===void 0?null:(0,r.jsx)(`span`,{"data-slot":`directional-usage`,"aria-label":a(e,n),title:l,className:t(`font-mono tabular-nums`,c),children:o(e,n,i)})}function c(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}export{o as i,s as n,a as r,c as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-CG8vWc5K.js";import{n}from"./markdown-BssEOroY.js";var r=e();function i(e){return e===void 0?`unknown`:new Intl.NumberFormat().format(e)}function a(e,t){return`Input tokens: ${i(e)}; output tokens: ${i(t)}`}function o(e,t,r=`compact`){let i=e===void 0?`—`:n(e),a=t===void 0?`—`:n(t);return r===`table`?`${i} / ${a}`:`IN ${i} · OUT ${a}`}function s({inputTokens:e,outputTokens:n,variant:i=`compact`,omitWhenUnknown:s=!0,className:c,title:l}){return s&&e===void 0&&n===void 0?null:(0,r.jsx)(`span`,{"data-slot":`directional-usage`,"aria-label":a(e,n),title:l,className:t(`font-mono tabular-nums`,c),children:o(e,n,i)})}function c(e){let t=e?.capabilities,n=t?.tokenMetrics!==!1;return{tokens:t?.tokenUsageMetrics??n,cost:t?.costMetrics??n}}export{o as i,s as n,a as r,c as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Ca as i,Ft as a,G as o,H as s,Ht as c,J as l,Jt as u,Lt as d,Oa as f,Ri as p,Vi as m,Y as h,Yt as g,Zt as _,_r as v,a as y,aa as b,at as x,c as ee,d as S,dr as C,ei as te,en as ne,gi as w,i as re,l as ie,mr as ae,n as oe,o as T,ot as E,qt as se,r as ce,rn as D,rt as le,s as O,st as ue,t as k,vi as de,xa as A}from"./alert-dialog-KUiPIBmb.js";import{t as j}from"./utils-CG8vWc5K.js";import{i as M,l as fe,r as N,t as pe}from"./dropdown-menu-xYcDecNM.js";import{i as me,n as he,o as P,r as ge,s as _e,t as ve}from"./textarea-DdKiIORK.js";import{i as ye,l as be,s as xe}from"./skills-DFBiAuJG.js";import{h as Se,i as Ce}from"./index-ujHRHX5o.js";import{n as we}from"./skill-empty-hint-oOtzR3v0.js";var F=e(n()),I=e(t());function Te(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var L=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function R(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function z(e){return e?R(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function B(e){let{Document:t}=z(e);return e instanceof t}function V(e){return!R(e)&&e instanceof z(e).HTMLElement}function De(e){return e instanceof z(e).SVGElement}function Oe(e){return e?R(e)?e.document:Ee(e)?B(e)?e:V(e)||De(e)?e.ownerDocument:document:document:document}var H=L?I.useLayoutEffect:I.useEffect;function ke(e){let t=(0,I.useRef)(e);return H(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ae(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function U(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return H(()=>{n.current!==e&&(n.current=e)},t),n}function je(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Me(e){let t=ke(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ne(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Pe={};function Fe(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Pe[e]==null?0:Pe[e]+1;return Pe[e]=n,e+`-`+n},[e,t])}function Ie(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var W=Ie(1),Le=Ie(-1);function Re(e){return`clientX`in e&&`clientY`in e}function ze(e){if(!e)return!1;let{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Be(e){if(!e)return!1;let{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ve(e){if(Be(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Re(e)?{x:e.clientX,y:e.clientY}:null}var G=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[G.Translate.toString(e),G.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),He=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ue(e){return e.matches(He)?e:e.querySelector(He)}var K={display:`none`};function We(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:K},n)}function Ge(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ke(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var qe=(0,I.createContext)(null);function Je(e){let t=(0,I.useContext)(qe);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ye(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Xe={draggable:`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{Ca as i,Ft as a,G as o,H as s,Ht as c,J as l,Jt as u,Lt as d,Oa as f,Ri as p,Vi as m,Y as h,Yt as g,Zt as _,_r as v,a as y,aa as b,at as x,c as ee,d as S,dr as C,ei as te,en as ne,gi as w,i as re,l as ie,mr as ae,n as oe,o as T,ot as E,qt as se,r as ce,rn as D,rt as le,s as O,st as ue,t as k,vi as de,xa as A}from"./alert-dialog-Bv9zV9w1.js";import{t as j}from"./utils-CG8vWc5K.js";import{i as M,l as fe,r as N,t as pe}from"./dropdown-menu-DkzcT6aO.js";import{i as me,n as he,o as P,r as ge,s as _e,t as ve}from"./textarea-DAHMUyAp.js";import{i as ye,l as be,s as xe}from"./skills-DFBiAuJG.js";import{h as Se,i as Ce}from"./index-BpI26cbM.js";import{n as we}from"./skill-empty-hint-oOtzR3v0.js";var F=e(n()),I=e(t());function Te(){var e=[...arguments];return(0,I.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var L=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function R(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ee(e){return`nodeType`in e}function z(e){return e?R(e)?e:Ee(e)?e.ownerDocument?.defaultView??window:window:window}function B(e){let{Document:t}=z(e);return e instanceof t}function V(e){return!R(e)&&e instanceof z(e).HTMLElement}function De(e){return e instanceof z(e).SVGElement}function Oe(e){return e?R(e)?e.document:Ee(e)?B(e)?e:V(e)||De(e)?e.ownerDocument:document:document:document}var H=L?I.useLayoutEffect:I.useEffect;function ke(e){let t=(0,I.useRef)(e);return H(()=>{t.current=e}),(0,I.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ae(){let e=(0,I.useRef)(null);return[(0,I.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,I.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function U(e,t){t===void 0&&(t=[e]);let n=(0,I.useRef)(e);return H(()=>{n.current!==e&&(n.current=e)},t),n}function je(e,t){let n=(0,I.useRef)();return(0,I.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Me(e){let t=ke(e),n=(0,I.useRef)(null);return[n,(0,I.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Ne(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var Pe={};function Fe(e,t){return(0,I.useMemo)(()=>{if(t)return t;let n=Pe[e]==null?0:Pe[e]+1;return Pe[e]=n,e+`-`+n},[e,t])}function Ie(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var W=Ie(1),Le=Ie(-1);function Re(e){return`clientX`in e&&`clientY`in e}function ze(e){if(!e)return!1;let{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Be(e){if(!e)return!1;let{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ve(e){if(Be(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Re(e)?{x:e.clientX,y:e.clientY}:null}var G=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[G.Translate.toString(e),G.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),He=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Ue(e){return e.matches(He)?e:e.querySelector(He)}var K={display:`none`};function We(e){let{id:t,value:n}=e;return I.createElement(`div`,{id:t,style:K},n)}function Ge(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return I.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Ke(){let[e,t]=(0,I.useState)(``);return{announce:(0,I.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var qe=(0,I.createContext)(null);function Je(e){let t=(0,I.useContext)(qe);(0,I.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Ye(){let[e]=(0,I.useState)(()=>new Set),t=(0,I.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,I.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var Xe={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -47,33 +47,33 @@
47
47
  }
48
48
  })()
49
49
  </script>
50
- <script type="module" crossorigin src="/assets/index-ujHRHX5o.js"></script>
50
+ <script type="module" crossorigin src="/assets/index-BpI26cbM.js"></script>
51
51
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/react-runtime-CCIEwYL0.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-BT31bpU6.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/utils-CG8vWc5K.js">
55
- <link rel="modulepreload" crossorigin href="/assets/alert-dialog-KUiPIBmb.js">
56
- <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-xYcDecNM.js">
57
- <link rel="modulepreload" crossorigin href="/assets/agent-accounts-MT-jtwOU.js">
58
- <link rel="modulepreload" crossorigin href="/assets/textarea-DdKiIORK.js">
55
+ <link rel="modulepreload" crossorigin href="/assets/alert-dialog-Bv9zV9w1.js">
56
+ <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-DkzcT6aO.js">
57
+ <link rel="modulepreload" crossorigin href="/assets/agent-accounts-BP0XBzQP.js">
58
+ <link rel="modulepreload" crossorigin href="/assets/textarea-DAHMUyAp.js">
59
59
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BHp8sXmF.js">
60
60
  <link rel="modulepreload" crossorigin href="/assets/external-link-BE6y205O.js">
61
61
  <link rel="modulepreload" crossorigin href="/assets/square-terminal-B6RYYieR.js">
62
- <link rel="modulepreload" crossorigin href="/assets/pill-DDhByAhe.js">
62
+ <link rel="modulepreload" crossorigin href="/assets/pill-C7gWe96Z.js">
63
63
  <link rel="modulepreload" crossorigin href="/assets/chevron-right-BENZ-1ZN.js">
64
- <link rel="modulepreload" crossorigin href="/assets/prompt-templates-DTSPmJP-.js">
65
- <link rel="modulepreload" crossorigin href="/assets/project-router-BOglfKgF.js">
64
+ <link rel="modulepreload" crossorigin href="/assets/prompt-templates-B4eJ8kQZ.js">
65
+ <link rel="modulepreload" crossorigin href="/assets/project-router-a1gx3dfP.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/search-x-I9Q8pgUa.js">
67
67
  <link rel="modulepreload" crossorigin href="/assets/lib-BxQXEXDF.js">
68
68
  <link rel="modulepreload" crossorigin href="/assets/chunk-BO2N2NFS-DE6qKn3r.js">
69
69
  <link rel="modulepreload" crossorigin href="/assets/highlighter-CdHqIwFr.js">
70
- <link rel="modulepreload" crossorigin href="/assets/markdown-CIi0LXvU.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/markdown-BssEOroY.js">
71
71
  <link rel="modulepreload" crossorigin href="/assets/skills-DFBiAuJG.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/use-submit-shortcut-KWJsC906.js">
73
- <link rel="modulepreload" crossorigin href="/assets/thread-loading-BRM8kyKz.js">
73
+ <link rel="modulepreload" crossorigin href="/assets/thread-loading-OtvWGq9Y.js">
74
74
  <link rel="modulepreload" crossorigin href="/assets/diff-stat-B7f-F8cC.js">
75
- <link rel="modulepreload" crossorigin href="/assets/token-metrics-DDvhrHmK.js">
76
- <link rel="stylesheet" crossorigin href="/assets/index-hcgmKBPj.css">
75
+ <link rel="modulepreload" crossorigin href="/assets/token-metrics-Q0paVq5n.js">
76
+ <link rel="stylesheet" crossorigin href="/assets/index-CG0CPeOx.css">
77
77
  </head>
78
78
  <body>
79
79
  <div id="root"></div>