@hearsay-tools/squawk 0.19.0-dev.9216 → 0.19.0-dev.9220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/features/hosts/routes.d.ts +64 -64
- package/dist/features/webhooks/routes.d.ts +38 -38
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/projects-routes.d.ts +41 -41
- package/dist/server/repo-routes.d.ts +13 -13
- package/dist/server/runs-routes.d.ts +312 -312
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-s6sAdUT8.js +1 -0
- package/web/dist/assets/activity-motion-CXlbNrMI.js +1 -0
- package/web/dist/assets/{activity-route-Bmig0E18.js → activity-route-BL-QWLNp.js} +1 -1
- package/web/dist/assets/agent-accounts-Du8CHfFX.js +1 -0
- package/web/dist/assets/agent-config-section-BzMSlPK0.js +7 -0
- package/web/dist/assets/agent-defaults-section-CqEVmRK0.js +1 -0
- package/web/dist/assets/appearance-vI6ae_So.js +1 -0
- package/web/dist/assets/archive-on-merge-field-C4hrO55O.js +1 -0
- package/web/dist/assets/ask-card-hEb8IHjL.js +9 -0
- package/web/dist/assets/automations-route-Bd6crv15.js +2 -0
- package/web/dist/assets/commit-list-Jr1_04RS.js +1 -0
- package/web/dist/assets/diff-BOF9OXhn.js +3 -0
- package/web/dist/assets/{diff-controls-Bb70UBsP.js → diff-controls-CkxtRrbB.js} +1 -1
- package/web/dist/assets/{diff-view-DLcxtXIH.js → diff-view-Chu6rn_i.js} +1 -1
- package/web/dist/assets/{discard-changes-dialog-BzypT4vb.js → discard-changes-dialog-BB47RqdX.js} +1 -1
- package/web/dist/assets/file-preview-DNM-krBZ.js +2 -0
- package/web/dist/assets/folder-browser-TNWat5kt.js +1 -0
- package/web/dist/assets/{git-toolbar-DPkpAaKz.js → git-toolbar-CoKBTzNV.js} +1 -1
- package/web/dist/assets/github-t611QkCi.js +1 -0
- package/web/dist/assets/{global-activity-route-CQULPYKA.js → global-activity-route-B9DMoviv.js} +1 -1
- package/web/dist/assets/hosts-rdWe_OBc.js +1 -0
- package/web/dist/assets/index-C3kap2_j.js +21 -0
- package/web/dist/assets/index-CWmMYQdT.css +1 -0
- package/web/dist/assets/label-B_s8eiYA.js +1 -0
- package/web/dist/assets/{markdown-C1p1PDmF.js → markdown-Bmdr6MIa.js} +1 -1
- package/web/dist/assets/{open-in-menu-CbPtuWnJ.js → open-in-menu-DkFneOWr.js} +1 -1
- package/web/dist/assets/{option-select-C6d3jHce.js → option-select-BxTmKg8G.js} +1 -1
- package/web/dist/assets/preferences-section-B_yl_o-g.js +1 -0
- package/web/dist/assets/preview-D3zYSmIA.js +1 -0
- package/web/dist/assets/{preview-pane-connected-ELLewN-g.js → preview-pane-connected-s9LvCVbp.js} +2 -2
- package/web/dist/assets/project-location-BczZtNyO.js +1 -0
- package/web/dist/assets/project-router-CfEuKuz1.js +1 -0
- package/web/dist/assets/project-scope-context-DNrHbqd2.js +4 -0
- package/web/dist/assets/projects-section-C6DnyUa2.js +1 -0
- package/web/dist/assets/{prompt-templates-section-D3GzKJMf.js → prompt-templates-section-BQvKWcaX.js} +2 -2
- package/web/dist/assets/queries-DD_9iITj.js +1 -0
- package/web/dist/assets/reference-chip-e-fG4-yW.js +1 -0
- package/web/dist/assets/remote-settings-notice-CUqI2DdF.js +1 -0
- package/web/dist/assets/repo-git-NG_TxE7N.js +1 -0
- package/web/dist/assets/report-reader-LYNHrAe-.js +1 -0
- package/web/dist/assets/{report-selection-DxBxW6dz.js → report-selection-nUbQVjJu.js} +1 -1
- package/web/dist/assets/reports-DuT4m7i5.js +1 -0
- package/web/dist/assets/{resources-section-CpAOY20Z.js → resources-section-CT48TCXY.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-D25BaEEb.js → review-notes-drafts-C7HCRebB.js} +1 -1
- package/web/dist/assets/{review-panel-CS9wTfAu.js → review-panel-BffLSkRo.js} +1 -1
- package/web/dist/assets/review-strip-COa0ir6V.js +1 -0
- package/web/dist/assets/{run-detail-refresh-wJr0M04e.js → run-detail-refresh-Db5HOGMX.js} +1 -1
- package/web/dist/assets/{run-diff-BBASqHSE.js → run-diff-DldSY8BJ.js} +1 -1
- package/web/dist/assets/run-header-DxpN6yVQ.js +2 -0
- package/web/dist/assets/{select-CEEeAH4k.js → select-Cd8wvwvm.js} +1 -1
- package/web/dist/assets/{session-context-section-F1umLA86.js → session-context-section-CW8DS0dW.js} +1 -1
- package/web/dist/assets/settings-agent-picker-an3ysM1B.js +1 -0
- package/web/dist/assets/{settings-save-bar-BkU1JDt3.js → settings-save-bar-BiHFQ4c0.js} +1 -1
- package/web/dist/assets/settings-shell-KZ801oLH.js +1 -0
- package/web/dist/assets/sidebar-section-BRMO7aY4.js +1 -0
- package/web/dist/assets/skills-DHkLoxXb.js +1 -0
- package/web/dist/assets/status-dot-Da1M54kK.js +1 -0
- package/web/dist/assets/{tab-link-CiKWtkK_.js → tab-link-DL1UtKVR.js} +1 -1
- package/web/dist/assets/task-changes-CQhwyj0L.js +5 -0
- package/web/dist/assets/task-commits-CTP8izpc.js +1 -0
- package/web/dist/assets/{task-file-scope-DU8AkDkr.js → task-file-scope-CDIfOvl-.js} +1 -1
- package/web/dist/assets/task-files-CGlRH86B.js +1 -0
- package/web/dist/assets/task-github-item-ChgjULzj.js +1 -0
- package/web/dist/assets/task-thread-Cj9B2ISO.js +2 -0
- package/web/dist/assets/thread-state-D2KJrZ1o.js +4 -0
- package/web/dist/assets/use-finish-run-DifixlCM.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Bjh1EnB3.js +1 -0
- package/web/dist/assets/use-path-bases-AV9YYh2B.js +1 -0
- package/web/dist/assets/use-workspace-config-save-02qlUK8v.js +1 -0
- package/web/dist/assets/{workflows-DdKRMlHR.js → workflows-BDc-MpiC.js} +2 -2
- package/web/dist/assets/workspace-tools-D7kUSb-0.js +1 -0
- package/web/dist/assets/{worktrees-section-CCgqbLAh.js → worktrees-section-Cv65NBgq.js} +5 -5
- package/web/dist/index.html +15 -18
- package/web/dist/assets/accounts-section-BJcwTmko.js +0 -1
- package/web/dist/assets/activity-motion-D7ylxNSA.js +0 -1
- package/web/dist/assets/agent-accounts-DaaS69XB.js +0 -1
- package/web/dist/assets/agent-config-section-BOXqQyTv.js +0 -7
- package/web/dist/assets/agent-defaults-section-Bxfreo-n.js +0 -1
- package/web/dist/assets/appearance-BRqSFVDC.js +0 -1
- package/web/dist/assets/archive-on-merge-field-hDSXItUf.js +0 -1
- package/web/dist/assets/ask-card-CWrAEuZE.js +0 -9
- package/web/dist/assets/attention-CFW302LY.js +0 -1
- package/web/dist/assets/automations-route-BBsU9yBn.js +0 -2
- package/web/dist/assets/commit-list-5iHD08NO.js +0 -1
- package/web/dist/assets/diff-CkIsqgZZ.js +0 -3
- package/web/dist/assets/file-preview-CJVN0cBa.js +0 -2
- package/web/dist/assets/folder-browser-Cdm2WZOB.js +0 -1
- package/web/dist/assets/github-DXBAYLfd.js +0 -1
- package/web/dist/assets/hosts-IKDCpyJQ.js +0 -1
- package/web/dist/assets/index-D1E0Dmck.css +0 -1
- package/web/dist/assets/index-k2m-s5zD.js +0 -21
- package/web/dist/assets/label-ODcSLYVj.js +0 -1
- package/web/dist/assets/preferences-section-ChS8Q-Lu.js +0 -1
- package/web/dist/assets/preview-B5bPk6HT.js +0 -1
- package/web/dist/assets/project-location-D8vnqA4E.js +0 -1
- package/web/dist/assets/project-router-CPgPVoBJ.js +0 -1
- package/web/dist/assets/projects-section-L3QxEiRK.js +0 -1
- package/web/dist/assets/queries-DHjNE2es.js +0 -1
- package/web/dist/assets/read-state-jUDTdM3R.js +0 -1
- package/web/dist/assets/reference-chip-kvc51N1L.js +0 -1
- package/web/dist/assets/remote-settings-notice-BtVKQ2vp.js +0 -1
- package/web/dist/assets/repo-git-BGSxevNj.js +0 -1
- package/web/dist/assets/report-reader-CvEkEEwN.js +0 -1
- package/web/dist/assets/reports-1vI74Z6R.js +0 -1
- package/web/dist/assets/review-strip-nrpQBfNI.js +0 -1
- package/web/dist/assets/run-header-DVnksnr4.js +0 -2
- package/web/dist/assets/settings-agent-picker-sUQdIon3.js +0 -1
- package/web/dist/assets/settings-shell-DodTPpjl.js +0 -1
- package/web/dist/assets/sidebar-section-DspuARa_.js +0 -1
- package/web/dist/assets/skills-CrHHdPjJ.js +0 -1
- package/web/dist/assets/status-dot-DuorWA5M.js +0 -1
- package/web/dist/assets/task-changes-U1cnUd83.js +0 -5
- package/web/dist/assets/task-commits-DxuX8SZp.js +0 -1
- package/web/dist/assets/task-files-DaDM9FRg.js +0 -1
- package/web/dist/assets/task-github-item-CXzzVHXw.js +0 -1
- package/web/dist/assets/task-groups-BapM4YcT.js +0 -1
- package/web/dist/assets/task-thread-9WIv4rPC.js +0 -2
- package/web/dist/assets/thread-state-IooDEE0b.js +0 -4
- package/web/dist/assets/toaster-Dglox5F-.js +0 -4
- package/web/dist/assets/use-finish-run-jVAqsGkV.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-DfucUGAH.js +0 -1
- package/web/dist/assets/use-path-bases-C7DRxlRi.js +0 -1
- package/web/dist/assets/use-workspace-config-save-B2eroiEx.js +0 -1
- package/web/dist/assets/workspace-tools-CePJG7uG.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Kt as r,in as i}from"./queries-DD_9iITj.js";import{Zi as a}from"./project-scope-context-DNrHbqd2.js";import{o}from"./dist-CCX8mhHc.js";import{t as s}from"./chevron-right-BENZ-1ZN.js";import{t as c}from"./button-BV_AiLj2.js";import{n as l,r as u,t as d}from"./collapsible-D5i3hm2L.js";import{i as f,r as p}from"./highlighter-Crq-WTmN.js";var m=e(t(),1),h=/^diff --git /;function g(e){let t=e.replace(h,``),n=t.lastIndexOf(` b/`);return _(n>=0?t.slice(n+3):t)}function _(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>=2?t.slice(1,-1).replace(/\\(.)/g,`$1`):t}function v(e){let t=_(e.slice(4));if(t!==`/dev/null`)return t.replace(/^[ab]\//,``)}function y(e){return{path:g(e),status:`modified`,binary:!1,additions:0,deletions:0,lines:[]}}function b(e,t){if(t.startsWith(`rename from `))e.status=`renamed`,e.oldPath=_(t.slice(12));else if(t.startsWith(`rename to `))e.status=`renamed`,e.path=_(t.slice(10));else if(t.startsWith(`new file mode`))e.status=`added`;else if(t.startsWith(`deleted file mode`))e.status=`deleted`;else if(t.startsWith(`Binary files `)||t===`GIT binary patch`)e.binary=!0;else if(t.startsWith(`+++ `)){let n=v(t);n!==void 0&&(e.path=n)}else if(t.startsWith(`--- `)){let n=v(t);n!==void 0&&e.status===`deleted`&&(e.path=n)}}function x(e,t){e.lines.push(t),t.startsWith(`+`)?e.additions+=1:t.startsWith(`-`)&&(e.deletions+=1)}function S(e){let t=[],n=null,r=!1;for(let i of e.split(`
|
|
2
2
|
`)){if(h.test(i)){n=y(i),t.push(n),r=!1;continue}if(n){if(!r){i.startsWith(`@@`)?(r=!0,n.lines.push(i)):b(n,i);continue}x(n,i)}}let i=t.at(-1);return i&&i.lines.at(-1)===``&&i.lines.pop(),t}function C(e){return{files:e.length,additions:e.reduce((e,t)=>e+t.additions,0),deletions:e.reduce((e,t)=>e+t.deletions,0)}}var w=n(),T=20,E=300;function D({runId:e,projectId:t}){let n=a(),o=r(e,t);(0,m.useEffect)(()=>{let r=t?[t,`runs`,`diff`,e]:i.runs.diff(e);n.invalidateQueries({queryKey:r})},[t,n,e]);let s=(0,m.useMemo)(()=>S(o.data??``),[o.data]),[l,u]=(0,m.useState)(!1);if(o.isPending)return(0,w.jsx)(`p`,{className:`px-1 text-xs text-soft-foreground`,children:`Loading diff…`});if(o.isError)return(0,w.jsx)(`p`,{className:`px-1 text-xs text-danger`,children:o.error.message});if(s.length===0)return(0,w.jsx)(`p`,{"data-slot":`run-diff-empty`,className:`px-1 font-mono text-xs text-soft-foreground`,children:o.data.trim()||`(no changes)`});let d=C(s),f=l?s:s.slice(0,T);return(0,w.jsxs)(`div`,{"data-slot":`run-diff`,className:`flex min-w-0 flex-col gap-2`,children:[(0,w.jsxs)(`p`,{className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,w.jsxs)(`span`,{children:[d.files,` `,d.files===1?`file`:`files`,` changed`]}),(0,w.jsxs)(`span`,{className:`font-mono font-semibold tabular-nums`,children:[(0,w.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,d.additions]}),` `,(0,w.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,d.deletions]})]})]}),f.map(e=>(0,w.jsx)(k,{file:e},`${e.oldPath??``}→${e.path}`)),s.length>f.length?(0,w.jsxs)(c,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>u(!0),children:[`Show `,s.length-f.length,` more files`]}):null]})}var O={added:`added`,deleted:`deleted`,renamed:`renamed`};function k({file:e}){let[t,n]=(0,m.useState)(!0),r=O[e.status],i=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,w.jsxs)(d,{open:t,onOpenChange:n,"data-slot":`diff-file`,className:`min-w-0 overflow-hidden rounded-md border border-card-edge bg-card shadow-card`,children:[(0,w.jsxs)(u,{className:`flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,w.jsx)(s,{className:o(`mbs-[1px] size-3.5 shrink-0 text-soft-foreground motion-safe:transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,w.jsx)(`span`,{"data-slot":`diff-file-path`,title:i,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:e.oldPath?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),r?(0,w.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:r}):null,e.binary?(0,w.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`binary`}):null,(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-xs font-semibold tabular-nums`,children:[(0,w.jsxs)(`span`,{className:`text-semantic-green`,children:[`+`,e.additions]}),` `,(0,w.jsxs)(`span`,{className:`text-semantic-red`,children:[`−`,e.deletions]})]})]}),(0,w.jsx)(l,{children:(0,w.jsx)(`div`,{className:`border-t border-border/50`,children:e.binary?(0,w.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.lines.length===0?(0,w.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,w.jsx)(A,{lines:e.lines})})})]})}function A({lines:e}){let[t,n]=(0,m.useState)(!1),r=t?e:e.slice(0,E),i=r.join(`
|
|
3
3
|
`),[a,s]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=!1;return p(i,`diff`).then(t=>{e||s({text:i,tokens:t.tokens})}),()=>{e=!0}},[i]);let c=a?.text===i?a.tokens:f(i,`diff`)?.tokens??null;return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`pre`,{"data-slot":`diff-file-body`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:r.map((e,t)=>(0,w.jsxs)(`span`,{"data-line":e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:void 0,className:o(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[c?.[t]===void 0?e:c[t].map((e,t)=>(0,w.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t)),e===``?` `:``]},t))}),e.length>E?(0,w.jsx)(`button`,{type:`button`,"data-slot":`diff-file-toggle`,onClick:()=>n(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-xs font-medium text-soft-foreground hover:text-foreground`,children:t?`Show less`:`Show all ${e.length} lines`}):null]})}export{D as t};
|
|
@@ -0,0 +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{B as r,Ft as i,H as a,Ht as o,It as s,Jn as c,Jt as l,Lt as u,Mn as d,Pn as f,Rt as p,U as m,W as h,Xt as g,_r as _,bt as v,d as y,gr as ee,hr as b,in as x,nn as S,zt as te}from"./queries-DD_9iITj.js";import{Bt as C,Cn as ne,Mi as re,Si as ie,Zi as w,a as T,ei as ae,ft as E,ni as D,rt as oe,yr as se,zt as O}from"./project-scope-context-DNrHbqd2.js";import{C as ce,E as k,S as le,_ as ue,h as de,i as fe,n as pe,p as me,t as A,w as he,x as ge}from"./reference-chip-e-fG4-yW.js";import{o as j,s as M}from"./dist-CCX8mhHc.js";import{I as _e,S as ve,Y as ye,Z as be,a as xe,ct as Se,m as Ce,mt as we,o as Te,st as Ee,t as De,u as Oe,y as N}from"./design-icons-QbNMZniQ.js";import{t as P}from"./createLucideIcon-BHp8sXmF.js";import{t as ke}from"./app-window-CSHwDX9N.js";import{n as Ae,r as je,t as Me}from"./open-in-menu-DkFneOWr.js";import{t as Ne}from"./info-DA1x_4bz.js";import{t as Pe}from"./message-square-B-MD-8rD.js";import{t as Fe}from"./square-terminal-B6RYYieR.js";import{t as F}from"./button-BV_AiLj2.js";import{a as I,i as L,l as R,n as z,p as B,r as V,t as H}from"./dropdown-menu-NJZfnQCU.js";import{n as Ie,r as Le,t as Re}from"./popover-BQolmvDR.js";import{a as ze,i as Be,o as Ve,r as He,s as Ue,t as We}from"./dialog-DKr-j9S6.js";import{c as Ge,s as Ke,t as U}from"./project-router-CfEuKuz1.js";import{t as W}from"./status-dot-Da1M54kK.js";import{t as qe}from"./format-BU7D3IfE.js";import{a as Je}from"./agent-accounts-Du8CHfFX.js";import{$t as Ye,Dn as G,Er as Xe,Fn as Ze,G as Qe,Jn as $e,K,W as et,Wn as tt,a as nt,an as rt,bn as q,dn as it,en as at,er as ot,h as st,hn as ct,i as lt,in as ut,ir as J,ln as dt,m as ft,mr as pt,nn as mt,nr as ht,on as gt,pr as _t,rn as vt,tn as yt,tr as bt,vr as xt,yn as St}from"./index-C3kap2_j.js";import{t as Ct}from"./textarea-BGp28xFr.js";import{t as wt}from"./markdown-Bmdr6MIa.js";import{t as Tt}from"./task-file-scope-CDIfOvl-.js";import{t as Y}from"./tab-link-DL1UtKVR.js";var Et=P(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),Dt=P(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Ot=P(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),kt=P(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),X=e(t(),1),Z=n();function At(e){let t=S();return _({mutationFn:t=>oe(ee(e),t),onSuccess:()=>t.invalidateAfter(`runs`,()=>b()),onError:e=>T(e.message,{tone:`danger`})})}var jt={archive:{full:`Archive task`,compact:`Archive`},unarchive:{full:`Unarchive`,compact:`Unarchive`}};function Mt(e){return jt[e.archived?`unarchive`:`archive`].full}function Nt(e){return jt[e.archived?`unarchive`:`archive`].compact}function Pt({run:e,open:t,onOpenChange:n,onConfirm:r}){return(0,Z.jsx)(Ye,{open:t,onOpenChange:n,children:(0,Z.jsxs)(mt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Z.jsxs)(rt,{children:[(0,Z.jsx)(gt,{children:`Archive task?`}),(0,Z.jsxs)(vt,{children:[`Move “`,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,title:f(e),children:f(e)}),`” out of Active tasks. You can restore it from Archived.`]})]}),(0,Z.jsxs)(ut,{children:[(0,Z.jsx)(yt,{children:`Cancel`}),(0,Z.jsx)(at,{className:`bg-accent-strong text-accent-strong-foreground hover:brightness-[0.96]`,onClick:r,children:`Archive task`})]})]})})}function Ft({run:e,className:t,compact:n=!1}){let[r,i]=(0,X.useState)(!1),a=At(e.id),o=Mt(e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(F,{type:`button`,variant:`outline`,"data-slot":`archive-action`,"aria-label":o,title:e.archived?`Put this task back in Active tasks`:`Move this task out of Active tasks`,disabled:a.isPending,className:j(`gap-[7px] px-3`,t),onClick:()=>e.archived?a.mutate(!1):i(!0),children:[e.archived?(0,Z.jsx)(Xe,{"aria-hidden":`true`}):(0,Z.jsx)(De,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{children:n?Nt(e):o})]}),(0,Z.jsx)(Pt,{run:e,open:r,onOpenChange:i,onConfirm:()=>{a.mutate(!0),i(!1)}})]})}function It({phone:e}){return e?(0,Z.jsx)(Te,{"aria-hidden":`true`}):null}function Lt({run:e,action:t,prUrl:n,patch:r,phone:i}){let a=t.phase===`blocked`;return{key:`completion`,heading:a?`Completion blocked`:`Completion pending`,reason:t.message||(a?`Completion needs attention.`:`Checking completion actions.`),pending:!a,actions:(0,Z.jsxs)(Z.Fragment,{children:[n&&M(n)?(0,Z.jsx)(F,{variant:`outline`,asChild:!0,children:(0,Z.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:[`Open PR`,(0,Z.jsx)(It,{phone:i})]})}):null,e.autoMergePr?(0,Z.jsx)(F,{variant:`outline`,disabled:r.isPending,onClick:()=>r.mutate({autoMergePr:!1},{onError:e=>T(e.message,{tone:`danger`})}),children:r.isPending?`Saving…`:`Disable auto-merge`}):null]})}}function Rt({run:e,blocker:t,flags:n,phone:r}){return{key:`archive`,heading:`Archive blocked`,reason:t.message,actions:(0,Z.jsxs)(Z.Fragment,{children:[t.runId?(0,Z.jsx)(F,{variant:`outline`,asChild:!0,children:(0,Z.jsx)(U,{to:`/tasks/${t.runId}`,"aria-label":r?`Open task that blocks the archive`:void 0,children:r?`Open task`:`Open blocking task`})}):null,t.pullRequestUrl&&M(t.pullRequestUrl)?(0,Z.jsx)(F,{variant:`outline`,asChild:!0,children:(0,Z.jsxs)(`a`,{href:t.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,"aria-label":r?`Open PR that blocks the archive`:void 0,children:[r?`Open PR`:`Open blocking PR`,(0,Z.jsx)(It,{phone:r})]})}):null,n.archive?(0,Z.jsx)(Ft,{run:e,compact:r}):null]})}}function zt({heading:e,reason:t,className:n,hideHeading:r}){return(0,Z.jsxs)(`p`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:j(`text-sm [overflow-wrap:anywhere]`,n),children:[r?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[e,` · `]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e}),` · `]}),t]})}function Bt({blocks:e}){return(0,Z.jsx)(`section`,{"data-slot":`completion-status`,"aria-label":`Completion action`,className:`grid min-w-0 gap-2 rounded-lg border border-card-edge bg-card p-3 shadow-card [margin-block:0.75rem]`,children:e.map(e=>(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(zt,{heading:e.heading,reason:e.reason}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.actions})]},e.key))})}function Vt({blocks:e}){let[t,n]=(0,X.useState)(!1),r=(0,X.useId)(),[i]=e;if(!i)return null;let a=e.length-1;return(0,Z.jsxs)(`section`,{"data-slot":`completion-status`,"aria-label":`Completion action`,className:`-mx-4 min-w-0 border-b border-card-edge bg-card`,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`completion-status-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),className:`flex min-h-11 w-full items-center gap-2 px-4 text-start text-sm outline-hidden focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/50`,children:[i.pending?(0,Z.jsx)(be,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Se,{"aria-hidden":`true`,className:`size-4 shrink-0 text-semantic-amber`}),(0,Z.jsx)(`span`,{className:`shrink-0 font-medium`,children:i.heading}),t?(0,Z.jsx)(`span`,{className:`flex-1`}):(0,Z.jsxs)(`span`,{"aria-hidden":`true`,className:`min-w-0 flex-1 truncate text-muted-foreground`,children:[`· `,i.reason]}),a>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-muted-foreground`,children:[`+`,a]}),(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`and `,a,` more`]})]}):null,(0,Z.jsx)(Oe,{"aria-hidden":`true`,className:j(`size-4 shrink-0 text-muted-foreground`,t&&`rotate-180`)})]}),(0,Z.jsx)(`div`,{id:r,className:j(t&&`grid gap-2 px-4 pb-3`),children:e.map((e,n)=>(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(zt,{heading:e.heading,reason:e.reason,className:j(!t&&`sr-only`),hideHeading:n===0}),t?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.actions}):null]},e.key))})]})}function Ht({run:e}){let t=p(e.id),n=bt(),r=q(e),i=e.status===`done`?e.completionAction:void 0,a=r.archive?e.archiveBlocker:void 0,o=i&&i.phase!==`complete`?i:void 0;if(!o&&!a)return null;let s=e.pullRequestUrl??e.pullRequests?.find(e=>e.url)?.url,c=!n,l=[o?Lt({run:e,action:o,prUrl:s,patch:t,phone:c}):void 0,a?Rt({run:e,blocker:a,flags:r,phone:c}):void 0].filter(e=>e!==void 0);return n?(0,Z.jsx)(Bt,{blocks:l}):(0,Z.jsx)(Vt,{blocks:l})}var Ut=[`running`,`queued`,`waiting`];function Wt(e,{queuePosition:t,now:n=new Date}){let r=ie(e),i=Ze(e,r).label,a=t===void 0?i:`${i} #${t}`,o=Ut.includes(e.status)?Kt(e,n):void 0;return o?{attention:r,label:a,nextCheck:o}:{attention:r,label:a}}function Gt(e){return e.nextCheck?`${e.label} · Next check ${e.nextCheck.text}`:e.label}function Kt(e,t){let n;for(let t of Array.isArray(e.waits)?e.waits:[]){if(t?.kind!==`timer`||t.phase!==`open`)continue;let e=new Date(t.deadline);Number.isFinite(e.getTime())&&(!n||e<n)&&(n=e)}if(n)return{at:n.toISOString(),text:qe(n,t)}}async function Q(e,t){try{await navigator.clipboard.writeText(e),T(t)}catch{T(`Run manually: ${e}`)}}function qt(e){let t=a(),n=y(),r=(0,X.useMemo)(()=>k(e,t),[e,t]);return{referenceProjectId:n,repoBase:t,references:r,requests:(0,X.useMemo)(()=>n===void 0?[]:r.filter(e=>me(e,t)).map(e=>({projectId:n,kind:e.kind,number:e.number})),[r,n,t])}}function Jt(e){return _({mutationFn:()=>C(e.id),onError:e=>{if(e instanceof ne&&e.command){Q(e.command,`No terminal found — command copied to clipboard.`);return}T(e.message,{tone:`danger`})}})}function Yt(e,t){let n=u(),r=h(),i=v(),a=_({mutationFn:t=>O(e.id,t),onError:e=>T(e.message,{tone:`danger`})}),o=Je(),s=c(e),l=o.runnersOn(e=>t&&s.sessionId!==void 0&&e===s.backend?s.profileId??`default`:o.repoAccount?.[e]).runners,d=e=>!r.isSuccess||!i.isSuccess||l.includes(e??`claude`);return{canResumeHere:t&&d(ct(e)),choices:e.worktreePath?(n.data?.targets??[]).filter(e=>{let t=Ae(e.id);return t===void 0||i.isSuccess&&d(t)}).map(t=>({target:t,...it(e,t.id)?{suffix:` (resume)`,title:`Resume this run's session`}:{}})):[],open:a}}function Xt({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Yt(e,t),o=v().data,s=St(e);return!r&&i.length===0&&!s?null:(0,Z.jsxs)(Z.Fragment,{children:[r||i.length>0?(0,Z.jsxs)(`div`,{className:`task-open-targets flex flex-wrap gap-3`,children:[r?(0,Z.jsxs)(F,{variant:`outline`,"data-target":`terminal-resume`,onClick:n,children:[(0,Z.jsx)(Fe,{}),`Terminal (resume session)`]}):null,i.map(({target:e,suffix:t,title:n})=>{let r=je(e,o);return(0,Z.jsxs)(F,{variant:`outline`,"data-target":e.id,title:n,disabled:a.isPending,onClick:()=>a.mutate(e.id),children:[(0,Z.jsx)(r,{"aria-hidden":`true`}),e.label,t??``]},e.id)}),e.worktreePath?(0,Z.jsxs)(F,{variant:`outline`,onClick:()=>{let t=e.worktreePath;t&&navigator.clipboard.writeText(t).then(()=>T(`Worktree path copied`)).catch(()=>T(`Path: ${t}`))},children:[(0,Z.jsx)(N,{}),`Copy worktree path`]}):null]}):null,s?(0,Z.jsxs)(`div`,{"data-slot":`resume-command`,className:`mt-5 border-t border-border pt-5`,children:[(0,Z.jsx)(`h3`,{className:`text-base font-medium`,children:`Resume in a terminal`}),(0,Z.jsx)(`pre`,{className:`my-4 whitespace-pre-wrap break-all rounded-lg border border-border bg-background p-4 text-xs`,children:s}),(0,Z.jsxs)(F,{variant:`outline`,onClick:()=>void Q(s,`Command copied to clipboard.`),children:[(0,Z.jsx)(N,{}),`Copy resume command`]})]}):null]})}function Zt({run:e,canResume:t,onResume:n}){let{canResumeHere:r,choices:i,open:a}=Yt(e,t),o=St(e),s=e.worktreePath;return!r&&i.length===0&&!o&&!s?null:(0,Z.jsxs)(`div`,{"data-slot":`workspace-tools`,className:`flex min-w-0 flex-wrap gap-2`,children:[r||i.length>0?(0,Z.jsx)(Me,{choices:i,onPick:e=>a.mutate(e),disabled:a.isPending,triggerVariant:`outline`,leading:r?(0,Z.jsxs)(L,{"data-target":`terminal-resume`,onSelect:n,children:[(0,Z.jsx)(Fe,{"aria-hidden":`true`}),`Terminal (resume session)`]}):void 0}):null,s?(0,Z.jsxs)(F,{variant:`outline`,size:`sm`,onClick:()=>void Q(s,`Worktree path copied`),children:[(0,Z.jsx)(N,{"aria-hidden":`true`}),`Copy worktree path`]}):null,o?(0,Z.jsxs)(F,{variant:`outline`,size:`sm`,"data-slot":`resume-command`,title:o,onClick:()=>void Q(o,`Command copied to clipboard.`),children:[(0,Z.jsx)(N,{"aria-hidden":`true`}),`Copy resume command`]}):null]})}function Qt({run:e,canResume:t,onResume:n,onOpen:r,onClose:i}){let{canResumeHere:a,choices:o}=Yt(e,t);return!a&&o.length===0?null:r?(0,Z.jsx)(L,{onSelect:r,children:`Open in…`}):(0,Z.jsxs)(`section`,{"aria-label":`Open task worktree in…`,className:`task-action-panel my-5 rounded-xl border border-border bg-card p-6`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:`Open task worktree in…`}),(0,Z.jsx)(F,{variant:`ghost`,size:`icon`,"aria-label":`Close worktree chooser`,onClick:i,children:(0,Z.jsx)(we,{})})]}),e.worktreePath?(0,Z.jsx)(`p`,{className:`my-4 break-all text-xs text-muted-foreground`,children:e.worktreePath}):null,(0,Z.jsx)(`div`,{className:`mt-4`,children:(0,Z.jsx)(Xt,{run:e,canResume:t,onResume:n})})]})}function $t({branch:e}){let[t,n]=(0,X.useState)(null),r=(0,X.useRef)(null);(0,X.useEffect)(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);let i=t===e,a=async()=>{r.current!==null&&clearTimeout(r.current),n(null);try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard unavailable`);await navigator.clipboard.writeText(e),n(e),r.current=setTimeout(()=>n(null),2e3)}catch{T(`Could not copy branch. Select and copy: ${e}`)}};return(0,Z.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,children:[(0,Z.jsx)(`span`,{"data-slot":`branch-chip`,className:`min-w-0 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-xs font-medium break-all`,children:e}),(0,Z.jsxs)(`button`,{type:`button`,"aria-label":i?`Copied branch name`:`Copy branch name`,onClick:()=>void a(),className:`inline-flex min-h-11 shrink-0 items-center gap-1 rounded-sm px-2 text-xs font-medium text-foreground hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground md:min-h-8`,children:[(0,Z.jsx)(N,{className:`size-3.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{"aria-live":`polite`,children:i?`Copied`:`Copy`})]})]})}function en({run:e}){let t=a(),n=y(),r=r=>n===void 0?void 0:le(n,e.id,r,t),i=(0,X.useMemo)(()=>k(e,t),[e,t]),o=[],s=[],c=i.filter(e=>e.kind===`PR`);for(let t of c)o.push((0,Z.jsx)(A,{reference:t,to:r(t),taskTitle:f(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`,conflictAction:(0,Z.jsx)(dt,{run:e,prNumber:t.number})},ue(t)));let l=he(e);l&&M(l)&&!c.some(e=>e.url===l)&&o.push((0,Z.jsx)(A,{reference:{kind:`PR`,url:l},taskTitle:f(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`pr`));let u=i.filter(e=>e.kind===`Issue`);for(let t of u)s.push((0,Z.jsx)(A,{reference:t,to:r(t),taskTitle:f(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},ue(t)));let d=ge(e,t);if(d&&M(d)&&!u.some(e=>e.url===d)){let t=de(d);s.push((0,Z.jsx)(A,{reference:{kind:`Issue`,...t?{number:Number(t)}:{},url:d},to:t?r({kind:`Issue`,number:Number(t),url:d}):void 0,taskTitle:f(e),className:`h-5 no-hover:min-h-[44px] no-hover:min-w-[44px]`},`issue`))}return o.length===0&&s.length===0?null:(0,Z.jsx)(`div`,{"data-slot":`linked-references`,className:`flex min-w-0 flex-col gap-3`,children:[[`PR`,`PRs`,o],[`Issue`,`Issues`,s]].map(([e,t,n])=>n.length>0?(0,Z.jsxs)(`div`,{"data-reference-kind":e,className:`grid min-w-0 grid-cols-[5rem_minmax(0,1fr)] items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:n})]},e):null)})}function tn(){let e=Ke(),t=m();return et(t.data?.projects?.find(n=>n.id===(e??t.data?.bootProject)))}var $=e=>e.map(e=>`${e.name}: ${Qe(e.url)}`).join(`
|
|
2
|
+
`);function nn(e){let t=$e(),n=tn(),r=n.length>0,i=s(e.id),[a,o]=(0,X.useState)(null),c=e.notify===!0,l=()=>i.mutate({notify:!1},{onSuccess:()=>T(`Stopped notifying the webhook`),onError:e=>T(`Could not stop notifying. ${e.message}`,{tone:`danger`})}),u=r?(0,Z.jsx)(sn,{mode:a,targets:n,pending:i.isPending,onOpenChange:e=>!e&&o(null),onSubmit:e=>i.mutate({notify:!0,...e?{message:e}:{}},{onSuccess:()=>{o(null),T(a===`note`?`Note sent to the webhook`:`Handed off to the webhook`)},onError:e=>T(`Could not hand off. ${e.message}`,{tone:`danger`})})}):null;return{visible:t!==`absent`&&(r||c),notifying:c,reachable:r,targets:n,pending:i.isPending,open:o,stop:l,dialog:u}}function rn({run:e}){let t=nn(e);if(!t.visible)return null;let{notifying:n,reachable:r,targets:i}=t;return(0,Z.jsxs)(Z.Fragment,{children:[n?(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsxs)(F,{variant:`outline`,"data-slot":`notifying-chip`,className:`gap-1.5`,"aria-label":r?`Notifying ${K(i)} — webhook actions`:`Notifying — webhook actions`,title:r?$(i):void 0,children:[(0,Z.jsx)(W,{tone:`success`}),(0,Z.jsx)(`span`,{children:`Notifying`}),(0,Z.jsx)(Oe,{"aria-hidden":`true`,className:`size-3.5`})]})}),(0,Z.jsxs)(V,{align:`end`,"data-slot":`notifying-menu`,className:`w-[240px] max-w-[calc(100vw-2rem)] p-2`,children:[r?(0,Z.jsx)(I,{"data-slot":`notifying-targets`,className:`flex flex-col gap-0.5 px-2 py-1.5 text-xs font-normal text-muted-foreground`,children:i.map(e=>(0,Z.jsx)(`span`,{"data-webhook-target":e.id,className:`truncate`,title:Qe(e.url),children:e.name},e.id))}):null,r?(0,Z.jsxs)(L,{className:`min-h-11`,onSelect:()=>t.open(`note`),children:[(0,Z.jsx)(Pe,{"aria-hidden":`true`}),` Send a note…`]}):null,(0,Z.jsxs)(L,{variant:`destructive`,className:`min-h-11`,disabled:t.pending,onSelect:t.stop,children:[(0,Z.jsx)(Et,{"aria-hidden":`true`}),` Stop notifying`]})]})]}):(0,Z.jsxs)(F,{variant:`outline`,"data-action":`handoff`,className:`max-md:px-0`,"aria-label":`Hand off to webhook`,onClick:()=>t.open(`handoff`),children:[(0,Z.jsx)(_t,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`max-md:sr-only`,children:`Hand off`})]}),t.dialog]})}function an({handoff:e}){if(!e.visible)return null;let{notifying:t,reachable:n,targets:r}=e;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(R,{}),(0,Z.jsx)(I,{"data-slot":`handoff-menu-label`,className:`truncate px-2 py-3 text-[12px] font-normal text-muted-foreground uppercase`,title:n?$(r):void 0,children:n?`Webhook · ${K(r)}`:`Webhook`}),t?(0,Z.jsxs)(Z.Fragment,{children:[n?(0,Z.jsx)(L,{"data-action":`handoff-note`,className:`min-h-11`,onSelect:()=>e.open(`note`),children:`Send a note…`}):null,(0,Z.jsx)(L,{"data-action":`handoff-stop`,variant:`destructive`,className:`min-h-11`,disabled:e.pending,onSelect:e.stop,children:`Stop notifying`})]}):(0,Z.jsx)(L,{"data-action":`handoff`,className:`min-h-11`,onSelect:()=>e.open(`handoff`),children:`Hand off to webhook…`})]})}function on({run:e}){let t=$e(),n=tn();return e.notify!==!0||t===`absent`?null:(0,Z.jsx)(J,{"data-slot":`notifying-status`,role:`img`,"aria-label":n.length>0?`Notifying ${K(n)}`:`Notifying`,title:n.length>0?$(n):void 0,className:`shrink-0 px-2 py-px leading-4`,children:(0,Z.jsx)(_t,{"aria-hidden":`true`,className:`size-3 text-success`})})}function sn({mode:e,targets:t,pending:n,onOpenChange:r,onSubmit:i}){let a=(0,X.useId)(),o=(0,X.useId)(),[s,c]=(0,X.useState)(``);(0,X.useEffect)(()=>{e!==null&&c(``)},[e]);let l=e===`note`,u=K(t);return(0,Z.jsx)(We,{open:e!==null,onOpenChange:e=>{e||c(``),r(e)},children:(0,Z.jsx)(He,{"data-slot":`handoff-dialog`,className:`max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none max-sm:rounded-t-xl max-sm:border-x-0 max-sm:border-b-0 max-sm:pb-[max(1.5rem,env(safe-area-inset-bottom))] max-sm:data-[state=open]:slide-in-from-bottom max-sm:data-[state=open]:zoom-in-100 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=closed]:zoom-out-100`,children:(0,Z.jsxs)(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),i(s.trim())},children:[(0,Z.jsxs)(Ve,{className:`text-left`,children:[(0,Z.jsx)(Ue,{children:l?`Send a note to ${t.length===1?`the webhook`:`the webhooks`}`:`Hand off to webhook`}),(0,Z.jsx)(Be,{children:(0,Z.jsx)(`span`,{"data-webhook-destination":``,title:$(t),children:l?`${u} ${t.length===1?`gets`:`get`} this note with the task's current status.`:`${u} will start receiving this task's status updates. Add a note (optional).`})})]}),(0,Z.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:a,className:`text-[13px] font-medium`,children:`Note`}),(0,Z.jsx)(Ct,{id:a,"data-slot":`handoff-note`,"aria-describedby":o,rows:4,maxLength:1e5,className:`min-h-24`,placeholder:`e.g. Take over from here, ping me when the PR is green`,value:s,onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`p`,{id:o,className:`flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[(0,Z.jsx)(Ne,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`The note goes to the webhook only, not to the agent.`]})]}),(0,Z.jsxs)(ze,{className:`gap-2 max-sm:flex-col-reverse max-sm:[&>button]:w-full`,children:[(0,Z.jsx)(F,{type:`button`,variant:`ghost`,onClick:()=>r(!1),children:`Cancel`}),(0,Z.jsxs)(F,{type:`submit`,variant:`contrast`,"data-action":`handoff-submit`,disabled:n||l&&s.trim()===``,children:[(0,Z.jsx)(_t,{"aria-hidden":`true`}),l?`Send note`:`Hand off`]})]})]})})})}function cn({id:e}){return(0,Z.jsxs)(U,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,"data-slot":`mobile-parent-task-link`,className:`inline-flex shrink-0 items-center justify-center gap-1 rounded-sm px-2 text-[13px] text-muted-foreground [min-block-size:2.75rem] [min-inline-size:2.75rem] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:bg-muted active:text-foreground`,children:[(0,Z.jsx)(xe,{"aria-hidden":!0,className:`shrink-0 [block-size:1.2cap] [inline-size:auto]`}),`Parent`]})}function ln({id:e}){let t=o(e),n=t.data?f(t.data):e;return(0,Z.jsxs)(`div`,{"data-slot":`parent-task`,className:`flex min-w-0 flex-wrap items-center gap-x-2 text-[13px] text-muted-foreground`,children:[(0,Z.jsxs)(U,{to:`/tasks/${e}`,"aria-label":`Parent task ${e}`,title:`Parent · ${n}`,"data-slot":`parent-task-link`,className:`flex min-h-11 min-w-0 max-w-full items-center gap-2 rounded-sm text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:text-foreground`,children:[(0,Z.jsx)(xe,{"aria-hidden":!0,className:`h-[1.2cap] w-auto shrink-0`}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`Parent`}),(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Z.jsx)(`span`,{className:`min-w-0 overflow-clip text-ellipsis whitespace-nowrap`,children:n})]}),t.isError?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{children:`Parent record unavailable or deleted`}),(0,Z.jsx)(F,{variant:`outline`,onClick:()=>void t.refetch(),children:`Retry parent task`})]}):null]})}var un=3,dn=(e,t)=>e.kind===t.kind&&e.number===t.number;function fn(e,t,n=un){let r=t?e.findIndex(e=>dn(e,t)):-1;if(e.length<=n||r<n)return{inline:e.slice(0,n),overflow:e.slice(n)};let i=[...e.slice(0,n-1),e[r]];return{inline:i,overflow:e.filter(e=>!i.includes(e))}}var pn=(e,t)=>`/tasks/${e}/${t.kind}/${t.number}`;function mn({tab:e}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(e.kind===`pr`?_e:Ce,{"aria-hidden":`true`,className:`mr-1 size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.kind===`pr`?`Pull request`:`Issue`}),` #`,e.number,(0,Z.jsx)(pe,{kind:e.kind===`pr`?`PR`:`Issue`,number:e.number,className:`ml-1`})]})}function hn(e,t){let n=e[0],r=e.length+ +!!t;return n?`Preview :${n.port}${r>1?` +${r-1}`:``}`:t?`Preview · agent`:`Preview`}function gn({servers:e,icon:t=!1}){let n=ft();if(n===null)return null;let r=n.agentLive===!0,i=e[0],a=e.length+ +!!r,o=a===1?i?{port:i.port}:{agent:!0}:{};return t?(0,Z.jsxs)(F,{variant:`ghost`,size:`icon`,"data-slot":`preview-toggle`,"data-entries":a,"aria-pressed":n.open,"aria-label":hn(e,r),className:j(`relative`,a>0?`text-foreground`:`text-soft-foreground`),onClick:()=>n.openPane(o),children:[(0,Z.jsx)(ke,{"aria-hidden":`true`}),n.live?(0,Z.jsx)(W,{tone:`success`,"aria-hidden":`true`,"data-slot":`preview-live-dot`,className:`absolute top-2 right-2`}):null]}):(0,Z.jsxs)(F,{variant:`outline`,"data-slot":`preview-toggle`,"aria-pressed":n.open,onClick:()=>n.openPane(o),children:[(0,Z.jsx)(ke,{"aria-hidden":`true`}),hn(e,r),n.live?(0,Z.jsx)(W,{tone:`success`,"aria-label":`Preview is live`}):null]})}function _n({tab:e}){let t=st();return!t?.available||e!==`session`&&e!==`changes`?null:(0,Z.jsxs)(F,{variant:`outline`,"data-slot":`split-view-toggle`,className:j(t.showing&&`border-accent-text/40 bg-muted text-accent-text`),"aria-pressed":t.showing,title:t.showing?`Show Session alone`:`Show Changes beside Session`,onClick:()=>t.setOn(!t.showing),children:[(0,Z.jsx)(Ot,{"aria-hidden":`true`}),`Split view`]})}function vn(e){return e?.role===`worker`?`Worker session`:e?.role===`root`?`Parent session`:`Task session`}function yn({run:e,compact:t=!1}){if(e.delegation?.role!==`worker`)return null;let n=e.delegation.supervisorRunId??e.delegation.parentRunId;return t?(0,Z.jsx)(cn,{id:n}):(0,Z.jsx)(ln,{id:n})}function bn({isDesktop:e,desktopActivitySlot:t,attention:n,statusLine:r,hostOffline:i}){return e&&t?(0,Z.jsx)(Z.Fragment,{children:t}):(0,Z.jsx)(`span`,{"data-slot":`run-status-slot`,className:`hidden`,children:(0,Z.jsx)(J,{dot:n.tone,shape:n.shape,pulse:n.pulse&&!i,children:Gt(r)})})}function xn(e,t,n){return e.worktreePath&&t?(0,Z.jsx)(gn,{servers:e.previewServers??[],icon:n}):null}function Sn(e,t,n){return n&&!e.archiveBlocker&&t.archive?(0,Z.jsx)(Ft,{run:e}):null}function Cn({offline:e,className:t}){return e?(0,Z.jsx)(J,{"data-slot":`host-not-live-pill`,dot:`neutral`,shape:`ring`,className:t,children:`Not live`}):null}function wn({archived:e,className:t}){return e?(0,Z.jsx)(J,{"data-slot":`run-archived-pill`,dot:G.tone,shape:G.shape,className:t,children:G.label}):null}function Tn({run:e}){return e.archived&&e.autoArchive?.reason===`pull-requests-merged`&&e.autoArchive.archivedAt===e.archivedAt?(0,Z.jsx)(`p`,{"data-slot":`auto-archive-reason`,className:`text-[13px] text-muted-foreground`,children:`Archived automatically after all associated PRs merged.`}):null}function En({run:e,statusLine:t,activityTrigger:n,hostOffline:r}){let{attention:i}=t;return(0,Z.jsx)(`span`,{"data-slot":`mobile-status-room`,className:`flex min-w-0`,children:(0,Z.jsxs)(`span`,{className:`inline-flex max-w-full min-w-0 items-center gap-1.5`,children:[n??(0,Z.jsx)(J,{"data-slot":`mobile-run-status`,dot:i.tone,shape:i.shape,pulse:i.pulse&&!r,className:`min-w-0 px-2 py-px text-xs leading-4`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:t.label})}),(0,Z.jsx)(Cn,{offline:r,className:`shrink-0 px-2 py-px text-xs leading-4`}),(0,Z.jsx)(wn,{archived:e.archived,className:`shrink-0 px-2 py-px text-xs leading-4`}),(0,Z.jsx)(on,{run:e})]})})}function Dn({run:e,tab:t,activeItem:n,inlineItemTabs:r,overflowItemTabs:i,phoneBar:a,isDesktop:o}){let s=(0,X.useRef)(null),[c,l]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=s.current;if(!e||o){l(!1);return}let t=()=>l(e.scrollWidth-e.clientWidth-e.scrollLeft>1),n=new ResizeObserver(t);n.observe(e);for(let t of e.children)n.observe(t);return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>{n.disconnect(),e.removeEventListener(`scroll`,t)}},[o,r,i,e.diffStat?.files]);let u=n?`${n.kind}#${n.number}`:null;return(0,X.useEffect)(()=>{!u||o||s.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[u,r.map(e=>`${e.kind}#${e.number}`).join(`,`),o]),(0,Z.jsxs)(`div`,{ref:s,"data-slot":`run-tabs`,"data-phone-bar":a||void 0,"data-overflow-end":c||void 0,className:j(`flex flex-wrap items-end gap-1 border-b border-border md:mt-5 max-md:flex-nowrap max-md:overflow-x-auto max-md:border-b-0 max-md:shadow-[inset_0_-1px_0_var(--border)] max-md:gap-0 max-md:[&>*]:mb-0 max-md:[&>*]:shrink-0 max-md:[&>a]:min-h-11 max-md:[&>a]:px-2 max-md:[&>a]:text-[13.5px]`,a?`mt-0`:`mt-3`),children:[(0,Z.jsx)(Y,{to:`/tasks/${e.id}`,active:t===`session`,replace:a,children:`Session`}),(0,Z.jsx)(Y,{to:`/tasks/${e.id}/changes`,active:t===`changes`,replace:a,count:e.diffStat&&e.diffStat.files>0?e.diffStat.files:void 0,children:`Changes`}),(0,Z.jsx)(Y,{to:`/tasks/${e.id}/commits`,active:t===`commits`,replace:a,children:`Commits`}),(0,Z.jsx)(Y,{to:`/tasks/${e.id}/files`,active:t===`files`,replace:a,children:`Files`}),r.map(t=>(0,Z.jsx)(Y,{to:pn(e.id,t),active:n!==null&&dn(t,n),replace:a,children:(0,Z.jsx)(mn,{tab:t})},`${t.kind}-${t.number}`)),i.length>0?(0,Z.jsxs)(H,{children:[(0,Z.jsxs)(B,{"data-slot":`run-tabs-more`,"aria-label":`${i.length} more linked items`,className:`-mb-px flex h-8 items-center rounded-t-md border-b-2 border-transparent px-3 text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-link-foreground max-md:min-h-11 max-md:px-3.5 max-md:text-[13.5px]`,children:[`+`,i.length]}),(0,Z.jsx)(V,{align:`end`,children:i.map(t=>(0,Z.jsx)(L,{asChild:!0,children:(0,Z.jsx)(U,{to:pn(e.id,t),replace:a,children:(0,Z.jsx)(mn,{tab:t})})},`${t.kind}-${t.number}`))})]}):null]})}function On({run:e,tab:t=`session`,onMarkedUnread:n,desktopActivitySlot:i,mobileActivitySlot:a}){let o=ie(e),s=q(e),[c,l]=(0,X.useState)(!1),[u,f]=(0,X.useState)(!1),p=kn(e,n),m=An(e),h=(0,X.useRef)(null),_=g(),v=r(),y=Wt(e,{queuePosition:e.status===`queued`?d(_.data??[]).get(e.id):void 0}),ee=ht(),b=bt(),x=ee!==null&&!b?ee:null,S=x!==null,{referenceProjectId:te,repoBase:C,requests:ne}=qt(e),re=(0,X.useMemo)(()=>ce(e,C),[e,C]),w=typeof t==`object`?t:null,{inline:T,overflow:ae}=fn(re,w),E=tt(v.data),D=se(),oe=xn(e,E,!1),O=(0,Z.jsx)(Nn,{run:e,actions:p,triggerRef:h,onRename:S?m.editor.begin:void 0,onOpenChooser:()=>f(!0),onToggleNotes:()=>l(e=>!e)}),k=Sn(e,s,b);return(0,Z.jsx)(fe,{projectId:te,repoBase:C,requests:ne,children:(0,Z.jsxs)(`header`,{"data-slot":`run-header`,"data-sticky":t===`session`||void 0,className:j(`relative z-20 shrink-0 bg-background px-4 md:px-9 md:pt-7`,S?`pt-0`:`pt-[18px]`,t===`session`&&`border-b border-border`),children:[(0,Z.jsx)(Tn,{run:e}),(0,Z.jsx)(Ht,{run:e}),(0,Z.jsxs)(`div`,{className:`w-full`,children:[(0,Z.jsx)(yn,{run:e}),x?(0,Z.jsxs)(ot,{slot:x,children:[(0,Z.jsx)(Mn,{run:e,title:m,returnFocus:h,status:(0,Z.jsx)(En,{run:e,statusLine:y,activityTrigger:a,hostOffline:D})}),xn(e,E,!0),(0,Z.jsx)(yn,{run:e,compact:!0}),O]}):(0,Z.jsxs)(`div`,{"data-slot":`run-title-row`,className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 md:flex-nowrap`,children:[(0,Z.jsx)(`p`,{"data-slot":`session-kind`,className:`text-[12px] font-semibold tracking-[0.14em] text-muted-foreground uppercase md:hidden`,children:vn(e.delegation)}),(0,Z.jsx)(jn,{run:e}),(0,Z.jsx)(bn,{isDesktop:b,desktopActivitySlot:i,attention:o,statusLine:y,hostOffline:D}),(0,Z.jsx)(Cn,{offline:D,className:`max-md:hidden`}),(0,Z.jsx)(wn,{archived:e.archived,className:`max-md:hidden`}),(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 md:gap-2.5`,children:[k,(0,Z.jsx)(_n,{tab:t}),oe,(0,Z.jsx)(rn,{run:e}),O]})]}),(0,Z.jsx)(Dn,{run:e,tab:t,activeItem:w,inlineItemTabs:T,overflowItemTabs:ae,phoneBar:S,isDesktop:b}),c?(0,Z.jsx)(In,{runId:e.id,onClose:()=>l(!1)}):null,u?(0,Z.jsx)(Qt,{run:e,canResume:q(e).terminal,onResume:()=>p.terminal.mutate(),onClose:()=>f(!1)}):null]}),(0,Z.jsx)(Fn,{run:e,actions:p})]})})}function kn(e,t){let n=w(),r=Ge(),[a,o]=(0,X.useState)(null),s=()=>n.invalidateQueries({queryKey:x.runs.all}),c=e=>T(e.message,{tone:`danger`}),l=te(),u={isPending:l.isPending,mutate:()=>l.mutate({id:e.id,pinned:!e.pinned})},d=i();return{pin:u,markUnread:{isPending:d.isPending,mutate:()=>{t?.(),d.mutate(e.id,{onError:c})}},delete:_({mutationFn:()=>E(e.id),onSuccess:()=>{s(),r(`/`)},onError:c}),terminal:Jt(e),confirming:a,setConfirming:o}}function An(e){let t=p(e.id),n=f(e);return{title:n,editor:nt(n,e=>t.mutate({title:e},{onError:e=>T(e.message,{tone:`danger`})}))}}function jn({run:e}){let{title:t,editor:n}=An(e);return n.editing?(0,Z.jsx)(lt,{editor:n,className:`flex-1 text-[16px] font-semibold`}):(0,Z.jsxs)(`span`,{className:`group flex min-w-0 items-center gap-1`,children:[(0,Z.jsx)(`h1`,{className:`line-clamp-2 min-w-0 break-words text-2xl font-semibold tracking-tight`,title:e.task,children:t}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Rename task`,onClick:n.begin,className:`shrink-0 rounded-sm p-1 text-soft-foreground opacity-0 transition-opacity group-hover:opacity-100 hover:bg-muted hover:text-foreground focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(pt,{className:`size-3.5`,"aria-hidden":`true`})})]})}function Mn({run:e,title:{title:t,editor:n},returnFocus:r,status:i}){return(0,Z.jsxs)(Re,{open:n.editing,onOpenChange:e=>{e||n.commit()},children:[(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(`div`,{"data-slot":`mobile-run-title`,className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`h1`,{className:`line-clamp-2 break-words text-[15px] leading-[18px] font-semibold text-foreground`,title:e.task,children:t}),i]})}),(0,Z.jsx)(Le,{align:`start`,sideOffset:12,className:`w-64 max-w-[calc(100vw-16px)] p-2`,onEscapeKeyDown:e=>{e.preventDefault(),n.cancel()},onCloseAutoFocus:e=>{e.preventDefault(),r.current?.focus()},children:(0,Z.jsx)(lt,{editor:n,className:`text-[16px] font-semibold`})})]})}function Nn({run:e,actions:t,triggerRef:n,onRename:r,onToggleNotes:i,onOpenChooser:a}){let o=q(e),s=St(e),c=bt(),l=At(e.id),[u,d]=(0,X.useState)(!1),f=p(e.id),m=(0,X.useId)(),h=nn(e),g=(0,X.useRef)(!1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Pt,{run:e,open:u,onOpenChange:d,onConfirm:()=>{l.mutate(!0),d(!1)}}),c?null:h.dialog,(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{asChild:!0,children:(0,Z.jsx)(F,{ref:n,variant:`ghost`,size:`icon`,"aria-label":`Run actions`,children:(0,Z.jsx)(ve,{"aria-hidden":`true`})})}),(0,Z.jsxs)(V,{align:`end`,"data-slot":`run-actions-menu`,className:`w-[270px] max-w-[calc(100vw-2rem)] p-3`,onCloseAutoFocus:e=>{g.current&&(g.current=!1,e.preventDefault(),r?.())},children:[(0,Z.jsx)(I,{className:`px-2 py-3 text-[12px] font-normal text-muted-foreground`,children:`TASK ACTIONS`}),r?(0,Z.jsxs)(L,{"data-action":`rename-task`,className:`min-h-11`,onSelect:()=>{g.current=!0},children:[(0,Z.jsx)(pt,{"aria-hidden":`true`}),` Rename`]}):null,!c&&o.archive&&!e.archiveBlocker?(0,Z.jsx)(L,{disabled:l.isPending,onSelect:()=>e.archived?l.mutate(!1):d(!0),children:Mt(e)}):null,(0,Z.jsxs)(L,{onSelect:i,children:[(0,Z.jsx)(xt,{"aria-hidden":`true`}),` Notes / handoff`]}),(0,Z.jsx)(Qt,{run:e,canResume:o.terminal,onResume:()=>t.terminal.mutate(),onOpen:a}),s?(0,Z.jsxs)(L,{onSelect:()=>void Q(s,`Command copied to clipboard.`),children:[(0,Z.jsx)(N,{"aria-hidden":`true`}),` Copy resume command`]}):null,o.markUnread?(0,Z.jsxs)(L,{disabled:t.markUnread.isPending,onSelect:()=>t.markUnread.mutate(),children:[(0,Z.jsx)(Dt,{"aria-hidden":`true`}),` Mark unread`]}):null,o.pin?(0,Z.jsxs)(z,{"data-slot":`pin-run`,className:`min-h-11`,checked:!!e.pinned,disabled:t.pin.isPending,onCheckedChange:()=>t.pin.mutate(),children:[e.pinned?(0,Z.jsx)(kt,{"aria-hidden":`true`}):(0,Z.jsx)(ye,{"aria-hidden":`true`}),e.pinned?`Unpin task`:`Pin task`]}):null,c?null:(0,Z.jsx)(an,{handoff:h}),(0,Z.jsx)(R,{}),(0,Z.jsx)(I,{className:`text-xs text-muted-foreground`,children:`AFTER DONE`}),(0,Z.jsx)(z,{"data-slot":`archive-when-done`,className:`min-h-11`,checked:e.archiveWhenDone===!0,disabled:f.isPending,onCheckedChange:e=>f.mutate({archiveWhenDone:e},{onError:e=>T(e.message,{tone:`danger`})}),children:`Archive when Done`}),(0,Z.jsx)(z,{"data-slot":`auto-merge-pr`,className:`min-h-11`,checked:e.autoMergePr===!0,disabled:f.isPending,"aria-describedby":m,onCheckedChange:e=>f.mutate({autoMergePr:e},{onError:e=>T(e.message,{tone:`danger`})}),children:`Auto-merge PR`}),(0,Z.jsx)(`p`,{id:m,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block:0.5rem]`,children:`After Done, auto-merge can mark a draft PR ready. It waits for current-head CI and GitHub rules. Merge comes before archive.`}),e.delegation?.role===`worker`?null:(0,Z.jsx)(Pn,{run:e,patch:f}),o.deleteRun?(0,Z.jsx)(R,{}):null,o.deleteRun?(0,Z.jsxs)(L,{variant:`destructive`,onSelect:()=>t.setConfirming(`delete`),children:[(0,Z.jsx)(Ee,{"aria-hidden":`true`}),` Delete task…`]}):null]})]})]})}function Pn({run:e,patch:t}){let n=(0,X.useId)(),r=(0,X.useId)(),i=(0,X.useId)(),a=e=>T(e.message,{tone:`danger`});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(R,{}),(0,Z.jsx)(I,{className:`text-xs text-muted-foreground`,children:`TASK ACCESS`}),(0,Z.jsx)(z,{"data-slot":`allow-workers`,className:`min-h-11`,checked:D(e),disabled:t.isPending,"aria-describedby":`${n} ${i}`,onCheckedChange:e=>t.mutate({allowWorkers:e},{onError:a}),children:`Allow Squawk workers`}),(0,Z.jsx)(`p`,{id:n,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block-end:0.5rem]`,children:`Agents in this task can start Squawk workers. Each worker is a separate paid agent session. Worker limits cap resources, not spending.`}),(0,Z.jsx)(z,{"data-slot":`allow-messaging`,className:`min-h-11`,checked:ae(e),disabled:t.isPending,"aria-describedby":`${r} ${i}`,onCheckedChange:e=>t.mutate({allowMessaging:e},{onError:a}),children:`Allow task messaging`}),(0,Z.jsx)(`p`,{id:r,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block-end:0.5rem]`,children:`Agents in this task can message other tasks in this project.`}),(0,Z.jsx)(`p`,{id:i,"data-slot":`task-access-session-note`,className:`text-xs text-muted-foreground [padding-inline:0.5rem] [padding-block-end:0.5rem]`,children:`Turning one off applies at once. Turning one on reaches a running agent at its next session.`})]})}function Fn({run:e,actions:t}){let n=t.confirming;return(0,Z.jsx)(Ye,{open:n!==null,onOpenChange:e=>!e&&t.setConfirming(null),children:(0,Z.jsxs)(mt,{"data-slot":`task-confirmation`,className:`sm:max-w-[660px]`,children:[(0,Z.jsxs)(rt,{children:[(0,Z.jsx)(gt,{className:`text-danger`,children:`Delete task permanently?`}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(Z.Fragment,{children:[`Delete “`,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,title:f(e),children:f(e)}),`” and its transcript`,e.delegation?.role===`worker`&&!re(e.delegation.workspace)?``:`, worktree and branch`,`. This cannot be undone.`]})})]}),(0,Z.jsxs)(ut,{children:[(0,Z.jsx)(yt,{children:`Cancel`}),(0,Z.jsx)(at,{className:`bg-danger text-danger-foreground hover:brightness-[0.96]`,onClick:()=>{t.delete.mutate(),t.setConfirming(null)},children:`Delete task`})]})]})})}function In({runId:e,onClose:t}){let n=l(e);return(0,Z.jsxs)(`div`,{"data-slot":`notes-panel`,className:`my-5 flex max-h-[min(45dvh,420px)] flex-col overflow-hidden rounded-xl border border-border bg-card p-6`,children:[(0,Z.jsxs)(`div`,{className:`mb-4 flex shrink-0 items-center justify-between gap-3`,children:[(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:`Notes / handoff`}),(0,Z.jsx)(F,{variant:`ghost`,size:`icon`,"aria-label":`Close notes`,onClick:t,children:(0,Z.jsx)(we,{})})]}),(0,Z.jsx)(`div`,{"data-slot":`notes-panel-body`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:n.isPending?(0,Z.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Loading notes…`}):n.isError?(0,Z.jsx)(`p`,{className:`text-xs text-danger`,children:n.error.message}):n.data.trim().length>0?(0,Z.jsx)(Tt,{runId:e,children:(0,Z.jsx)(wt,{children:n.data})}):(0,Z.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`No notes yet — the handoff file is seeded when the task starts.`})}),(0,Z.jsxs)(`div`,{className:`mt-4 flex shrink-0 gap-3`,children:[(0,Z.jsx)(F,{variant:`outline`,disabled:!n.data?.trim(),onClick:()=>void Q(n.data??``,`Notes copied`),children:`Copy notes`}),(0,Z.jsx)(F,{variant:`outline`,onClick:t,children:`Close`})]})]})}export{Jt as a,Zt as i,$t as n,qt as o,en as r,Wt as s,On as t};
|
|
@@ -1 +1 @@
|
|
|
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{a as i,n as a,o}from"./dist-CCX8mhHc.js";import{f as s,l as c,u as l}from"./design-icons-QbNMZniQ.js";import{a as u,c as d,d as f,f as p,h as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,t as S,u as C}from"./es2015-BHonSvOU.js";import{n as w,t as T}from"./dist-B2_vvox1.js";import{t as E}from"./dist-Czz3Y5qH.js";import{a as D,i as O,n as k,r as A,t as j}from"./dist-Du6flkGD.js";import{dr as ee}from"./index-k2m-s5zD.js";var M=e(t(),1),N=e(n(),1);function P(e,[t,n]){return Math.min(n,Math.max(t,e))}var F=r(),I=[` `,`Enter`,`ArrowUp`,`ArrowDown`],L=[` `,`Enter`],R=`Select`,[z,B,V]=w(R),[H,U]=_(R,[V,D]),W=D(),[te,G]=H(R),[ne,re]=H(R),ie=`SelectProvider`;function K(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:p,required:m,form:h,internal_do_not_use_render:_}=e,v=W(t),[y,b]=M.useState(null),[x,S]=M.useState(null),[C,w]=M.useState(!1),E=T(l),[D,k]=f({prop:r,defaultProp:i??!1,onChange:a,caller:R}),[A,j]=f({prop:o,defaultProp:s,onChange:c,caller:R}),ee=M.useRef(null),N=M.useRef(A);M.useEffect(()=>{let e=h?y?.ownerDocument.getElementById(h):y?.form;if(e instanceof HTMLFormElement){let t=()=>j(N.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,y,j]);let P=!y||!!h||!!y.closest(`form`),[I,L]=M.useState(new Set),B=g(),V=Array.from(I).map(e=>e.props.value).join(`;`),H=M.useCallback(e=>{L(t=>new Set(t).add(e))},[]),U=M.useCallback(e=>{L(t=>{let n=new Set(t);return n.delete(e),n})},[]),G={required:m,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:B,value:A,onValueChange:j,open:D,onOpenChange:k,dir:E,triggerPointerDownPosRef:ee,disabled:p,name:u,autoComplete:d,form:h,nativeOptions:I,nativeSelectKey:V,isFormControl:P};return(0,F.jsx)(O,{...v,children:(0,F.jsx)(te,{scope:t,...G,children:(0,F.jsx)(z.Provider,{scope:t,children:(0,F.jsx)(ne,{scope:t,onNativeOptionAdd:H,onNativeOptionRemove:U,children:Qe(_)?_(G):n})})})})}K.displayName=ie;var q=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,F.jsx)(K,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,F.jsxs)(F.Fragment,{children:[n,e?(0,F.jsx)(Ze,{__scopeSelect:t}):null]})})};q.displayName=R;var ae=`SelectTrigger`,oe=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...a}=e,o=W(n),s=G(ae,n),c=s.disabled||r,l=i(t,s.onTriggerChange),u=B(n),d=M.useRef(`touch`),[f,p,h]=$e(e=>{let t=u().filter(e=>!e.disabled),n=et(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(j,{asChild:!0,...o,children:(0,F.jsx)(m.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(s.value)?``:void 0,...a,ref:l,onClick:b(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:b(a.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:b(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&I.includes(e.key)&&(g(),e.preventDefault())})})})});oe.displayName=ae;var se=`SelectValue`,ce=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,l=G(se,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=i(t,l.onValueNodeChange);p(()=>{u(d)},[u,d]);let h=$(l.value);return(0,F.jsx)(m.span,{...c,asChild:!h&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,F.jsx)(M.Fragment,{children:h?s:o},h?`placeholder`:`value`)})});ce.displayName=se;var le=`SelectIcon`,ue=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(m.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ue.displayName=le;var de=`SelectPortal`,[fe,pe]=H(de,{forceMount:void 0}),me=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,F.jsx)(fe,{scope:e.__scopeSelect,forceMount:n,children:(0,F.jsx)(h,{asChild:!0,...r})})};me.displayName=de;var J=`SelectContent`,he=M.forwardRef((e,t)=>{let n=pe(J,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=G(J,e.__scopeSelect),[o,s]=M.useState();return p(()=>{s(new DocumentFragment)},[]),(0,F.jsx)(C,{present:r||a.open,children:({present:e})=>e?(0,F.jsx)(be,{...i,ref:t}):(0,F.jsx)(ge,{...i,fragment:o})})});he.displayName=J;var ge=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?N.createPortal((0,F.jsx)(_e,{scope:n,children:(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(`div`,{ref:t,children:r})})}),i):null});ge.displayName=`SelectContentFragment`;var Y=10,[_e,X]=H(J),ve=`SelectContentImpl`,ye=a(`SelectContent.RemoveScroll`),be=M.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:l,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:C,...w}=e,T=G(J,n),[E,D]=M.useState(null),[O,k]=M.useState(null),A=i(t,D),[j,ee]=M.useState(null),[N,P]=M.useState(null),I=B(n),[L,R]=M.useState(!1),z=M.useRef(!1);M.useEffect(()=>{if(E)return S(E)},[E]),x();let V=M.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[I,O]),H=M.useCallback(()=>V([j,E]),[V,j,E]);M.useEffect(()=>{L&&H()},[L,H]);let{onOpenChange:U,triggerPointerDownPosRef:W}=T;M.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||U(!1),document.removeEventListener(`pointermove`,t),W.current=null};return W.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,U,W]),M.useEffect(()=>{let e=()=>U(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[U]);let[te,ne]=$e(e=>{let t=I().filter(e=>!e.disabled),n=et(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(z.current=!0))},[T.value]),ie=M.useCallback(()=>E?.focus(),[E]),K=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(T.value!==void 0&&T.value===t||r)&&P(e)},[T.value]),q=r===`popper`?we:Se,ae=q===we?{side:c,sideOffset:l,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:C}:{};return(0,F.jsx)(_e,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:re,selectedItem:j,onItemLeave:ie,itemTextRefCallback:K,focusSelectedItem:H,selectedItemText:N,position:r,isPositioned:L,searchRef:te,children:(0,F.jsx)(v,{as:ye,allowPinchZoom:!0,children:(0,F.jsx)(u,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:b(a,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(y,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,F.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ae,onPlaced:()=>R(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:b(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});be.displayName=ve;var xe=`SelectItemAlignedPosition`,Se=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...a}=e,o=G(J,n),s=X(J,n),[c,l]=M.useState(null),[u,d]=M.useState(null),f=i(t,d),h=B(n),g=M.useRef(!1),_=M.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=M.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=P(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=P(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=h(),s=window.innerHeight-Y*2,l=v.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),m=parseInt(d.borderBottomWidth,10),_=parseInt(d.paddingBottom,10),x=f+p+l+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,o.trigger,o.valueNode,c,u,v,y,b,o.dir,r]);p(()=>S(),[S]);let[C,w]=M.useState();return p(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,F.jsx)(Te,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,F.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,F.jsx)(m.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});Se.displayName=xe;var Ce=`SelectPopperPosition`,we=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=W(n);return(0,F.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});we.displayName=Ce;var[Te,Ee]=H(J,{}),De=`SelectViewport`,Oe=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...a}=e,o=X(De,n),s=Ee(De,n),c=i(t,o.onViewportChange),l=M.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(m.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:b(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});Oe.displayName=De;var ke=`SelectGroup`,[Ae,je]=H(ke),Me=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=g();return(0,F.jsx)(Ae,{scope:n,id:i,children:(0,F.jsx)(m.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Me.displayName=ke;var Ne=`SelectLabel`,Pe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=je(Ne,n);return(0,F.jsx)(m.div,{id:i.id,...r,ref:t})});Pe.displayName=Ne;var Z=`SelectItem`,[Fe,Ie]=H(Z),Le=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,c=G(Z,n),l=X(Z,n),u=c.value===r,[f,p]=M.useState(o??``),[h,_]=M.useState(!1),v=i(t,d(e=>l.itemRefCallback?.(e,r,a))),y=g(),x=M.useRef(`touch`),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};return(0,F.jsx)(Fe,{scope:n,value:r,disabled:a,textId:y,isSelected:u,onItemTextChange:M.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(z.ItemSlot,{scope:n,value:r,disabled:a,textValue:f,children:(0,F.jsx)(m.div,{role:`option`,"aria-labelledby":y,"data-highlighted":h?``:void 0,"aria-selected":u&&h,"data-state":u?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:v,onFocus:b(s.onFocus,()=>_(!0)),onBlur:b(s.onBlur,()=>_(!1)),onClick:b(s.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:b(s.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:b(s.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:b(s.onPointerMove,e=>{x.current=e.pointerType,a?l.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:b(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:b(s.onKeyDown,e=>{a||e.target!==e.currentTarget||l.searchRef?.current!==``&&e.key===` `||(L.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Le.displayName=Z;var Q=`SelectItemText`,Re=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,...o}=e,s=G(Q,n),c=X(Q,n),l=Ie(Q,n),u=re(Q,n),[f,h]=M.useState(null),g=d(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),_=i(t,h,l.onItemTextChange,g),v=f?.textContent,y=M.useMemo(()=>(0,F.jsx)(`option`,{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=u;return p(()=>(b(y),()=>x(y)),[b,x,y]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(m.span,{id:l.textId,...o,ref:_}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!$(s.value)?N.createPortal(o.children,s.valueNode):null]})});Re.displayName=Q;var ze=`SelectItemIndicator`,Be=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ie(ze,n).isSelected?(0,F.jsx)(m.span,{"aria-hidden":!0,...r,ref:t}):null});Be.displayName=ze;var Ve=`SelectScrollUpButton`,He=M.forwardRef((e,t)=>{let n=X(Ve,e.__scopeSelect),r=Ee(Ve,e.__scopeSelect),[a,o]=M.useState(!1),s=i(t,r.onScrollButtonChange);return p(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,F.jsx)(Ge,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});He.displayName=Ve;var Ue=`SelectScrollDownButton`,We=M.forwardRef((e,t)=>{let n=X(Ue,e.__scopeSelect),r=Ee(Ue,e.__scopeSelect),[a,o]=M.useState(!1),s=i(t,r.onScrollButtonChange);return p(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,F.jsx)(Ge,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});We.displayName=Ue;var Ge=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=M.useRef(null),s=B(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),p(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(m.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:b(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:b(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:b(i.onPointerLeave,()=>{c()})})}),Ke=`SelectSeparator`,qe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(m.div,{"aria-hidden":!0,...r,ref:t})});qe.displayName=Ke;var Je=`SelectArrow`,Ye=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n);return X(Je,n).position===`popper`?(0,F.jsx)(k,{...i,...r,ref:t}):null});Ye.displayName=Je;var Xe=`SelectBubbleInput`,Ze=M.forwardRef(({__scopeSelect:e,...t},n)=>{let r=G(Xe,e),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,h=M.useRef(null),g=i(n,h),_=a??``,v=E(_),y=Array.from(f).some(e=>(e.props.value??``)===``);return M.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,F.jsxs)(m.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...t,style:{...ee,...t.style},ref:g,defaultValue:_,children:[$(a)&&!y?(0,F.jsx)(`option`,{value:``}):null,Array.from(f)]},p)});Ze.displayName=Xe;function Qe(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function $e(e){let t=d(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function et(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=tt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function tt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function nt({...e}){return(0,F.jsx)(q,{"data-slot":`select`,...e})}function rt({...e}){return(0,F.jsx)(ce,{"data-slot":`select-value`,...e})}function it({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(oe,{"data-slot":`select-trigger`,"data-size":t,className:o(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-[var(--task-brand-bg)] px-3 py-2 text-sm whitespace-nowrap shadow-none transition-[color,box-shadow] outline-hidden 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 data-[placeholder]:text-muted-foreground data-[size=default]:h-11 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 pointer-hover:bg-muted [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,F.jsx)(ue,{asChild:!0,children:(0,F.jsx)(l,{className:`size-4 opacity-50`})})]})}function at({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,F.jsx)(me,{children:(0,F.jsxs)(he,{"data-slot":`select-content`,className:o(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,F.jsx)(st,{}),(0,F.jsx)(Oe,{className:o(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,F.jsx)(ct,{})]})})}function ot({className:e,children:t,...n}){return(0,F.jsxs)(Le,{"data-slot":`select-item`,className:o(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,F.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute end-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(Be,{children:(0,F.jsx)(c,{className:`size-4`})})}),(0,F.jsx)(Re,{children:t})]})}function st({className:e,...t}){return(0,F.jsx)(He,{"data-slot":`select-scroll-up-button`,className:o(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(s,{className:`size-4`})})}function ct({className:e,...t}){return(0,F.jsx)(We,{"data-slot":`select-scroll-down-button`,className:o(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(l,{className:`size-4`})})}export{rt as a,it as i,at as n,ot as r,nt as t};
|
|
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{a as i,n as a,o}from"./dist-CCX8mhHc.js";import{f as s,l as c,u as l}from"./design-icons-QbNMZniQ.js";import{a as u,c as d,d as f,f as p,h as m,i as h,l as g,m as _,n as v,o as y,p as b,r as x,t as S,u as C}from"./es2015-BHonSvOU.js";import{n as w,t as T}from"./dist-B2_vvox1.js";import{t as E}from"./dist-Czz3Y5qH.js";import{a as D,i as O,n as k,r as A,t as j}from"./dist-Du6flkGD.js";import{dr as ee}from"./index-C3kap2_j.js";var M=e(t(),1),N=e(n(),1);function P(e,[t,n]){return Math.min(n,Math.max(t,e))}var F=r(),I=[` `,`Enter`,`ArrowUp`,`ArrowDown`],L=[` `,`Enter`],R=`Select`,[z,B,V]=w(R),[H,U]=_(R,[V,D]),W=D(),[te,G]=H(R),[ne,re]=H(R),ie=`SelectProvider`;function K(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:p,required:m,form:h,internal_do_not_use_render:_}=e,v=W(t),[y,b]=M.useState(null),[x,S]=M.useState(null),[C,w]=M.useState(!1),E=T(l),[D,k]=f({prop:r,defaultProp:i??!1,onChange:a,caller:R}),[A,j]=f({prop:o,defaultProp:s,onChange:c,caller:R}),ee=M.useRef(null),N=M.useRef(A);M.useEffect(()=>{let e=h?y?.ownerDocument.getElementById(h):y?.form;if(e instanceof HTMLFormElement){let t=()=>j(N.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,y,j]);let P=!y||!!h||!!y.closest(`form`),[I,L]=M.useState(new Set),B=g(),V=Array.from(I).map(e=>e.props.value).join(`;`),H=M.useCallback(e=>{L(t=>new Set(t).add(e))},[]),U=M.useCallback(e=>{L(t=>{let n=new Set(t);return n.delete(e),n})},[]),G={required:m,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:B,value:A,onValueChange:j,open:D,onOpenChange:k,dir:E,triggerPointerDownPosRef:ee,disabled:p,name:u,autoComplete:d,form:h,nativeOptions:I,nativeSelectKey:V,isFormControl:P};return(0,F.jsx)(O,{...v,children:(0,F.jsx)(te,{scope:t,...G,children:(0,F.jsx)(z.Provider,{scope:t,children:(0,F.jsx)(ne,{scope:t,onNativeOptionAdd:H,onNativeOptionRemove:U,children:Qe(_)?_(G):n})})})})}K.displayName=ie;var q=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,F.jsx)(K,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,F.jsxs)(F.Fragment,{children:[n,e?(0,F.jsx)(Ze,{__scopeSelect:t}):null]})})};q.displayName=R;var ae=`SelectTrigger`,oe=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...a}=e,o=W(n),s=G(ae,n),c=s.disabled||r,l=i(t,s.onTriggerChange),u=B(n),d=M.useRef(`touch`),[f,p,h]=$e(e=>{let t=u().filter(e=>!e.disabled),n=et(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(j,{asChild:!0,...o,children:(0,F.jsx)(m.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(s.value)?``:void 0,...a,ref:l,onClick:b(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:b(a.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:b(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&I.includes(e.key)&&(g(),e.preventDefault())})})})});oe.displayName=ae;var se=`SelectValue`,ce=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,l=G(se,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=i(t,l.onValueNodeChange);p(()=>{u(d)},[u,d]);let h=$(l.value);return(0,F.jsx)(m.span,{...c,asChild:!h&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,F.jsx)(M.Fragment,{children:h?s:o},h?`placeholder`:`value`)})});ce.displayName=se;var le=`SelectIcon`,ue=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,F.jsx)(m.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ue.displayName=le;var de=`SelectPortal`,[fe,pe]=H(de,{forceMount:void 0}),me=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,F.jsx)(fe,{scope:e.__scopeSelect,forceMount:n,children:(0,F.jsx)(h,{asChild:!0,...r})})};me.displayName=de;var J=`SelectContent`,he=M.forwardRef((e,t)=>{let n=pe(J,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=G(J,e.__scopeSelect),[o,s]=M.useState();return p(()=>{s(new DocumentFragment)},[]),(0,F.jsx)(C,{present:r||a.open,children:({present:e})=>e?(0,F.jsx)(be,{...i,ref:t}):(0,F.jsx)(ge,{...i,fragment:o})})});he.displayName=J;var ge=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?N.createPortal((0,F.jsx)(_e,{scope:n,children:(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(`div`,{ref:t,children:r})})}),i):null});ge.displayName=`SelectContentFragment`;var Y=10,[_e,X]=H(J),ve=`SelectContentImpl`,ye=a(`SelectContent.RemoveScroll`),be=M.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:l,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:C,...w}=e,T=G(J,n),[E,D]=M.useState(null),[O,k]=M.useState(null),A=i(t,D),[j,ee]=M.useState(null),[N,P]=M.useState(null),I=B(n),[L,R]=M.useState(!1),z=M.useRef(!1);M.useEffect(()=>{if(E)return S(E)},[E]),x();let V=M.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[I,O]),H=M.useCallback(()=>V([j,E]),[V,j,E]);M.useEffect(()=>{L&&H()},[L,H]);let{onOpenChange:U,triggerPointerDownPosRef:W}=T;M.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||U(!1),document.removeEventListener(`pointermove`,t),W.current=null};return W.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,U,W]),M.useEffect(()=>{let e=()=>U(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[U]);let[te,ne]=$e(e=>{let t=I().filter(e=>!e.disabled),n=et(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),re=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(z.current=!0))},[T.value]),ie=M.useCallback(()=>E?.focus(),[E]),K=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(T.value!==void 0&&T.value===t||r)&&P(e)},[T.value]),q=r===`popper`?we:Se,ae=q===we?{side:c,sideOffset:l,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:C}:{};return(0,F.jsx)(_e,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:re,selectedItem:j,onItemLeave:ie,itemTextRefCallback:K,focusSelectedItem:H,selectedItemText:N,position:r,isPositioned:L,searchRef:te,children:(0,F.jsx)(v,{as:ye,allowPinchZoom:!0,children:(0,F.jsx)(u,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:b(a,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(y,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,F.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ae,onPlaced:()=>R(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:b(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});be.displayName=ve;var xe=`SelectItemAlignedPosition`,Se=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...a}=e,o=G(J,n),s=X(J,n),[c,l]=M.useState(null),[u,d]=M.useState(null),f=i(t,d),h=B(n),g=M.useRef(!1),_=M.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=M.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=P(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=P(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=h(),s=window.innerHeight-Y*2,l=v.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),m=parseInt(d.borderBottomWidth,10),_=parseInt(d.paddingBottom,10),x=f+p+l+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+m);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[h,o.trigger,o.valueNode,c,u,v,y,b,o.dir,r]);p(()=>S(),[S]);let[C,w]=M.useState();return p(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,F.jsx)(Te,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:M.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,F.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,F.jsx)(m.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});Se.displayName=xe;var Ce=`SelectPopperPosition`,we=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=W(n);return(0,F.jsx)(A,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});we.displayName=Ce;var[Te,Ee]=H(J,{}),De=`SelectViewport`,Oe=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...a}=e,o=X(De,n),s=Ee(De,n),c=i(t,o.onViewportChange),l=M.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,F.jsx)(z.Slot,{scope:n,children:(0,F.jsx)(m.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:b(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});Oe.displayName=De;var ke=`SelectGroup`,[Ae,je]=H(ke),Me=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=g();return(0,F.jsx)(Ae,{scope:n,id:i,children:(0,F.jsx)(m.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Me.displayName=ke;var Ne=`SelectLabel`,Pe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=je(Ne,n);return(0,F.jsx)(m.div,{id:i.id,...r,ref:t})});Pe.displayName=Ne;var Z=`SelectItem`,[Fe,Ie]=H(Z),Le=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...s}=e,c=G(Z,n),l=X(Z,n),u=c.value===r,[f,p]=M.useState(o??``),[h,_]=M.useState(!1),v=i(t,d(e=>l.itemRefCallback?.(e,r,a))),y=g(),x=M.useRef(`touch`),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};return(0,F.jsx)(Fe,{scope:n,value:r,disabled:a,textId:y,isSelected:u,onItemTextChange:M.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(z.ItemSlot,{scope:n,value:r,disabled:a,textValue:f,children:(0,F.jsx)(m.div,{role:`option`,"aria-labelledby":y,"data-highlighted":h?``:void 0,"aria-selected":u&&h,"data-state":u?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:v,onFocus:b(s.onFocus,()=>_(!0)),onBlur:b(s.onBlur,()=>_(!1)),onClick:b(s.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:b(s.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:b(s.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:b(s.onPointerMove,e=>{x.current=e.pointerType,a?l.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:b(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:b(s.onKeyDown,e=>{a||e.target!==e.currentTarget||l.searchRef?.current!==``&&e.key===` `||(L.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Le.displayName=Z;var Q=`SelectItemText`,Re=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,...o}=e,s=G(Q,n),c=X(Q,n),l=Ie(Q,n),u=re(Q,n),[f,h]=M.useState(null),g=d(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),_=i(t,h,l.onItemTextChange,g),v=f?.textContent,y=M.useMemo(()=>(0,F.jsx)(`option`,{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=u;return p(()=>(b(y),()=>x(y)),[b,x,y]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(m.span,{id:l.textId,...o,ref:_}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!$(s.value)?N.createPortal(o.children,s.valueNode):null]})});Re.displayName=Q;var ze=`SelectItemIndicator`,Be=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Ie(ze,n).isSelected?(0,F.jsx)(m.span,{"aria-hidden":!0,...r,ref:t}):null});Be.displayName=ze;var Ve=`SelectScrollUpButton`,He=M.forwardRef((e,t)=>{let n=X(Ve,e.__scopeSelect),r=Ee(Ve,e.__scopeSelect),[a,o]=M.useState(!1),s=i(t,r.onScrollButtonChange);return p(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,F.jsx)(Ge,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});He.displayName=Ve;var Ue=`SelectScrollDownButton`,We=M.forwardRef((e,t)=>{let n=X(Ue,e.__scopeSelect),r=Ee(Ue,e.__scopeSelect),[a,o]=M.useState(!1),s=i(t,r.onScrollButtonChange);return p(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,F.jsx)(Ge,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});We.displayName=Ue;var Ge=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=M.useRef(null),s=B(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),p(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,F.jsx)(m.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:b(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:b(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:b(i.onPointerLeave,()=>{c()})})}),Ke=`SelectSeparator`,qe=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,F.jsx)(m.div,{"aria-hidden":!0,...r,ref:t})});qe.displayName=Ke;var Je=`SelectArrow`,Ye=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n);return X(Je,n).position===`popper`?(0,F.jsx)(k,{...i,...r,ref:t}):null});Ye.displayName=Je;var Xe=`SelectBubbleInput`,Ze=M.forwardRef(({__scopeSelect:e,...t},n)=>{let r=G(Xe,e),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,h=M.useRef(null),g=i(n,h),_=a??``,v=E(_),y=Array.from(f).some(e=>(e.props.value??``)===``);return M.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,F.jsxs)(m.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...t,style:{...ee,...t.style},ref:g,defaultValue:_,children:[$(a)&&!y?(0,F.jsx)(`option`,{value:``}):null,Array.from(f)]},p)});Ze.displayName=Xe;function Qe(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function $e(e){let t=d(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function et(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=tt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function tt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function nt({...e}){return(0,F.jsx)(q,{"data-slot":`select`,...e})}function rt({...e}){return(0,F.jsx)(ce,{"data-slot":`select-value`,...e})}function it({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(oe,{"data-slot":`select-trigger`,"data-size":t,className:o(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-[var(--task-brand-bg)] px-3 py-2 text-sm whitespace-nowrap shadow-none transition-[color,box-shadow] outline-hidden 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 data-[placeholder]:text-muted-foreground data-[size=default]:h-11 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 pointer-hover:bg-muted [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,F.jsx)(ue,{asChild:!0,children:(0,F.jsx)(l,{className:`size-4 opacity-50`})})]})}function at({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,F.jsx)(me,{children:(0,F.jsxs)(he,{"data-slot":`select-content`,className:o(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,F.jsx)(st,{}),(0,F.jsx)(Oe,{className:o(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,F.jsx)(ct,{})]})})}function ot({className:e,children:t,...n}){return(0,F.jsxs)(Le,{"data-slot":`select-item`,className:o(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pe-8 ps-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,F.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute end-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(Be,{children:(0,F.jsx)(c,{className:`size-4`})})}),(0,F.jsx)(Re,{children:t})]})}function st({className:e,...t}){return(0,F.jsx)(He,{"data-slot":`select-scroll-up-button`,className:o(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(s,{className:`size-4`})})}function ct({className:e,...t}){return(0,F.jsx)(We,{"data-slot":`select-scroll-down-button`,className:o(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(l,{className:`size-4`})})}export{rt as a,it as i,at as n,ot as r,nt as t};
|
package/web/dist/assets/{session-context-section-F1umLA86.js → session-context-section-CW8DS0dW.js}
RENAMED
|
@@ -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{D as r,E as i,x as a}from"./queries-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{D as r,E as i,x as a}from"./queries-DD_9iITj.js";import{Cn as o}from"./project-scope-context-DNrHbqd2.js";import{o as s}from"./dist-CCX8mhHc.js";import{t as c}from"./plus-CxRU2X8C.js";import{t as l}from"./button-BV_AiLj2.js";import{t as u}from"./badge-DAnkqD7i.js";import{t as d}from"./centered-state-N8vWM_Hw.js";import{sr as f,yr as p}from"./index-C3kap2_j.js";import{t as m}from"./code-editor-DZMD1guX.js";import{r as h}from"./settings-save-bar-BiHFQ4c0.js";var g=e(t(),1);function _(e,t,n){let r=e.indexOf(t),i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};if(n===`Home`)return e[0];if(n===`End`)return e.at(-1);if(!(i[n]===void 0||r===-1))return e[(r+i[n]+e.length)%e.length]}var v=n(),y={"built-in":`built in`,parent:`parent`,worker:`worker`,both:`both`},b={"built-in":`built in`,shared:`shared`,local:`local`},x={applied:`border-success/40 text-success`,skipped:`border-conflict/50 text-conflict`,"not-for-role":`text-soft-foreground`},S=e=>`${e.toLocaleString(`en-US`)} B`;function ee({id:e,preview:t,role:n,onRole:r,pending:i,className:a}){return(0,v.jsxs)(`section`,{id:e,"data-slot":`session-context-preview`,"aria-labelledby":`session-context-preview-title`,"aria-busy":i,className:s(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,a),children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border p-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`h3`,{id:`session-context-preview-title`,className:`text-sm font-semibold`,children:`Combined preview`}),(0,v.jsx)(`span`,{className:`ml-auto text-[12px] text-soft-foreground`,children:`Updates as you type`})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,v.jsx)(`span`,{id:`session-context-role`,className:`text-[12px] text-soft-foreground`,children:`Preview as`}),(0,v.jsx)(te,{role:n,onRole:r}),(0,v.jsx)(`span`,{className:`text-[12px] text-soft-foreground`,children:`Handoff, shared, then local. Files come from the project checkout.`})]}),t?(0,v.jsx)(ne,{used:t.usedBytes,limit:t.limitBytes,blocks:t.blocks}):(0,v.jsx)(`div`,{className:`h-[38px]`})]}),(0,v.jsx)(`ul`,{"data-slot":`session-context-blocks`,className:`divide-y divide-border`,children:t?.blocks.map((e,t)=>(0,v.jsx)(w,{block:e,role:n},`${e.source}-${e.id}-${t}`))})]})}var C=[`parent`,`worker`];function te({role:e,onRole:t}){let n=(0,g.useRef)(new Map);return(0,v.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`session-context-role`,onKeyDown:r=>{let i=_(C,e,r.key);i!==void 0&&(r.preventDefault(),t(i),n.current.get(i)?.focus())},className:`inline-flex overflow-hidden rounded-md border border-[var(--control-border)]`,children:C.map(r=>(0,v.jsx)(`button`,{ref:e=>{e?n.current.set(r,e):n.current.delete(r)},type:`button`,role:`radio`,"aria-checked":e===r,tabIndex:e===r?0:-1,"data-slot":`session-context-role`,onClick:()=>t(r),className:s(`min-h-11 px-4 text-[13px] capitalize text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring`,e===r&&`bg-muted text-foreground`),children:r},r))})}function ne({used:e,limit:t,blocks:n}){let r=n.filter(e=>e.status===`applied`).length,i=n.filter(e=>e.status===`skipped`).length,a=Math.min(100,e/t*100);return(0,v.jsxs)(`div`,{"data-slot":`session-context-meter`,children:[(0,v.jsx)(`div`,{role:`meter`,"aria-label":`Session context size`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-valuetext":`${S(e)} of ${S(t)}`,className:`h-2 overflow-hidden rounded-full bg-muted`,children:(0,v.jsx)(`div`,{className:`h-full rounded-full bg-accent-strong`,style:{width:`${a}%`}})}),(0,v.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-3 text-[12px]`,children:[(0,v.jsxs)(`span`,{className:`text-muted-foreground`,children:[S(e),` used: `,r,` `,r===1?`block`:`blocks`,` applied`,i>0?`, ${i} skipped`:``]}),(0,v.jsxs)(`span`,{className:`ml-auto text-soft-foreground`,children:[`Limit 64 KiB (`,S(t),`)`]})]})]})}function w({block:e,role:t}){let n=e.status===`not-for-role`?`not for ${t}`:e.status,r=e.overridesShared?`local · overrides shared`:b[e.source],i=e.source===`built-in`||e.overridesShared,a=e.reason!==null&&!(e.status===`applied`&&e.overridesShared);return(0,v.jsxs)(`li`,{"data-slot":`session-context-block`,"data-status":e.status,"data-source":e.source,className:`flex flex-col gap-1.5 p-3`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(`code`,{className:`font-mono text-[12px] text-foreground`,children:e.id}),(0,v.jsx)(u,{"data-slot":`session-context-source`,variant:`outline`,className:s(`text-xs`,i&&`border-accent-strong/40 text-link-foreground`),children:r}),e.target&&e.target!==`built-in`&&(0,v.jsx)(u,{variant:`outline`,className:`text-xs`,children:y[e.target]}),(0,v.jsx)(`span`,{className:`ml-auto font-mono text-[12px] text-soft-foreground`,children:e.bytes===null?`—`:S(e.bytes)}),(0,v.jsx)(u,{variant:`outline`,className:s(`text-xs`,x[e.status]),children:n})]}),a&&(0,v.jsx)(`p`,{className:`text-[12px] text-conflict`,children:e.reason}),e.text!==null&&(0,v.jsxs)(`pre`,{tabIndex:0,"aria-label":`${e.id} text`,className:`max-h-28 overflow-auto rounded-md bg-background px-2.5 py-2 font-mono text-[12px] whitespace-pre-wrap text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring`,children:[e.text,e.truncated?`
|
|
2
2
|
…`:``]})]})}var re=Symbol.for(`yaml.alias`),ie=Symbol.for(`yaml.document`),T=Symbol.for(`yaml.map`),ae=Symbol.for(`yaml.pair`),E=Symbol.for(`yaml.scalar`),D=Symbol.for(`yaml.seq`),O=Symbol.for(`yaml.node.type`),k=e=>!!e&&typeof e==`object`&&e[O]===re,oe=e=>!!e&&typeof e==`object`&&e[O]===ie,A=e=>!!e&&typeof e==`object`&&e[O]===T,j=e=>!!e&&typeof e==`object`&&e[O]===ae,M=e=>!!e&&typeof e==`object`&&e[O]===E,se=e=>!!e&&typeof e==`object`&&e[O]===D;function N(e){if(e&&typeof e==`object`)switch(e[O]){case T:case D:return!0}return!1}function P(e){if(e&&typeof e==`object`)switch(e[O]){case re:case T:case E:case D:return!0}return!1}var ce=e=>(M(e)||N(e))&&!!e.anchor,F=Symbol(`break visit`),le=Symbol(`skip children`),I=Symbol(`remove node`);function ue(e,t){let n=me(t);oe(e)?de(null,e.contents,n,Object.freeze([e]))===I&&(e.contents=null):de(null,e,n,Object.freeze([]))}ue.BREAK=F,ue.SKIP=le,ue.REMOVE=I;function de(e,t,n,r){let i=he(e,t,n,r);if(P(i)||j(i))return ge(e,r,i),de(e,i,n,r);if(typeof i!=`symbol`){if(N(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=de(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===F)return F;else i===I&&(t.items.splice(e,1),--e)}}else if(j(t)){r=Object.freeze(r.concat(t));let e=de(`key`,t.key,n,r);if(e===F)return F;e===I&&(t.key=null);let i=de(`value`,t.value,n,r);if(i===F)return F;i===I&&(t.value=null)}}return i}async function fe(e,t){let n=me(t);oe(e)?await pe(null,e.contents,n,Object.freeze([e]))===I&&(e.contents=null):await pe(null,e,n,Object.freeze([]))}fe.BREAK=F,fe.SKIP=le,fe.REMOVE=I;async function pe(e,t,n,r){let i=await he(e,t,n,r);if(P(i)||j(i))return ge(e,r,i),pe(e,i,n,r);if(typeof i!=`symbol`){if(N(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await pe(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===F)return F;else i===I&&(t.items.splice(e,1),--e)}}else if(j(t)){r=Object.freeze(r.concat(t));let e=await pe(`key`,t.key,n,r);if(e===F)return F;e===I&&(t.key=null);let i=await pe(`value`,t.value,n,r);if(i===F)return F;i===I&&(t.value=null)}}return i}function me(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function he(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(A(t))return n.Map?.(e,t,r);if(se(t))return n.Seq?.(e,t,r);if(j(t))return n.Pair?.(e,t,r);if(M(t))return n.Scalar?.(e,t,r);if(k(t))return n.Alias?.(e,t,r)}function ge(e,t,n){let r=t[t.length-1];if(N(r))r.items[e]=n;else if(j(r))e===`key`?r.key=n:r.value=n;else if(oe(r))r.contents=n;else{let e=k(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var _e={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ve=e=>e.replace(/[!,[\]{}]/g,e=>_e[e]),L=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ve(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&P(e.contents)){let t={};ue(e.contents,(e,n)=>{P(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
3
3
|
`)}};L.defaultYaml={explicit:!1,version:`1.2`},L.defaultTags={"!!":`tag:yaml.org,2002:`};function ye(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function be(e){let t=new Set;return ue(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function xe(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Se(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=be(e);let a=xe(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(M(t.node)||N(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function R(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=R(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=R(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=R(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=R(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function z(e,t,n){if(Array.isArray(e))return e.map((e,t)=>z(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!ce(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Ce=class{constructor(e){Object.defineProperty(this,O,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!oe(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=z(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?R(i,{"":o},``,o):o}},we=class extends Ce{constructor(e){super(re),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ue(e,{Node:(e,t)=>{(k(t)||ce(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(z(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Te(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ye(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Te(e,t,n){if(k(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(N(t)){let r=0;for(let i of t.items){let t=Te(e,i,n);t>r&&(r=t)}return r}else if(j(t)){let r=Te(e,t.key,n),i=Te(e,t.value,n);return Math.max(r,i)}return 1}var Ee=e=>!e||typeof e!=`function`&&typeof e!=`object`,B=class extends Ce{constructor(e){super(E),this.value=e}toJSON(e,t){return t?.keep?this.value:z(this.value,e,t)}toString(){return String(this.value)}};B.BLOCK_FOLDED=`BLOCK_FOLDED`,B.BLOCK_LITERAL=`BLOCK_LITERAL`,B.PLAIN=`PLAIN`,B.QUOTE_DOUBLE=`QUOTE_DOUBLE`,B.QUOTE_SINGLE=`QUOTE_SINGLE`;var De=`tag:yaml.org,2002:`;function Oe(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function ke(e,t,n){if(oe(e)&&(e=e.contents),P(e))return e;if(j(e)){let t=n.schema[T].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new we(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=De+t.slice(2));let l=Oe(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new B(e);return c&&(c.node=t),t}l=e instanceof Map?o[T]:Symbol.iterator in Object(e)?o[D]:o[T]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new B(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Ae(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return ke(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var je=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Me=class extends Ce{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>P(t)||j(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(je(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(N(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ae(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(N(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&M(i)?i.value:i:N(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j(t))return!1;let n=t.value;return n==null||e&&M(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return N(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(N(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Ae(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ne=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function V(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var H=(e,t,n)=>e.endsWith(`
|
|
4
4
|
`)?V(n,t):n.includes(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,_r as i,an as a,bt as o,gt as s,mt as c}from"./queries-DD_9iITj.js";import{An as l,Bi as u,Ln as d,Zi as f,wn as p}from"./project-scope-context-DNrHbqd2.js";import{o as m}from"./dist-CCX8mhHc.js";import{ot as h,u as g}from"./design-icons-QbNMZniQ.js";import{t as _}from"./button-BV_AiLj2.js";import{a as v,i as y,o as b,r as x,s as S,t as C}from"./dialog-DKr-j9S6.js";import{lr as w}from"./index-C3kap2_j.js";var T=e(t(),1),E=n();function D(e,t){return c(t).flatMap(t=>{let n=e.filter(e=>e.provider===t.id);return n.length<2?[{runner:t,account:null,label:t.pickerLabel,desc:t.pickerDescription,missing:!1}]:n.map(e=>({runner:t,account:e.isDefault?null:e.id,label:`${t.pickerLabel} · ${e.label}`,desc:e.configDir?e.exists?e.configDir:`${e.configDir} — folder not created yet`:e.exists?``:`Not initialized on host yet`,missing:!e.exists,...e.isDefault||e.status===void 0?{}:{accountStatus:e.status.status}}))})}var O=(e,t)=>e.length>s(t).length;function k(e,t,n){let r=d(e.data,t),i=r!==void 0&&r.status!==`not-installed`&&(n??r.status)===`connected`,a=!e.isPending&&!e.isError&&r?.enabled===!0&&i;return{providerConnected:a,providerReason:e.isPending?`Checking provider authentication…`:e.isError?`Provider authentication could not be verified.`:r?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:a?void 0:`Connect this provider before selecting it.`}}function A({rows:e,runner:t,accountFor:n,providerStatus:r,disabled:i=!1,accountDisabled:a=!1,onPick:s}){let c=o().data,l=c===void 0,u=O(e,c);return(0,E.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default runner`,"data-slot":`agents-runner`,className:m(`gap-0.5 rounded-md border border-border bg-card p-0.5`,u?`flex max-w-md flex-col`:`inline-flex w-fit`),children:e.map(o=>{let{providerConnected:c,providerReason:d}=k(r,o.runner.id,o.accountStatus),f=e.filter(e=>e.runner.id===o.runner.id).length>1,p=o.runner.id===t&&o.account===n(o.runner.id);return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":p,"data-value":o.runner.id,"data-account":o.account??``,title:d??o.desc,disabled:i||l||!c||f&&a,onClick:()=>s(o.runner.id,o.account,f),className:m(`rounded-sm px-3 py-1.5 text-left font-mono text-[13px] font-medium transition-colors disabled:opacity-50`,p?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:[o.label,u?(0,E.jsx)(`span`,{"data-slot":o.missing?`agents-account-missing`:`agents-account-dir`,"data-runner":o.runner.id,className:`ml-2 font-sans text-xs text-soft-foreground`,children:o.desc}):null]},`${o.runner.id}:${o.account??``}`)})})}async function j(e,t){return l(await p.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return l(await p.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return l(await p.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return l(await p.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=f(),[r,o]=(0,T.useState)(!1),[s,c]=(0,T.useState)(null),[l,d]=(0,T.useState)(``),p=(0,T.useRef)(null),m=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=p.current;p.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),c(null),d(``),o(!1)};(0,T.useEffect)(()=>(m.current=!0,()=>{m.current=!1,h.current++;let e=p.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=i({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!m.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}p.current=e,c(e)}}),v=(0,T.useRef)(r);v.current=r;let y=u({queryKey:[`browser-sign-in`,s?.id],queryFn:()=>M(s.id),enabled:r&&s?.state===`waiting`,retry:!1,refetchInterval:e=>e.state.error||e.state.data?.state&&e.state.data.state!==`waiting`?!1:1e3,gcTime:0}),b=y.data??s,x=i({mutationFn:()=>N(s.id,l),retry:!1,onSuccess:()=>{d(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(p.current=b,c(b),Promise.all([n.invalidateQueries({queryKey:a.agentProfiles}),n.invalidateQueries({queryKey:a.providerStatus}),n.invalidateQueries({queryKey:a.models(e)})]))},[b,n,e]),{open:r,result:b,redirect:l,setRedirect:d,start:_,replay:x,status:y,error:_.error??x.error??y.error,close:g,connect:()=>{o(!0),v.current=!0,_.reset(),x.reset(),_.mutate(++h.current)}}}function I(){return`Open the sign-in link in your browser. After Google consent, the page shows a code. Copy that code, or the full address of that page, and paste it below.`}function L({provider:e,profileId:t,label:n}){let{open:i,result:a,redirect:o,setRedirect:s,start:c,replay:l,status:u,error:d,close:f,connect:p}=F(e,t);return r().data?.capabilities?.settingsAdmin===!0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(_,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:c.isPending,onClick:p,children:`Connect`}),(0,E.jsx)(C,{open:i,onOpenChange:e=>{e||f()},children:(0,E.jsxs)(x,{children:[(0,E.jsxs)(b,{children:[(0,E.jsxs)(S,{children:[`Sign in to `,n]}),(0,E.jsx)(y,{children:`Use a personal Google account. Business and agent-platform sign-in are not supported.`})]}),c.isPending?(0,E.jsx)(`p`,{role:`status`,children:`Preparing sign-in…`}):null,a?.state===`waiting`?(0,E.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,E.jsx)(`a`,{href:a.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-action underline`,children:`Open Google sign-in`}),(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(I,{})}),(0,E.jsxs)(`label`,{className:`grid gap-2`,children:[`Code or page address`,(0,E.jsx)(w,{type:`text`,autoComplete:`off`,spellCheck:!1,value:o,onChange:e=>s(e.target.value)})]}),(0,E.jsx)(_,{disabled:!o.trim()||l.isPending,onClick:()=>l.mutate(),children:`Complete sign-in`})]}):null,a?.state===`connected`?(0,E.jsx)(`p`,{role:`status`,children:`Connected.`}):null,a?.state===`failed`?(0,E.jsx)(`p`,{role:`alert`,children:a.error}):null,a?.state===`cancelled`?(0,E.jsx)(`p`,{role:`status`,children:`Sign-in cancelled. Close this window and Connect again.`}):null,d?(0,E.jsx)(`p`,{role:`alert`,children:d.message}):null,u.isError&&a?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void u.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:f,children:a?.state===`connected`?`Done`:`Cancel`})})]})})]}):null}function R(e){let t=e.label.startsWith(e.runner.pickerLabel)?e.label.slice(e.runner.pickerLabel.length):``;return{...e,label:`${e.runner.displayName}${t}`}}function z(e){let t=(0,T.useRef)(null),n=e.rows.map(R),r=n.find(t=>t.runner.id===e.runner&&t.account===e.accountFor(t.runner.id)),i=n.find(t=>t.runner.id===e.runner)?.runner.displayName;return(0,E.jsxs)(`details`,{ref:t,className:`settings-agent-picker`,children:[(0,E.jsxs)(`summary`,{children:[(0,E.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1`,children:r?.label??i??e.runner}),(0,E.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})]}),(0,E.jsx)(A,{...e,rows:n,onPick:(...n)=>{e.onPick(...n),t.current&&(t.current.open=!1)}})]})}export{k as a,O as i,L as n,D as r,z 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{h as r}from"./host-context-iTMFRMT5.js";import{t as i}from"./button-BV_AiLj2.js";import{wn as a}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{h as r}from"./host-context-iTMFRMT5.js";import{t as i}from"./button-BV_AiLj2.js";import{wn as a}from"./index-C3kap2_j.js";import{n as o}from"./save-cue-CpHgT93o.js";var s=e(t(),1),c=n(),l={dirty:0,invalid:0,busy:0},u=class{entries=new Map;listeners=new Set;snapshot=l;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.snapshot;set(e,t,n){this.entries.set(e,{...t,draft:n}),this.publish()}delete(e){this.entries.delete(e)&&this.publish()}dirtyDrafts(){return[...this.entries.values()].filter(e=>e.dirty).map(e=>e.draft.current)}publish(){let e=0,t=0,n=0;for(let r of this.entries.values())r.dirty&&(e+=1,r.invalid&&(t+=1),r.busy&&(n+=1));let{snapshot:r}=this;if(!(e===r.dirty&&t===r.invalid&&n===r.busy)){this.snapshot=e===0&&t===0&&n===0?l:{dirty:e,invalid:t,busy:n};for(let e of this.listeners)e()}}},d=(0,s.createContext)(null);function f(e){let t=(0,s.useContext)(d);if(!t)throw Error(`useSettingsDraft needs a SettingsDraftScope above it`);let n=(0,s.useId)(),r=(0,s.useRef)(e);(0,s.useLayoutEffect)(()=>{r.current=e});let i=e.dirty,o=e.invalid===!0,c=e.busy===!0;(0,s.useLayoutEffect)(()=>{t.set(n,{dirty:i,invalid:o,busy:c},r)},[t,n,i,o,c]),(0,s.useLayoutEffect)(()=>()=>t.delete(n),[t,n]),a(e.holdsReload??i)}function p({children:e}){let[t]=(0,s.useState)(()=>new u);return(0,c.jsxs)(d.Provider,{value:t,children:[e,(0,c.jsx)(h,{store:t})]})}function m(e){return e===1?`1 field`:`${e} fields`}function h({store:e}){let{dirty:t,invalid:n,busy:a}=(0,s.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),[l,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(0),{saved:p,flash:h}=o(),g=(0,s.useRef)(!0);(0,s.useLayoutEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]);let _=async()=>{u(!0),f(0);let t=r(),n=0;for(let i of e.dirtyDrafts()){if(!g.current||r()!==t)return;try{await i.save()}catch{n+=1}}g.current&&(u(!1),n>0?f(n):h())},v=()=>{f(0);for(let t of e.dirtyDrafts())t.discard()},y=l||a>0;if(t===0&&!y)return p?(0,c.jsx)(`div`,{"data-slot":`settings-save-bar`,"data-state":`saved`,className:`settings-save-bar`,children:(0,c.jsx)(`span`,{role:`status`,className:`settings-save-bar-message`,children:`Saved`})}):null;let b=`Unsaved changes`;return y?b=`Saving…`:n>0?b=`Unsaved changes — fix ${m(n)}`:d>0&&(b=`Unsaved changes — ${m(d)} did not save`),(0,c.jsxs)(`div`,{"data-slot":`settings-save-bar`,"data-state":y?`saving`:`dirty`,className:`settings-save-bar`,children:[(0,c.jsx)(`span`,{role:`status`,className:`settings-save-bar-message`,children:b}),(0,c.jsxs)(`span`,{className:`settings-save-bar-actions`,children:[(0,c.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,"data-action":`settings-discard`,disabled:y,onClick:v,children:`Discard`}),(0,c.jsx)(i,{type:`button`,variant:`primary`,size:`sm`,"data-action":`settings-save`,disabled:y||n>0,onClick:()=>void _(),children:`Save`})]})]})}function g(){return(0,c.jsx)(`button`,{type:`submit`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,"data-slot":`settings-implicit-submit`})}export{p as n,f as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,L as i,U as a,X as o,nt as s,rt as c}from"./queries-DD_9iITj.js";import{a as l,bi as u,gi as d,hi as f,mi as p,yi as m}from"./project-scope-context-DNrHbqd2.js";import{m as h,n as g,r as _}from"./chunk-KS7C4IRE-BdLLx37K.js";import{d as v,u as y}from"./design-icons-QbNMZniQ.js";import{t as b}from"./plus-CxRU2X8C.js";import{t as x}from"./button-BV_AiLj2.js";import{n as ee,r as te,t as ne}from"./collapsible-D5i3hm2L.js";import{t as S}from"./switch-B9OfOEzC.js";import{t as C}from"./badge-DAnkqD7i.js";import{n as w,s as T,t as E}from"./project-router-CfEuKuz1.js";import{o as D,u as re}from"./page-shell-BdjH5hyc.js";import{G as ie,Jn as O,ar as ae,bt as k,lr as A,vt as oe,wn as se,yt as j}from"./index-C3kap2_j.js";import{t as ce}from"./textarea-BGp28xFr.js";import{n as le}from"./save-cue-CpHgT93o.js";import{n as M}from"./settings-field-AyinSFR_.js";import{t as ue}from"./project-location-BczZtNyO.js";import{n as N,r as de,t as fe}from"./settings-save-bar-BiHFQ4c0.js";import{n as pe,t as me}from"./saved-draft-BwzBc-_Y.js";import{t as he}from"./archive-on-merge-field-C4hrO55O.js";import{a as ge,i as _e,n as P,t as F}from"./projects-section-C6DnyUa2.js";var I=e(t(),1),L={"needs-you":{label:`Needs you`,hint:`Asks a question, asks for permission, or waits for review`},failed:{label:`Failed`,hint:`Failed, with no scheduled resume`},done:{label:`Done`,hint:`Finished`},cancelled:{label:`Cancelled`,hint:`Was cancelled`},running:{label:`Running`,hint:`Runs an agent turn`},"waiting-workers":{label:`Waiting for agents`,hint:`Waits on its workers or their replies`},"waiting-ci":{label:`Waiting on CI`,hint:`Waits on a pull request's checks`},"waiting-timer":{label:`Waiting`,hint:`Waits on a timer`},"waiting-other":{label:`Any other wait`,hint:`Waits on anything else, including wait types added later`}},R=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),z={name:``,description:``,url:``,token:``,tasks:!0,triggers:m,agent:!1};function B(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??m,agent:e.agent}}var V=e=>u.filter(t=>e.includes(t));function ve(e){let t=e.description.trim();return{name:e.name.trim(),url:e.url.trim(),...t?{description:t}:{},...e.token?{token:e.token}:{},tasks:e.tasks,...R(e.triggers,m)?{}:{triggers:V(e.triggers)},agent:e.agent}}function ye(e){return e.name.trim()!==``||e.description.trim()!==``||e.url.trim()!==``||e.token!==``||e.tasks!==z.tasks||e.agent!==z.agent||!R(e.triggers,z.triggers)}function be(e,t){let n={},r=e.name.trim(),i=e.description.trim(),a=e.url.trim();return r!==t.name&&(n.name=r),i!==(t.description??``)&&(n.description=i),a!==t.url&&(n.url=a),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),R(e.triggers,t.triggers??m)||(n.triggers=V(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var H=n(),U=`flex flex-col gap-1 text-[13px]`,W=`text-xs text-muted-foreground`;function G({draft:e,onChange:t,tokenSet:n}){let r=(0,I.useId)(),i=(0,I.useId)(),a=(0,I.useId)(),o=(0,I.useId)(),s=(0,I.useId)(),c=(0,I.useId)(),l=(0,I.useId)(),m=(0,I.useId)(),h=(0,I.useId)(),g=(0,I.useId)();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,H.jsxs)(`div`,{className:U,children:[(0,H.jsx)(`label`,{htmlFor:r,className:W,children:`Name`}),(0,H.jsx)(A,{id:r,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,H.jsxs)(`div`,{className:U,children:[(0,H.jsx)(`label`,{htmlFor:o,className:W,children:`URL`}),(0,H.jsx)(A,{id:o,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:d,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,H.jsxs)(`div`,{className:U,children:[(0,H.jsx)(`label`,{htmlFor:i,className:W,children:`Description`}),(0,H.jsx)(ce,{id:i,"data-slot":`webhook-description`,"aria-describedby":a,rows:2,maxLength:p,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,H.jsx)(`span`,{id:a,className:`text-xs text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,H.jsxs)(`div`,{className:U,children:[(0,H.jsx)(`label`,{htmlFor:s,className:W,children:`Token`}),(0,H.jsx)(A,{id:s,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:f,"aria-describedby":c,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,H.jsx)(`span`,{id:c,className:`text-xs text-soft-foreground`,children:n?`The token is stored in ~/.cezar and never shown again. Leave it empty to keep it.`:`The token is stored in ~/.cezar, never in the repo. It is sent as a Bearer header.`})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,H.jsx)(S,{id:l,"aria-describedby":m,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,H.jsx)(`label`,{htmlFor:l,className:`font-medium`,children:`Task notifications`}),(0,H.jsx)(`span`,{id:m,className:`text-xs text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,H.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,H.jsx)(`legend`,{className:`pbe-1 text-xs text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,H.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:u.map(n=>(0,H.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,H.jsx)(`input`,{type:`checkbox`,"data-trigger":n,checked:e.triggers.includes(n),onChange:r=>t({triggers:r.target.checked?[...e.triggers,n]:e.triggers.filter(e=>e!==n)}),className:`mbs-0.5 size-[18px] shrink-0`}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:L[n].label}),(0,H.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:L[n].hint})]})]},n))}),(0,H.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,H.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,H.jsx)(S,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,H.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,H.jsx)(`span`,{id:g,className:`text-xs text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var K=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),xe=e=>e.dryRun?{tone:`ok`,text:`Dry run: nothing was sent.`}:e.ok?{tone:`ok`,text:`Delivered (HTTP ${e.status??200}).`}:{tone:`danger`,text:`Not delivered: ${e.error??`unknown error`}.`};function q({feedback:e}){return e?(0,H.jsx)(`p`,{"data-slot":e.tone===`alert`?`webhook-error`:`webhook-result`,role:e.tone===`alert`?`alert`:`status`,className:e.tone===`ok`?`text-[13px] text-muted-foreground`:`text-[13px] text-danger`,children:e.text}):null}var J=`rounded-md border border-border bg-background`,Y=`flex flex-col gap-3 border-bs border-border p-3`;function Se({projectId:e,webhook:t,defaultOpen:n=!1}){let i=s(),a=o(),c=r(),[u,d]=(0,I.useState)(n),[f,p]=pe(B(t),me),[m,h]=(0,I.useState)(null),g=be(f,t),_=Object.keys(g).length>0,v=f.name.trim()!==``&&f.url.trim()!==``,b=i.isPending||a.isPending||c.isPending,S={projectId:e,webhookId:t.id},w=()=>(h(null),i.mutateAsync({...S,...g},{onSuccess:()=>p(e=>({...e,token:``})),onError:e=>h(K(e,`Save`))}));de({dirty:_,invalid:!v,busy:b,save:w,discard:()=>p(B(t))});let T=()=>c.mutate(S,{onSuccess:e=>h(xe(e)),onError:e=>h({tone:`danger`,text:e.message})});return(0,H.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:J,children:(0,H.jsxs)(ne,{open:u,onOpenChange:d,children:[(0,H.jsx)(te,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,"data-action":`webhook-toggle`,className:`group flex min-h-11 w-full items-center gap-3 rounded-md p-3 text-start focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-foreground pointer-hover:bg-muted/50 active:bg-muted/50`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,H.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,H.jsx)(C,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,H.jsx)(C,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,H.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:ie(t.url)})]}),(0,H.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,H.jsx)(ee,{children:(0,H.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,className:Y,onSubmit:e=>{e.preventDefault(),h(null),v&&_&&!b&&w().catch(()=>{})},children:[(0,H.jsx)(G,{draft:f,tokenSet:t.tokenSet,onChange:e=>p(t=>({...t,...e}))}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(x,{type:`button`,size:`sm`,variant:`outline`,"data-action":`webhook-test`,disabled:b||!v,onClick:()=>{h(null),_?w().then(T,()=>{}):T()},children:`Send test`}),t.tokenSet?(0,H.jsx)(x,{type:`button`,size:`sm`,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>i.mutate({...S,token:``},{onSuccess:()=>l(`Webhook token cleared`),onError:e=>h({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,H.jsx)(x,{type:`button`,size:`sm`,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>a.mutate(S,{onSuccess:()=>l(`${t.name} removed`),onError:e=>h({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,H.jsx)(q,{feedback:m}),(0,H.jsx)(fe,{})]})})]})})}function Ce({projectId:e,onCreated:t,onCancel:n}){let r=i(),[a,o]=(0,I.useState)(z),[s,c]=(0,I.useState)(null),u=a.name.trim()!==``&&a.url.trim()!==``;return se(ye(a)),(0,H.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:J,children:[(0,H.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,H.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,"aria-label":`New webhook`,className:Y,onSubmit:n=>{n.preventDefault(),c(null),u&&r.mutate({projectId:e,...ve(a)},{onSuccess:({webhook:e})=>{l(`${e.name} created`),t(e)},onError:e=>c(K(e,`Create`))})},children:[(0,H.jsx)(G,{draft:a,tokenSet:!1,onChange:e=>o(t=>({...t,...e}))}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(x,{type:`submit`,size:`sm`,variant:`outline`,"data-action":`webhook-create`,disabled:r.isPending||!u,children:`Create`}),(0,H.jsx)(x,{type:`button`,size:`sm`,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,H.jsx)(q,{feedback:s})]})]})}function we({project:e}){let t=e.webhooks??[],[n,r]=(0,I.useState)(!1),[i,a]=(0,I.useState)(null),o=t.length>=16;return(0,H.jsx)(M,{wide:!0,title:`Webhooks`,hint:`A webhook gets a POST from Squawk. Tasks can send their status to it, and agents can send it reports.`,children:(0,H.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,H.jsx)(`p`,{"data-slot":`webhooks-empty`,className:`text-[13px] text-soft-foreground`,children:`No webhooks yet. Add one to send task updates to a bot, or to let agents post reports.`}):null,t.length>0||n?(0,H.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,H.jsx)(Se,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,H.jsx)(Ce,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,H.jsx)(b,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,H.jsxs)(`span`,{className:`text-xs text-soft-foreground`,children:[`A project holds at most `,16,` webhooks.`]}):null]})]})})}function X(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}function Te(){let e=T(),t=a(),n=c(),r=O(),i=le();if(t.isPending)return(0,H.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,H.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let o=t.data,s=o?.projects.find(t=>t.id===e);return!o||!s?null:(0,H.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,H.jsxs)(`section`,{className:`flex flex-col gap-5 rounded-lg border border-border bg-card p-5 [&_select]:min-h-11 [&_select]:w-full`,children:[(0,H.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,H.jsx)(ue,{}),(0,H.jsx)(Z,{project:s}),(0,H.jsx)(M,{title:`Max parallel tasks`,saved:i.saved,hint:n.data?`The workspace limit (${n.data.resources.maxParallel}) still applies as an overall ceiling.`:`How many of this project's tasks may run at once. The workspace limit still applies as an overall ceiling.`,children:n.data?(0,H.jsx)(F,{project:s,workspaceMax:n.data.resources.maxParallel,onSaved:i.flash}):(0,H.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),r===`absent`?null:(0,H.jsx)(we,{project:s},s.id)]}),(0,H.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,H.jsx)(Ee,{project:s,projects:o.projects,bootProject:o.bootProject})})]})}function Z({project:e}){return(0,H.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Project`}),(0,H.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Branch`}),(0,H.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,H.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[P[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Added`}),(0,H.jsxs)(`dd`,{className:`mt-1`,children:[X(e.addedAt),(0,H.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last opened`}),(0,H.jsx)(`dd`,{className:`mt-1`,children:X(e.lastOpenedAt)})]})]})}function Ee({project:e,projects:t,bootProject:n}){let[r,i]=(0,I.useState)(null),a=ge(),o=h(),s=n!==null&&e.id===n,c=n??t.find(t=>t.id!==e.id&&t.status!==`missing`)?.id??t.find(t=>t.id!==e.id)?.id??null;return(0,H.jsxs)(M,{title:`Remove from workspace`,hint:`Unregisters this project so it leaves the sidebar and the project list. Nothing on disk is deleted — the folder, its git history and its task history all stay, and opening it again re-registers it.`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,"data-action":`project-general-remove`,"aria-label":`Remove ${e.name} from the workspace — unregisters it, no files are deleted`,title:s?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:s||a.isPending,onClick:()=>i(e),className:`text-danger`,children:[`Remove `,e.name]}),s?(0,H.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-xs text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,H.jsx)(_e,{project:r,onOpenChange:e=>!e&&i(null),onConfirm:()=>{i(null),a.confirm(e,()=>void o(c===null?`/`:`/p/${encodeURIComponent(c)}`))}})]})}function De(e){return e===`global`?{Link:g,NavLink:_}:{Link:E,NavLink:w}}function Q({scope:e,title:t,mobileTitle:n,description:r}){let i=ae().name,a=e===`global`?`every project`:i??`this project`;return{headerSlot:`settings-main-header`,title:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`md:hidden`,children:n}),(0,H.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` `,(0,H.jsxs)(`span`,{"data-slot":`page-header-scope`,className:`font-normal text-soft-foreground`,children:[`· `,a]})]})]}),subtitle:r,hideSubtitleOnMobile:!0,headerExtra:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"data-slot":`settings-mobile-scope`,className:`mt-1 text-[13px] text-muted-foreground md:hidden`,children:e===`global`?`Applies to every project`:a}),e===`global`?(0,H.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}}function $({scope:e,activeId:t}){let{NavLink:n}=De(e),r=k(e);return(0,H.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,H.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,H.jsx)(y,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,H.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,H.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,H.jsx)(n,{to:j(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function Oe({section:e,scope:t}){let n=e.component,r=T(),i=Q({scope:t,title:e.title,description:e.description,mobileTitle:t===`global`?`Global settings`:`Project settings`});return(0,H.jsx)(e.id===`agent-config`?re:D,{route:t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,density:`full`,className:`settings-route`,header:i,children:(0,H.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,H.jsxs)(`div`,{"data-slot":`settings-mobile-section`,className:`flex flex-col gap-2 md:hidden`,children:[(0,H.jsx)($,{scope:t,activeId:e.id}),e.description?(0,H.jsx)(`p`,{"data-slot":`settings-mobile-section-subtitle`,className:`px-1 text-[13px] leading-normal text-muted-foreground`,children:e.description}):null]}),(0,H.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,H.jsx)(`h2`,{className:`settings-panel-title sr-only`,children:e.title}),(0,H.jsx)(N,{children:(0,H.jsx)(n,{})},`${r??``}:${e.id}`)]})]})})}function ke(){let e=Q({scope:`project`,title:`General`,mobileTitle:`Project settings`}),t=T();return(0,H.jsx)(D,{route:`settings`,density:`full`,className:`settings-route`,header:e,children:(0,H.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,H.jsx)($,{scope:`project`,activeId:null}),(0,H.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:(0,H.jsxs)(N,{children:[(0,H.jsx)(Te,{}),(0,H.jsx)(`section`,{className:`rounded-lg border border-card-edge bg-card p-5 shadow-card`,children:(0,H.jsx)(he,{})}),(0,H.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-card-edge bg-card px-5 pt-5 text-base font-semibold shadow-card md:hidden`,children:`Other project settings`}),(0,H.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:k(`project`).map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(E,{to:j(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-card-edge bg-card p-4 shadow-card transition-colors hover:bg-card-2`,children:[(0,H.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,H.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,H.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]}),(0,H.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,H.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, preferences, host resources and the project registry live in`,` `,(0,H.jsx)(g,{to:oe,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]},t??``)})]})})}export{ke as SettingsIndexRoute,Oe as SettingsSectionRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{_r as r,v as i}from"./queries-DD_9iITj.js";import{h as a}from"./host-context-iTMFRMT5.js";import{R as o,Xn as s,Zi as c,Zn as l}from"./project-scope-context-DNrHbqd2.js";import{t as u}from"./button-BV_AiLj2.js";import{r as d,t as f}from"./settings-save-bar-BiHFQ4c0.js";var p=e(t(),1),m=n(),h=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function g(){let e=a(),t=i(e);return t.isPending?(0,m.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,m.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,m.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,m.jsx)(u,{onClick:()=>void t.refetch(),children:`Retry`})]}):(0,m.jsx)(_,{scope:e,initial:t.data.sidebarLimits??{}},e)}function _({scope:e,initial:t}){let n=c(),i=s(void 0),a=v(t),[u,g]=(0,p.useState)(()=>({values:a,saved:a,received:a})),{values:_,saved:b}=u,x=e=>g(t=>({...t,values:e})),S=l.safeParse(Object.fromEntries(h.map(([e])=>[e,_[e]===null?null:Number(_[e])]))),C=e=>_[e]!==null&&(_[e].trim()===``||!Number.isSafeInteger(Number(_[e]))||Number(_[e])<=0),w=h.some(([e])=>_[e]!==b[e]),T=!S.success||h.some(([e])=>C(e)),E=r({onMutate:()=>n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),mutationFn:t=>o({sidebarLimits:t},e),onSuccess:async t=>{await n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),n.setQueryData([e,`ui-state`],t);let r=v(t.sidebarLimits);g({values:r,saved:r,received:r})}}),D=()=>S.success?E.mutateAsync(S.data):Promise.reject(Error(`invalid sidebar limits`));return d({dirty:w,invalid:T,busy:E.isPending,save:D,discard:()=>g(e=>({...e,values:e.saved}))}),!E.isPending&&!y(u.received,a)&&g({values:w?_:a,saved:a,received:a}),(0,m.jsxs)(`form`,{"data-slot":`sidebar-settings`,"data-reports-dirty":``,className:`flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6`,onSubmit:e=>{e.preventDefault(),w&&!T&&!E.isPending&&D().catch(()=>{})},children:[(0,m.jsx)(`p`,{id:`sidebar-limits-help`,className:`text-sm text-muted-foreground`,children:`Limits apply to this project on desktop and mobile. The overall budget is shared in section order: Needs You, Finished, then Working. Each section also respects its own limit. Unlimited removes only that constraint.`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pinned tasks and groups containing a pin bypass both limits. A task group counts as one row. Archived uses only the overall limit; archived pins are not exempt.`}),h.map(([e,t])=>(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:_[e]??``,disabled:_[e]===null||E.isPending,"aria-invalid":C(e),"aria-describedby":C(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>x({..._,[e]:t.target.value}),className:`min-h-[44px] w-28 rounded-md border border-input bg-card px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`}),(0,m.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,m.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:_[e]===null,disabled:E.isPending,onChange:t=>x({..._,[e]:t.target.checked?null:String(i[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),C(e)&&(0,m.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),E.isError&&(0,m.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,E.error.message]}),(0,m.jsx)(f,{})]})}function v(e){let t=s(e);return Object.fromEntries(h.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function y(e,t){return h.every(([n])=>e[n]===t[n])}export{g as SidebarSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{bt as r,dt as i,g as a,in as o,yt as s}from"./queries-DD_9iITj.js";import{E as c,Zi as l,a as u}from"./project-scope-context-DNrHbqd2.js";import{_ as d}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as f}from"./dist-CCX8mhHc.js";import{E as p,Q as m,Z as h,ct as g,d as _,k as v,rt as y,u as b,ut as x}from"./design-icons-QbNMZniQ.js";import{t as S}from"./button-BV_AiLj2.js";import{t as C}from"./project-router-CfEuKuz1.js";import{c as w,d as T,f as E,n as D,t as O}from"./page-shell-BdjH5hyc.js";import{f as k,l as A}from"./skills-pM_PouEs.js";import{i as j}from"./agent-accounts-Du8CHfFX.js";import{Yn as M,lr as N,q as P}from"./index-C3kap2_j.js";import{t as F}from"./option-select-BxTmKg8G.js";var I=e(t(),1),L=n(),R=e=>e.split(`@`)[0]||e,z={project:0,user:1,plugin:2,system:3,other:4},B={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function V(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:R(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:B[t],kind:t}}function H(e){let t=new Map;for(let n of e){let e=V(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>z[e.kind]-z[t.kind]||e.label.localeCompare(t.label))}function U(e){let t=e.plugin?`${R(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var W={project:p,user:x,plugin:v,system:v,other:v};function G({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,I.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,L.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,L.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,L.jsx)(K,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,L.jsx)(q,{skill:e,open:e.id===t,runner:r,account:i},k(e))):null]},e.key)})})}function K({group:e,open:t,onToggle:n}){let r=W[e.kind];return(0,L.jsx)(`h2`,{className:`m-0`,children:(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,L.jsx)(_,{"aria-hidden":`true`,className:f(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,L.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,L.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function q({skill:e,open:t,runner:n,account:r}){let i=M({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,L.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,L.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 py-2 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover [&::-webkit-details-marker]:hidden`,children:[(0,L.jsxs)(`span`,{className:`grid min-w-0 flex-1 grid-cols-1 items-center gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)]`,children:[(0,L.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:U(e)}),e.description?(0,L.jsx)(`span`,{className:`min-w-0 line-clamp-2 text-[13px] leading-snug text-muted-foreground [overflow-wrap:anywhere] group-open/skill:hidden`,title:e.description,children:e.description}):null]}),(0,L.jsx)(b,{"data-slot":`skill-row-cue`,"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/skill:rotate-180 motion-reduce:transition-none`})]}),(0,L.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,L.jsx)(P,{skill:e,heading:null,actions:(0,L.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,L.jsx)(C,{to:i,children:`Start task`})})})})]})}function J(){let e=a(),[t,n]=(0,I.useState)(null),[r,o]=(0,I.useState)(null),[c,l]=(0,I.useState)(``),[u]=d(),p=t??e.data?.defaultRunner,{runner:g}=s(p??`claude`),_=r?.runner===g?r.id:null,v=e=>o(e===null?null:{runner:g,id:e}),y=i(p,_),b=$(g,y.account),x=y.data??[],O=A(x,c);return(0,L.jsxs)(T,{route:`skills`,density:y.isPending?`full`:E(O.length),className:`max-md:[padding-block-end:5rem]`,bodyClassName:`gap-5`,header:{title:`Skills`,subtitle:`The skills each agent loads in this project, as its runner reports them.`,secondaryActions:(0,L.jsxs)(w,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,L.jsx)(h,{"aria-hidden":`true`,className:f(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&O.length>0?(0,L.jsx)(D,{summary:`${O.length} ${O.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,L.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,children:(0,L.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(X,{runner:g,onChange:e=>{n(e),v(null)}}),(0,L.jsx)(Z,{runner:g,account:_,onChange:v}),(0,L.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${x.length} ${x.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null})]}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(N,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:c,onChange:e=>l(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,L.jsx)(Q,{query:y}),y.isPending?(0,L.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,L.jsx)(Y,{skills:x,matches:O,search:c,onClearSearch:()=>l(``),onRefresh:()=>void b.run(),openId:u.get(`skill`),runner:g,account:y.account??null,unchecked:y.unchecked})]})}function Y({skills:e,matches:t,search:n,onClearSearch:r,onRefresh:i,openId:a,runner:o,account:s,unchecked:c}){return e.length===0?c?null:(0,L.jsx)(O,{icon:(0,L.jsx)(y,{}),title:`No skills reported by this runner and account.`,description:`Add a skill to this repository or your runner home, then re-read to refresh the inventory.`,actions:(0,L.jsx)(S,{variant:`outline`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,L.jsx)(O,{icon:(0,L.jsx)(m,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,L.jsx)(S,{variant:`outline`,onClick:r,children:`Clear filter`})}):(0,L.jsx)(G,{groups:H(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function X({runner:e,onChange:t}){let n=r().data;return n?(0,L.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-1 overflow-x-auto rounded-lg border border-border bg-muted/60 p-1`,children:n.runners.map(n=>(0,L.jsx)(`button`,{type:`button`,"aria-pressed":n.id===e,onClick:()=>t(n.id),className:`h-8 shrink-0 rounded-md border border-transparent px-3 text-[13px] font-normal text-muted-foreground transition-colors focus-visible:outline-2 aria-pressed:border-border aria-pressed:bg-card aria-pressed:font-semibold aria-pressed:text-foreground aria-pressed:shadow-xs pointer-hover:text-foreground max-md:h-11`,children:n.displayName},n.id))}):null}function Z({runner:e,account:t,onChange:n}){let r=j().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,L.jsx)(F,{"aria-label":`Account`,value:t??``,onValueChange:e=>n(e||null),options:[{value:``,label:`Account: project default`},...r.map(e=>({value:e.id,label:e.label}))],className:`rounded-lg border-border bg-card text-[13px] text-foreground md:data-[size=default]:h-[38px]`})}function Q({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,L.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,L.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,L.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function $(e,t){let n=l(),[r,i]=(0,I.useState)(!1),a=o.runnerSkills(e,t);return{running:r,run:async()=>{i(!0);try{n.setQueryData(a,await c(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:a.slice(0,3)})}catch(e){u(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{i(!1)}}}}export{J as SkillsRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{yr as n}from"./project-scope-context-DNrHbqd2.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./bot-TkDIw4y-.js";import{r as a}from"./button-BV_AiLj2.js";e();var o=t(),s=a(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function c({className:e,tone:t=`neutral`,shape:a=`filled`,pulse:c=!1,...l}){let u=n(),d=!!c&&!u;return(0,o.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":a,"data-pulse":d?`true`:void 0,className:r(s({tone:t,shape:a,pulse:d,className:e})),...l,children:a===`workers`?(0,o.jsx)(i,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{c as t,o as n}from"./dist-CCX8mhHc.js";import{t as r}from"./project-router-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{c as t,o as n}from"./dist-CCX8mhHc.js";import{t as r}from"./project-router-CfEuKuz1.js";var i=e();function a({to:e,active:a=!1,onClick:o,count:s,replace:c,className:l,children:u}){return(0,i.jsxs)(r,{to:e,...t({replace:c}),"aria-current":a?`page`:void 0,onClick:o,className:n(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,a?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,l),children:[u,s===void 0?null:(0,i.jsx)(`span`,{"data-slot":`tab-count`,className:`ml-1.5 text-xs font-normal text-soft-foreground`,children:s})]})}export{a as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{B as r,Ht as i,Pn as a,S as o,Un as s,Ut as c,_r as l,in as u}from"./queries-DD_9iITj.js";import{Ai as d,Bt as f,Cn as p,Gt as m,Ot as h,Rt as g,Ut as _,Zi as v,a as y,st as b,ut as ee}from"./project-scope-context-DNrHbqd2.js";import{g as x}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as S}from"./dist-CCX8mhHc.js";import{M as C,u as w,w as T}from"./design-icons-QbNMZniQ.js";import{t as te}from"./run-header-DxpN6yVQ.js";import{i as E,n as ne,r as D}from"./git-toolbar-CoKBTzNV.js";import{t as O}from"./button-BV_AiLj2.js";import{a as k,i as A,o as j,r as M,s as N,t as P}from"./dialog-DKr-j9S6.js";import{f as re,l as ie,m as ae}from"./page-shell-BdjH5hyc.js";import{t as F}from"./centered-state-N8vWM_Hw.js";import{D as oe,E as se,Vn as ce,gn as I,rt as L}from"./index-C3kap2_j.js";import{t as R}from"./textarea-BGp28xFr.js";import{t as z}from"./markdown-BBDDg-4t.js";import{n as B,t as V}from"./review-notes-drafts-C7HCRebB.js";import{t as H}from"./diff-BOF9OXhn.js";import{t as U}from"./code-workbench-B0GIezrD.js";import{t as W}from"./file-text-nGpo7MVd.js";import{i as le,n as G,r as ue}from"./selected-file-CfBWFB6p.js";var K=e(t(),1),q=`no worktree — this task ran directly in the repo working tree`;function J(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.run.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${q}`)}function Y(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.run.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${q}`)}function de(e){let t=e=>({id:`create-pr`,label:`Draft PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Draft PR unavailable — ${q}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?d(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):s(e.run)?t(`Draft PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Draft PR`,enabled:!0}:t(`Draft PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function fe(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:J(e),n=e.prUrl?[J(e),Y(e)]:[Y(e),de(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?s(e.run)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,primaryVariant:e.run.status===`review`?`outline`:`primary`,secondary:n,menu:r}}function pe(e,t){let[n=``,...r]=t.trim().split(`
|
|
2
|
+
`),i=[n,...r.map(e=>e.trim()===``?``:` ${e.trimEnd()}`)].join(`
|
|
3
|
+
`);return`- \`${me(e)}\` — ${i}`}function me({path:e,side:t,line:n}){let r=typeof n==`number`||n.start===n.end?String(typeof n==`number`?n:n.start):`${n.start}-${n.end}`;return t===`old`?`${e} (old ${r})`:`${e}:${r}`}function he(e,t,n){let r=V(e).notes;B(e,{open:!0,notes:`${r}${r===``||r.endsWith(`
|
|
4
|
+
`)?``:`
|
|
5
|
+
`}${pe(t,n)}`})}var X=n();function Z({run:e,open:t,onOpenChange:n}){let r=v(),[i,o]=(0,K.useState)(``),s=a(e),c=(0,K.useRef)(s);c.current=s,(0,K.useEffect)(()=>{t&&o(c.current)},[t]);let d=l({mutationFn:t=>b(e.id,t),onSuccess:t=>{y(`Committed ${ce(t.sha)}`),n(!1),r.invalidateQueries({queryKey:u.runs.changes(e.id)}),r.invalidateQueries({queryKey:u.runs.all})},onError:e=>y(e.message,{tone:`danger`})}),f=()=>{let e=i.trim();e.length===0||d.isPending||d.mutate(e)};return(0,X.jsx)(P,{open:t,onOpenChange:n,children:(0,X.jsxs)(M,{"data-slot":`commit-dialog`,children:[(0,X.jsxs)(j,{children:[(0,X.jsx)(N,{children:`Commit changes`}),(0,X.jsxs)(A,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,X.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,X.jsx)(R,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{L(e)&&(e.preventDefault(),f())}}),(0,X.jsxs)(k,{children:[(0,X.jsx)(O,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,X.jsx)(O,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||d.isPending,onClick:f,children:d.isPending?`Committing…`:`Commit`})]})]})})}function ge(){let{id:e}=x(),t=i(e);return t.isPending?(0,X.jsx)(oe,{tab:`changes`}):t.isError?(0,X.jsx)(se,{tab:`changes`,error:t.error}):(0,X.jsx)(_e,{run:t.data},t.data.id)}function _e({run:e}){let t=r(),n=o(),i=c(e.id,s(e)),a=ae(),[d,m]=(0,K.useState)(`unified`),[h,g]=(0,K.useState)(!0),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=v(),T=()=>w.invalidateQueries({queryKey:u.runs.all}),E=e=>y(e.message,{tone:`danger`}),D=l({mutationFn:()=>_(e.id),onSuccess:e=>y(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:E}),O=l({mutationFn:()=>ee(e.id),onSuccess:e=>{y(`Draft PR created — ${e.url}`),T()},onError:E}),k=l({mutationFn:()=>f(e.id),onError:e=>{if(e instanceof p&&e.command){navigator.clipboard.writeText(e.command).then(()=>y(`No terminal found — command copied to clipboard.`)).catch(()=>y(`Run manually: ${e.command}`));return}E(e)}}),A=$(i),j=fe({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!A,branch:e.branch,changedFiles:i.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:I(e)!==void 0,prUrl:e.pullRequestUrl}),M=e=>{switch(e){case`commit`:C(!0);break;case`push`:D.mutate();break;case`create-pr`:O.mutate();break;case`open-terminal`:k.mutate();break;case`view-pr`:break}},N=i.data?.files??[],P=(0,K.useMemo)(()=>N.some(z),[N]),F=a?d:`unified`;return(0,X.jsxs)(ie,{route:`task-changes`,density:re(N.length),flushPadding:!0,children:[(0,X.jsx)(te,{run:e,tab:`changes`}),(0,X.jsx)(ne,{bar:j,healthReady:t.data!==void 0,branch:e.branch,stat:i.data?.stat,mode:F,wrap:h,preview:b,onModeChange:m,onWrapChange:g,onPreviewChange:P?x:void 0,onAction:M}),(0,X.jsx)(Q,{run:e,mode:F,wrap:h,preview:b}),(0,X.jsx)(Z,{run:e,open:S,onOpenChange:C})]})}function Q({run:e,mode:t=`unified`,wrap:n=!0,preview:i=!1,revealRef:a}){let o=r(),u=c(e.id,s(e)),d=l({mutationFn:t=>g(e.id,t),onError:e=>y(e.message,{tone:`danger`})}),f=$(u),p=u.data?.files??[],m=(0,K.useMemo)(()=>D(p),[p]),h=le(e.id),_=ue(e.id,`changes`,u.data?.files);return(0,K.useEffect)(()=>{if(a)return a.current=t=>p.some(e=>e.path===t)?(G(e.id,t),_.reveal(t),!0):!1,()=>{a.current=null}},[a,p,e.id,_]),(0,X.jsxs)(X.Fragment,{children:[u.data?.repointedHead?(0,X.jsxs)(`p`,{"data-slot":`repointed-head-note`,className:`border-b px-4 py-2 text-xs text-soft-foreground md:px-9`,children:[`HEAD is on `,(0,X.jsx)(`code`,{children:u.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,X.jsx)(`code`,{children:u.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,X.jsx)(ve,{changes:u,changesRefused:f,fileCount:p.length,children:(0,X.jsx)(ye,{runId:e.id,files:p,tree:m,selected:h,selectFile:t=>{G(e.id,t),_.reveal(t)},diffRef:_,effectiveMode:t,effectiveWrap:n,preview:i,localHandoff:o.data?.capabilities.localHandoff,onOpenInApp:d.mutate,onNote:e.status===`review`?(t,n)=>he(e.id,t,n):void 0})})]})}function $(e){return e.isError&&e.error instanceof p&&e.error.status===409}function ve({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,X.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading changes…`}):e.isError?(0,X.jsx)(F,{icon:t?(0,X.jsx)(T,{size:16}):(0,X.jsx)(C,{size:16}),tone:t?`neutral`:`danger`,heading:`h2`,title:t?`No changes to show`:`Could not load the changes`,subtitle:e.error.message}):n===0?(0,X.jsx)(F,{icon:(0,X.jsx)(T,{size:16}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):r}function ye({runId:e,files:t,tree:n,selected:r,selectFile:i,diffRef:a,effectiveMode:o,effectiveWrap:s,preview:c,localHandoff:l,onOpenInApp:u,onNote:d}){let[f,p]=(0,K.useState)(!1);return(0,X.jsx)(U,{className:`px-4 pb-9 pt-0 [--diff-sticky-top:0px] md:px-9`,treeSlot:`changes-tree-pane`,treeClassName:`rounded-xl border border-border bg-card md:sticky md:top-4 md:max-h-[calc(100dvh_-_64px_-_2rem)] md:overflow-y-auto md:overscroll-contain md:p-3.5`,tree:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"data-slot":`changes-tree-toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),className:`flex min-h-11 w-full items-center justify-between gap-2 px-3.5 py-2 text-left text-xs font-semibold text-foreground md:hidden`,children:[(0,X.jsxs)(`span`,{children:[`Changed files`,` `,(0,X.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,X.jsx)(w,{size:16,"aria-hidden":`true`,className:S(`size-4 shrink-0 text-muted-foreground motion-safe:transition-transform`,f&&`rotate-180`)})]}),(0,X.jsx)(`h2`,{className:`mb-3 hidden border-b border-border pb-3 text-xs font-semibold md:block`,children:`Changed files`}),(0,X.jsx)(`div`,{className:S(f?`border-t border-border px-3.5 py-3 md:border-t-0 md:p-0`:`hidden md:block`),children:(0,X.jsx)(E,{root:n,selected:r,onSelect:e=>{i(e),p(!1)}})})]}),children:(0,X.jsx)(H,{files:t,viewRef:a,mode:o,wrap:s,preview:c,loadFileText:t=>W(()=>h(e,t)),imageSrc:t=>m(e,t),onOpenInApp:l?e=>u(e):void 0,onNote:d,totals:!1,className:`min-w-0 flex-1`})})}export{Q as ChangesPane,ge as TaskChangesRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Gt as t,Ht as n,Un as r,Wt as i,in as a,vr as o}from"./queries-DD_9iITj.js";import{Cn as s,Tt as c,wt as l}from"./project-scope-context-DNrHbqd2.js";import{g as u}from"./chunk-KS7C4IRE-BdLLx37K.js";import{C as d,M as f}from"./design-icons-QbNMZniQ.js";import{t as p}from"./run-header-DxpN6yVQ.js";import{t as m}from"./project-router-CfEuKuz1.js";import{f as h,l as g,m as _}from"./page-shell-BdjH5hyc.js";import{t as v}from"./centered-state-N8vWM_Hw.js";import{Bn as y,D as b,E as x}from"./index-C3kap2_j.js";import{t as S}from"./change-counts-BLLRvt46.js";import{t as C}from"./code-workbench-B0GIezrD.js";import{t as w}from"./file-text-nGpo7MVd.js";import{i as T,r as E,t as D}from"./commit-list-Jr1_04RS.js";import{i as O,n as k,r as A}from"./selected-file-CfBWFB6p.js";var j=e();function M(){let{id:e}=u(),t=n(e);return t.isPending?(0,j.jsx)(b,{tab:`changes`}):t.isError?(0,j.jsx)(x,{tab:`changes`,error:t.error}):(0,j.jsx)(N,{run:t.data})}function N({run:e}){let{sha:n}=u(),i=t(e.id,r(e)),a=_(),o=n??i.data?.commits[0]?.sha,c=n!==void 0&&(!a||i.isError||i.data?.commits.length===0);return(0,j.jsxs)(g,{route:`task-commits`,density:h(i.data?.commits.length??0),flushPadding:!0,children:[(0,j.jsx)(p,{run:e,tab:`commits`}),c?(0,j.jsx)(F,{runId:e.id,sha:n}):i.isPending?(0,j.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading commits…`}):i.isError?(0,j.jsx)(v,{icon:(0,j.jsx)(f,{size:16}),tone:i.error instanceof s&&i.error.status===409?`neutral`:`danger`,heading:`h2`,title:i.error instanceof s&&i.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:i.error.message}):i.data.commits.length===0?(0,j.jsx)(v,{icon:(0,j.jsx)(f,{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,j.jsx)(P,{run:e,commits:i.data.commits,selectedSha:o})]})}function P({run:e,commits:t,selectedSha:n}){let r=i(e.id,n),a=L(e.id,t),o=A(e.id,`commit:${n??``}`,r.data?.files),s=O(e.id);return(0,j.jsx)(C,{className:`px-4 py-5 md:px-9`,treeSlot:`task-commits-pane`,tree:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(D,{slot:`task-commits`,selectedSha:n,heading:(0,j.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[t.length,` `,t.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:t.map(t=>({...t,href:`/tasks/${e.id}/commits/${t.sha}`,stat:a.get(t.sha)}))}),n&&r.data&&r.data.files.length>0?(0,j.jsx)(R,{runId:e.id,sha:n,files:r.data.files,selected:s,onPick:t=>{k(e.id,t),o.reveal(t)}}):null]}),children:n?(0,j.jsx)(T,{commit:r,sha:n,slot:`task-commit-preview`,heading:`h3`,diffRef:o,loadFileText:t=>w(()=>c(e.id,n,t))}):null})}function F({runId:e,sha:t}){let n=i(e,t);return(0,j.jsx)(E,{commit:n,sha:t,diffRef:A(e,`commit:${t}`,n.data?.files),backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,loadFileText:n=>w(()=>c(e,t,n))})}var I=12;function L(e,t){let n=t.length<=I,r=o({queries:t.map(t=>({queryKey:a.runs.commit(e,t.sha),queryFn:({signal:n})=>l(e,t.sha,{signal:n}),enabled:n,retry:!1}))}),i=new Map;return r.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&i.set(r,e.data.stat)}),i}function R({runId:e,sha:t,files:n,selected:r,onPick:i}){return(0,j.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,j.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,j.jsx)(y,{sha:t,variant:`inline`,className:`text-[13px] font-medium`})]}),(0,j.jsx)(m,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,j.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{type:`button`,"data-slot":`task-commit-file`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,"aria-current":e.path===r?`true`:void 0,onClick:()=>i(e.path),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=true]:bg-muted aria-[current=true]:text-foreground`,children:[(0,j.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,j.jsx)(S,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{M as TaskCommitsRoute};
|
|
@@ -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{f as r,g as i}from"./chunk-KS7C4IRE-BdLLx37K.js";import{x as a}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{f as r,g as i}from"./chunk-KS7C4IRE-BdLLx37K.js";import{x as a}from"./index-C3kap2_j.js";var o=e(t(),1),s=n();function c({runId:e,children:t}){let n=r(),i=(0,o.useMemo)(()=>({runId:e}),[e]);return n?(0,s.jsx)(l,{runId:e,children:t}):(0,s.jsx)(a.Provider,{value:i,children:t})}function l({runId:e,children:t}){let{projectId:n}=i(),r=(0,o.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,s.jsx)(a.Provider,{value:r,children:t})}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Et as r,Ht as i,Nt as a,Ot as o,qt as s}from"./queries-DD_9iITj.js";import{Cn as c,it as l,mt as u}from"./project-scope-context-DNrHbqd2.js";import{_ as d,g as f,h as p,p as m}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as h}from"./dist-CCX8mhHc.js";import{C as g,E as _,Q as v,Z as ee,ct as y,d as b}from"./design-icons-QbNMZniQ.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as S}from"./run-header-DxpN6yVQ.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-DNM-krBZ.js";import{t as D}from"./button-BV_AiLj2.js";import{l as O}from"./page-shell-BdjH5hyc.js";import{t as k}from"./centered-state-N8vWM_Hw.js";import{t as A}from"./use-search-params-writer-DD5PEEZw.js";import{C as j,D as M,E as N,lr as P,vr as F,x as I,zn as L}from"./index-C3kap2_j.js";import{t as R}from"./task-file-scope-CDIfOvl-.js";import{t as z}from"./code-workbench-B0GIezrD.js";import{t as B}from"./middle-truncated-name-jUQS2QzL.js";import{n as V,t as H}from"./selected-file-CfBWFB6p.js";var U=x(`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`}]]),ne=x(`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`}]]),W=e(t(),1),G=n();function K({runId:e,path:t,artifactId:n,worktreePath:i}){let o=a(e,n?null:t),s=r(e,n),c=n?s:o,d=(0,W.useContext)(I),f=m(),p=f.pathname.replace(/\/files\/?$/,`/report`)+f.search,h=c.data,g=(0,W.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...d,basePath:h.path}:null,[h,d,e]);if(!t&&!n)return(0,G.jsx)(te,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,G.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:`Could not load this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!h)return(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=w(h.path,i,t);if(h.type!==`file`)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,G.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let v=h.artifact;return(0,G.jsx)(I.Provider,{value:g,children:(0,G.jsx)(T,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:v?l(e,v.id,`image`):u(e,t),...v?{downloadUrl:l(e,v.id,`download`),snapshot:(0,G.jsx)(L,{iso:v.createdAt})}:{}},v?.id??h.path)})}var q=new Map;function J(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var Y=(0,W.createContext)(null);function X(){let{key:e}=m(),t=p()===`POP`,[n,r]=(0,W.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var Z=()=>document.querySelector(`[data-slot="main"]`);function re(e,t){let n=(0,W.useRef)(null),r=m(),i=p()===`POP`?r.key:J(r.state),[a]=(0,W.useState)(()=>{let t=i?q.get(i):void 0;return t?.runId===e?t:null}),o=(0,W.useRef)(new Set(a?.folders??[])),s=(0,W.useRef)(new Set),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(a===null),d=(0,W.useCallback)(()=>{u.current&&q.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:Z()?.scrollTop??0})},[r.key,e]),f=(0,W.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,W.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=Z();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,W.useEffect)(()=>{d();let e=[n.current,Z()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:f}}function ie({runId:e,selected:t,onSelect:n}){return(0,G.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Q({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=s(e,t),o=(0,W.useContext)(Y);return(0,W.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,G.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,G.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,G.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,G.jsx)(G.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,G.jsx)(ae,{runId:e,name:a.chain??a.name,path:t===``?a.chain??a.name:`${t}/${a.chain??a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,G.jsx)(oe,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function ae({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let o=(0,W.useContext)(Y),[s,c]=(0,W.useState)(()=>o?.isOpen(n)??!1);return(0,G.jsxs)(`li`,{children:[(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":s?`open`:`closed`,"aria-expanded":s,onClick:()=>{o?.setOpen(n,!s),c(!s)},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,G.jsx)(b,{size:16,"aria-hidden":`true`,className:h(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,s&&`rotate-90`)}),(0,G.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{title:n,className:`min-w-0 truncate font-normal`,children:t})]}),s?(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function oe({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=E(t)?ne:g;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:h(`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,G.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(B,{name:e,path:t}),n===void 0?null:(0,G.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:C(n)})]})})}function $(){let{id:e}=f(),t=i(e),n=X();return t.isPending?(0,G.jsx)(M,{tab:`files`}):t.isError?(0,G.jsx)(N,{tab:`files`,error:t.error}):(0,G.jsx)(R,{runId:t.data.id,children:(0,G.jsx)(le,{run:t.data},`${t.data.id}:${n}`)})}function se(e,t,n,i){let o=a(e,i||n!==null?null:t),s=r(e,i?null:n);return i||t===null&&n===null?!0:!(n===null?o:s).isPending}function ce(e,t,n,r){let i=e.id,a=e.worktreePath,[,o]=A(),s=p(),c=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(c.current)return;c.current=!0;let e=H(i);s===`POP`||t!==null||n!==null||e===null||o(t=>(t.set(`path`,e),t))},[s,n,t,i,o]),(0,W.useEffect)(()=>{t!==null&&!r&&V(i,j(t,a))},[r,t,i,a])}function le({run:e}){let t=s(e.id,``),n=o(e.id),[r,i]=d(),a=r.get(`path`),l=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||a!==null&&l!==null;ce(e,a,l,u);let[f,p]=(0,W.useState)(a??``);(0,W.useEffect)(()=>p(a??``),[a]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),i(n)},h=t.isError&&t.error instanceof c&&t.error.status===409,g=se(e.id,a,l,u),_=re(e.id,!t.isPending&&g);return(0,G.jsxs)(O,{route:`task-files`,density:ue(t.isError),flushPadding:!0,children:[(0,G.jsx)(S,{run:e,tab:`files`}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),f.trim()&&m(`path`,f.trim())},children:[(0,G.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,G.jsx)(P,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:f,onChange:e=>p(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,G.jsx)(D,{type:`submit`,variant:`outline`,className:`shrink-0`,disabled:!f.trim(),children:`Open file`})]}),(0,G.jsx)(z,{className:`flex-none gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:gap-0 md:px-9`,treeRef:_.tree,treeSlot:`files-tree-pane`,treeClassName:`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:overflow-y-auto md:overscroll-contain`,tree:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,G.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,G.jsx)(k,{icon:h?(0,G.jsx)(U,{}):(0,G.jsx)(y,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,G.jsx)(Y.Provider,{value:_.folders,children:(0,G.jsx)(ie,{runId:e.id,selected:a,onSelect:e=>m(`path`,e)})}),(0,G.jsx)(de,{artifacts:n,artifactId:l,onSelect:e=>m(`artifact`,e)})]}),children:u?(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):a!==null||l!==null||t.isSuccess?(0,G.jsx)(K,{runId:e.id,path:a,artifactId:l,worktreePath:e.worktreePath}):null}),(0,G.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}function ue(e){return e?`empty`:`full`}function de({artifacts:e,artifactId:t,onSelect:n}){return(0,G.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,G.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,G.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,G.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,G.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>n(e.id),children:[(0,G.jsx)(F,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,G.jsxs)(D,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2`,onClick:()=>void e.refetch(),children:[(0,G.jsx)(ee,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ as TaskFilesRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{B as t,H as n,Ht as r,U as i,_r as a,a as o,in as s,n as c}from"./queries-DD_9iITj.js";import{Y as l,Zi as u}from"./project-scope-context-DNrHbqd2.js";import{g as d}from"./chunk-KS7C4IRE-BdLLx37K.js";import{C as f,E as p}from"./reference-chip-e-fG4-yW.js";import{s as m}from"./dist-CCX8mhHc.js";import{I as h,ct as g,m as _}from"./design-icons-QbNMZniQ.js";import{t as v}from"./run-header-DxpN6yVQ.js";import{t as y}from"./external-link-BE6y205O.js";import{t as b}from"./search-x-I9Q8pgUa.js";import{t as x}from"./button-BV_AiLj2.js";import{t as S}from"./project-router-CfEuKuz1.js";import{l as C}from"./page-shell-BdjH5hyc.js";import{t as w}from"./centered-state-N8vWM_Hw.js";import{E as T,T as E,hr as D}from"./index-C3kap2_j.js";import{l as O,n as k,t as A}from"./use-hand-to-agent-state-Bjh1EnB3.js";var j=e(),M={issue:`Issue`,pr:`Pull request`};function N({kind:e}){let{id:t}=d(),n=r(t);return n.isPending?(0,j.jsx)(E,{kind:e}):n.isError?(0,j.jsx)(T,{tab:`github-item`,error:n.error}):(0,j.jsx)(P,{run:n.data,kind:e})}function P({run:e,kind:r}){let{n:a}=d(),s=Number(a),c=n(),l=i(),u=t(),p=l.isPending||u.isPending,m=f(e,c).some(e=>e.kind===r&&e.number===s),h=o(r,s,m);return(0,j.jsxs)(C,{route:`task-github-item`,density:m?`full`:`empty`,flushPadding:!0,children:[(0,j.jsx)(v,{run:e,tab:{kind:r,number:s}}),m?(0,j.jsx)(H,{run:e,kind:r,number:s,repoBase:c,item:h}):p?(0,j.jsx)(E,{kind:r,number:s,heading:`h2`}):(0,j.jsx)(w,{icon:(0,j.jsx)(D,{size:16}),tone:`neutral`,heading:`h2`,title:`#${a} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function F(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function I(e,t,n,r){return e===`pr`?n?.[t]??r:r}function L({retry:e,kind:t,number:n}){return(0,j.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(s.githubItem(t,n)),children:`Retry`})}function R({kind:e,number:t,error:n,retryButton:r}){return(0,j.jsx)(w,{icon:(0,j.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${M[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function z({run:e,kind:t,number:n,repoBase:r,reason:i,retryError:a,retryButton:o}){let s=t===`pr`?h:_,c=p(e,r).find(e=>e.kind===`PR`==(t===`pr`)&&e.number===n)?.url;return(0,j.jsx)(w,{icon:(0,j.jsx)(s,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:a?.message??i,actions:(0,j.jsxs)(j.Fragment,{children:[o,c&&m(c)?(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,j.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function B({label:e,repoBase:t}){return(0,j.jsx)(w,{icon:(0,j.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${U(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function V({kind:e,item:t,labelColors:n,checks:r}){return(0,j.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,j.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,j.jsx)(W,{item:t},t.url):null})})}function H({run:e,kind:t,number:n,repoBase:r,item:i}){let o=u(),s=a({mutationFn:e=>l(t,n,{refresh:!0}),onSuccess:(e,t)=>o.setQueryData(t,e)}),d=F(t,i),f=c(d?[n]:[],d),p=f.data?.available?f.data.checks:void 0,m=`${M[t]} #${n}`,h=(0,j.jsx)(L,{retry:s,kind:t,number:n});if(i.isPending)return(0,j.jsx)(E,{kind:t,number:n,heading:`h2`});if(i.isError)return(0,j.jsx)(R,{kind:t,number:n,error:s.error??i.error,retryButton:h});let g=i.data;return g.available?g.item?(0,j.jsx)(V,{kind:t,item:g.item,labelColors:g.labelColors,checks:I(t,n,p,g.item.checks)}):(0,j.jsx)(B,{label:m,repoBase:r}):(0,j.jsx)(z,{run:e,kind:t,number:n,repoBase:r,reason:g.reason,retryError:s.error,retryButton:h})}function U(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function W({item:e}){let t=A();return(0,j.jsx)(k,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{N as TaskGithubItemRoute};
|