@hearsay-tools/squawk 0.19.0-dev.9132 → 0.19.0-dev.9137
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 +4 -4
- package/web/dist/assets/{accounts-section-B4kEEiWs.js → accounts-section-BsgnDmow.js} +1 -1
- package/web/dist/assets/{activity-motion-DUZ4l5Y3.js → activity-motion-Ckq9kC3I.js} +1 -1
- package/web/dist/assets/{activity-route-YAqJVIKB.js → activity-route-5S9WhN9U.js} +1 -1
- package/web/dist/assets/{agent-config-section-bUNUaoek.js → agent-config-section-D8pxNy2V.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-B8dWNT51.js → agent-defaults-section-et5LHv9W.js} +1 -1
- package/web/dist/assets/{appearance-BwqalVnF.js → appearance-D_t3wCjY.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-B3PVwd5v.js → archive-on-merge-field-C63xRNFZ.js} +1 -1
- package/web/dist/assets/{ask-card-BmLwnSDP.js → ask-card-kqWOqKIc.js} +3 -3
- package/web/dist/assets/{automations-route-B0AiEpEO.js → automations-route-B5YBpGMc.js} +2 -2
- package/web/dist/assets/{commit-list-DidJ1SQk.js → commit-list-Bjc-pQxv.js} +1 -1
- package/web/dist/assets/{diff-controls-BW6ZPORB.js → diff-controls-CaCUSyxs.js} +1 -1
- package/web/dist/assets/{diff-1-ZZxHE7.js → diff-lwWO-At7.js} +2 -2
- package/web/dist/assets/{diff-view-BXLNGK_U.js → diff-view-4wxDvYXE.js} +1 -1
- package/web/dist/assets/discard-changes-dialog-B3gvm7lX.js +1 -0
- package/web/dist/assets/{file-preview-CL7CFVQW.js → file-preview-98pJhZJj.js} +1 -1
- package/web/dist/assets/{git-toolbar-Cn5M9SIx.js → git-toolbar-CepvG0Ng.js} +1 -1
- package/web/dist/assets/{github-CWssvL9L.js → github-4Jhl7lLG.js} +1 -1
- package/web/dist/assets/{global-activity-route-WSb9IeCy.js → global-activity-route-DhmrWj31.js} +1 -1
- package/web/dist/assets/index-BK1FcZrA.css +1 -0
- package/web/dist/assets/index-DJB0lid-.js +21 -0
- package/web/dist/assets/{markdown-DkyIbV7h.js → markdown-BAPhDASs.js} +1 -1
- package/web/dist/assets/{option-select-DgSc8QKe.js → option-select-BwSkbCrQ.js} +1 -1
- package/web/dist/assets/{preferences-section-C5ipASFT.js → preferences-section-Cvh644K0.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-B_DUnNJx.js → preview-pane-connected-B08ZdGux.js} +2 -2
- package/web/dist/assets/{project-location-0NYs0ZDN.js → project-location-DR8go8oL.js} +1 -1
- package/web/dist/assets/{projects-section-CQquy8jC.js → projects-section-XDboHBFP.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-CbchtG9G.js → prompt-templates-section-DcxD28iA.js} +2 -2
- package/web/dist/assets/{remote-settings-notice-BosQQg8I.js → remote-settings-notice-Dtaa3ovl.js} +1 -1
- package/web/dist/assets/repo-git-Dp9R2TuI.js +1 -0
- package/web/dist/assets/{report-reader-DCpgZb3Q.js → report-reader-mbkd2DKt.js} +1 -1
- package/web/dist/assets/{reports-C7oXbx7H.js → reports-ya2OW-iR.js} +1 -1
- package/web/dist/assets/{resources-section-B7ikBubL.js → resources-section-g5XRlefz.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-DrS7HBu8.js → review-notes-drafts-BdBvLP6E.js} +1 -1
- package/web/dist/assets/{review-panel-DocPb2sY.js → review-panel-Ba8yb8Fu.js} +1 -1
- package/web/dist/assets/{review-strip-BqnpW1n1.js → review-strip-CdlMeV2i.js} +1 -1
- package/web/dist/assets/{run-header-C_asFhAY.js → run-header-BTRXYB4W.js} +2 -2
- package/web/dist/assets/{select-DuuHVsVn.js → select-DdH25sWT.js} +1 -1
- package/web/dist/assets/{session-context-section-DecXXiZF.js → session-context-section-BqEdLdTv.js} +2 -2
- package/web/dist/assets/{settings-agent-picker-C4KKci2g.js → settings-agent-picker-b4M6fQ8m.js} +1 -1
- package/web/dist/assets/{settings-save-bar-Jp9UQXYS.js → settings-save-bar-DFY_Km4X.js} +1 -1
- package/web/dist/assets/{settings-shell-D_WnST_P.js → settings-shell-BUwdvhI9.js} +1 -1
- package/web/dist/assets/{sidebar-section-Dyw_hnnC.js → sidebar-section-CcucfASN.js} +1 -1
- package/web/dist/assets/{skills-C48utCzL.js → skills-BLkPhZO8.js} +1 -1
- package/web/dist/assets/{task-changes-CHMaGATC.js → task-changes-Drvnew5P.js} +2 -2
- package/web/dist/assets/{task-commits-BWBec83J.js → task-commits-1MJHuX1i.js} +1 -1
- package/web/dist/assets/{task-file-scope-bmyzqReq.js → task-file-scope-CB3L3KQl.js} +1 -1
- package/web/dist/assets/{task-files-BjSP_4uv.js → task-files-B9okW1TC.js} +1 -1
- package/web/dist/assets/{task-github-item-CFCxfzlu.js → task-github-item-CMNk7FxR.js} +1 -1
- package/web/dist/assets/{task-thread-C4aSbGAi.js → task-thread-_2ch8BRt.js} +2 -2
- package/web/dist/assets/{task-thread-C70CCqyd.css → task-thread-a6CXLxwn.css} +1 -1
- package/web/dist/assets/{thread-state-C1Pf77GN.js → thread-state-qNczqxZQ.js} +1 -1
- package/web/dist/assets/{use-finish-run-CqVI9_BW.js → use-finish-run-Dvm4JnAH.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-B0wW0kOx.js → use-hand-to-agent-state-CBJvP-US.js} +1 -1
- package/web/dist/assets/use-path-bases-C9yvZF5B.js +1 -0
- package/web/dist/assets/{workflows-B8CS-UWS.js → workflows-BUcx-n8J.js} +3 -3
- package/web/dist/assets/{workspace-tools-DA2Q9bj8.js → workspace-tools-dbiR1fzO.js} +1 -1
- package/web/dist/assets/{worktrees-section-BdZorHZ5.js → worktrees-section-Dyb_QkSd.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/discard-changes-dialog-BVKAatbp.js +0 -1
- package/web/dist/assets/index-CESQIsLq.css +0 -1
- package/web/dist/assets/index-CS4efF3Z.js +0 -21
- package/web/dist/assets/repo-git-DxWPoHJ9.js +0 -1
- package/web/dist/assets/use-path-bases-BZSjw1dB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{J as t,Ut as n,X as r,Z as i,dn as a}from"./queries-CchoEEzj.js";import{Rn as o,Tt as s,wt as c}from"./toaster-zMN8cNZQ.js";import{h as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as u,M as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./run-header-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{J as t,Ut as n,X as r,Z as i,dn as a}from"./queries-CchoEEzj.js";import{Rn as o,Tt as s,wt as c}from"./toaster-zMN8cNZQ.js";import{h as l}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as u,M as d}from"./design-icons-QbNMZniQ.js";import{t as f}from"./run-header-BTRXYB4W.js";import{t as p}from"./project-router-j0uBi7Ep.js";import{b as m}from"./task-groups-CGCnVqHE.js";import{f as h,l as g,m as _}from"./page-shell-BgabWJ3w.js";import{t as v}from"./centered-state-BgSV4e79.js";import{A as y,Un as b,k as x}from"./index-DJB0lid-.js";import{t as S}from"./change-counts-wqSYI3W8.js";import{t as C}from"./code-workbench-CUkiQ1pF.js";import{t as w}from"./file-text-nGpo7MVd.js";import{i as T,r as E,t as D}from"./commit-list-Bjc-pQxv.js";import{i as O,n as k,r as A}from"./selected-file-CfBWFB6p.js";var j=e();function M(){let{id:e}=l(),n=t(e);return n.isPending?(0,j.jsx)(y,{tab:`changes`}):n.isError?(0,j.jsx)(x,{tab:`changes`,error:n.error}):(0,j.jsx)(N,{run:n.data})}function N({run:e}){let{sha:t}=l(),n=i(e.id,m(e)),r=_(),a=t??n.data?.commits[0]?.sha,s=t!==void 0&&(!r||n.isError||n.data?.commits.length===0);return(0,j.jsxs)(g,{route:`task-commits`,density:h(n.data?.commits.length??0),flushPadding:!0,children:[(0,j.jsx)(f,{run:e,tab:`commits`}),s?(0,j.jsx)(F,{runId:e.id,sha:t}):n.isPending?(0,j.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-9`,children:`Loading commits…`}):n.isError?(0,j.jsx)(v,{icon:(0,j.jsx)(d,{size:16}),tone:n.error instanceof o&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof o&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,j.jsx)(v,{icon:(0,j.jsx)(d,{size:16}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,j.jsx)(P,{run:e,commits:n.data.commits,selectedSha:a})]})}function P({run:e,commits:t,selectedSha:n}){let i=r(e.id,n),a=L(e.id,t),o=A(e.id,`commit:${n??``}`,i.data?.files),c=O(e.id);return(0,j.jsx)(C,{className:`px-4 py-5 md:px-9`,treeSlot:`task-commits-pane`,tree:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(D,{slot:`task-commits`,selectedSha:n,heading:(0,j.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[t.length,` `,t.length===1?`commit`:`commits`,` in this task`]}),className:`w-full`,commits:t.map(t=>({...t,href:`/tasks/${e.id}/commits/${t.sha}`,stat:a.get(t.sha)}))}),n&&i.data&&i.data.files.length>0?(0,j.jsx)(R,{runId:e.id,sha:n,files:i.data.files,selected:c,onPick:t=>{k(e.id,t),o.reveal(t)}}):null]}),children:n?(0,j.jsx)(T,{commit:i,sha:n,slot:`task-commit-preview`,heading:`h3`,diffRef:o,loadFileText:t=>w(()=>s(e.id,n,t))}):null})}function F({runId:e,sha:t}){let n=r(e,t);return(0,j.jsx)(E,{commit:n,sha:t,diffRef:A(e,`commit:${t}`,n.data?.files),backTo:`/tasks/${e}/commits`,backLabel:`All commits`,slot:`task-commit`,loadFileText:n=>w(()=>s(e,t,n))})}var I=12;function L(e,t){let r=t.length<=I,i=a({queries:t.map(t=>({queryKey:n.runs.commit(e,t.sha),queryFn:({signal:n})=>c(e,t.sha,{signal:n}),enabled:r,retry:!1}))}),o=new Map;return i.forEach((e,n)=>{let r=t[n]?.sha;r&&e.data?.stat&&o.set(r,e.data.stat)}),o}function R({runId:e,sha:t,files:n,selected:r,onPick:i}){return(0,j.jsxs)(`section`,{"data-slot":`task-commit-files`,className:`mt-4 rounded-xl border border-border bg-card p-4`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,j.jsxs)(`h2`,{className:`text-sm font-semibold text-foreground`,children:[n.length,` `,n.length===1?`file`:`files`,` in`,` `,(0,j.jsx)(b,{sha:t,variant:`inline`,className:`text-[13px] font-medium`})]}),(0,j.jsx)(p,{to:`/tasks/${e}/changes`,className:`text-xs text-muted-foreground hover:text-foreground`,children:`All task changes ›`})]}),(0,j.jsx)(`ul`,{className:`space-y-1`,children:n.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{type:`button`,"data-slot":`task-commit-file`,title:e.oldPath?`${e.oldPath} → ${e.path}`:e.path,"aria-current":e.path===r?`true`:void 0,onClick:()=>i(e.path),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=true]:bg-muted aria-[current=true]:text-foreground`,children:[(0,j.jsx)(u,{size:16,"aria-hidden":`true`,className:`size-[15px] shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 break-all`,children:e.path}),(0,j.jsx)(S,{adds:e.adds,dels:e.dels,className:`font-mono text-xs`})]})},e.path))})]})}export{M as TaskCommitsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{d as r,h as i}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{w as a}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{d as r,h as i}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{w as a}from"./index-DJB0lid-.js";var o=e(t(),1),s=n();function c({runId:e,children:t}){let n=r(),i=(0,o.useMemo)(()=>({runId:e}),[e]);return n?(0,s.jsx)(l,{runId:e,children:t}):(0,s.jsx)(a.Provider,{value:i,children:t})}function l({runId:e,children:t}){let{projectId:n}=i(),r=(0,o.useMemo)(()=>({runId:e,...n?{projectId:n}:{}}),[e,n]);return(0,s.jsx)(a.Provider,{value:r,children:t})}export{c as t};
|
|
@@ -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{o as r}from"./dist-C_rn70hE.js";import{$ as i,J as a,M as o,P as s,z as c}from"./queries-CchoEEzj.js";import{Rn as l,it as u,mt as d}from"./toaster-zMN8cNZQ.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as g,E as _,Q as v,Z as ee,ct as y,d as b}from"./design-icons-QbNMZniQ.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as S}from"./run-header-C_asFhAY.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-CL7CFVQW.js";import{t as D}from"./button-B22ANdCY.js";import{l as O}from"./page-shell-BgabWJ3w.js";import{t as k}from"./centered-state-BgSV4e79.js";import{t as A}from"./use-search-params-writer-ClMScnNe.js";import{A as j,E as M,Vn as N,k as P,lr as F,vr as I,w as L}from"./index-CS4efF3Z.js";import{t as R}from"./task-file-scope-bmyzqReq.js";import{t as z}from"./code-workbench-CUkiQ1pF.js";import{t as B}from"./middle-truncated-name-D41ibfXD.js";import{n as V,t as H}from"./selected-file-CfBWFB6p.js";var U=x(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),ne=x(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),W=e(t(),1),G=n();function K({runId:e,path:t,artifactId:n,worktreePath:r}){let i=c(e,n?null:t),a=o(e,n),s=n?a:i,l=(0,W.useContext)(L),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=s.data,g=(0,W.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...l,basePath:h.path}:null,[h,l,e]);if(!t&&!n)return(0,G.jsx)(te,{runId:e,path:null,className:`min-w-0 flex-1`});if(s.isPending)return(0,G.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(s.isError)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:`Could not load this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:s.error.message}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});if(!h)return(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=w(h.path,r,t);if(h.type!==`file`)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,G.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});let v=h.artifact;return(0,G.jsx)(L.Provider,{value:g,children:(0,G.jsx)(T,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?u(e,v.id,`image`):d(e,t),...v?{downloadUrl:u(e,v.id,`download`),snapshot:(0,G.jsx)(N,{iso:v.createdAt})}:{}},v?.id??h.path)})}var q=new Map;function J(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var Y=(0,W.createContext)(null);function X(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,W.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var Z=()=>document.querySelector(`[data-slot="main"]`);function re(e,t){let n=(0,W.useRef)(null),r=f(),i=h()===`POP`?r.key:J(r.state),[a]=(0,W.useState)(()=>{let t=i?q.get(i):void 0;return t?.runId===e?t:null}),o=(0,W.useRef)(new Set(a?.folders??[])),s=(0,W.useRef)(new Set),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(a===null),d=(0,W.useCallback)(()=>{u.current&&q.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:Z()?.scrollTop??0})},[r.key,e]),p=(0,W.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,W.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=Z();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,W.useEffect)(()=>{d();let e=[n.current,Z()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:p}}function ie({runId:e,selected:t,onSelect:n}){return(0,G.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Q({runId:e,path:t,depth:n,selected:r,onSelect:a}){let o=i(e,t),s=(0,W.useContext)(Y);return(0,W.useEffect)(()=>{if(!(!t||!s))return s.loading(t,o.isPending),()=>s.loading(t,!1)},[s,t,o.isPending]),o.isPending?(0,G.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):o.isError?(0,G.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,G.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,G.jsx)(G.Fragment,{children:o.data.entries.map(i=>i.type===`dir`?(0,G.jsx)(ae,{runId:e,name:i.chain??i.name,path:t===``?i.chain??i.name:`${t}/${i.chain??i.name}`,depth:n,selected:r,onSelect:a},i.name):(0,G.jsx)(oe,{name:i.name,path:t===``?i.name:`${t}/${i.name}`,size:i.size,depth:n,selected:r,onSelect:a},i.name))}):null}function ae({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,W.useContext)(Y),[c,l]=(0,W.useState)(()=>s?.isOpen(n)??!1);return(0,G.jsxs)(`li`,{children:[(0,G.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,G.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,G.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{title:n,className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function oe({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=E(t)?ne:g;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":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,G.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(B,{name:e,path:t}),n===void 0?null:(0,G.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:C(n)})]})})}function $(){let{id:e}=m(),t=a(e),n=X();return t.isPending?(0,G.jsx)(j,{tab:`files`}):t.isError?(0,G.jsx)(P,{tab:`files`,error:t.error}):(0,G.jsx)(R,{runId:t.data.id,children:(0,G.jsx)(le,{run:t.data},`${t.data.id}:${n}`)})}function se(e,t,n,r){let i=c(e,r||n!==null?null:t),a=o(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function ce(e,t,n,r){let i=e.id,a=e.worktreePath,[,o]=A(),s=h(),c=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(c.current)return;c.current=!0;let e=H(i);s===`POP`||t!==null||n!==null||e===null||o(t=>(t.set(`path`,e),t))},[s,n,t,i,o]),(0,W.useEffect)(()=>{t!==null&&!r&&V(i,M(t,a))},[r,t,i,a])}function le({run:e}){let t=i(e.id,``),n=s(e.id),[r,a]=p(),o=r.get(`path`),c=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&c!==null;ce(e,o,c,u);let[d,f]=(0,W.useState)(o??``);(0,W.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof l&&t.error.status===409,g=se(e.id,o,c,u),_=re(e.id,!t.isPending&&g);return(0,G.jsxs)(O,{route:`task-files`,density:ue(t.isError),flushPadding:!0,children:[(0,G.jsx)(S,{run:e,tab:`files`}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,G.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,G.jsx)(F,{"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,G.jsx)(D,{type:`submit`,variant:`outline`,className:`shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,G.jsx)(z,{className:`flex-none gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:gap-0 md:px-9`,treeRef:_.tree,treeSlot:`files-tree-pane`,treeClassName:`rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:overflow-y-auto md:overscroll-contain`,tree:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,G.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,G.jsx)(k,{icon:h?(0,G.jsx)(U,{}):(0,G.jsx)(y,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,G.jsx)(Y.Provider,{value:_.folders,children:(0,G.jsx)(ie,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,G.jsx)(de,{artifacts:n,artifactId:c,onSelect:e=>m(`artifact`,e)})]}),children:u?(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||c!==null||t.isSuccess?(0,G.jsx)(K,{runId:e.id,path:o,artifactId:c,worktreePath:e.worktreePath}):null}),(0,G.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}function ue(e){return e?`empty`:`full`}function de({artifacts:e,artifactId:t,onSelect:n}){return(0,G.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,G.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,G.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,G.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,G.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>n(e.id),children:[(0,G.jsx)(I,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,G.jsxs)(D,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2`,onClick:()=>void e.refetch(),children:[(0,G.jsx)(ee,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ as TaskFilesRoute};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{$ as i,J as a,M as o,P as s,z as c}from"./queries-CchoEEzj.js";import{Rn as l,it as u,mt as d}from"./toaster-zMN8cNZQ.js";import{f,g as p,h as m,m as h}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{C as g,E as _,Q as v,Z as ee,ct as y,d as b}from"./design-icons-QbNMZniQ.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{t as S}from"./run-header-BTRXYB4W.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-98pJhZJj.js";import{t as D}from"./button-B22ANdCY.js";import{l as O}from"./page-shell-BgabWJ3w.js";import{t as k}from"./centered-state-BgSV4e79.js";import{t as A}from"./use-search-params-writer-ClMScnNe.js";import{A as j,E as M,Hn as N,k as P,ur as F,w as I,yr as L}from"./index-DJB0lid-.js";import{t as R}from"./task-file-scope-CB3L3KQl.js";import{t as z}from"./code-workbench-CUkiQ1pF.js";import{t as B}from"./middle-truncated-name-D41ibfXD.js";import{n as V,t as H}from"./selected-file-CfBWFB6p.js";var U=x(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),ne=x(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),W=e(t(),1),G=n();function K({runId:e,path:t,artifactId:n,worktreePath:r}){let i=c(e,n?null:t),a=o(e,n),s=n?a:i,l=(0,W.useContext)(I),p=f(),m=p.pathname.replace(/\/files\/?$/,`/report`)+p.search,h=s.data,g=(0,W.useMemo)(()=>h?.type===`file`&&h.source!==`artifact`?{runId:e,...l,basePath:h.path}:null,[h,l,e]);if(!t&&!n)return(0,G.jsx)(te,{runId:e,path:null,className:`min-w-0 flex-1`});if(s.isPending)return(0,G.jsx)(`p`,{role:`status`,className:`p-4`,children:`Loading file…`});if(s.isError)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:`Could not load this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere text-sm`,children:s.error.message}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});if(!h)return(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`No file data was returned.`});let _=w(h.path,r,t);if(h.type!==`file`)return(0,G.jsxs)(`section`,{"data-slot":`file-preview`,className:`min-w-0 flex-1 rounded-lg border p-4`,children:[(0,G.jsx)(`h2`,{children:h.type===`unpublished`?`File not published`:`Cannot preview this file`}),(0,G.jsx)(`p`,{className:`wrap-anywhere py-2 font-mono text-xs`,children:_}),(0,G.jsx)(`p`,{className:`text-sm`,children:h.reason}),(0,G.jsx)(D,{variant:`outline`,onClick:()=>void s.refetch(),children:`Retry`})]});let v=h.artifact;return(0,G.jsx)(I.Provider,{value:g,children:(0,G.jsx)(T,{runId:e,entry:h,displayPath:_,documentPreview:!0,readerHref:m,className:`min-w-0 flex-1`,imageUrl:v?u(e,v.id,`image`):d(e,t),...v?{downloadUrl:u(e,v.id,`download`),snapshot:(0,G.jsx)(N,{iso:v.createdAt})}:{}},v?.id??h.path)})}var q=new Map;function J(e){let t=e?.filesRestoreKey;return typeof t==`string`&&t?t:null}var Y=(0,W.createContext)(null);function X(){let{key:e}=f(),t=h()===`POP`,[n,r]=(0,W.useState)({key:e,generation:0});if(n.key===e)return n.generation;let i={key:e,generation:t?n.generation+1:n.generation};return r(i),i.generation}var Z=()=>document.querySelector(`[data-slot="main"]`);function re(e,t){let n=(0,W.useRef)(null),r=f(),i=h()===`POP`?r.key:J(r.state),[a]=(0,W.useState)(()=>{let t=i?q.get(i):void 0;return t?.runId===e?t:null}),o=(0,W.useRef)(new Set(a?.folders??[])),s=(0,W.useRef)(new Set),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(a===null),d=(0,W.useCallback)(()=>{u.current&&q.set(r.key,{runId:e,folders:new Set(o.current),tree:n.current?.scrollTop??0,main:Z()?.scrollTop??0})},[r.key,e]),p=(0,W.useMemo)(()=>({isOpen:e=>o.current.has(e),setOpen:(e,t)=>{t?o.current.add(e):o.current.delete(e),d()},loading:(e,t)=>{a?.folders.has(e)&&(t?s.current.add(e):s.current.delete(e),l(s.current.size))}}),[a,d]);return(0,W.useEffect)(()=>{if(u.current||!a||!t||s.current.size>0)return;n.current&&(n.current.scrollTop=a.tree);let e=Z();e&&(e.scrollTop=a.main),u.current=!0,d()},[a,t,c,d]),(0,W.useEffect)(()=>{d();let e=[n.current,Z()].filter(e=>e!==null);for(let t of e)t.addEventListener(`scroll`,d,{passive:!0});return()=>{for(let t of e)t.removeEventListener(`scroll`,d)}},[d]),{tree:n,folders:p}}function ie({runId:e,selected:t,onSelect:n}){return(0,G.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function Q({runId:e,path:t,depth:n,selected:r,onSelect:a}){let o=i(e,t),s=(0,W.useContext)(Y);return(0,W.useEffect)(()=>{if(!(!t||!s))return s.loading(t,o.isPending),()=>s.loading(t,!1)},[s,t,o.isPending]),o.isPending?(0,G.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Loading…`}):o.isError?(0,G.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${6+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,G.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${6+n*14}px`},children:`Empty directory`}):(0,G.jsx)(G.Fragment,{children:o.data.entries.map(i=>i.type===`dir`?(0,G.jsx)(ae,{runId:e,name:i.chain??i.name,path:t===``?i.chain??i.name:`${t}/${i.chain??i.name}`,depth:n,selected:r,onSelect:a},i.name):(0,G.jsx)(oe,{name:i.name,path:t===``?i.name:`${t}/${i.name}`,size:i.size,depth:n,selected:r,onSelect:a},i.name))}):null}function ae({runId:e,name:t,path:n,depth:i,selected:a,onSelect:o}){let s=(0,W.useContext)(Y),[c,l]=(0,W.useState)(()=>s?.isOpen(n)??!1);return(0,G.jsxs)(`li`,{children:[(0,G.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,G.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,G.jsx)(_,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{title:n,className:`min-w-0 truncate font-normal`,children:t})]}),c?(0,G.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,G.jsx)(Q,{runId:e,path:n,depth:i+1,selected:a,onSelect:o})}):null]})}function oe({name:e,path:t,size:n,depth:i,selected:a,onSelect:o}){let s=a===t,c=E(t)?ne:g;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":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,G.jsx)(c,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,G.jsx)(B,{name:e,path:t}),n===void 0?null:(0,G.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs tabular-nums text-soft-foreground`,children:C(n)})]})})}function $(){let{id:e}=m(),t=a(e),n=X();return t.isPending?(0,G.jsx)(j,{tab:`files`}):t.isError?(0,G.jsx)(P,{tab:`files`,error:t.error}):(0,G.jsx)(R,{runId:t.data.id,children:(0,G.jsx)(le,{run:t.data},`${t.data.id}:${n}`)})}function se(e,t,n,r){let i=c(e,r||n!==null?null:t),a=o(e,r?null:n);return r||t===null&&n===null?!0:!(n===null?i:a).isPending}function ce(e,t,n,r){let i=e.id,a=e.worktreePath,[,o]=A(),s=h(),c=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(c.current)return;c.current=!0;let e=H(i);s===`POP`||t!==null||n!==null||e===null||o(t=>(t.set(`path`,e),t))},[s,n,t,i,o]),(0,W.useEffect)(()=>{t!==null&&!r&&V(i,M(t,a))},[r,t,i,a])}function le({run:e}){let t=i(e.id,``),n=s(e.id),[r,a]=p(),o=r.get(`path`),c=r.get(`artifact`),u=r.getAll(`path`).length>1||r.getAll(`artifact`).length>1||o!==null&&c!==null;ce(e,o,c,u);let[d,f]=(0,W.useState)(o??``);(0,W.useEffect)(()=>f(o??``),[o]);let m=(e,t)=>{let n=new URLSearchParams(r);n.delete(`path`),n.delete(`artifact`),n.set(e,t),a(n)},h=t.isError&&t.error instanceof l&&t.error.status===409,g=se(e.id,o,c,u),_=re(e.id,!t.isPending&&g);return(0,G.jsxs)(O,{route:`task-files`,density:ue(t.isError),flushPadding:!0,children:[(0,G.jsx)(S,{run:e,tab:`files`}),(0,G.jsxs)(`form`,{className:`flex min-w-0 gap-2 px-4 pt-[22px] md:px-9`,onSubmit:e=>{e.preventDefault(),d.trim()&&m(`path`,d.trim())},children:[(0,G.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,G.jsx)(v,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3.5 size-4 text-muted-foreground`}),(0,G.jsx)(F,{"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,G.jsx)(D,{type:`submit`,variant:`outline`,className:`shrink-0`,disabled:!d.trim(),children:`Open file`})]}),(0,G.jsx)(z,{className:`flex-none gap-5 px-4 py-[22px] [--diff-sticky-top:1rem] md:gap-0 md:px-9`,treeRef:_.tree,treeSlot:`files-tree-pane`,treeClassName:`rounded-xl border border-border bg-card p-3.5 md:sticky md:top-[var(--diff-sticky-top)] md:max-h-[calc(100dvh_-_64px_-_var(--diff-sticky-top)_-_1rem)] md:overflow-y-auto md:overscroll-contain`,tree:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h2`,{className:`sr-only`,children:`Worktree files`}),t.isPending?(0,G.jsx)(`p`,{"data-slot":`files-loading`,className:`py-4 text-xs`,children:`Loading files…`}):t.isError?(0,G.jsx)(k,{icon:h?(0,G.jsx)(U,{}):(0,G.jsx)(y,{size:16}),tone:h?`neutral`:`danger`,heading:`h2`,title:h?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,G.jsx)(Y.Provider,{value:_.folders,children:(0,G.jsx)(ie,{runId:e.id,selected:o,onSelect:e=>m(`path`,e)})}),(0,G.jsx)(de,{artifacts:n,artifactId:c,onSelect:e=>m(`artifact`,e)})]}),children:u?(0,G.jsx)(`p`,{role:`alert`,className:`p-4`,children:`Invalid file link: choose either a path or a published artifact.`}):o!==null||c!==null||t.isSuccess?(0,G.jsx)(K,{runId:e.id,path:o,artifactId:c,worktreePath:e.worktreePath}):null}),(0,G.jsx)(`p`,{className:`px-4 pb-6 text-xs text-muted-foreground md:px-9`,children:`Browsing files is read-only. Worktree contents may differ from your main checkout. Published files are snapshots.`})]})}function ue(e){return e?`empty`:`full`}function de({artifacts:e,artifactId:t,onSelect:n}){return(0,G.jsxs)(`section`,{className:`mt-4 border-t border-border pt-3`,"aria-label":`Published artifacts`,children:[(0,G.jsx)(`h2`,{className:`text-sm font-medium`,children:`Published artifacts`}),e.isPending?(0,G.jsx)(`p`,{className:`py-2 text-xs`,children:`Loading published files…`}):e.isError?(0,G.jsx)(`p`,{role:`alert`,className:`py-2 text-xs`,children:`Could not load published files.`}):e.data.artifacts.length===0?(0,G.jsx)(`p`,{className:`py-2 text-xs text-muted-foreground`,children:`No published files yet.`}):(0,G.jsx)(`ul`,{children:e.data.artifacts.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,"data-slot":`artifact-row`,"aria-current":e.id===t?`true`:void 0,className:`group flex min-h-11 w-full items-center gap-2 rounded px-2 py-2 text-left text-xs text-foreground hover:bg-muted focus-visible:ring-2 aria-[current=true]:bg-muted aria-[current=true]:font-medium`,onClick:()=>n(e.id),children:[(0,G.jsx)(L,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 wrap-anywhere underline-offset-2 group-hover:underline`,children:e.name}),(0,G.jsx)(b,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground group-hover:text-foreground`})]})},e.id))}),(0,G.jsxs)(D,{variant:`outline`,size:`sm`,"data-action":`refresh-artifacts`,className:`mt-2`,onClick:()=>void e.refetch(),children:[(0,G.jsx)(ee,{"aria-hidden":`true`}),`Refresh published files`]})]})}export{$ as TaskFilesRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{s as t}from"./dist-C_rn70hE.js";import{J as n,Ut as r,a as i,bt as a,n as o,un as s,vt as c,xt as l}from"./queries-CchoEEzj.js";import{Y as u,vi as d}from"./toaster-zMN8cNZQ.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as p,T as m}from"./reference-chip-z7dZJVH-.js";import{I as h,ct as g,m as _}from"./design-icons-QbNMZniQ.js";import{t as v}from"./run-header-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{s as t}from"./dist-C_rn70hE.js";import{J as n,Ut as r,a as i,bt as a,n as o,un as s,vt as c,xt as l}from"./queries-CchoEEzj.js";import{Y as u,vi as d}from"./toaster-zMN8cNZQ.js";import{h as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{S as p,T as m}from"./reference-chip-z7dZJVH-.js";import{I as h,ct as g,m as _}from"./design-icons-QbNMZniQ.js";import{t as v}from"./run-header-BTRXYB4W.js";import{t as y}from"./external-link-BE6y205O.js";import{t as b}from"./search-x-I9Q8pgUa.js";import{t as x}from"./button-B22ANdCY.js";import{t as S}from"./project-router-j0uBi7Ep.js";import{l as C}from"./page-shell-BgabWJ3w.js";import{t as w}from"./centered-state-BgSV4e79.js";import{O as T,gr as E,k as D}from"./index-DJB0lid-.js";import{l as O,n as k,t as A}from"./use-hand-to-agent-state-CBJvP-US.js";var j=e(),M={issue:`Issue`,pr:`Pull request`};function N({kind:e}){let{id:t}=f(),r=n(t);return r.isPending?(0,j.jsx)(T,{kind:e}):r.isError?(0,j.jsx)(D,{tab:`github-item`,error:r.error}):(0,j.jsx)(P,{run:r.data,kind:e})}function P({run:e,kind:t}){let{n}=f(),r=Number(n),o=a(),s=l(),u=c(),d=s.isPending||u.isPending,m=p(e,o).some(e=>e.kind===t&&e.number===r),h=i(t,r,m);return(0,j.jsxs)(C,{route:`task-github-item`,density:m?`full`:`empty`,flushPadding:!0,children:[(0,j.jsx)(v,{run:e,tab:{kind:t,number:r}}),m?(0,j.jsx)(H,{run:e,kind:t,number:r,repoBase:o,item:h}):d?(0,j.jsx)(T,{kind:t,number:r,heading:`h2`}):(0,j.jsx)(w,{icon:(0,j.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,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsx)(S,{to:`/tasks/${e.id}`,children:`Back to the session`})})})]})}function F(e,t){return e===`pr`&&t.data?.available===!0&&t.data.item!==null}function I(e,t,n,r){return e===`pr`?n?.[t]??r:r}function L({retry:e,kind:t,number:n}){return(0,j.jsx)(x,{variant:`outline`,disabled:e.isPending,onClick:()=>e.mutate(r.githubItem(t,n)),children:`Retry`})}function R({kind:e,number:t,error:n,retryButton:r}){return(0,j.jsx)(w,{icon:(0,j.jsx)(g,{size:16}),tone:`danger`,heading:`h2`,title:`Could not load ${M[e].toLowerCase()} #${t}`,subtitle:n.message,actions:r})}function z({run:e,kind:n,number:r,repoBase:i,reason:a,retryError:o,retryButton:s}){let c=n===`pr`?h:_,l=m(e,i).find(e=>e.kind===`PR`==(n===`pr`)&&e.number===r)?.url;return(0,j.jsx)(w,{icon:(0,j.jsx)(c,{size:16}),tone:`neutral`,heading:`h2`,title:`GitHub is unavailable`,subtitle:o?.message??a,actions:(0,j.jsxs)(j.Fragment,{children:[s,l&&t(l)?(0,j.jsx)(x,{asChild:!0,variant:`outline`,children:(0,j.jsxs)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,children:[`open on GitHub`,(0,j.jsx)(y,{"aria-hidden":`true`})]})}):null]})})}function B({label:e,repoBase:t}){return(0,j.jsx)(w,{icon:(0,j.jsx)(b,{}),tone:`neutral`,heading:`h2`,title:`${e} was not found in ${U(t)}`,subtitle:`It may have been deleted, or the number points at a different repository.`})}function V({kind:e,item:t,labelColors:n,checks:r}){return(0,j.jsx)(`div`,{className:`min-w-0 px-0.5 md:px-2`,children:(0,j.jsx)(O,{item:t,colors:n??{},checks:r,backLink:null,subNav:null,children:e===`issue`?(0,j.jsx)(W,{item:t},t.url):null})})}function H({run:e,kind:t,number:n,repoBase:r,item:i}){let a=d(),c=s({mutationFn:e=>u(t,n,{refresh:!0}),onSuccess:(e,t)=>a.setQueryData(t,e)}),l=F(t,i),f=o(l?[n]:[],l),p=f.data?.available?f.data.checks:void 0,m=`${M[t]} #${n}`,h=(0,j.jsx)(L,{retry:c,kind:t,number:n});if(i.isPending)return(0,j.jsx)(T,{kind:t,number:n,heading:`h2`});if(i.isError)return(0,j.jsx)(R,{kind:t,number:n,error:c.error??i.error,retryButton:h});let g=i.data;return g.available?g.item?(0,j.jsx)(V,{kind:t,item:g.item,labelColors:g.labelColors,checks:I(t,n,p,g.item.checks)}):(0,j.jsx)(B,{label:m,repoBase:r}):(0,j.jsx)(z,{run:e,kind:t,number:n,repoBase:r,reason:g.reason,retryError:c.error,retryButton:h})}function U(e){if(!e)return`this repository`;try{return new URL(e).pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`)||`this repository`}catch{return`this repository`}}function W({item:e}){let t=A();return(0,j.jsx)(k,{item:e,workflows:t.workflows.data?.workflows??[],skills:t.skillList,workflow:t.workflow,onWorkflowChange:t.setWorkflow,selectedSkills:t.selectedSkills,onSkillsChange:t.setSelectedSkills,engine:t.engine,onEngineChange:t.setEngine,queuedRunId:t.queued.get(e.url)??null,onQueued:t.onQueued},e.url)}export{N as TaskGithubItemRoute};
|