@wjarka/cezarion 0.18.0-dev.8004 → 0.18.0-dev.8012
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/package.json +2 -2
- package/web/dist/assets/{accounts-section-BvrCdhB1.js → accounts-section-CJ1xR0FN.js} +1 -1
- package/web/dist/assets/activity-motion-C01GEN0y.js +2 -0
- package/web/dist/assets/{activity-route-BZPRmiNI.js → activity-route-BZ1NIKSY.js} +1 -1
- package/web/dist/assets/{agent-config-section-DEeDIcK_.js → agent-config-section-DvFcRRLD.js} +2 -2
- package/web/dist/assets/{agent-defaults-section-RYnao4vB.js → agent-defaults-section-BE88c2RN.js} +1 -1
- package/web/dist/assets/{appearance-obeD0TrH.js → appearance-B9Z6lNEm.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-DP12N-QW.js → archive-on-merge-field-DtR7twJI.js} +1 -1
- package/web/dist/assets/attention-B6NEiTGm.js +1 -0
- package/web/dist/assets/{automations-route-bJYe7JKX.js → automations-route-Dpa01C3j.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-yCI8kY--.js → commit-diff-panel-CGjhxIPJ.js} +1 -1
- package/web/dist/assets/{diff-B9wl20YA.js → diff-DQ18_bA-.js} +2 -2
- package/web/dist/assets/{diff-view-C-HieogW.js → diff-view-CMwe_Rx7.js} +1 -1
- package/web/dist/assets/{file-preview-BzialgZg.js → file-preview-_lAUlt5u.js} +1 -1
- package/web/dist/assets/{folder-browser-B8_lzQT7.js → folder-browser-Cy26Y6YK.js} +1 -1
- package/web/dist/assets/{git-toolbar-lvqVHT9o.js → git-toolbar-BJM3pWHY.js} +1 -1
- package/web/dist/assets/{github-CQhVzG31.js → github-aO7y0526.js} +1 -1
- package/web/dist/assets/{global-activity-route-Cnk7K6kB.js → global-activity-route-BWOfw2C5.js} +1 -1
- package/web/dist/assets/index-D-Y1olb1.js +21 -0
- package/web/dist/assets/label-CbEJ99h4.js +1 -0
- package/web/dist/assets/{markdown-BLWEExIH.js → markdown-BDWII3gy.js} +1 -1
- package/web/dist/assets/{notifications-section-Ci4iCnOt.js → notifications-section-Z_4IW83J.js} +1 -1
- package/web/dist/assets/{open-in-menu-JhT-c8K6.js → open-in-menu-21vcjK3t.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-COUwLzj1.js → preview-pane-connected-CxwvH4pt.js} +2 -2
- package/web/dist/assets/{project-location-BMreyTgv.js → project-location-CvJMe_Vp.js} +1 -1
- package/web/dist/assets/{project-router-DG3CwEiO.js → project-router-hhGBPlav.js} +1 -1
- package/web/dist/assets/project-scope-context-BiijuuWU.js +4 -0
- package/web/dist/assets/{projects-section-I4Umh57f.js → projects-section-CQ34YFnT.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-Byinr-jH.js → prompt-templates-section-UIxQCLJq.js} +1 -1
- package/web/dist/assets/queries-D6ioEk6c.js +1 -0
- package/web/dist/assets/{reference-chip-Bphmq8DU.js → reference-chip-B5br2cfV.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-CcYe1mbK.js → remote-settings-notice-BWDpTH5W.js} +1 -1
- package/web/dist/assets/{repo-git-tmqJIA3Y.js → repo-git-U12bPaG-.js} +1 -1
- package/web/dist/assets/{report-reader-GE7zBDlE.js → report-reader-B5vipU-m.js} +1 -1
- package/web/dist/assets/{reports-Dzd6o31r.js → reports-Cdk8Dc-w.js} +1 -1
- package/web/dist/assets/{resources-section-D6yjk2_7.js → resources-section-BCLu3v1Z.js} +1 -1
- package/web/dist/assets/run-header-gOqc0BKa.js +2 -0
- package/web/dist/assets/{runners-GyEIYtzT.js → runners-5cgs0qUY.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-gDWJBt2q.js → settings-agent-picker-CB7l8AW-.js} +1 -1
- package/web/dist/assets/{settings-shell-1kV0mCGg.js → settings-shell-BUHHoCDs.js} +1 -1
- package/web/dist/assets/{sidebar-section-bytwajV6.js → sidebar-section-8dTKLdQw.js} +1 -1
- package/web/dist/assets/{skills-oC915Joa.js → skills-thuBrq2s.js} +1 -1
- package/web/dist/assets/{tab-link-BrrGCBYJ.js → tab-link-DaFUyEhe.js} +1 -1
- package/web/dist/assets/{task-changes-CgEF750z.js → task-changes-DSpeg6sX.js} +1 -1
- package/web/dist/assets/{task-commits-CmewNVBz.js → task-commits-DRDRswBh.js} +1 -1
- package/web/dist/assets/{task-files-x0fUUNIG.js → task-files-Cevz9Mex.js} +1 -1
- package/web/dist/assets/{task-github-item-DuwLqcE4.js → task-github-item-DpLkKSKy.js} +1 -1
- package/web/dist/assets/{task-groups-Ccol3P2t.js → task-groups-CafTiSSz.js} +1 -1
- package/web/dist/assets/{task-thread-DkgKDQSG.js → task-thread-BvM4rEQe.js} +6 -6
- package/web/dist/assets/{tasks-table-CbfBNxAB.js → tasks-table-DYjfmofR.js} +1 -1
- package/web/dist/assets/{thread-state-Nzl4pHXB.js → thread-state-A3TSuI5v.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-BMWlCZBX.js → use-hand-to-agent-state-IepoiFbj.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-C8q14xTE.js → useInfiniteQuery-B20OnjTe.js} +1 -1
- package/web/dist/assets/useQuery-BTg3x78A.js +1 -0
- package/web/dist/assets/{workflows-BV5oZdB_.js → workflows-B0TaHAzz.js} +2 -2
- package/web/dist/assets/{workspace-tools-NWKvRhWg.js → workspace-tools-B8sP_p5c.js} +1 -1
- package/web/dist/assets/{worktrees-section--MUxuXUq.js → worktrees-section-BDfwadB6.js} +4 -4
- package/web/dist/assets/{ws-BYbBRDfC.js → ws-ExzR2_Yn.js} +1 -1
- package/web/dist/index.html +15 -15
- package/web/dist/assets/activity-motion-CyQUo8rH.js +0 -2
- package/web/dist/assets/attention-CSFsCoi5.js +0 -1
- package/web/dist/assets/index-D0DvUgTj.js +0 -21
- package/web/dist/assets/label-CYqEyapm.js +0 -1
- package/web/dist/assets/project-scope-context-BairiAvs.js +0 -4
- package/web/dist/assets/queries-bg9YtgmX.js +0 -1
- package/web/dist/assets/run-header-Cc5Flvc9.js +0 -2
- package/web/dist/assets/useQuery-Berjv5Ts.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Cn as r,On as i,Tn as a,kn as o,wn as s}from"./project-scope-context-BairiAvs.js";import{At as c,Ot as l,q as u,rt as d,v as f,wt as p}from"./queries-bg9YtgmX.js";import{n as m,p as h,r as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as _}from"./toaster-Bo5vCbz-.js";import{l as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./createLucideIcon-BHp8sXmF.js";import{t as x}from"./button-BQ2y4XRB.js";import{n as ee,r as S,t as te}from"./collapsible-BEV4FO-1.js";import{t as C}from"./switch-Bv2Zf1uU.js";import{t as w}from"./badge-D9JrXe0o.js";import{n as T,s as E,t as D}from"./project-router-DG3CwEiO.js";import"./attention-CSFsCoi5.js";import{Hn as O,Rn as ne,dt as re,ft as k,pt as A,z as j}from"./index-D0DvUgTj.js";import{t as ie}from"./textarea-vJt9undk.js";import{ArchiveOnMergeField as ae}from"./archive-on-merge-field-DP12N-QW.js";import{a as oe,i as se,n as ce,t as le}from"./projects-section-I4Umh57f.js";import{t as M}from"./settings-field-Bl6WuvGX.js";import{t as ue}from"./project-location-BMreyTgv.js";var de=b(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),N=e(t(),1),P={"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`}},F=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),I={name:``,description:``,url:``,token:``,tasks:!0,triggers:i,agent:!1};function L(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??i,agent:e.agent}}var R=e=>o.filter(t=>e.includes(t));function z(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,...F(e.triggers,i)?{}:{triggers:R(e.triggers)},agent:e.agent}}function B(e,t){let n={},r=e.name.trim(),a=e.description.trim(),o=e.url.trim();return r!==t.name&&(n.name=r),a!==(t.description??``)&&(n.description=a),o!==t.url&&(n.url=o),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),F(e.triggers,t.triggers??i)||(n.triggers=R(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var V=n(),H=`flex flex-col gap-1 text-[13px]`,U=`text-[11px] text-muted-foreground`;function W({draft:e,onChange:t,tokenSet:n}){let i=(0,N.useId)(),c=(0,N.useId)(),l=(0,N.useId)(),u=(0,N.useId)(),d=(0,N.useId)(),f=(0,N.useId)(),p=(0,N.useId)(),m=(0,N.useId)(),h=(0,N.useId)(),g=(0,N.useId)();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:i,className:U,children:`Name`}),(0,V.jsx)(O,{id:i,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:u,className:U,children:`URL`}),(0,V.jsx)(O,{id:u,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:a,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:c,className:U,children:`Description`}),(0,V.jsx)(ie,{id:c,"data-slot":`webhook-description`,"aria-describedby":l,rows:2,maxLength:r,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,V.jsx)(`span`,{id:l,className:`text-[11px] text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:d,className:U,children:`Token`}),(0,V.jsx)(O,{id:d,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:s,"aria-describedby":f,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,V.jsx)(`span`,{id:f,className:`text-[11px] 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,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(C,{id:p,"aria-describedby":m,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:p,className:`font-medium`,children:`Task notifications`}),(0,V.jsx)(`span`,{id:m,className:`text-[11px] text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,V.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,V.jsx)(`legend`,{className:`pbe-1 text-[11px] text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,V.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:o.map(n=>(0,V.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,V.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,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:P[n].label}),(0,V.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:P[n].hint})]})]},n))}),(0,V.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(C,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,V.jsx)(`span`,{id:g,className:`text-[11px] text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var G=`max-sm:h-11`,K=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),fe=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,V.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 pe({projectId:e,webhook:t,defaultOpen:n=!1}){let r=l(),i=d(),a=p(),[o,s]=(0,N.useState)(n),[c,u]=(0,N.useState)(()=>L(t)),[f,m]=(0,N.useState)(null),h=B(c,t),g=Object.keys(h).length>0,y=c.name.trim()!==``&&c.url.trim()!==``,b=r.isPending||i.isPending||a.isPending,C={projectId:e,webhookId:t.id},T=e=>r.mutate({...C,...h},{onSuccess:()=>{u(e=>({...e,token:``})),e?e():_(`${c.name.trim()} saved`)},onError:e=>m(K(e,`Save`))}),E=()=>a.mutate(C,{onSuccess:e=>m(fe(e)),onError:e=>m({tone:`danger`,text:e.message})});return(0,V.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:J,children:(0,V.jsxs)(te,{open:o,onOpenChange:s,children:[(0,V.jsx)(S,{asChild:!0,children:(0,V.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,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,V.jsx)(w,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,V.jsx)(w,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,V.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:j(t.url)})]}),(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,V.jsx)(ee,{children:(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,className:Y,onSubmit:e=>{e.preventDefault(),m(null),y&&g&&T()},children:[(0,V.jsx)(W,{draft:c,tokenSet:t.tokenSet,onChange:e=>u(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-save`,disabled:b||!y||!g,children:`Save`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`outline`,"data-action":`webhook-test`,disabled:b||!y,onClick:()=>{m(null),g?T(E):E()},children:`Send test`}),t.tokenSet?(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>r.mutate({...C,token:``},{onSuccess:()=>_(`Webhook token cleared`),onError:e=>m({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>i.mutate(C,{onSuccess:()=>_(`${t.name} removed`),onError:e=>m({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,V.jsx)(q,{feedback:f})]})})]})})}function me({projectId:e,onCreated:t,onCancel:n}){let r=f(),[i,a]=(0,N.useState)(I),[o,s]=(0,N.useState)(null),c=i.name.trim()!==``&&i.url.trim()!==``;return(0,V.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:J,children:[(0,V.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"aria-label":`New webhook`,className:Y,onSubmit:n=>{n.preventDefault(),s(null),c&&r.mutate({projectId:e,...z(i)},{onSuccess:({webhook:e})=>{_(`${e.name} created`),t(e)},onError:e=>s(K(e,`Create`))})},children:[(0,V.jsx)(W,{draft:i,tokenSet:!1,onChange:e=>a(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-create`,disabled:r.isPending||!c,children:`Create`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,V.jsx)(q,{feedback:o})]})]})}function he({project:e}){let t=e.webhooks??[],[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(null),o=t.length>=16;return(0,V.jsx)(M,{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,V.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,V.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,V.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,V.jsx)(pe,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,V.jsx)(me,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,className:`max-sm:h-11`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,V.jsx)(de,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,V.jsxs)(`span`,{className:`text-[11px] 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 Z(){let e=E(),t=u(),n=c();if(t.isPending)return(0,V.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,V.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let r=t.data,i=r?.projects.find(t=>t.id===e);return!r||!i?null:(0,V.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,V.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,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,V.jsx)(ue,{}),(0,V.jsx)(ge,{project:i}),(0,V.jsx)(M,{title:`Max parallel tasks`,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,V.jsx)(le,{project:i,workspaceMax:n.data.resources.maxParallel}):(0,V.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,V.jsx)(he,{project:i},i.id)]}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(_e,{project:i,bootProject:r.bootProject})})]})}function ge({project:e}){return(0,V.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Project`}),(0,V.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Branch`}),(0,V.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Status`}),(0,V.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[ce[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Added`}),(0,V.jsxs)(`dd`,{className:`mt-1`,children:[X(e.addedAt),(0,V.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Last opened`}),(0,V.jsx)(`dd`,{className:`mt-1`,children:X(e.lastOpenedAt)})]})]})}function _e({project:e,bootProject:t}){let[n,r]=(0,N.useState)(null),i=oe(),a=h(),o=e.id===t;return(0,V.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,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.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:o?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:o||i.isPending,onClick:()=>r(e),className:`text-danger`,children:[`Remove `,e.name]}),o?(0,V.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-[11px] text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,V.jsx)(se,{project:n,onOpenChange:e=>!e&&r(null),onConfirm:()=>{r(null),i.confirm(e,()=>void a(`/p/${encodeURIComponent(t)}`))}})]})}function ve(e){return e===`global`?{Link:m,NavLink:g}:{Link:D,NavLink:T}}function Q({scope:e,title:t,mobileTitle:n}){let r=ne().name;return(0,V.jsxs)(`header`,{"data-slot":`settings-main-header`,className:`settings-route-header flex shrink-0 flex-col gap-2`,children:[(0,V.jsxs)(`h1`,{className:`text-[15px] font-semibold tracking-normal max-md:text-[24px] max-md:font-normal`,children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:n}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` · `,e===`global`?`every project`:r??`this project`]})]}),e===`global`?(0,V.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}function $({scope:e,activeId:t}){let{NavLink:n}=ve(e),r=A(e);return(0,V.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,V.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,V.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,V.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,V.jsx)(n,{to:k(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function ye({section:e,scope:t}){let n=e.component;return(0,V.jsxs)(`div`,{"data-route":t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,className:`settings-route mx-auto flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:t,title:e.title,mobileTitle:t===`global`?`Global settings`:`Project settings`}),(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:t,activeId:e.id}),(0,V.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,V.jsx)(`h2`,{className:`settings-panel-title`,children:e.title}),(0,V.jsx)(n,{})]})]})]})}function be(){return(0,V.jsxs)(`div`,{"data-route":`settings`,className:`settings-route mx-auto flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:`project`,title:`General`,mobileTitle:`Project settings`}),(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:`project`,activeId:null}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,V.jsx)(Z,{}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(ae,{})}),(0,V.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-border bg-card px-5 pt-5 text-base font-semibold md:hidden`,children:`Other project settings`}),(0,V.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:A(`project`).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(D,{to:k(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-border bg-card p-4 transition-colors hover:bg-card-2`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,V.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,V.jsx)(`span`,{className:`block text-xs text-soft-foreground`,children:e.description})]}),(0,V.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,V.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, notifications, host resources and the project registry live in`,` `,(0,V.jsx)(m,{to:re,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]})]})]})}export{be as SettingsIndexRoute,ye as SettingsSectionRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Cn as r,On as i,Tn as a,kn as o,wn as s}from"./project-scope-context-BiijuuWU.js";import{At as c,Ot as l,q as u,rt as d,v as f,wt as p}from"./queries-D6ioEk6c.js";import{n as m,p as h,r as g}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as _}from"./toaster-Bo5vCbz-.js";import{l as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./createLucideIcon-BHp8sXmF.js";import{t as x}from"./button-BQ2y4XRB.js";import{n as ee,r as S,t as te}from"./collapsible-BEV4FO-1.js";import{t as C}from"./switch-Bv2Zf1uU.js";import{t as w}from"./badge-D9JrXe0o.js";import{n as T,s as E,t as D}from"./project-router-hhGBPlav.js";import"./attention-B6NEiTGm.js";import{Hn as O,Rn as ne,dt as re,ft as k,pt as A,z as j}from"./index-D-Y1olb1.js";import{t as ie}from"./textarea-vJt9undk.js";import{ArchiveOnMergeField as ae}from"./archive-on-merge-field-DtR7twJI.js";import{a as oe,i as se,n as ce,t as le}from"./projects-section-CQ34YFnT.js";import{t as M}from"./settings-field-Bl6WuvGX.js";import{t as ue}from"./project-location-CvJMe_Vp.js";var de=b(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),N=e(t(),1),P={"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`}},F=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),I={name:``,description:``,url:``,token:``,tasks:!0,triggers:i,agent:!1};function L(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??i,agent:e.agent}}var R=e=>o.filter(t=>e.includes(t));function z(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,...F(e.triggers,i)?{}:{triggers:R(e.triggers)},agent:e.agent}}function B(e,t){let n={},r=e.name.trim(),a=e.description.trim(),o=e.url.trim();return r!==t.name&&(n.name=r),a!==(t.description??``)&&(n.description=a),o!==t.url&&(n.url=o),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),F(e.triggers,t.triggers??i)||(n.triggers=R(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var V=n(),H=`flex flex-col gap-1 text-[13px]`,U=`text-[11px] text-muted-foreground`;function W({draft:e,onChange:t,tokenSet:n}){let i=(0,N.useId)(),c=(0,N.useId)(),l=(0,N.useId)(),u=(0,N.useId)(),d=(0,N.useId)(),f=(0,N.useId)(),p=(0,N.useId)(),m=(0,N.useId)(),h=(0,N.useId)(),g=(0,N.useId)();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:i,className:U,children:`Name`}),(0,V.jsx)(O,{id:i,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:u,className:U,children:`URL`}),(0,V.jsx)(O,{id:u,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:a,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:c,className:U,children:`Description`}),(0,V.jsx)(ie,{id:c,"data-slot":`webhook-description`,"aria-describedby":l,rows:2,maxLength:r,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,V.jsx)(`span`,{id:l,className:`text-[11px] text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,V.jsxs)(`div`,{className:H,children:[(0,V.jsx)(`label`,{htmlFor:d,className:U,children:`Token`}),(0,V.jsx)(O,{id:d,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:s,"aria-describedby":f,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,V.jsx)(`span`,{id:f,className:`text-[11px] 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,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(C,{id:p,"aria-describedby":m,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:p,className:`font-medium`,children:`Task notifications`}),(0,V.jsx)(`span`,{id:m,className:`text-[11px] text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,V.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,V.jsx)(`legend`,{className:`pbe-1 text-[11px] text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,V.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:o.map(n=>(0,V.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,V.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,V.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:P[n].label}),(0,V.jsx)(`span`,{className:`text-[11px] text-soft-foreground`,children:P[n].hint})]})]},n))}),(0,V.jsx)(`p`,{className:`text-[11px] text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,V.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,V.jsx)(C,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,V.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,V.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,V.jsx)(`span`,{id:g,className:`text-[11px] text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var G=`max-sm:h-11`,K=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),fe=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,V.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 pe({projectId:e,webhook:t,defaultOpen:n=!1}){let r=l(),i=d(),a=p(),[o,s]=(0,N.useState)(n),[c,u]=(0,N.useState)(()=>L(t)),[f,m]=(0,N.useState)(null),h=B(c,t),g=Object.keys(h).length>0,y=c.name.trim()!==``&&c.url.trim()!==``,b=r.isPending||i.isPending||a.isPending,C={projectId:e,webhookId:t.id},T=e=>r.mutate({...C,...h},{onSuccess:()=>{u(e=>({...e,token:``})),e?e():_(`${c.name.trim()} saved`)},onError:e=>m(K(e,`Save`))}),E=()=>a.mutate(C,{onSuccess:e=>m(fe(e)),onError:e=>m({tone:`danger`,text:e.message})});return(0,V.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:J,children:(0,V.jsxs)(te,{open:o,onOpenChange:s,children:[(0,V.jsx)(S,{asChild:!0,children:(0,V.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,V.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,V.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,V.jsx)(w,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,V.jsx)(w,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,V.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:j(t.url)})]}),(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,V.jsx)(ee,{children:(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,className:Y,onSubmit:e=>{e.preventDefault(),m(null),y&&g&&T()},children:[(0,V.jsx)(W,{draft:c,tokenSet:t.tokenSet,onChange:e=>u(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-save`,disabled:b||!y||!g,children:`Save`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`outline`,"data-action":`webhook-test`,disabled:b||!y,onClick:()=>{m(null),g?T(E):E()},children:`Send test`}),t.tokenSet?(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>r.mutate({...C,token:``},{onSuccess:()=>_(`Webhook token cleared`),onError:e=>m({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>i.mutate(C,{onSuccess:()=>_(`${t.name} removed`),onError:e=>m({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,V.jsx)(q,{feedback:f})]})})]})})}function me({projectId:e,onCreated:t,onCancel:n}){let r=f(),[i,a]=(0,N.useState)(I),[o,s]=(0,N.useState)(null),c=i.name.trim()!==``&&i.url.trim()!==``;return(0,V.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:J,children:[(0,V.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,V.jsxs)(`form`,{"data-slot":`webhook-form`,"aria-label":`New webhook`,className:Y,onSubmit:n=>{n.preventDefault(),s(null),c&&r.mutate({projectId:e,...z(i)},{onSuccess:({webhook:e})=>{_(`${e.name} created`),t(e)},onError:e=>s(K(e,`Create`))})},children:[(0,V.jsx)(W,{draft:i,tokenSet:!1,onChange:e=>a(t=>({...t,...e}))}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(x,{type:`submit`,size:`sm`,className:G,"data-action":`webhook-create`,disabled:r.isPending||!c,children:`Create`}),(0,V.jsx)(x,{type:`button`,size:`sm`,className:G,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,V.jsx)(q,{feedback:o})]})]})}function he({project:e}){let t=e.webhooks??[],[n,r]=(0,N.useState)(!1),[i,a]=(0,N.useState)(null),o=t.length>=16;return(0,V.jsx)(M,{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,V.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,V.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,V.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,V.jsx)(pe,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,V.jsx)(me,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,className:`max-sm:h-11`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,V.jsx)(de,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,V.jsxs)(`span`,{className:`text-[11px] 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 Z(){let e=E(),t=u(),n=c();if(t.isPending)return(0,V.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,V.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let r=t.data,i=r?.projects.find(t=>t.id===e);return!r||!i?null:(0,V.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,V.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,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,V.jsx)(ue,{}),(0,V.jsx)(ge,{project:i}),(0,V.jsx)(M,{title:`Max parallel tasks`,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,V.jsx)(le,{project:i,workspaceMax:n.data.resources.maxParallel}):(0,V.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,V.jsx)(he,{project:i},i.id)]}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(_e,{project:i,bootProject:r.bootProject})})]})}function ge({project:e}){return(0,V.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Project`}),(0,V.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Branch`}),(0,V.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Status`}),(0,V.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[ce[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Added`}),(0,V.jsxs)(`dd`,{className:`mt-1`,children:[X(e.addedAt),(0,V.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:`Last opened`}),(0,V.jsx)(`dd`,{className:`mt-1`,children:X(e.lastOpenedAt)})]})]})}function _e({project:e,bootProject:t}){let[n,r]=(0,N.useState)(null),i=oe(),a=h(),o=e.id===t;return(0,V.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,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.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:o?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:o||i.isPending,onClick:()=>r(e),className:`text-danger`,children:[`Remove `,e.name]}),o?(0,V.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-[11px] text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,V.jsx)(se,{project:n,onOpenChange:e=>!e&&r(null),onConfirm:()=>{r(null),i.confirm(e,()=>void a(`/p/${encodeURIComponent(t)}`))}})]})}function ve(e){return e===`global`?{Link:m,NavLink:g}:{Link:D,NavLink:T}}function Q({scope:e,title:t,mobileTitle:n}){let r=ne().name;return(0,V.jsxs)(`header`,{"data-slot":`settings-main-header`,className:`settings-route-header flex shrink-0 flex-col gap-2`,children:[(0,V.jsxs)(`h1`,{className:`text-[15px] font-semibold tracking-normal max-md:text-[24px] max-md:font-normal`,children:[(0,V.jsx)(`span`,{className:`md:hidden`,children:n}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` · `,e===`global`?`every project`:r??`this project`]})]}),e===`global`?(0,V.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}function $({scope:e,activeId:t}){let{NavLink:n}=ve(e),r=A(e);return(0,V.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,V.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,V.jsx)(v,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,V.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,V.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,V.jsx)(n,{to:k(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function ye({section:e,scope:t}){let n=e.component;return(0,V.jsxs)(`div`,{"data-route":t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,className:`settings-route mx-auto flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:t,title:e.title,mobileTitle:t===`global`?`Global settings`:`Project settings`}),(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:t,activeId:e.id}),(0,V.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,V.jsx)(`h2`,{className:`settings-panel-title`,children:e.title}),(0,V.jsx)(n,{})]})]})]})}function be(){return(0,V.jsxs)(`div`,{"data-route":`settings`,className:`settings-route mx-auto flex min-h-full w-full flex-col`,children:[(0,V.jsx)(Q,{scope:`project`,title:`General`,mobileTitle:`Project settings`}),(0,V.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,V.jsx)($,{scope:`project`,activeId:null}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:[(0,V.jsx)(Z,{}),(0,V.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,V.jsx)(ae,{})}),(0,V.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-border bg-card px-5 pt-5 text-base font-semibold md:hidden`,children:`Other project settings`}),(0,V.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:A(`project`).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(D,{to:k(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-border bg-card p-4 transition-colors hover:bg-card-2`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,V.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,V.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,V.jsx)(`span`,{className:`block text-xs text-soft-foreground`,children:e.description})]}),(0,V.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,V.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, notifications, host resources and the project registry live in`,` `,(0,V.jsx)(m,{to:re,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]})]})]})}export{be as SettingsIndexRoute,ye as SettingsSectionRoute};
|
|
@@ -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{c as r}from"./utils-DSMR_WLb.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{c as r}from"./utils-DSMR_WLb.js";import{Nr as i,Pr as a,ci as o,qt as s}from"./project-scope-context-BiijuuWU.js";import{G as c,Yt as l}from"./queries-D6ioEk6c.js";import{t as u}from"./button-BQ2y4XRB.js";var d=e(t(),1),f=n(),p=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function m(){let e=r(),t=c(e);return t.isPending?(0,f.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,f.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,f.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,f.jsx)(u,{className:`min-h-[44px]`,onClick:()=>void t.refetch(),children:`Retry`})]}):(0,f.jsx)(h,{scope:e,initial:t.data.sidebarLimits??{}},e)}function h({scope:e,initial:t}){let n=o(),r=i(void 0),c=g(t),[m,h]=(0,d.useState)(()=>({values:c,saved:c,received:c})),{values:v,saved:y}=m,b=e=>h(t=>({...t,values:e})),x=a.safeParse(Object.fromEntries(p.map(([e])=>[e,v[e]===null?null:Number(v[e])]))),S=e=>v[e]!==null&&(v[e].trim()===``||!Number.isSafeInteger(Number(v[e]))||Number(v[e])<=0),C=p.some(([e])=>v[e]!==y[e]),w=l({onMutate:()=>n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),mutationFn:t=>s({sidebarLimits:t},e),onSuccess:async t=>{await n.cancelQueries({queryKey:[e,`ui-state`],exact:!0}),n.setQueryData([e,`ui-state`],t);let r=g(t.sidebarLimits);h({values:r,saved:r,received:r})}});return!w.isPending&&!_(m.received,c)&&h({values:C?v:c,saved:c,received:c}),(0,f.jsxs)(`form`,{"data-slot":`sidebar-settings`,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(),x.success&&!p.some(([e])=>S(e))&&!w.isPending&&w.mutate(x.data)},children:[(0,f.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,f.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.`}),p.map(([e,t])=>(0,f.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,f.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,f.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:v[e]??``,disabled:v[e]===null||w.isPending,"aria-invalid":S(e),"aria-describedby":S(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>b({...v,[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,f.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,f.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:v[e]===null,disabled:w.isPending,onChange:t=>b({...v,[e]:t.target.checked?null:String(r[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),S(e)&&(0,f.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),(0,f.jsx)(u,{type:`submit`,className:`min-h-[44px] self-start`,variant:`primary`,disabled:!C||!x.success||p.some(([e])=>S(e))||w.isPending,children:w.isPending?`Saving…`:`Save sidebar limits`}),w.isError&&(0,f.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,w.error.message]}),w.isSuccess&&!C&&(0,f.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Sidebar limits saved.`})]})}function g(e){let t=i(e);return Object.fromEntries(p.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function _(e,t){return p.every(([n])=>e[n]===t[n])}export{m as SidebarSection};
|
|
@@ -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{t as r}from"./utils-DSMR_WLb.js";import{Ct as i,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Ct as i,ci as a}from"./project-scope-context-BiijuuWU.js";import{Pt as o,p as s,t as c}from"./queries-D6ioEk6c.js";import{g as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as u}from"./toaster-Bo5vCbz-.js";import{s as d,t as f}from"./runners-5cgs0qUY.js";import{O as p,T as m,X as h,Y as g,ct as _,ot as v,u as y}from"./design-icons-CzEoMH9c.js";import{t as b}from"./button-BQ2y4XRB.js";import{t as x}from"./project-router-hhGBPlav.js";import{f as S,l as C}from"./skills-pM_PouEs.js";import{Hn as w,V as T,vn as E,wn as D}from"./index-D-Y1olb1.js";var O=e(t(),1),k=n(),A=e=>e.split(`@`)[0]||e,j={project:0,user:1,plugin:2,system:3,other:4},M={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function N(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:A(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:M[t],kind:t}}function P(e){let t=new Map;for(let n of e){let e=N(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>j[e.kind]-j[t.kind]||e.label.localeCompare(t.label))}function F(e){let t=e.plugin?`${A(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var I={project:m,user:_,plugin:p,system:p,other:p};function L({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,O.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,k.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,k.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,k.jsx)(R,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,k.jsx)(z,{skill:e,open:e.id===t,runner:r,account:i},S(e))):null]},e.key)})})}function R({group:e,open:t,onToggle:n}){let i=I[e.kind];return(0,k.jsx)(`h2`,{className:`m-0`,children:(0,k.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,k.jsx)(y,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,k.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,k.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,k.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function z({skill:e,open:t,runner:n,account:r}){let i=D({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,k.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,k.jsxs)(`summary`,{className:`grid min-h-11 cursor-pointer list-none grid-cols-1 items-baseline gap-x-4 gap-y-0.5 py-2.5 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)] [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(`span`,{className:`truncate text-[13.5px] font-semibold`,title:e.name,children:F(e)}),e.description?(0,k.jsx)(`span`,{className:`truncate text-[13px] text-muted-foreground group-open/skill:hidden`,children:e.description}):null]}),(0,k.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,k.jsx)(T,{skill:e,heading:null,actions:(0,k.jsx)(b,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,k.jsx)(x,{to:i,children:`Start task`})})})})]})}function B(){let e=s(),[t,n]=(0,O.useState)(null),[i,a]=(0,O.useState)(null),[c,u]=(0,O.useState)(``),[d]=l(),f=t??e.data?.defaultRunner??`claude`,p=o(t??e.data?.defaultRunner,i),m=G(f,p.account),_=p.data??[];return(0,k.jsxs)(`div`,{"data-route":`skills`,className:`mx-auto grid min-h-full w-full max-w-[1100px] grid-cols-1 content-start gap-5 px-[18px] py-6 md:p-9 max-md:[padding-block-end:5rem]`,children:[(0,k.jsxs)(`header`,{children:[(0,k.jsx)(`h1`,{className:`text-[25px] font-semibold tracking-tight md:text-[30px]`,children:`Skills`}),(0,k.jsx)(`p`,{className:`mt-1 text-[13px] text-muted-foreground`,children:`The skills each agent loads in this project, as its runner reports them.`})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(H,{runner:f,onChange:e=>{n(e),a(null)}}),(0,k.jsx)(U,{runner:f,account:i,onChange:a}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-soft-foreground`,"data-slot":`skills-count`,children:p.list?`${_.length} ${_.length===1?`skill`:`skills`}${p.list.source===`cache`?` · from cache`:``}`:null}),(0,k.jsxs)(b,{variant:`outline`,size:`sm`,onClick:()=>void m.run(),disabled:m.running||p.isPending,"data-slot":`skills-refresh`,children:[(0,k.jsx)(g,{"aria-hidden":`true`,className:r(`size-3.5`,m.running&&`motion-safe:animate-spin`)}),`Re-read`]})]}),(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,k.jsx)(w,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:c,onChange:e=>u(e.target.value),className:`h-10 bg-card pl-9 text-[13px]`})]}),(0,k.jsx)(W,{query:p}),p.isPending?(0,k.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,k.jsx)(V,{skills:_,search:c,openId:d.get(`skill`),runner:f,account:p.account??null,unchecked:p.unchecked})]})}function V({skills:e,search:t,openId:n,runner:r,account:i,unchecked:a}){if(e.length===0)return a?null:(0,k.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`No skills reported by this runner and account.`});let o=C(e,t);return o.length===0?(0,k.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No skills match “`,t.trim(),`”.`]}):(0,k.jsx)(L,{groups:P(o),openId:n,searching:t.trim()!==``,runner:r,account:i})}function H({runner:e,onChange:t}){let n=d().data;return n?(0,k.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-0.5 overflow-x-auto rounded-[10px] border border-border bg-card p-[3px]`,children:n.runners.map(r=>(0,k.jsx)(`button`,{type:`button`,"aria-pressed":r.id===e,onClick:()=>t(r.id),className:`h-8 shrink-0 rounded-[7px] px-3 text-[13px] text-muted-foreground focus-visible:outline-2 aria-pressed:bg-muted aria-pressed:font-semibold aria-pressed:text-foreground pointer-hover:text-foreground`,children:f(n,r.id)},r.id))}):null}function U({runner:e,account:t,onChange:n}){let r=E().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,k.jsxs)(`select`,{"aria-label":`Account`,value:t??``,onChange:e=>n(e.target.value||null),className:`h-[38px] rounded-md border border-border bg-card px-2.5 text-[13px] text-foreground focus-visible:outline-2`,children:[(0,k.jsx)(`option`,{value:``,children:`Account: project default`}),r.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function W({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,k.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,k.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,k.jsx)(v,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,k.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,k.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,k.jsx)(v,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,k.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function G(e,t){let n=a(),[r,o]=(0,O.useState)(!1),s=c.runnerSkills(e,t);return{running:r,run:async()=>{o(!0);try{n.setQueryData(s,await i(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:s.slice(0,3)})}catch(e){u(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{o(!1)}}}}export{B as SkillsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./project-router-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{r as t,t as n}from"./utils-DSMR_WLb.js";import{t as r}from"./project-router-hhGBPlav.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-[11.5px] font-normal text-soft-foreground`,children:s})]})}export{a 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{It as r,Rt as i,Wt as a,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{It as r,Rt as i,Wt as a,Yn as o,ci as s,h as c,i as l,on as u,vt as d,w as f}from"./project-scope-context-BiijuuWU.js";import{M as p,Yt as m,at as h,dt as g,t as _,ut as v}from"./queries-D6ioEk6c.js";import{h as y}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as b}from"./toaster-Bo5vCbz-.js";import{C as x,j as S}from"./design-icons-CzEoMH9c.js";import{t as C}from"./run-header-gOqc0BKa.js";import{i as w,n as T,r as E}from"./git-toolbar-BJM3pWHY.js";import{t as D}from"./button-BQ2y4XRB.js";import{a as O,i as k,o as A,r as j,s as M,t as N}from"./dialog-BVF6dIeS.js";import{b as P,f as F}from"./task-groups-CafTiSSz.js";import{t as I}from"./centered-state-V15AR_qo.js";import{$t as L,C as R,X as z,cn as B,w as V}from"./index-D-Y1olb1.js";import{t as H}from"./markdown-BBDDg-4t.js";import{t as U}from"./textarea-vJt9undk.js";import{t as W}from"./diff-DQ18_bA-.js";var G=e(t(),1),K=`no worktree — this task ran directly in the repo working tree`;function q(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 — ${K}`)}function J(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 — ${K}`)}function Y(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${K}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?o(e.run)?t(`Create PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):P(e.run)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function X(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:q(e),n=e.prUrl?[q(e),J(e)]:[J(e),Y(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?P(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,secondary:n,menu:r}}var Z=n();function Q({run:e,open:t,onOpenChange:n}){let r=s(),[i,a]=(0,G.useState)(``),o=F(e),l=(0,G.useRef)(o);l.current=o,(0,G.useEffect)(()=>{t&&a(l.current)},[t]);let u=m({mutationFn:t=>c(e.id,t),onSuccess:t=>{b(`Committed ${t.sha.slice(0,7)}`),n(!1),r.invalidateQueries({queryKey:_.runs.changes(e.id)}),r.invalidateQueries({queryKey:_.runs.all})},onError:e=>b(e.message,{tone:`danger`})}),d=()=>{let e=i.trim();e.length===0||u.isPending||u.mutate(e)};return(0,Z.jsx)(N,{open:t,onOpenChange:n,children:(0,Z.jsxs)(j,{"data-slot":`commit-dialog`,children:[(0,Z.jsxs)(A,{children:[(0,Z.jsx)(M,{children:`Commit changes`}),(0,Z.jsxs)(k,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,Z.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,Z.jsx)(U,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{z({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d())}}),(0,Z.jsxs)(O,{children:[(0,Z.jsx)(D,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,Z.jsx)(D,{"data-slot":`commit-confirm`,disabled:i.trim().length===0||u.isPending,onClick:d,children:u.isPending?`Committing…`:`Commit`})]})]})})}function $(){let{id:e}=y(),t=v(e);return t.isPending?(0,Z.jsx)(V,{tab:`changes`}):t.isError?(0,Z.jsx)(R,{tab:`changes`,error:t.error}):(0,Z.jsx)(ee,{run:t.data})}function ee({run:e}){let t=p(),n=h(),o=g(e.id,P(e)),c=L(),[u,d]=(0,G.useState)(`unified`),[v,y]=(0,G.useState)(!1),[x,S]=(0,G.useState)(!1),[w,D]=(0,G.useState)(null),[O,k]=(0,G.useState)(!1),A=(0,G.useRef)(null),j=s(),M=()=>j.invalidateQueries({queryKey:_.runs.all}),N=e=>b(e.message,{tone:`danger`}),F=m({mutationFn:()=>a(e.id),onSuccess:e=>b(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:N}),I=m({mutationFn:()=>f(e.id),onSuccess:e=>{b(`Draft PR created — ${e.url}`),M()},onError:N}),R=m({mutationFn:()=>i(e.id),onError:e=>{if(e instanceof l&&e.command){navigator.clipboard.writeText(e.command).then(()=>b(`No terminal found — command copied to clipboard.`)).catch(()=>b(`Run manually: ${e.command}`));return}N(e)}}),z=m({mutationFn:t=>r(e.id,t),onError:N}),V=o.isError&&o.error instanceof l&&o.error.status===409,U=X({run:e,cliHandoff:e.cliHandoff,hasWorktree:!!e.worktreePath&&!V,branch:e.branch,changedFiles:o.data?.stat.files,remote:n.data?.info?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:B(e)!==void 0,prUrl:e.pullRequestUrl}),W=e=>{switch(e){case`commit`:k(!0);break;case`push`:F.mutate();break;case`create-pr`:I.mutate();break;case`open-terminal`:R.mutate();break;case`view-pr`:break}},K=o.data?.files??[],q=(0,G.useMemo)(()=>E(K),[K]),J=(0,G.useMemo)(()=>K.some(H),[K]),Y=c?u:`unified`,$=!c||v;return(0,Z.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,Z.jsx)(C,{run:e,tab:`changes`}),(0,Z.jsx)(T,{bar:U,healthReady:t.data!==void 0,branch:e.branch,stat:o.data?.stat,mode:Y,wrap:$,preview:x,onModeChange:d,onWrapChange:y,onPreviewChange:J?S:void 0,onAction:W}),o.data?.repointedHead?(0,Z.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,Z.jsx)(`code`,{children:o.data.repointedHead.headBranch}),`, not this task's branch`,` `,(0,Z.jsx)(`code`,{children:o.data.repointedHead.taskBranch}),` — showing only what this task changed there.`]}):null,(0,Z.jsx)(te,{changes:o,changesRefused:V,fileCount:K.length,children:(0,Z.jsx)(ne,{runId:e.id,files:K,tree:q,selected:w,selectFile:e=>{D(e),A.current?.scrollToPath(e)},diffRef:A,effectiveMode:Y,effectiveWrap:$,preview:x,localHandoff:t.data?.capabilities.localHandoff,onOpenInApp:z.mutate})}),(0,Z.jsx)(Q,{run:e,open:O,onOpenChange:k})]})}function te({changes:e,changesRefused:t,fileCount:n,children:r}){return e.isPending?(0,Z.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,Z.jsx)(I,{icon:t?(0,Z.jsx)(x,{size:16}):(0,Z.jsx)(S,{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,Z.jsx)(I,{icon:(0,Z.jsx)(x,{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 ne({runId:e,files:t,tree:n,selected:r,selectFile:i,diffRef:a,effectiveMode:o,effectiveWrap:s,preview:c,localHandoff:l,onOpenInApp:d}){return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 md:flex-row md:items-start px-[18px] pb-9 pt-0 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-9`,children:[(0,Z.jsxs)(`aside`,{"data-slot":`changes-tree-pane`,className:`md:sticky md:top-4 max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] w-full md:w-60 shrink-0 overflow-y-auto overscroll-contain rounded-xl border border-border bg-card p-3.5 md:block lg:w-[250px]`,children:[(0,Z.jsx)(`h2`,{className:`mb-3 border-b border-border pb-3 text-xs font-semibold`,children:`Changed files`}),(0,Z.jsx)(w,{root:n,selected:r,onSelect:i})]}),(0,Z.jsx)(W,{files:t,viewRef:a,mode:o,wrap:s,preview:c,loadFileText:t=>re(e,t),imageSrc:t=>u(e,t),onOpenInApp:l?e=>d(e):void 0,className:`min-w-0 flex-1`})]})}async function re(e,t){try{let n=await d(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{$ as TaskChangesRoute};
|
|
@@ -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{t as r}from"./utils-DSMR_WLb.js";import{i}from"./project-scope-context-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{i}from"./project-scope-context-BiijuuWU.js";import{dt as a,ft as o,pt as s,ut as c}from"./queries-D6ioEk6c.js";import{h as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as u,S as d,X as f,j as p}from"./design-icons-CzEoMH9c.js";import{t as m}from"./run-header-gOqc0BKa.js";import{t as h}from"./project-router-hhGBPlav.js";import{b as g}from"./task-groups-CafTiSSz.js";import{t as _}from"./centered-state-V15AR_qo.js";import{C as v,Hn as y,s as b,w as x}from"./index-D-Y1olb1.js";import{t as S}from"./commit-diff-panel-CGjhxIPJ.js";var C=e(t(),1),w=n(),T=77;function E({slot:e,commits:t,className:n,heading:i}){let[a,o]=(0,C.useState)(``),s=a.trim().toLowerCase(),c=s?t.filter(e=>e.subject.toLowerCase().includes(s)):t,l=c.length>150,u=(0,C.useRef)(null),d=(0,C.useRef)(null),[p,m]=(0,C.useState)(0);(0,C.useLayoutEffect)(()=>{if(!l)return;let e=()=>{let e=u.current,t=d.current;!e||!t||m(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l]);let h=c.map(n=>(0,w.jsx)(D,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,w.jsx)(f,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,w.jsx)(y,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>o(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,w.jsxs)(`div`,{ref:e=>{u.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":l,className:r(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,w.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,c.length===0?(0,w.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,l?(0,w.jsx)(b,{scrollRef:d,startMargin:p,itemSize:T,children:h}):h]})]})}function D({commit:e,detailed:t}){return(0,w.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,w.jsxs)(h,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:r(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,w.jsx)(p,{size:16,"aria-hidden":`true`,className:r(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,w.jsxs)(`span`,{className:r(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,w.jsx)(`span`,{className:r(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,w.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,w.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,w.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,w.jsx)(u,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}function O(){let{id:e}=l(),t=c(e);return t.isPending?(0,w.jsx)(x,{tab:`changes`}):t.isError?(0,w.jsx)(v,{tab:`changes`,error:t.error}):(0,w.jsx)(k,{run:t.data})}function k({run:e}){let{sha:t}=l(),n=s(e.id,g(e));return(0,w.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,w.jsx)(m,{run:e,tab:`commits`}),t?(0,w.jsx)(A,{runId:e.id,sha:t}):n.isPending?(0,w.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,w.jsx)(_,{icon:(0,w.jsx)(p,{size:16}),tone:n.error instanceof i&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof i&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,w.jsx)(_,{icon:(0,w.jsx)(p,{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,w.jsxs)(`div`,{className:`px-[18px] py-[22px] md:px-9`,children:[(0,w.jsx)(E,{slot:`task-commits`,heading:(0,w.jsxs)(`h2`,{className:`text-base font-semibold`,children:[n.data.commits.length,` `,n.data.commits.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:n.data.commits.map(t=>({...t,shaLabel:t.sha.slice(0,8),href:`/tasks/${e.id}/commits/${t.sha}`}))}),(0,w.jsx)(j,{run:e})]})]})}function A({runId:e,sha:t}){return(0,w.jsx)(S,{commit:o(e,t),sha:t,backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,className:`mx-auto flex min-h-0 w-full max-w-[var(--measure)] flex-1 flex-col`,diffClassName:`px-4 py-4 [--diff-sticky-top:0px] md:[--diff-sticky-top:1rem] md:px-6`})}function j({run:e}){let t=a(e.id,g(e));return t.isPending?(0,w.jsx)(`p`,{className:`mt-[22px] text-xs text-muted-foreground`,children:`Loading changed files…`}):t.isError?(0,w.jsxs)(`p`,{role:`status`,className:`mt-[22px] text-xs text-danger`,children:[`Could not load changed files: `,t.error.message]}):t.data.files.length===0?null:(0,w.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-[22px] rounded-[10px] border border-border bg-card p-5`,children:[(0,w.jsxs)(`h2`,{className:`mb-4 text-[16px] font-semibold`,children:[t.data.files.length,` changed files`]}),(0,w.jsx)(`ul`,{className:`space-y-4`,children:t.data.files.map(t=>(0,w.jsx)(`li`,{children:(0,w.jsxs)(h,{to:`/tasks/${e.id}/changes`,className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground hover:text-foreground`,children:[(0,w.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,w.jsx)(`span`,{className:`break-all`,children:t.path})]})},t.path))})]})}export{O 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{t as r}from"./utils-DSMR_WLb.js";import{M as i,i as a,s as o}from"./project-scope-context-BairiAvs.js";import{c as s,ht as c,u as l,ut as u,x as d}from"./queries-bg9YtgmX.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as g,T as _,X as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{f as S,t as C}from"./run-header-Cc5Flvc9.js";import{a as w,i as T,n as E,r as D}from"./file-preview-BzialgZg.js";import{t as O}from"./button-BQ2y4XRB.js";import{t as k}from"./centered-state-V15AR_qo.js";import{C as A,Hn as j,w as M}from"./index-D0DvUgTj.js";import{r as N}from"./markdown-BLWEExIH.js";var P=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`}]]),F=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`}]]),I=e(t(),1),L=n();function R({runId:e,path:t,artifactId:n}){let r=d(e,n?null:t),a=s(e,n),c=n?a:r,l=(0,I.useContext)(N),u=f(),p=u.pathname.replace(/\/files\/?$/,`/report`)+u.search,m=c.data,h=(0,I.useMemo)(()=>m?.type===`file`&&m.source!==`artifact`?{runId:e,...l,basePath:m.path}:null,[m,l,e]);if(!t&&!n)return(0,L.jsx)(D,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,L.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:`Could not load this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,L.jsx)(O,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!m)return(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(m.type!==`file`)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:m.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:m.path}),(0,L.jsx)(`p`,{className:`text-sm`,children:m.reason}),(0,L.jsx)(O,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let g=m.artifact;return(0,L.jsx)(N.Provider,{value:h,children:(0,L.jsx)(E,{runId:e,entry:m,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:g?o(e,g.id,`image`):i(e,t),...g?{downloadUrl:o(e,g.id,`download`),snapshot:new Date(g.createdAt).toLocaleString()}:{}},g?.id??m.path)})}var z=new Map;function B(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var V=(0,I.createContext)(null);function H(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,I.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 U=()=>document.querySelector(`[data-slot="main"]`);function W(e,t){let n=(0,I.useRef)(null),r=f(),i=h()===`POP`?r.key:B(r.state),[a]=(0,I.useState)(()=>{let t=i?z.get(i):void 0;return t?.runId===e?t:null}),o=(0,I.useRef)(new Set(a?.folders??[])),s=(0,I.useRef)(new Set),[c,l]=(0,I.useState)(0),u=(0,I.useRef)(a===null),d=(0,I.useCallback)(()=>{u.current&&z.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:U()?.scrollTop??0})},[r.key,e]),p=(0,I.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,I.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=U();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,I.useEffect)(()=>{d();let e=[n.current,U()].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:p}}function G({runId:e,selected:t,onSelect:n}){return(0,L.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function K({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=c(e,t),o=(0,I.useContext)(V);return(0,I.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,L.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,L.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,L.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,L.jsx)(L.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,L.jsx)(q,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,L.jsx)(J,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function q({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,I.useContext)(V),[c,l]=(0,I.useState)(()=>s?.isOpen(n)??!1);return(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},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+i*14}px`},children:[(0,L.jsx)(b,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,L.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function J({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=w(t)?F:g;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`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`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,L.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,L.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:T(n)})]})})}function Y(){let{id:e}=m(),t=u(e),n=H();return t.isPending?(0,L.jsx)(M,{tab:`files`}):t.isError?(0,L.jsx)(A,{tab:`files`,error:t.error}):(0,L.jsx)(S,{runId:t.data.id,children:(0,L.jsx)(Z,{run:t.data},`${t.data.id}:${n}`)})}function X(e,t,n,r){let i=d(e,r||n!==null?null:t),a=s(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function Z({run:e}){let t=c(e.id,``),n=l(e.id),[r,i]=p(),o=r.get(`path`),s=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[d,f]=(0,I.useState)(o??``);(0,I.useEffect)(()=>f(o??``),[o]);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 a&&t.error.status===409,g=X(e.id,o,s,u),_=W(e.id,!t.isPending&&g);return(0,L.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,L.jsx)(C,{run:e,tab:`files`}),(0,L.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,L.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,L.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,L.jsx)(j,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:d,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,L.jsx)(O,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,L.jsxs)(`aside`,{ref:_.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,L.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,L.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,L.jsx)(k,{icon:h?(0,L.jsx)(P,{}):(0,L.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,L.jsx)(V.Provider,{value:_.folders,children:(0,L.jsx)(G,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,L.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,L.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,L.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,L.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,L.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,"aria-current":e.id===s?`true`:void 0,className:`min-h-11 w-full rounded px-2 py-2 text-left text-xs wrap-anywhere hover:bg-muted focus-visible:ring-2`,onClick:()=>m(`artifact`,e.id),children:e.name})},e.id))}),(0,L.jsx)(O,{variant:`ghost`,className:`min-h-11`,onClick:()=>void n.refetch(),children:`Refresh published files`})]})]}),u?(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||s!==null||t.isSuccess?(0,L.jsx)(R,{runId:e.id,path:o,artifactId:s}):null]}),(0,L.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Y as TaskFilesRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{M as i,i as a,s as o}from"./project-scope-context-BiijuuWU.js";import{c as s,ht as c,u as l,ut as u,x as d}from"./queries-D6ioEk6c.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as g,T as _,X as v,ot as y,u as b}from"./design-icons-CzEoMH9c.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{f as S,t as C}from"./run-header-gOqc0BKa.js";import{a as w,i as T,n as E,r as D}from"./file-preview-_lAUlt5u.js";import{t as O}from"./button-BQ2y4XRB.js";import{t as k}from"./centered-state-V15AR_qo.js";import{C as A,Hn as j,w as M}from"./index-D-Y1olb1.js";import{r as N}from"./markdown-BDWII3gy.js";var P=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`}]]),F=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`}]]),I=e(t(),1),L=n();function R({runId:e,path:t,artifactId:n}){let r=d(e,n?null:t),a=s(e,n),c=n?a:r,l=(0,I.useContext)(N),u=f(),p=u.pathname.replace(/\/files\/?$/,`/report`)+u.search,m=c.data,h=(0,I.useMemo)(()=>m?.type===`file`&&m.source!==`artifact`?{runId:e,...l,basePath:m.path}:null,[m,l,e]);if(!t&&!n)return(0,L.jsx)(D,{runId:e,path:null,className:`min-w-0 flex-1`});if(c.isPending)return(0,L.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(c.isError)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:`Could not load this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:c.error.message}),(0,L.jsx)(O,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});if(!m)return(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});if(m.type!==`file`)return(0,L.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,L.jsx)(`h2`,{children:m.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,L.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:m.path}),(0,L.jsx)(`p`,{className:`text-sm`,children:m.reason}),(0,L.jsx)(O,{variant:`outline`,onClick:()=>void c.refetch(),children:`Retry`})]});let g=m.artifact;return(0,L.jsx)(N.Provider,{value:h,children:(0,L.jsx)(E,{runId:e,entry:m,documentPreview:!0,readerHref:p,className:`min-w-0 flex-1`,imageUrl:g?o(e,g.id,`image`):i(e,t),...g?{downloadUrl:o(e,g.id,`download`),snapshot:new Date(g.createdAt).toLocaleString()}:{}},g?.id??m.path)})}var z=new Map;function B(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var V=(0,I.createContext)(null);function H(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,I.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 U=()=>document.querySelector(`[data-slot="main"]`);function W(e,t){let n=(0,I.useRef)(null),r=f(),i=h()===`POP`?r.key:B(r.state),[a]=(0,I.useState)(()=>{let t=i?z.get(i):void 0;return t?.runId===e?t:null}),o=(0,I.useRef)(new Set(a?.folders??[])),s=(0,I.useRef)(new Set),[c,l]=(0,I.useState)(0),u=(0,I.useRef)(a===null),d=(0,I.useCallback)(()=>{u.current&&z.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:U()?.scrollTop??0})},[r.key,e]),p=(0,I.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,I.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=U();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,I.useEffect)(()=>{d();let e=[n.current,U()].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:p}}function G({runId:e,selected:t,onSelect:n}){return(0,L.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function K({runId:e,path:t,depth:n,selected:r,onSelect:i}){let a=c(e,t),o=(0,I.useContext)(V);return(0,I.useEffect)(()=>{if(!(!t||!o))return o.loading(t,a.isPending),()=>o.loading(t,!1)},[o,t,a.isPending]),a.isPending?(0,L.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,L.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,L.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,L.jsx)(L.Fragment,{children:a.data.entries.map(a=>a.type===`dir`?(0,L.jsx)(q,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,L.jsx)(J,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function q({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,I.useContext)(V),[c,l]=(0,I.useState)(()=>s?.isOpen(n)??!1);return(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":c?`open`:`closed`,"aria-expanded":c,onClick:()=>{s?.setOpen(n,!c),l(!c)},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+i*14}px`},children:[(0,L.jsx)(b,{size:16,"aria-hidden":`true`,className:r(`order-last ml-auto size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,c&&`rotate-90`)}),(0,L.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,L.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,L.jsx)(K,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function J({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=w(t)?F:g;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":s?`true`:void 0,onClick:()=>o(t),className:r(`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`,s?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${6+i*14}px`},children:[(0,L.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,L.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:T(n)})]})})}function Y(){let{id:e}=m(),t=u(e),n=H();return t.isPending?(0,L.jsx)(M,{tab:`files`}):t.isError?(0,L.jsx)(A,{tab:`files`,error:t.error}):(0,L.jsx)(S,{runId:t.data.id,children:(0,L.jsx)(Z,{run:t.data},`${t.data.id}:${n}`)})}function X(e,t,n,r){let i=d(e,r||n!==null?null:t),a=s(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function Z({run:e}){let t=c(e.id,``),n=l(e.id),[r,i]=p(),o=r.get(`path`),s=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&s!==null,[d,f]=(0,I.useState)(o??``);(0,I.useEffect)(()=>f(o??``),[o]);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 a&&t.error.status===409,g=X(e.id,o,s,u),_=W(e.id,!t.isPending&&g);return(0,L.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,L.jsx)(C,{run:e,tab:`files`}),(0,L.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-[18px] pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,L.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,L.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,L.jsx)(j,{"aria-label":`File path in the worktree`,placeholder:`Open a file by path…`,value:d,onChange:e=>f(e.target.value),className:`h-11 min-w-0 bg-card pl-10`})]}),(0,L.jsx)(O,{type:`submit`,variant:`outline`,className:`h-11 shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-col items-stretch gap-5 px-[18px] py-[22px] [--diff-sticky-top:1rem] md:flex-row md:items-start md:px-9`,children:[(0,L.jsxs)(`aside`,{ref:_.tree,"data-slot":`files-tree-pane`,className:`w-full shrink-0 rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:w-60 md:overflow-y-auto md:overscroll-contain lg:w-72`,children:[(0,L.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,L.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,L.jsx)(k,{icon:h?(0,L.jsx)(P,{}):(0,L.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,L.jsx)(V.Provider,{value:_.folders,children:(0,L.jsx)(G,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,L.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),n.isPending?(0,L.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):n.isError?(0,L.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):n.data.artifacts.length===0?(0,L.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,L.jsx)(`ul`,{children:n.data.artifacts.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,"aria-current":e.id===s?`true`:void 0,className:`min-h-11 w-full rounded px-2 py-2 text-left text-xs wrap-anywhere hover:bg-muted focus-visible:ring-2`,onClick:()=>m(`artifact`,e.id),children:e.name})},e.id))}),(0,L.jsx)(O,{variant:`ghost`,className:`min-h-11`,onClick:()=>void n.refetch(),children:`Refresh published files`})]})]}),u?(0,L.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||s!==null||t.isSuccess?(0,L.jsx)(R,{runId:e.id,path:o,artifactId:s}):null]}),(0,L.jsx)(`p`,{className:`px-[18px] pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}export{Y as TaskFilesRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{Q as n,
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{n as t}from"./utils-DSMR_WLb.js";import{Q as n,ci as r}from"./project-scope-context-BiijuuWU.js";import{D as i,M as a,U as o,Yt as s,q as c,t as l,ut as u,w as d}from"./queries-D6ioEk6c.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{g as p,p as m}from"./tasks-table-DYjfmofR.js";import{F as h,ot as g,p as _}from"./design-icons-CzEoMH9c.js";import{t as v}from"./run-header-gOqc0BKa.js";import{t as y}from"./external-link-BE6y205O.js";import{u as b}from"./reference-chip-B5br2cfV.js";import{t as x}from"./button-BQ2y4XRB.js";import{t as S}from"./project-router-hhGBPlav.js";import{t as C}from"./centered-state-V15AR_qo.js";import{C as w,S as T,qn as E}from"./index-D-Y1olb1.js";import{n as D,o as O,t as k}from"./use-hand-to-agent-state-IepoiFbj.js";var A=e(),j={issue:`Issue`,pr:`Pull request`};function M({kind:e}){let{id:t}=f(),n=u(t);return n.isPending?(0,A.jsx)(T,{kind:e}):n.isError?(0,A.jsx)(w,{tab:`github-item`,error:n.error}):(0,A.jsx)(N,{run:n.data,kind:e})}function N({run:e,kind:t}){let{n}=f(),r=Number(n),s=o(),l=c(),u=a(),d=l.isPending||u.isPending,p=m(e,s).some(e=>e.kind===t&&e.number===r),h=i(t,r,p);return(0,A.jsxs)(`div`,{"data-route":`task-github-item`,className:`flex min-h-full flex-col`,children:[(0,A.jsx)(v,{run:e,tab:{kind:t,number:r}}),p?(0,A.jsx)(V,{run:e,kind:t,number:r,repoBase:s,item:h}):d?(0,A.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,A.jsx)(C,{icon:(0,A.jsx)(E,{size:16}),tone:`neutral`,heading:`h2`,title:`#${n} is not linked to this task`,subtitle:`Only the issues and pull requests this task references open here.`,actions:(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function P(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function F(e,t,n,r){return e===`pr`?n?.[t]??r:r}function I({retry:e,kind:t,number:n}){return(0,A.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(l.githubItem(t,n)),children:`Retry`})}function L({kind:e,number:t,error:n,retryButton:r}){return(0,A.jsx)(C,{icon:(0,A.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${j[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function R({run:e,kind:n,number:r,repoBase:i,reason:a,retryError:o,retryButton:s}){let c=n===`pr`?h:_,l=p(e,i).find(e=>e.kind===`PR`==(n===`pr`)&&e.number===r)?.url;return(0,A.jsx)(C,{icon:(0,A.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,A.jsxs)(A.Fragment,{children:[s,l&&t(l)?(0,A.jsx)(x,{asChild:!0,variant:`outline`,children:(0,A.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,A.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function z({label:e,repoBase:t}){return(0,A.jsx)(C,{icon:(0,A.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${H(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function B({kind:e,item:t,labelColors:n,checks:r}){return(0,A.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,A.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,A.jsx)(U,{item:t},t.url):null})})}function V({run:e,kind:t,number:i,repoBase:a,item:o}){let c=r(),l=s({mutationFn:e=>n(t,i,{refresh:!0}),onSuccess:(e,t)=>c.setQueryData(t,e)}),u=P(t,o),f=d(u?[i]:[],u),p=f.data?.available?f.data.checks:void 0,m=`${j[t]} #${i}`,h=(0,A.jsx)(I,{retry:l,kind:t,number:i});if(o.isPending)return(0,A.jsx)(T,{kind:t,number:i,heading:`h2`});if(o.isError)return(0,A.jsx)(L,{kind:t,number:i,error:l.error??o.error,retryButton:h});let g=o.data;return g.available?g.item?(0,A.jsx)(B,{kind:t,item:g.item,labelColors:g.labelColors,checks:F(t,i,p,g.item.checks)}):(0,A.jsx)(z,{label:m,repoBase:a}):(0,A.jsx)(R,{run:e,kind:t,number:i,repoBase:a,reason:g.reason,retryError:l.error,retryButton:h})}function H(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 U({item:e}){let t=k();return(0,A.jsx)(D,{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{M as TaskGithubItemRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{En as e,
|
|
1
|
+
import{En as e,Ln as t,Mn as n,Nr as r,Yn as i,jn as a}from"./project-scope-context-BiijuuWU.js";import"./queries-D6ioEk6c.js";import"./attention-B6NEiTGm.js";function o(e,t){let n;for(let r of e)!r.sessionId||r.id===t||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n}function s(e,t){return e?.backend??t?.runner??`claude`}function c(e,t){let n;for(let r of e)r.removedBackend===void 0&&(t===void 0||r.sessionId!==t)||(!n||!r.startedAt||!n.startedAt||r.startedAt>=n.startedAt)&&(n=r);return n?.removedBackend===void 0?void 0:n}function l(e){let t=o(e.steps),n=c(e.steps,t?.sessionId)?void 0:t;return{sessionId:n?.sessionId,backend:s(n,e),profileId:n?.profileId}}var u=new Set([`queued`,`running`,`waiting`]);function d(e){return u.has(e)}function f(e){return i(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function p(e){return f(e)&&e.status!==`queued`}function m(e,n,r){return e.archived||!(e.status===`done`||e.status===`failed`||e.status===`cancelled`)||e.delegation?.role===`worker`||r!==void 0&&t(e)!==r?!1:n===`unpinned`?!e.pinned:n!==`pinned`||e.pinned===!0}var h=[`done`,`failed`];function g(e){return e.archived||i(e)||!h.includes(e.status)?!1:e.finishedAt!==void 0}function _(e){let t=e.finishedAt;return t===void 0||!g(e)?!1:e.seenAt===void 0||e.seenAt<t}var v=[`Needs you`,`Finished`,`Working`,`Archived`],y={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},b=3,x=e=>i(e)?b:y[e.status]??9;function S(t){let n=t=>e[a(t).bucket];return[...t].sort((e,t)=>n(e)-n(t)||x(e)-x(t))[0]}function C(e,t){return t===`archived`?`Archived`:n(e)?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function w(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function T(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function E(e,t){return t!==void 0&&T(e).ref===t}function D(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function O(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=x(e)-x(n);if(r!==0)return r;if(i(e)&&i(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function k(e){return e.delegation?.role===`worker`}function A(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!k(n)?e:n.delegation?.parentRunId??e}function j(e,t,n=D(e)){let r=O(e,t).filter(e=>!k(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(C(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return v.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function M(e,t={}){let n=typeof t==`number`?{overall:t}:r(t),i={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},a=[],o=n.overall===void 0?10:n.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:n[i[t.label]]??1/0,r=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:o<=0||e<=0?!1:(--o,--e,!0)});r.length&&a.push({label:t.label,rows:r})}return a}function N(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function P(e){let t=0,r=0,i=0;for(let a of e)if(!k(a)){if(a.archived){r+=1;continue}t+=1,n(a)&&(i+=1)}return{active:t,archived:r,waiting:i}}function F(e,n,r){return e.filter(e=>!e.archived&&(!r||t(e)===(n===`automations`)))}var I={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},L=Object.keys(I),R=`section`;function z(e,t,n){let r=`${R}=${I[e]}`;return n?`/?origin=${t===`automations`?`automations`:`direct`}&${r}`:`/?${r}`}function B(e){return L.find(t=>I[t]===e)??null}function V(e,r){let i={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let a of e){if(k(a)||a.archived)continue;let e=+!!n(a);r&&t(a)?(i.automations+=1,i.automationsWaiting+=e):(i.active+=1,i.activeWaiting+=e)}return i}export{m as C,s as D,o as E,p as S,l as T,T as _,j as a,f as b,S as c,E as d,w as f,F as g,V as h,M as i,B as l,A as m,R as n,k as o,z as p,L as r,P as s,v as t,D as u,N as v,_ as w,d as x,g as y};
|