@hearsay-tools/squawk 0.19.0-dev.9065 → 0.19.0-dev.9071
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/automations/automations-routes.d.ts +150 -150
- package/dist/server/models-routes.d.ts +12 -12
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/projects-routes.d.ts +73 -73
- package/dist/server/server.d.ts +1190 -1190
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-DrA0kndh.js +1 -0
- package/web/dist/assets/activity-motion-C23PnhhH.js +1 -0
- package/web/dist/assets/{activity-route-CGRkPwJP.js → activity-route-CWGPbwtG.js} +1 -1
- package/web/dist/assets/{agent-config-section-C6I_sRta.js → agent-config-section-DWZQ2DSW.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-CiOFMcep.js → agent-defaults-section-Da4tKbp7.js} +1 -1
- package/web/dist/assets/{appearance-CBX1qOwx.js → appearance-Bm4ePfiH.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-BzxW7NJS.js → archive-on-merge-field-DuRmMR6k.js} +1 -1
- package/web/dist/assets/ask-card-vM_Z-WAg.js +9 -0
- package/web/dist/assets/automations-route-B8zD3wux.js +2 -0
- package/web/dist/assets/{badge-B6B-xYQQ.js → badge-DVxxThpb.js} +1 -1
- package/web/dist/assets/{button-C8jUIs8Q.js → button-B22ANdCY.js} +1 -1
- package/web/dist/assets/{command-BiBq24zL.js → command-B2Y0By1v.js} +1 -1
- package/web/dist/assets/{commit-list-CCgF6z16.js → commit-list-lwVhwbS8.js} +1 -1
- package/web/dist/assets/{dialog-DRZuXvul.js → dialog-rpNyAWGb.js} +1 -1
- package/web/dist/assets/{diff-BcseHLlM.js → diff-CC5UqjNZ.js} +2 -2
- package/web/dist/assets/diff-controls-C8KWZ5S-.js +1 -0
- package/web/dist/assets/{diff-view--Nv4Px8F.js → diff-view-DiuQQoKq.js} +2 -2
- package/web/dist/assets/{discard-changes-dialog-CD2HMH7E.js → discard-changes-dialog-CX7M4k9n.js} +1 -1
- package/web/dist/assets/{file-preview-BwrymAy7.js → file-preview-C_0CRYAr.js} +1 -1
- package/web/dist/assets/{git-toolbar-CYgIbgOf.js → git-toolbar-PM540i_A.js} +1 -1
- package/web/dist/assets/github-CeBvZzjo.js +1 -0
- package/web/dist/assets/{global-activity-route-BXAhhLrt.js → global-activity-route-CiTt7W6o.js} +2 -2
- package/web/dist/assets/index-CSgBel_0.css +1 -0
- package/web/dist/assets/index-UFO7Bk2I.js +21 -0
- package/web/dist/assets/{markdown-BAmUNyiK.js → markdown-CqzDs1kO.js} +1 -1
- package/web/dist/assets/{open-in-menu-Bzca0KPF.js → open-in-menu-CbQWVBD0.js} +1 -1
- package/web/dist/assets/{option-select-BxFrlK_-.js → option-select-CDOKbUov.js} +1 -1
- package/web/dist/assets/page-shell-BgabWJ3w.js +1 -0
- package/web/dist/assets/{page-shell-DQPYcKyL.css → page-shell-CEIoW56O.css} +1 -1
- package/web/dist/assets/{preferences-section-ByeO0I87.js → preferences-section-cdbIMfEU.js} +1 -1
- package/web/dist/assets/preview-pane-connected-BcU9ryyW.js +3 -0
- package/web/dist/assets/{project-location-Cq1K7hXN.js → project-location-BpBbcl3v.js} +1 -1
- package/web/dist/assets/{projects-section-P0RuBn2c.js → projects-section-CX1WJq4d.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-ChqZ2Gl4.js → prompt-templates-section-DrQthAY7.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-DYOP5Yxe.js → remote-settings-notice-_MtFnktv.js} +1 -1
- package/web/dist/assets/repo-git-5JS3oL12.js +1 -0
- package/web/dist/assets/{report-reader-D0ud2uIA.js → report-reader-iboN3k6l.js} +1 -1
- package/web/dist/assets/{reports-BNO0jrQI.js → reports-Cn3kWlK7.js} +1 -1
- package/web/dist/assets/{resources-section-CQkpzv63.js → resources-section-BmDbIpaO.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-B_Mb82AK.js → review-notes-drafts-DXxIudVB.js} +1 -1
- package/web/dist/assets/{review-panel-DcEmHodb.js → review-panel-BjWbFGev.js} +1 -1
- package/web/dist/assets/review-strip-QIghY88F.js +1 -0
- package/web/dist/assets/{run-diff-BvGvPk3g.js → run-diff-BDMdnSv7.js} +1 -1
- package/web/dist/assets/run-header-788Dmvef.css +1 -0
- package/web/dist/assets/run-header-BWLcG57S.js +2 -0
- package/web/dist/assets/{select--dGOlrzM.js → select-BxuV2GlN.js} +1 -1
- package/web/dist/assets/{session-context-section-b4-i_DSE.js → session-context-section-OLW5UTvx.js} +2 -2
- package/web/dist/assets/{settings-agent-picker-BhyVKLRu.js → settings-agent-picker-Dasyc6Qo.js} +1 -1
- package/web/dist/assets/{settings-list-detail-Dn5CWzHj.js → settings-list-detail-D3ibaYUj.js} +1 -1
- package/web/dist/assets/{settings-save-bar-9D1QPg_P.js → settings-save-bar-Mrc6Vm7P.js} +1 -1
- package/web/dist/assets/settings-shell-Bvje3VDf.css +1 -0
- package/web/dist/assets/settings-shell-DWRk12-i.js +1 -0
- package/web/dist/assets/sidebar-section-CVNvjM29.js +1 -0
- package/web/dist/assets/{skills-BizIiogS.js → skills-7MwCp2i_.js} +1 -1
- package/web/dist/assets/{status-dot-BXf-Ubd0.js → status-dot-Drd4-nfa.js} +1 -1
- package/web/dist/assets/{task-changes-DjB5jujp.js → task-changes-DSZjztX7.js} +1 -1
- package/web/dist/assets/{task-commits-cDkfIAvD.js → task-commits-P_ElCQ4M.js} +1 -1
- package/web/dist/assets/{task-file-scope-DLVI8zBp.js → task-file-scope-B63NmSov.js} +1 -1
- package/web/dist/assets/{task-files-BVbjuEaL.js → task-files-CSFB6sG7.js} +1 -1
- package/web/dist/assets/{task-github-item-DW5Rl7Me.js → task-github-item-BJ1rGyc6.js} +1 -1
- package/web/dist/assets/task-thread-C0DbAGi_.js +2 -0
- package/web/dist/assets/task-thread-i16nxSQv.css +1 -0
- package/web/dist/assets/thread-state-B7pyjJYO.js +4 -0
- package/web/dist/assets/{use-finish-run-BK7gmbXh.js → use-finish-run-B1Gy5JPt.js} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-BSM9EGsW.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-CMyKCFeb.js +1 -0
- package/web/dist/assets/use-path-bases-wGc__G57.js +1 -0
- package/web/dist/assets/workflows-D7bXUmGa.css +1 -0
- package/web/dist/assets/workflows-seQiL2pi.js +7 -0
- package/web/dist/assets/workspace-tools-BDf7nsE5.js +1 -0
- package/web/dist/assets/{worktrees-section-Cm1pcQ9g.js → worktrees-section-x7r5wRhx.js} +1 -1
- package/web/dist/index.html +10 -10
- package/web/dist/assets/accounts-section-CdmTsc7W.js +0 -1
- package/web/dist/assets/activity-motion-CrFzRrI5.js +0 -1
- package/web/dist/assets/ask-card-CKD_gFDN.js +0 -9
- package/web/dist/assets/automations-route-CoSNUId5.js +0 -2
- package/web/dist/assets/diff-controls-DhD4a7Z4.js +0 -1
- package/web/dist/assets/github-CtYRNNDH.js +0 -1
- package/web/dist/assets/index-BUmO8olN.css +0 -1
- package/web/dist/assets/index-CXvWnyZg.js +0 -21
- package/web/dist/assets/page-shell-Dky5crRl.js +0 -1
- package/web/dist/assets/preview-pane-connected-CJy9Miri.js +0 -3
- package/web/dist/assets/repo-git-DcZTZ70-.js +0 -1
- package/web/dist/assets/review-strip-En21aXDx.js +0 -1
- package/web/dist/assets/run-header-DE0wTSnO.js +0 -2
- package/web/dist/assets/run-header-V9BxPSvn.css +0 -1
- package/web/dist/assets/settings-shell-Ct4CWWvw.js +0 -1
- package/web/dist/assets/settings-shell-Ct_qn_MM.css +0 -1
- package/web/dist/assets/sidebar-section-azclPE--.js +0 -1
- package/web/dist/assets/task-thread-DTLhAQbe.js +0 -2
- package/web/dist/assets/task-thread-DxVehGLy.css +0 -1
- package/web/dist/assets/thread-state-VRKiUyJj.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-DZZUsUAd.css +0 -1
- package/web/dist/assets/use-hand-to-agent-state-pINTYkY9.js +0 -1
- package/web/dist/assets/use-path-bases-D1yBeTzY.js +0 -1
- package/web/dist/assets/workflows-B2Sw8qQa.css +0 -1
- package/web/dist/assets/workflows-D2h67tAS.js +0 -7
- package/web/dist/assets/workspace-tools-uIbmvTfR.js +0 -1
package/web/dist/assets/{settings-agent-picker-BhyVKLRu.js → settings-agent-picker-Dasyc6Qo.js}
RENAMED
|
@@ -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{Qt as i,Wt as a,Xt as o,nn as s,un as c,vt as l}from"./queries-CchoEEzj.js";import{Hn as u,Or as d,si as f,vi as p,zn as m}from"./toaster-zMN8cNZQ.js";import{ot as h,u as g}from"./design-icons-QbNMZniQ.js";import{t as _}from"./button-
|
|
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{Qt as i,Wt as a,Xt as o,nn as s,un as c,vt as l}from"./queries-CchoEEzj.js";import{Hn as u,Or as d,si as f,vi as p,zn as m}from"./toaster-zMN8cNZQ.js";import{ot as h,u as g}from"./design-icons-QbNMZniQ.js";import{t as _}from"./button-B22ANdCY.js";import{a as v,i as y,o as b,r as x,s as S,t as C}from"./dialog-rpNyAWGb.js";import{sr as w}from"./index-UFO7Bk2I.js";var T=e(t(),1),E=n();function D(e,t){return o(t).flatMap(t=>{let n=e.filter(e=>e.provider===t.id);return n.length<2?[{runner:t,account:null,label:t.pickerLabel,desc:t.pickerDescription,missing:!1}]:n.map(e=>({runner:t,account:e.isDefault?null:e.id,label:`${t.pickerLabel} · ${e.label}`,desc:e.configDir?e.exists?e.configDir:`${e.configDir} — folder not created yet`:e.exists?``:`Not initialized on host yet`,missing:!e.exists,...e.isDefault||e.status===void 0?{}:{accountStatus:e.status.status}}))})}var O=(e,t)=>e.length>i(t).length;function k(e,t,n){let r=d(e.data,t),i=r!==void 0&&r.status!==`not-installed`&&(n??r.status)===`connected`,a=!e.isPending&&!e.isError&&r?.enabled===!0&&i;return{providerConnected:a,providerReason:e.isPending?`Checking provider authentication…`:e.isError?`Provider authentication could not be verified.`:r?.enabled===!1?`This provider is disabled. Enable it above or choose another provider.`:a?void 0:`Connect this provider before selecting it.`}}function A({rows:e,runner:t,accountFor:n,providerStatus:i,disabled:a=!1,accountDisabled:o=!1,onPick:c}){let l=s().data,u=l===void 0,d=O(e,l);return(0,E.jsx)(`div`,{role:`radiogroup`,"aria-label":`Default runner`,"data-slot":`agents-runner`,className:r(`gap-0.5 rounded-md border border-border bg-card p-0.5`,d?`flex max-w-md flex-col`:`inline-flex w-fit`),children:e.map(s=>{let{providerConnected:l,providerReason:f}=k(i,s.runner.id,s.accountStatus),p=e.filter(e=>e.runner.id===s.runner.id).length>1,m=s.runner.id===t&&s.account===n(s.runner.id);return(0,E.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":m,"data-value":s.runner.id,"data-account":s.account??``,title:f??s.desc,disabled:a||u||!l||p&&o,onClick:()=>c(s.runner.id,s.account,p),className:r(`rounded-sm px-3 py-1.5 text-left font-mono text-[13px] font-medium transition-colors disabled:opacity-50`,m?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:[s.label,d?(0,E.jsx)(`span`,{"data-slot":s.missing?`agents-account-missing`:`agents-account-dir`,"data-runner":s.runner.id,className:`ml-2 font-sans text-xs text-soft-foreground`,children:s.desc}):null]},`${s.runner.id}:${s.account??``}`)})})}async function j(e,t){return u(await m.api.v1.providers[`sign-in`].start.$post({json:{provider:e,...t?{profileId:t}:{}}}),`/providers/sign-in/start`)}async function M(e){return u(await m.api.v1.providers[`sign-in`][`:id`].$get({param:{id:e}}),`/providers/sign-in/:id`)}async function N(e,t){return u(await m.api.v1.providers[`sign-in`][`:id`].redirect.$post({param:{id:e},json:{redirectUrl:t}}),`/providers/sign-in/:id/redirect`)}async function P(e){return u(await m.api.v1.providers[`sign-in`][`:id`].$delete({param:{id:e}}),`/providers/sign-in/:id`)}function F(e,t){let n=p(),[r,i]=(0,T.useState)(!1),[o,s]=(0,T.useState)(null),[l,u]=(0,T.useState)(``),d=(0,T.useRef)(null),m=(0,T.useRef)(!0),h=(0,T.useRef)(0),g=()=>{h.current++,v.current=!1;let e=d.current;d.current=null,e?.state===`waiting`&&P(e.id).catch(()=>{}),s(null),u(``),i(!1)};(0,T.useEffect)(()=>(m.current=!0,()=>{m.current=!1,h.current++;let e=d.current;e?.state===`waiting`&&P(e.id).catch(()=>{})}),[]);let _=c({mutationFn:n=>j(e,t).then(e=>({result:e,generation:n})),retry:!1,onSuccess:({result:e,generation:t})=>{if(!m.current||!v.current||t!==h.current){P(e.id).catch(()=>{});return}d.current=e,s(e)}}),v=(0,T.useRef)(r);v.current=r;let y=f({queryKey:[`browser-sign-in`,o?.id],queryFn:()=>M(o.id),enabled:r&&o?.state===`waiting`,retry:!1,refetchInterval:e=>e.state.error||e.state.data?.state&&e.state.data.state!==`waiting`?!1:1e3,gcTime:0}),b=y.data??o,x=c({mutationFn:()=>N(o.id,l),retry:!1,onSuccess:()=>{u(``),y.refetch()}});return(0,T.useEffect)(()=>{b?.state===`connected`&&(d.current=b,s(b),Promise.all([n.invalidateQueries({queryKey:a.agentProfiles}),n.invalidateQueries({queryKey:a.providerStatus}),n.invalidateQueries({queryKey:a.models(e)})]))},[b,n,e]),{open:r,result:b,redirect:l,setRedirect:u,start:_,replay:x,status:y,error:_.error??x.error??y.error,close:g,connect:()=>{i(!0),v.current=!0,_.reset(),x.reset(),_.mutate(++h.current)}}}function I(){return`Open the sign-in link in your browser. After Google consent, the page shows a code. Copy that code, or the full address of that page, and paste it below.`}function L({provider:e,profileId:t,label:n}){let{open:r,result:i,redirect:a,setRedirect:o,start:s,replay:c,status:u,error:d,close:f,connect:p}=F(e,t);return l().data?.capabilities?.settingsAdmin===!0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(_,{type:`button`,size:`sm`,"data-action":`account-connect`,disabled:s.isPending,onClick:p,children:`Connect`}),(0,E.jsx)(C,{open:r,onOpenChange:e=>{e||f()},children:(0,E.jsxs)(x,{children:[(0,E.jsxs)(b,{children:[(0,E.jsxs)(S,{children:[`Sign in to `,n]}),(0,E.jsx)(y,{children:`Use a personal Google account. Business and agent-platform sign-in are not supported.`})]}),s.isPending?(0,E.jsx)(`p`,{role:`status`,children:`Preparing sign-in…`}):null,i?.state===`waiting`?(0,E.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,E.jsx)(`a`,{href:i.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-action underline`,children:`Open Google sign-in`}),(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,E.jsx)(I,{})}),(0,E.jsxs)(`label`,{className:`grid gap-2`,children:[`Code or page address`,(0,E.jsx)(w,{type:`text`,autoComplete:`off`,spellCheck:!1,value:a,onChange:e=>o(e.target.value)})]}),(0,E.jsx)(_,{disabled:!a.trim()||c.isPending,onClick:()=>c.mutate(),children:`Complete sign-in`})]}):null,i?.state===`connected`?(0,E.jsx)(`p`,{role:`status`,children:`Connected.`}):null,i?.state===`failed`?(0,E.jsx)(`p`,{role:`alert`,children:i.error}):null,i?.state===`cancelled`?(0,E.jsx)(`p`,{role:`status`,children:`Sign-in cancelled. Close this window and Connect again.`}):null,d?(0,E.jsx)(`p`,{role:`alert`,children:d.message}):null,u.isError&&i?.state===`waiting`?(0,E.jsx)(_,{onClick:()=>void u.refetch(),children:`Retry status`}):null,(0,E.jsx)(v,{children:(0,E.jsx)(_,{variant:`outline`,onClick:f,children:i?.state===`connected`?`Done`:`Cancel`})})]})})]}):null}function R(e){let t=e.label.startsWith(e.runner.pickerLabel)?e.label.slice(e.runner.pickerLabel.length):``;return{...e,label:`${e.runner.displayName}${t}`}}function z(e){let t=(0,T.useRef)(null),n=e.rows.map(R),r=n.find(t=>t.runner.id===e.runner&&t.account===e.accountFor(t.runner.id)),i=n.find(t=>t.runner.id===e.runner)?.runner.displayName;return(0,E.jsxs)(`details`,{ref:t,className:`settings-agent-picker`,children:[(0,E.jsxs)(`summary`,{children:[(0,E.jsx)(h,{"aria-hidden":`true`,className:`size-4 text-accent-text`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1`,children:r?.label??i??e.runner}),(0,E.jsx)(g,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})]}),(0,E.jsx)(A,{...e,rows:n,onPick:(...n)=>{e.onPick(...n),t.current&&(t.current.open=!1)}})]})}export{k as a,O as i,L as n,D as r,z as t};
|
package/web/dist/assets/{settings-list-detail-Dn5CWzHj.js → settings-list-detail-D3ibaYUj.js}
RENAMED
|
@@ -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{d as i}from"./design-icons-QbNMZniQ.js";import{i as a}from"./page-shell-
|
|
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{d as i}from"./design-icons-QbNMZniQ.js";import{i as a}from"./page-shell-BgabWJ3w.js";var o=e(t(),1),s=n();function c({slot:e,label:t,items:n,itemKey:c,selectedKey:l,onSelect:u,row:d,detail:f,empty:p}){let m=(0,o.useRef)(null),h=a(m),g=n.find(e=>c(e)===l)??(h?n[0]:void 0),_=g===void 0?null:c(g);return(0,s.jsx)(`div`,{ref:m,"data-slot":e,"data-layout":h?`split`:`stack`,className:`settings-list-detail`,children:n.length===0?p:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`ul`,{"aria-label":t,className:`settings-list-detail-rows`,children:n.map(t=>{let n=c(t),a=n===_;return(0,s.jsxs)(`li`,{"data-key":n,"data-selected":a?`true`:void 0,children:[(0,s.jsxs)(`button`,{type:`button`,"data-slot":`${e}-row`,"data-key":n,"aria-pressed":a,"aria-expanded":h?void 0:a,onClick:()=>u(!h&&a?null:n),className:r(`settings-list-detail-row`,a&&`is-open`),children:[(0,s.jsx)(`span`,{className:`min-w-0 flex-1`,children:d(t)}),(0,s.jsx)(i,{"aria-hidden":`true`,className:r(`size-4 shrink-0 text-soft-foreground motion-safe:transition-transform`,!h&&a&&`rotate-90`)})]}),!h&&a?(0,s.jsx)(`div`,{"data-slot":`${e}-detail`,className:`settings-list-detail-inline`,children:f(t)}):null]},n)})}),h&&g!==void 0?(0,s.jsx)(`section`,{"data-slot":`${e}-detail`,className:`settings-list-detail-pane`,children:f(g)},_):null]})})}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{p as r}from"./dist-C_rn70hE.js";import{t as i}from"./button-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{p as r}from"./dist-C_rn70hE.js";import{t as i}from"./button-B22ANdCY.js";import{En as a}from"./index-UFO7Bk2I.js";import{n as o}from"./save-cue-CpHgT93o.js";var s=e(t(),1),c=n(),l={dirty:0,invalid:0,busy:0},u=class{entries=new Map;listeners=new Set;snapshot=l;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.snapshot;set(e,t,n){this.entries.set(e,{...t,draft:n}),this.publish()}delete(e){this.entries.delete(e)&&this.publish()}dirtyDrafts(){return[...this.entries.values()].filter(e=>e.dirty).map(e=>e.draft.current)}publish(){let e=0,t=0,n=0;for(let r of this.entries.values())r.dirty&&(e+=1,r.invalid&&(t+=1),r.busy&&(n+=1));let{snapshot:r}=this;if(!(e===r.dirty&&t===r.invalid&&n===r.busy)){this.snapshot=e===0&&t===0&&n===0?l:{dirty:e,invalid:t,busy:n};for(let e of this.listeners)e()}}},d=(0,s.createContext)(null);function f(e){let t=(0,s.useContext)(d);if(!t)throw Error(`useSettingsDraft needs a SettingsDraftScope above it`);let n=(0,s.useId)(),r=(0,s.useRef)(e);(0,s.useLayoutEffect)(()=>{r.current=e});let i=e.dirty,o=e.invalid===!0,c=e.busy===!0;(0,s.useLayoutEffect)(()=>{t.set(n,{dirty:i,invalid:o,busy:c},r)},[t,n,i,o,c]),(0,s.useLayoutEffect)(()=>()=>t.delete(n),[t,n]),a(e.holdsReload??i)}function p({children:e}){let[t]=(0,s.useState)(()=>new u);return(0,c.jsxs)(d.Provider,{value:t,children:[e,(0,c.jsx)(h,{store:t})]})}function m(e){return e===1?`1 field`:`${e} fields`}function h({store:e}){let{dirty:t,invalid:n,busy:a}=(0,s.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot),[l,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(0),{saved:p,flash:h}=o(),g=(0,s.useRef)(!0);(0,s.useLayoutEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]);let _=async()=>{u(!0),f(0);let t=r(),n=0;for(let i of e.dirtyDrafts()){if(!g.current||r()!==t)return;try{await i.save()}catch{n+=1}}g.current&&(u(!1),n>0?f(n):h())},v=()=>{f(0);for(let t of e.dirtyDrafts())t.discard()},y=l||a>0;if(t===0&&!y)return p?(0,c.jsx)(`div`,{"data-slot":`settings-save-bar`,"data-state":`saved`,className:`settings-save-bar`,children:(0,c.jsx)(`span`,{role:`status`,className:`settings-save-bar-message`,children:`Saved`})}):null;let b=`Unsaved changes`;return y?b=`Saving…`:n>0?b=`Unsaved changes — fix ${m(n)}`:d>0&&(b=`Unsaved changes — ${m(d)} did not save`),(0,c.jsxs)(`div`,{"data-slot":`settings-save-bar`,"data-state":y?`saving`:`dirty`,className:`settings-save-bar`,children:[(0,c.jsx)(`span`,{role:`status`,className:`settings-save-bar-message`,children:b}),(0,c.jsxs)(`span`,{className:`settings-save-bar-actions`,children:[(0,c.jsx)(i,{type:`button`,variant:`outline`,size:`sm`,"data-action":`settings-discard`,disabled:y,onClick:v,children:`Discard`}),(0,c.jsx)(i,{type:`button`,variant:`primary`,size:`sm`,"data-action":`settings-save`,disabled:y||n>0,onClick:()=>void _(),children:`Save`})]})]})}function g(){return(0,c.jsx)(`button`,{type:`submit`,hidden:!0,tabIndex:-1,"aria-hidden":`true`,"data-slot":`settings-implicit-submit`})}export{p as n,f as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.settings-panel{border:1px solid var(--border-card);background:var(--card);width:100%;box-shadow:var(--shadow-card);border-radius:12px;padding:24px}.settings-panel>[data-slot]{width:100%;max-width:none;margin:0;padding:0}.settings-panel .settings-field+.settings-field{border-block-start:1px solid var(--border);padding-block-start:22px}.settings-panel .settings-field h2{font-size:14px;font-weight:400}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),.settings-select,textarea:not([data-slot=code-editor-input])){background:var(--background);min-width:0;max-width:100%;min-height:44px;box-shadow:none;font-size:13px}.settings-panel .settings-field-control>:is(input,.settings-select,textarea:not([data-slot=code-editor-input])),.settings-panel [data-slot=agents-default-runner],.settings-panel [data-slot=projects-browse-root],.settings-panel [data-slot=projects-checkout-root]{width:100%;max-width:none}.settings-panel button:not([data-button-size]):not([role=switch]):not([data-slot=project-tag-suggestion]){min-height:40px}.settings-panel [data-slot=resources-composer-defaults]{grid-template-columns:1fr;gap:24px}.settings-panel [data-slot=prompt-template-row]{gap:6px}.settings-panel [data-slot=agent-config-agents]{background:color-mix(in oklch, var(--muted) 60%, transparent);border:1px solid var(--border);border-radius:8px;gap:4px;width:fit-content;max-width:100%;padding:4px}.settings-panel [data-slot=agent-config-agent]{border:1px solid #0000}.settings-panel [data-slot=agent-config-agent][aria-selected=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs)}.settings-panel [data-slot=agent-config-group] ul{flex-direction:column;gap:6px}.settings-panel [data-slot=agent-config-file]{border:1px solid var(--border);width:100%;color:var(--foreground);padding-block:10px;padding-inline:12px}.settings-panel [data-slot=agent-config-file][data-selected=true]{border-color:var(--accent-strong);color:var(--accent-text)}.settings-route-body{gap:24px;width:100%;max-width:56rem;padding-block:0;padding-inline:0}.settings-route[data-route=settings-agent-config] .settings-route-body{max-width:none}.settings-section-picker{border:1px solid var(--border-card);background:var(--card);width:100%;box-shadow:var(--shadow-card);border-radius:8px;position:relative}.settings-section-picker summary{cursor:pointer;justify-content:space-between;align-items:center;min-height:48px;padding-block:12px;padding-inline:14px;font-size:14px;list-style:none;display:flex}.settings-section-picker summary::-webkit-details-marker{display:none}.settings-section-picker nav{border-block-start:1px solid var(--border);padding:4px;display:grid}.settings-section-picker nav a{border-radius:6px;padding:12px;font-size:13px}.settings-section-picker nav a[aria-current=page]{background:color-mix(in oklch, var(--accent-strong) 12%, transparent);color:var(--accent-text)}.settings-panel{border-radius:10px}.settings-panel h3,.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2{font-weight:400}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) h2+p{margin-block-start:8px;line-height:1.6}.settings-panel :is([data-slot=notifications-section],[data-slot=skills-settings-section]) [role=switch]{margin-block-start:8px}.settings-panel [data-slot=appearance-section]{border:0;border-radius:0}.settings-panel [data-slot=appearance-section]>section{gap:12px}.settings-panel [data-slot=appearance-section]>section+section{border-block-start:1px solid var(--border);padding-block-start:24px}.settings-panel [data-slot=appearance-section] h2{font-size:14px;font-weight:400}.settings-panel [data-slot=appearance-section] h2+p{margin-block-start:8px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{gap:4px}.settings-panel [data-slot=appearance-section] [role=radio]{border-radius:6px;padding-block:8px;padding-inline:14px;font-weight:400}.settings-panel [data-slot=notifications-permission]{margin-block:20px;margin-inline:0}.settings-panel [data-slot=notifications-permission][data-permission=denied]{color:var(--semantic-text-red)}.settings-panel .settings-readout{border:1px solid var(--border);background:var(--background);overflow-wrap:anywhere;border-radius:6px;padding:12px;font-size:13px;line-height:1.6}.settings-panel .settings-disclosure{border-block-start:1px solid var(--border);color:var(--muted-foreground);padding-block-start:16px;font-size:12px}.settings-panel .settings-disclosure summary{cursor:pointer;padding-block:4px;padding-inline:0}.settings-panel .settings-disclosure>:not(summary){margin-block-start:12px}.settings-panel [data-slot=agent-defaults-section]{gap:20px}.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:20px}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}.settings-panel [data-slot=agents-task-runs]>h2{font-size:14px;font-weight:400}.settings-panel .settings-option-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.settings-panel .settings-option-row>div:first-child{flex:1;min-width:0}.settings-panel .settings-option-row h3{font-size:14px;font-weight:400}.settings-panel .settings-option-row p{margin-block-start:8px;line-height:1.6}.settings-panel .settings-option-row label{flex-shrink:0}.settings-panel .settings-option-row label>span{display:none}.settings-panel .settings-form-actions{border-block-start:1px solid var(--border);flex-wrap:wrap;gap:12px;padding-block-start:20px;display:flex}@media (width<=767px){.settings-route-body{gap:20px;max-width:none}.settings-panel{padding:16px}.settings-panel button:not([data-button-size]):not([role=switch]):not([data-slot=project-tag-suggestion]):not([data-slot=prompt-template-skill-chip]){min-height:44px}.settings-panel [data-slot=agent-config-agents]{flex-wrap:wrap}.settings-panel [data-slot=agent-config-group] li{max-width:100%}.settings-panel [data-slot=appearance-section] [role=radiogroup]{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;display:grid}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-width]{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-panel [data-slot=appearance-section] [role=radio]{white-space:nowrap;justify-content:center;padding-inline:8px;font-size:12px}.settings-panel [data-slot=appearance-section] [role=radiogroup][data-slot=appearance-density]{grid-template-columns:repeat(3,auto);gap:4px}.settings-panel [data-slot=appearance-section] [data-slot=appearance-density] [role=radio]{padding-inline:10px}.settings-panel .settings-resource-controls{align-items:stretch}.settings-panel [data-slot=agents-system-prompt]{min-height:192px}}.settings-panel .settings-retention-controls input{width:100%}.settings-panel .settings-retention-controls>span{display:none}.settings-panel .settings-appearance-preview{padding:20px}.settings-panel [data-slot=appearance-theme] svg,.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>h2{display:none}.settings-panel [data-slot=prompt-templates-section]>.settings-field>div:first-child>p{margin-block-start:0}.settings-panel [data-slot=prompt-template-row]>label,.settings-panel [data-slot=prompt-template-row]>p,.settings-panel [data-slot=prompt-template-row]>label{margin-block-start:6px}.settings-panel [data-slot=prompt-template-row] textarea{min-height:44px}.settings-panel [data-slot=prompt-template-skill-chip]{border:1px solid var(--border);background:var(--muted);border-radius:6px;min-height:28px;padding-block:2px;padding-inline:8px;font-size:12px}.settings-panel [data-slot=prompt-template-skill-chip]:hover{background:color-mix(in oklch, var(--danger) 10%, transparent);color:var(--danger)}.settings-panel [data-slot=prompt-template-skills-trigger]{border-radius:6px}.settings-panel [data-slot=accounts-defaults]{margin-block-start:8px}.settings-panel [data-slot=accounts-defaults] .settings-select{max-width:none}.settings-panel [data-slot=account-details]{background:var(--background)}.settings-route [data-slot=project-general]{gap:20px}.settings-route [data-slot=project-general]>section{border-radius:10px;padding:20px}.settings-route [data-slot=project-general] [data-slot=project-facts]{border-block-end:1px solid var(--border);padding-block-end:16px}:is(.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-browse-root]) .settings-field-control>div:first-child,.settings-panel [data-slot=projects-section] .settings-field:has([data-slot=projects-checkout-root]) .settings-field-control>div:first-child){flex-wrap:wrap;row-gap:8px}.settings-panel [data-slot=settings-save-row]{align-items:center}.settings-panel [data-slot=settings-save-row]>*{margin:0}@media (width<=767px){.settings-panel [data-slot=accounts-defaults] label{flex-direction:column;align-items:stretch}.settings-panel [data-slot=accounts-defaults] label>span{width:auto}.settings-route [data-slot=project-general]>section{padding:16px}}.settings-agent-picker{border:1px solid var(--border);background:var(--background);border-radius:6px;min-width:0}.settings-agent-picker summary{cursor:pointer;align-items:center;gap:10px;min-height:44px;padding-block:10px;padding-inline:12px;font-size:13px;list-style:none;display:flex}.settings-agent-picker summary::-webkit-details-marker{display:none}.settings-agent-picker [data-slot=agents-runner]{border:0;border-block-start:1px solid var(--border);flex-direction:column;width:100%;max-width:none;padding:4px;display:flex}.settings-agent-picker [role=radio]{white-space:normal;font-family:inherit}.settings-panel [data-slot=settings-config-editor]>[data-slot=agent-config-editor-frame]{margin-block-start:8px}@media (width<=767px){.settings-route[data-route=settings] [data-slot=settings-index]{border:1px solid var(--border);background:var(--card);border-block-start:0;border-radius:0 0 10px 10px;gap:0;margin-block-start:0;padding-block:12px;padding-inline:16px}.settings-route[data-route=settings] [data-slot=settings-index] a{border:0;border-radius:0;padding-block:16px;padding-inline:0}.settings-route[data-route=settings] [data-slot=settings-index] a>span:first-child,.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span+span{display:none}.settings-route[data-route=settings] [data-slot=settings-index] a>span:nth-child(2)>span:first-child{color:var(--muted-foreground);font-size:13px;font-weight:400}.settings-panel .settings-resource-controls input{flex-basis:100%}.settings-panel [data-slot=resources-composer-defaults] .settings-select{width:100%}}.settings-model-control{position:relative}.settings-model-control>svg{pointer-events:none;position:absolute;inset-block-start:50%;inset-inline-start:12px;transform:translateY(-50%)}.settings-panel .settings-model-control :is(.settings-select,output){padding-inline-start:36px}.settings-route [data-slot=button]{border-radius:8px;font-weight:400}.settings-panel [data-slot=button]{padding-inline:16px}.settings-route [data-slot=switch-thumb]{background:#fff}.settings-panel .settings-form-actions [data-variant=primary]{order:1}.settings-panel .settings-form-actions>span{order:2}.settings-panel [data-slot=settings-config-editor]{gap:12px}.settings-config-toolbar{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.settings-config-file-row{flex-wrap:wrap;gap:10px;display:flex}.settings-config-file-row button{border:1px solid var(--border);background:var(--card);border-radius:8px;padding-block:10px;padding-inline:16px;font-size:12px;font-weight:400}.settings-config-file-row button[aria-pressed=true]{background:var(--card);color:var(--foreground);border-color:var(--border);box-shadow:var(--shadow-xs);font-weight:500}.settings-config-agent-choice{color:var(--muted-foreground);align-items:center;gap:8px;margin-inline-start:auto;font-size:12px;display:flex}.settings-panel .settings-config-agent-choice select{border:1px solid var(--border);border-radius:6px;min-height:36px;padding-block:6px;padding-inline:10px}.settings-config-content-heading{border-block-start:1px solid var(--border);margin-block-start:8px;padding-block-start:20px}.settings-config-content-heading h3{font-size:14px}.settings-config-content-heading p{color:var(--muted-foreground);margin-block-start:8px;font-size:12px}.settings-config-save-help{color:var(--muted-foreground);gap:8px;padding-block-start:8px;font-size:12px;display:grid}.settings-config-scopes{border-block-start:1px solid var(--border);gap:12px;padding-block-start:24px;display:grid}.settings-config-scopes h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]{background:0 0;border:0;gap:12px;margin-block-start:12px;padding:0}.settings-panel [data-slot=accounts-defaults]>div:first-child>h3{font-size:14px}.settings-panel [data-slot=accounts-defaults]>div:first-child>p{margin-block-start:8px;font-size:12px}.settings-account-models{background:var(--background);border:1px solid var(--border);border-radius:8px;padding:14px}.settings-panel .settings-account-model{background:var(--background);border:1px solid var(--border);border-radius:8px;padding-block:10px;padding-inline:12px;position:relative}.settings-panel .settings-account-model .settings-select{box-shadow:none;background:0 0;border:0;padding-inline:0;font-size:13px}@media (width<=767px){.settings-config-agent-choice{margin-inline-start:0}.settings-config-file-row{gap:8px}.settings-config-file-row button{padding-inline:12px}.settings-panel [data-slot=accounts-defaults] .settings-account-model{flex-flow:wrap;align-items:center}.settings-panel .settings-account-model .settings-select{flex:1;min-width:100px}}.settings-panel [data-slot=agent-config-path]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.settings-config-scopes [data-slot=agent-config-nav]{grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:20px;display:grid}.settings-config-scopes [data-slot=agent-config-file]{padding:8px;font-size:12px}.settings-panel [data-slot=accounts-defaults] .settings-model-agent-choice{color:var(--muted-foreground);flex-direction:row;align-items:center;gap:8px;font-size:12px;display:flex}.settings-panel .settings-model-agent-choice .settings-select{width:16rem;max-width:100%}.settings-config-scopes [data-slot=agent-config-group]>ul>li{width:100%;min-width:0}.settings-config-scopes [data-slot=agent-config-file]{min-width:0;max-width:100%}.settings-panel [data-slot=settings-config-editor] [data-slot=code-editor]{background:var(--background)}.settings-panel .settings-select{border:1px solid var(--border);border-radius:8px;padding-inline:12px}.settings-panel .settings-option-row{align-items:center}.settings-panel .settings-option-row :is(.settings-select,output){width:16rem;min-width:0;max-width:100%}.settings-panel .settings-field-control>.settings-select:is([data-slot=resources-max-parallel],[data-slot=resources-max-monitoring]){width:8rem}.settings-panel .settings-resource-controls input[data-slot=resources-memory-limit],.settings-panel .settings-resource-controls input[data-slot=resources-monitoring-wake-interval]{flex:none;width:9rem}.settings-panel [data-slot=resources-composer-defaults] .settings-select{width:16rem;max-width:100%}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label{font-size:14px;font-weight:400}.settings-panel [data-slot=archive-on-merge-field]>div:first-child>label+p{margin-block-start:4px;line-height:1.6}.settings-panel .settings-agent-card{gap:0;padding:0;scroll-margin-block-start:16px}.settings-agent-head{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;padding:12px 16px;display:flex}.settings-agent-heading{flex-wrap:wrap;flex:18rem;align-items:baseline;gap:2px 12px;min-width:0;display:flex}.settings-panel .settings-account-provider-title{color:var(--foreground);font-size:14px;font-weight:600}.settings-agent-summary{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 0;font-size:12px;line-height:1.5;display:flex}.settings-agent-summary-item{overflow-wrap:anywhere;align-items:center;min-width:0;display:inline-flex}.settings-agent-summary-sep{color:var(--soft-foreground);padding-inline:6px}.settings-account-actions{flex-flow:wrap;align-items:center;gap:8px;display:flex}.settings-panel .settings-agent-card .settings-account-actions button:not([data-slot=account-rename-input]){padding-inline:12px;font-size:12px}.settings-panel .settings-agent-card .settings-account-actions button:not([data-button-size]):not([data-slot=account-rename-input]){min-height:32px}.settings-agent-accounts{flex-direction:column;display:flex}.settings-account-meta{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-account-readout{flex-direction:column;align-items:flex-start;gap:2px;min-width:0;display:flex}.settings-account-meta-line{min-width:0;color:var(--muted-foreground);flex-wrap:wrap;align-items:center;gap:2px 12px;font-size:12px;display:flex}.settings-account-label{color:var(--foreground);font-size:13px;font-weight:500}.settings-account-path{font-family:var(--font-mono);color:color-mix(in oklch, var(--foreground) 80%, transparent);overflow-wrap:anywhere;font-size:12px;line-height:1.5}.settings-account-hint{color:var(--muted-foreground);font-size:12px;line-height:1.5}.settings-account-line{border-block-start:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 16px;margin-inline:16px;padding-block:8px 10px;display:flex}.settings-agent-note{border-block-start:1px solid var(--border);color:var(--muted-foreground);margin-inline:16px;padding-block:8px 10px;font-size:12px;line-height:1.5}.settings-agent-card>section[aria-label=CLI\ installation]{border-block-start:1px solid var(--border);margin-inline:16px;padding-block:8px 10px}.settings-account-management{display:contents}.settings-account-management>span{color:var(--muted-foreground);flex-basis:100%;font-size:12px}.settings-account-management [data-slot=account-rename-input]{min-width:0;max-width:100%}@media (width<=767px){.settings-agent-head{padding:12px}.settings-account-meta,.settings-account-line,.settings-agent-note,.settings-agent-card>section[aria-label=CLI\ installation]{margin-inline:12px}.settings-panel .settings-agent-card .settings-account-actions button:not([data-button-size]):not([data-slot=account-rename-input]){min-height:44px}}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),.settings-select,textarea:not([data-slot=code-editor-input])),.settings-panel [data-slot=code-editor]{border-color:var(--border)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),.settings-select,textarea:not([data-slot=code-editor-input])):focus-visible{border-color:var(--ring)}.settings-panel :is(input:not([type=checkbox]):not([type=radio]),.settings-select,textarea:not([data-slot=code-editor-input]))[aria-invalid=true]{border-color:var(--destructive)}.settings-panel [data-slot=code-editor]:focus-within{border-color:var(--ring)}.settings-panel :is(input,textarea)::placeholder{color:var(--soft-foreground);opacity:1}.settings-panel .settings-form-actions [data-variant=outline]:disabled{opacity:1;color:var(--muted-foreground);background:0 0}@media (width>=768px){.settings-panel{padding:20px 24px}}.settings-panel>:is([data-slot=agent-defaults-section],[data-slot=worktrees-section],[data-slot=projects-section],[data-slot=accounts-section]){gap:16px}.settings-panel .settings-field{gap:10px}.settings-panel .settings-field+.settings-field,.settings-panel [data-slot=agent-defaults-section] .settings-field+.settings-field{padding-block-start:18px}.settings-panel .settings-field h2+p{margin-block-start:4px;line-height:1.55}.settings-panel [data-slot=agents-task-runs]{gap:16px}.settings-panel [data-slot=agent-cards]{gap:12px}.settings-panel .settings-form-actions{padding-block-start:16px}.settings-panel [data-slot=appearance-section] [role=radiogroup]{background:color-mix(in oklch, var(--muted) 60%, transparent)}.settings-panel [data-slot=appearance-section] [role=radio][aria-checked=true]{background:var(--card);border-color:var(--border);color:var(--foreground);box-shadow:var(--shadow-xs);font-weight:500}.settings-panel .settings-select[data-slot=project-max-parallel]{width:15rem;max-width:100%}@media (width<=767px){.settings-panel .settings-select[data-slot=project-max-parallel]{width:100%}}@media (width<48rem),(any-pointer:coarse){[data-slot=agent-config-placeholder]{font-size:max(16px,1rem)}}.settings-save-bar{z-index:5;border:1px solid var(--border-card);background:var(--card);box-shadow:var(--shadow-card);color:var(--foreground);border-radius:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 16px;margin-block-start:20px;padding-block:10px;padding-inline:16px;font-size:13px;display:flex;position:sticky;inset-block-end:max(12px, env(safe-area-inset-bottom))}.settings-panel>.settings-save-bar{width:auto;margin-block-start:20px;padding-block:10px;padding-inline:16px}.settings-save-bar[data-state=saved]{color:var(--muted-foreground)}.settings-save-bar-actions{gap:8px;margin-inline-start:auto;display:inline-flex}@media (width<=767px){.settings-save-bar-actions{width:100%}.settings-save-bar-actions>*{flex:1}}.settings-list-detail{gap:16px;min-width:0;display:grid}.settings-list-detail[data-layout=split]{grid-template-columns:minmax(0,280px) minmax(0,1fr);align-items:start;gap:20px}.settings-list-detail-rows{flex-direction:column;gap:6px;min-width:0;display:flex}.settings-list-detail-row{text-align:start;border:1px solid var(--border);background:var(--background);width:100%;min-height:44px;color:var(--foreground);border-radius:8px;align-items:center;gap:10px;padding-block:8px;padding-inline:12px;font-size:13px;display:flex}.settings-list-detail-row:hover{background:var(--card-2)}.settings-list-detail-row:focus-visible{outline:2px solid var(--ring);outline-offset:2px}.settings-list-detail-row.is-open{border-color:var(--accent-strong)}.settings-list-detail-inline{gap:12px;padding-block:12px 4px;padding-inline:4px;display:grid}.settings-list-detail-pane{border:1px solid var(--border);border-radius:8px;gap:12px;min-width:0;padding:16px;display:grid}.settings-list-row-title{text-overflow:ellipsis;white-space:nowrap;font-weight:500;display:block;overflow:hidden}.settings-list-row-meta{text-overflow:ellipsis;white-space:nowrap;color:var(--muted-foreground);font-size:12px;display:block;overflow:hidden}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ft as r,Ot as i,Pt as a,ht as o,jt as s,xt as c}from"./queries-CchoEEzj.js";import{An as l,Dn as u,En as d,Tn as f,jn as p,n as m}from"./toaster-zMN8cNZQ.js";import{n as h,p as g,r as _}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{d as v,u as y}from"./design-icons-QbNMZniQ.js";import{t as b}from"./plus-CxRU2X8C.js";import{t as x}from"./button-B22ANdCY.js";import{n as ee,r as S,t as te}from"./collapsible-Bx2vViFx.js";import{t as C}from"./switch-CAKeV99j.js";import{t as w}from"./badge-DVxxThpb.js";import{n as T,s as E,t as D}from"./project-router-j0uBi7Ep.js";import"./attention-DnxGjw_R.js";import{o as O,u as ne}from"./page-shell-BgabWJ3w.js";import{En as re,J as ie,St as k,bt as ae,rr as oe,sr as A,xt as j}from"./index-UFO7Bk2I.js";import{t as se}from"./textarea-vEsJAUAV.js";import{n as ce}from"./save-cue-CpHgT93o.js";import{n as M}from"./settings-field-Bhh8I9fJ.js";import{t as le}from"./project-location-BpBbcl3v.js";import{n as N,r as ue,t as P}from"./settings-save-bar-Mrc6Vm7P.js";import{n as de,t as fe}from"./saved-draft-BwzBc-_Y.js";import{t as pe}from"./archive-on-merge-field-DuRmMR6k.js";import{a as me,i as he,n as F,t as I}from"./projects-section-CX1WJq4d.js";var L=e(t(),1),R={"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`}},z=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e)),B={name:``,description:``,url:``,token:``,tasks:!0,triggers:l,agent:!1};function V(e){return{name:e.name,description:e.description??``,url:e.url,token:``,tasks:e.tasks,triggers:e.triggers??l,agent:e.agent}}var H=e=>p.filter(t=>e.includes(t));function ge(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,...z(e.triggers,l)?{}:{triggers:H(e.triggers)},agent:e.agent}}function _e(e){return e.name.trim()!==``||e.description.trim()!==``||e.url.trim()!==``||e.token!==``||e.tasks!==B.tasks||e.agent!==B.agent||!z(e.triggers,B.triggers)}function ve(e,t){let n={},r=e.name.trim(),i=e.description.trim(),a=e.url.trim();return r!==t.name&&(n.name=r),i!==(t.description??``)&&(n.description=i),a!==t.url&&(n.url=a),e.token&&(n.token=e.token),e.tasks!==t.tasks&&(n.tasks=e.tasks),z(e.triggers,t.triggers??l)||(n.triggers=H(e.triggers)),e.agent!==t.agent&&(n.agent=e.agent),n}var U=n(),W=`flex flex-col gap-1 text-[13px]`,G=`text-xs text-muted-foreground`;function K({draft:e,onChange:t,tokenSet:n}){let r=(0,L.useId)(),i=(0,L.useId)(),a=(0,L.useId)(),o=(0,L.useId)(),s=(0,L.useId)(),c=(0,L.useId)(),l=(0,L.useId)(),m=(0,L.useId)(),h=(0,L.useId)(),g=(0,L.useId)();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3`,children:[(0,U.jsxs)(`div`,{className:W,children:[(0,U.jsx)(`label`,{htmlFor:r,className:G,children:`Name`}),(0,U.jsx)(A,{id:r,"data-slot":`webhook-name`,autoComplete:`off`,maxLength:80,placeholder:`e.g. Team bot`,value:e.name,onChange:e=>t({name:e.target.value})})]}),(0,U.jsxs)(`div`,{className:W,children:[(0,U.jsx)(`label`,{htmlFor:o,className:G,children:`URL`}),(0,U.jsx)(A,{id:o,"data-slot":`webhook-url`,type:`url`,inputMode:`url`,autoComplete:`off`,spellCheck:!1,maxLength:u,placeholder:`https://bot.example/hooks/cez`,value:e.url,onChange:e=>t({url:e.target.value})})]})]}),(0,U.jsxs)(`div`,{className:W,children:[(0,U.jsx)(`label`,{htmlFor:i,className:G,children:`Description`}),(0,U.jsx)(se,{id:i,"data-slot":`webhook-description`,"aria-describedby":a,rows:2,maxLength:f,placeholder:`e.g. Posts to the #releases channel. Use it for release notes.`,value:e.description,onChange:e=>t({description:e.target.value})}),(0,U.jsx)(`span`,{id:a,className:`text-xs text-soft-foreground`,children:`Agents read the name and description to decide when to use this webhook.`})]}),(0,U.jsxs)(`div`,{className:W,children:[(0,U.jsx)(`label`,{htmlFor:s,className:G,children:`Token`}),(0,U.jsx)(A,{id:s,"data-slot":`webhook-token`,type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:d,"aria-describedby":c,placeholder:n?`Token set — type to replace`:`Optional Bearer token`,value:e.token,onChange:e=>t({token:e.target.value})}),(0,U.jsx)(`span`,{id:c,className:`text-xs text-soft-foreground`,children:n?`The token is stored in ~/.cezar and never shown again. Leave it empty to keep it.`:`The token is stored in ~/.cezar, never in the repo. It is sent as a Bearer header.`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,U.jsx)(C,{id:l,"aria-describedby":m,"data-slot":`webhook-tasks`,checked:e.tasks,onCheckedChange:e=>t({tasks:e})}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,U.jsx)(`label`,{htmlFor:l,className:`font-medium`,children:`Task notifications`}),(0,U.jsx)(`span`,{id:m,className:`text-xs text-soft-foreground`,children:`Tasks you hand off, or start with notify on, send their status here.`})]})]}),e.tasks?(0,U.jsxs)(`fieldset`,{"data-slot":`webhook-triggers`,className:`flex flex-col gap-1 sm:ps-[3.25rem]`,children:[(0,U.jsx)(`legend`,{className:`pbe-1 text-xs text-muted-foreground`,children:`Send a delivery when a task enters`}),(0,U.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(min(100%,15rem),1fr))] gap-x-3`,children:p.map(n=>(0,U.jsxs)(`label`,{className:`flex min-h-11 items-start gap-2.5 pbs-2 text-[13px]`,children:[(0,U.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,U.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:R[n].label}),(0,U.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:R[n].hint})]})]},n))}),(0,U.jsx)(`p`,{className:`text-xs text-soft-foreground`,children:`Handing a task off and Send test always deliver.`})]}):null]}),(0,U.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3`,children:[(0,U.jsx)(C,{id:h,"aria-describedby":g,"data-slot":`webhook-agent`,checked:e.agent,onCheckedChange:e=>t({agent:e})}),(0,U.jsxs)(`span`,{className:`flex min-w-0 flex-col text-[13px]`,children:[(0,U.jsx)(`label`,{htmlFor:h,className:`font-medium`,children:`Let agents send reports`}),(0,U.jsx)(`span`,{id:g,className:`text-xs text-soft-foreground`,children:`Agents in this project may post a report here when the task calls for it.`})]})]})]})}var q=(e,t)=>({tone:`alert`,text:`Not saved: ${e.message}. Fix the field and select ${t} again.`}),ye=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 J({feedback:e}){return e?(0,U.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 Y=`rounded-md border border-border bg-background`,X=`flex flex-col gap-3 border-bs border-border p-3`;function be({projectId:e,webhook:t,defaultOpen:n=!1}){let r=a(),o=i(),c=s(),[l,u]=(0,L.useState)(n),[d,f]=de(V(t),fe),[p,h]=(0,L.useState)(null),g=ve(d,t),_=Object.keys(g).length>0,v=d.name.trim()!==``&&d.url.trim()!==``,b=r.isPending||o.isPending||c.isPending,C={projectId:e,webhookId:t.id},T=()=>(h(null),r.mutateAsync({...C,...g},{onSuccess:()=>f(e=>({...e,token:``})),onError:e=>h(q(e,`Save`))}));ue({dirty:_,invalid:!v,busy:b,save:T,discard:()=>f(V(t))});let E=()=>c.mutate(C,{onSuccess:e=>h(ye(e)),onError:e=>h({tone:`danger`,text:e.message})});return(0,U.jsx)(`li`,{"data-slot":`webhook-card`,"data-webhook-id":t.id,className:Y,children:(0,U.jsxs)(te,{open:l,onOpenChange:u,children:[(0,U.jsx)(S,{asChild:!0,children:(0,U.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,U.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,U.jsx)(`span`,{"data-slot":`webhook-card-name`,className:`min-w-0 break-words text-[13px] font-medium`,children:t.name}),t.tasks?(0,U.jsx)(w,{variant:`secondary`,"data-badge":`tasks`,children:`Task notifications`}):null,t.agent?(0,U.jsx)(w,{variant:`secondary`,"data-badge":`agent`,children:`Agents`}):null]}),(0,U.jsx)(`span`,{"data-slot":`webhook-card-url`,className:`truncate text-[12px] text-muted-foreground`,children:ie(t.url)})]}),(0,U.jsx)(y,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180`})]})}),(0,U.jsx)(ee,{children:(0,U.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,className:X,onSubmit:e=>{e.preventDefault(),h(null),v&&_&&!b&&T().catch(()=>{})},children:[(0,U.jsx)(K,{draft:d,tokenSet:t.tokenSet,onChange:e=>f(t=>({...t,...e}))}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(x,{type:`button`,size:`sm`,variant:`outline`,"data-action":`webhook-test`,disabled:b||!v,onClick:()=>{h(null),_?T().then(E,()=>{}):E()},children:`Send test`}),t.tokenSet?(0,U.jsx)(x,{type:`button`,size:`sm`,variant:`ghost`,"data-action":`webhook-clear-token`,disabled:b,onClick:()=>r.mutate({...C,token:``},{onSuccess:()=>m(`Webhook token cleared`),onError:e=>h({tone:`danger`,text:`Token not cleared: ${e.message}.`})}),children:`Clear token`}):null,(0,U.jsx)(x,{type:`button`,size:`sm`,variant:`danger-ghost`,"data-action":`webhook-remove`,"aria-label":`Remove ${t.name}`,disabled:b,onClick:()=>o.mutate(C,{onSuccess:()=>m(`${t.name} removed`),onError:e=>h({tone:`danger`,text:`Not removed: ${e.message}.`})}),children:`Remove`})]}),(0,U.jsx)(J,{feedback:p}),(0,U.jsx)(P,{})]})})]})})}function xe({projectId:e,onCreated:t,onCancel:n}){let r=o(),[i,a]=(0,L.useState)(B),[s,c]=(0,L.useState)(null),l=i.name.trim()!==``&&i.url.trim()!==``;return re(_e(i)),(0,U.jsxs)(`li`,{"data-slot":`webhook-card`,"data-draft":``,className:Y,children:[(0,U.jsx)(`p`,{className:`p-3 text-[13px] font-medium`,children:`New webhook`}),(0,U.jsxs)(`form`,{"data-slot":`webhook-form`,"data-reports-dirty":``,"aria-label":`New webhook`,className:X,onSubmit:n=>{n.preventDefault(),c(null),l&&r.mutate({projectId:e,...ge(i)},{onSuccess:({webhook:e})=>{m(`${e.name} created`),t(e)},onError:e=>c(q(e,`Create`))})},children:[(0,U.jsx)(K,{draft:i,tokenSet:!1,onChange:e=>a(t=>({...t,...e}))}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(x,{type:`submit`,size:`sm`,variant:`outline`,"data-action":`webhook-create`,disabled:r.isPending||!l,children:`Create`}),(0,U.jsx)(x,{type:`button`,size:`sm`,variant:`ghost`,"data-action":`webhook-cancel`,disabled:r.isPending,onClick:n,children:`Cancel`})]}),(0,U.jsx)(J,{feedback:s})]})]})}function Se({project:e}){let t=e.webhooks??[],[n,r]=(0,L.useState)(!1),[i,a]=(0,L.useState)(null),o=t.length>=16;return(0,U.jsx)(M,{wide:!0,title:`Webhooks`,hint:`A webhook gets a POST from Squawk. Tasks can send their status to it, and agents can send it reports.`,children:(0,U.jsxs)(`div`,{"data-slot":`project-webhooks`,className:`flex flex-col gap-3`,children:[t.length===0&&!n?(0,U.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,U.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[t.map(t=>(0,U.jsx)(be,{projectId:e.id,webhook:t,defaultOpen:t.id===i},t.id)),n?(0,U.jsx)(xe,{projectId:e.id,onCancel:()=>r(!1),onCreated:e=>{a(e.id),r(!1)}}):null]}):null,n?null:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsxs)(x,{type:`button`,size:`sm`,variant:`outline`,"data-action":`webhook-add`,disabled:o,onClick:()=>r(!0),children:[(0,U.jsx)(b,{"aria-hidden":`true`}),`Add webhook`]}),o?(0,U.jsxs)(`span`,{className:`text-xs text-soft-foreground`,children:[`A project holds at most `,16,` webhooks.`]}):null]})]})})}function Z(e){let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}function Ce(){let e=E(),t=c(),n=r(),i=ce();if(t.isPending)return(0,U.jsx)(`p`,{"data-slot":`project-general-loading`,className:`text-[13px] text-soft-foreground`,children:`Loading project…`});if(t.isError)return(0,U.jsxs)(`p`,{"data-slot":`project-general-error`,className:`text-[13px] text-danger`,children:[`Could not read the project registry — `,t.error.message]});let a=t.data,o=a?.projects.find(t=>t.id===e);return!a||!o?null:(0,U.jsxs)(`div`,{"data-slot":`project-general`,className:`flex w-full flex-col gap-5`,children:[(0,U.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,U.jsx)(`h2`,{className:`text-lg font-semibold`,children:`General`}),(0,U.jsx)(le,{}),(0,U.jsx)(we,{project:o}),(0,U.jsx)(M,{title:`Max parallel tasks`,saved:i.saved,hint:n.data?`The workspace limit (${n.data.resources.maxParallel}) still applies as an overall ceiling.`:`How many of this project's tasks may run at once. The workspace limit still applies as an overall ceiling.`,children:n.data?(0,U.jsx)(I,{project:o,workspaceMax:n.data.resources.maxParallel,onSaved:i.flash}):(0,U.jsx)(`p`,{className:`text-[13px] text-soft-foreground`,children:`Loading the workspace limit…`})}),(0,U.jsx)(Se,{project:o},o.id)]}),(0,U.jsx)(`section`,{className:`rounded-lg border border-border bg-card p-5`,children:(0,U.jsx)(Te,{project:o,projects:a.projects,bootProject:a.bootProject})})]})}function we({project:e}){return(0,U.jsxs)(`dl`,{"data-slot":`project-facts`,className:`grid grid-cols-1 gap-4 text-[13px] sm:grid-cols-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Project`}),(0,U.jsx)(`dd`,{className:`mt-1 font-medium`,children:e.name})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Branch`}),(0,U.jsx)(`dd`,{className:`mt-1 break-all`,children:e.branch??`—`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,U.jsxs)(`dd`,{"data-slot":`project-general-status`,className:e.status===`missing`?`mt-1 text-danger`:`mt-1`,children:[F[e.status],e.status===`missing`?` — remove it below, or restore the folder`:null]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Added`}),(0,U.jsxs)(`dd`,{className:`mt-1`,children:[Z(e.addedAt),(0,U.jsx)(`span`,{className:`text-soft-foreground`,children:e.source===`checkout`?` · cloned from GitHub`:` · opened locally`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last opened`}),(0,U.jsx)(`dd`,{className:`mt-1`,children:Z(e.lastOpenedAt)})]})]})}function Te({project:e,projects:t,bootProject:n}){let[r,i]=(0,L.useState)(null),a=me(),o=g(),s=n!==null&&e.id===n,c=n??t.find(t=>t.id!==e.id&&t.status!==`missing`)?.id??t.find(t=>t.id!==e.id)?.id??null;return(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,"data-action":`project-general-remove`,"aria-label":`Remove ${e.name} from the workspace — unregisters it, no files are deleted`,title:s?`Squawk is serving this project — it re-registers itself at every start`:void 0,disabled:s||a.isPending,onClick:()=>i(e),className:`text-danger`,children:[`Remove `,e.name]}),s?(0,U.jsx)(`span`,{"data-slot":`project-general-remove-boot`,className:`text-xs text-soft-foreground`,children:`Squawk is serving this project — it re-registers itself at every start.`}):null]}),(0,U.jsx)(he,{project:r,onOpenChange:e=>!e&&i(null),onConfirm:()=>{i(null),a.confirm(e,()=>void o(c===null?`/`:`/p/${encodeURIComponent(c)}`))}})]})}function Ee(e){return e===`global`?{Link:h,NavLink:_}:{Link:D,NavLink:T}}function Q({scope:e,title:t,mobileTitle:n,description:r}){let i=oe().name,a=e===`global`?`every project`:i??`this project`;return{headerSlot:`settings-main-header`,title:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`md:hidden`,children:n}),(0,U.jsxs)(`span`,{className:`max-md:hidden`,children:[t,` `,(0,U.jsxs)(`span`,{"data-slot":`page-header-scope`,className:`font-normal text-soft-foreground`,children:[`· `,a]})]})]}),subtitle:r,hideSubtitleOnMobile:!0,headerExtra:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{"data-slot":`settings-mobile-scope`,className:`mt-1 text-[13px] text-muted-foreground md:hidden`,children:e===`global`?`Applies to every project`:a}),e===`global`?(0,U.jsx)(`span`,{"data-slot":`settings-scope-chip`,className:`sr-only`,children:`Global settings`}):null]})}}function $({scope:e,activeId:t}){let{NavLink:n}=Ee(e),r=k(e);return(0,U.jsxs)(`details`,{className:`settings-section-picker md:hidden`,children:[(0,U.jsxs)(`summary`,{children:[r.find(e=>e.id===t)?.title??`General`,(0,U.jsx)(y,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`})]}),(0,U.jsxs)(`nav`,{"aria-label":`Settings sections`,"data-slot":`settings-nav-mobile`,"data-scope":e,children:[e===`project`?(0,U.jsx)(n,{to:`/settings`,end:!0,"data-slot":`settings-nav-index`,children:`General`}):null,r.map(t=>(0,U.jsx)(n,{to:j(e,t.id),"data-section":t.id,children:t.title},t.id))]})]},`${e}-${t}`)}function De({section:e,scope:t}){let n=e.component,r=E(),i=Q({scope:t,title:e.title,description:e.description,mobileTitle:t===`global`?`Global settings`:`Project settings`});return(0,U.jsx)(e.id===`agent-config`?ne:O,{route:t===`global`?`settings-global-${e.id}`:`settings-${e.id}`,density:`full`,className:`settings-route`,header:i,children:(0,U.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,U.jsxs)(`div`,{"data-slot":`settings-mobile-section`,className:`flex flex-col gap-2 md:hidden`,children:[(0,U.jsx)($,{scope:t,activeId:e.id}),e.description?(0,U.jsx)(`p`,{"data-slot":`settings-mobile-section-subtitle`,className:`px-1 text-[13px] leading-normal text-muted-foreground`,children:e.description}):null]}),(0,U.jsxs)(`section`,{className:`settings-panel min-w-0 self-start md:flex-1`,"aria-label":e.title,children:[(0,U.jsx)(`h2`,{className:`settings-panel-title sr-only`,children:e.title}),(0,U.jsx)(N,{children:(0,U.jsx)(n,{})},`${r??``}:${e.id}`)]})]})})}function Oe(){let e=Q({scope:`project`,title:`General`,mobileTitle:`Project settings`}),t=E();return(0,U.jsx)(O,{route:`settings`,density:`full`,className:`settings-route`,header:e,children:(0,U.jsxs)(`div`,{className:`settings-route-body flex min-w-0 flex-1 flex-col md:flex-row`,children:[(0,U.jsx)($,{scope:`project`,activeId:null}),(0,U.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-5`,children:(0,U.jsxs)(N,{children:[(0,U.jsx)(Ce,{}),(0,U.jsx)(`section`,{className:`rounded-lg border border-card-edge bg-card p-5 shadow-card`,children:(0,U.jsx)(pe,{})}),(0,U.jsx)(`h2`,{className:`settings-other-title mt-6 rounded-t-lg border border-b-0 border-card-edge bg-card px-5 pt-5 text-base font-semibold shadow-card md:hidden`,children:`Other project settings`}),(0,U.jsx)(`ul`,{"data-slot":`settings-index`,className:`mt-7 flex w-full flex-col gap-5 md:hidden`,children:k(`project`).map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(D,{to:j(`project`,e.id),"data-section":e.id,className:`flex items-center gap-3.5 rounded-lg border border-card-edge bg-card p-4 shadow-card transition-colors hover:bg-card-2`,children:[(0,U.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center text-accent-text`,children:(0,U.jsx)(e.icon,{"aria-hidden":`true`,className:`size-4`})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,U.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]}),(0,U.jsx)(v,{"aria-hidden":`true`,className:`size-4 shrink-0 text-soft-foreground`})]})},e.id))}),(0,U.jsxs)(`p`,{className:`mt-5 w-full text-[12px] text-soft-foreground`,children:[`Appearance, preferences, host resources and the project registry live in`,` `,(0,U.jsx)(h,{to:ae,"data-slot":`settings-global-link`,className:`underline underline-offset-2 hover:text-foreground`,children:`Global settings`}),`.`]})]},t??``)})]})})}export{Oe as SettingsIndexRoute,De as SettingsSectionRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{p as r}from"./dist-C_rn70hE.js";import{un as i,v as a}from"./queries-CchoEEzj.js";import{Hr as o,R as s,Vr as c,vi as l}from"./toaster-zMN8cNZQ.js";import{t as u}from"./button-B22ANdCY.js";import{r as d,t as f}from"./settings-save-bar-Mrc6Vm7P.js";var p=e(t(),1),m=n(),h=[[`overall`,`Overall`],[`needsYou`,`Needs You`],[`finished`,`Finished`],[`working`,`Working`]];function g(){let e=r(),t=a(e);return t.isPending?(0,m.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading sidebar settings…`}):t.isError?(0,m.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,m.jsxs)(`p`,{role:`alert`,children:[`Sidebar settings did not load: `,t.error.message]}),(0,m.jsx)(u,{onClick:()=>void t.refetch(),children:`Retry`})]}):(0,m.jsx)(_,{scope:e,initial:t.data.sidebarLimits??{}},e)}function _({scope:e,initial:t}){let n=l(),r=c(void 0),a=v(t),[u,g]=(0,p.useState)(()=>({values:a,saved:a,received:a})),{values:_,saved:b}=u,x=e=>g(t=>({...t,values:e})),S=o.safeParse(Object.fromEntries(h.map(([e])=>[e,_[e]===null?null:Number(_[e])]))),C=e=>_[e]!==null&&(_[e].trim()===``||!Number.isSafeInteger(Number(_[e]))||Number(_[e])<=0),w=h.some(([e])=>_[e]!==b[e]),T=!S.success||h.some(([e])=>C(e)),E=i({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=v(t.sidebarLimits);g({values:r,saved:r,received:r})}}),D=()=>S.success?E.mutateAsync(S.data):Promise.reject(Error(`invalid sidebar limits`));return d({dirty:w,invalid:T,busy:E.isPending,save:D,discard:()=>g(e=>({...e,values:e.saved}))}),!E.isPending&&!y(u.received,a)&&g({values:w?_:a,saved:a,received:a}),(0,m.jsxs)(`form`,{"data-slot":`sidebar-settings`,"data-reports-dirty":``,className:`flex w-full max-w-2xl flex-col gap-5 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6`,onSubmit:e=>{e.preventDefault(),w&&!T&&!E.isPending&&D().catch(()=>{})},children:[(0,m.jsx)(`p`,{id:`sidebar-limits-help`,className:`text-sm text-muted-foreground`,children:`Limits apply to this project on desktop and mobile. The overall budget is shared in section order: Needs You, Finished, then Working. Each section also respects its own limit. Unlimited removes only that constraint.`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pinned tasks and groups containing a pin bypass both limits. A task group counts as one row. Archived uses only the overall limit; archived pins are not exempt.`}),h.map(([e,t])=>(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`label`,{htmlFor:`sidebar-${e}`,className:`text-sm font-medium`,children:t}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(`input`,{id:`sidebar-${e}`,type:`number`,inputMode:`numeric`,min:`1`,step:`1`,value:_[e]??``,disabled:_[e]===null||E.isPending,"aria-invalid":C(e),"aria-describedby":C(e)?`sidebar-${e}-error sidebar-limits-help`:`sidebar-limits-help`,onChange:t=>x({..._,[e]:t.target.value}),className:`min-h-[44px] w-28 rounded-md border border-input bg-card px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`}),(0,m.jsxs)(`label`,{className:`flex min-h-[44px] cursor-pointer items-center gap-2 text-sm`,children:[(0,m.jsx)(`input`,{type:`checkbox`,"aria-label":`${t} Unlimited`,checked:_[e]===null,disabled:E.isPending,onChange:t=>x({..._,[e]:t.target.checked?null:String(r[e]??10)}),className:`size-4 accent-[var(--accent-strong)]`}),`Unlimited`]})]}),C(e)&&(0,m.jsx)(`p`,{id:`sidebar-${e}-error`,className:`text-sm text-danger`,children:`Enter a positive whole number or choose Unlimited.`})]},e)),E.isError&&(0,m.jsxs)(`p`,{role:`alert`,className:`text-sm text-danger`,children:[`Could not save sidebar limits: `,E.error.message]}),(0,m.jsx)(f,{})]})}function v(e){let t=c(e);return Object.fromEntries(h.map(([e])=>[e,t[e]===null?null:String(t[e])]))}function y(e,t){return h.every(([n])=>e[n]===t[n])}export{g as SidebarSection};
|
|
@@ -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{Ut as i,g as a,nn as o,qt as s,tn as c}from"./queries-CchoEEzj.js";import{E as l,n as u,vi as d}from"./toaster-zMN8cNZQ.js";import{g as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{E as p,Q as m,Z as h,ct as g,d as _,k as v,rt as y,u as b,ut as x}from"./design-icons-QbNMZniQ.js";import{t as S}from"./button-
|
|
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{Ut as i,g as a,nn as o,qt as s,tn as c}from"./queries-CchoEEzj.js";import{E as l,n as u,vi as d}from"./toaster-zMN8cNZQ.js";import{g as f}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{E as p,Q as m,Z as h,ct as g,d as _,k as v,rt as y,u as b,ut as x}from"./design-icons-QbNMZniQ.js";import{t as S}from"./button-B22ANdCY.js";import{t as C}from"./project-router-j0uBi7Ep.js";import{c as w,d as T,f as E,n as D,t as O}from"./page-shell-BgabWJ3w.js";import{f as k,l as A}from"./skills-pM_PouEs.js";import{i as j}from"./agent-accounts-D_7QcFSx.js";import{Jn as M,X as N,sr as P}from"./index-UFO7Bk2I.js";import{t as F}from"./option-select-CDOKbUov.js";var I=e(t(),1),L=n(),R=e=>e.split(`@`)[0]||e,z={project:0,user:1,plugin:2,system:3,other:4},B={project:`This project`,user:`Your skills`,system:`Built in`,other:`Other`};function V(e){if(e.plugin)return{key:`plugin:${e.plugin}`,label:R(e.plugin),kind:`plugin`};let t=e.scope===`repo`?`project`:e.scope===`user`?`user`:e.scope===`system`?`system`:`other`;return{key:t,label:B[t],kind:t}}function H(e){let t=new Map;for(let n of e){let e=V(n),r=t.get(e.key)??{...e,skills:[]};r.skills.push(n),t.set(e.key,r)}return[...t.values()].sort((e,t)=>z[e.kind]-z[t.kind]||e.label.localeCompare(t.label))}function U(e){let t=e.plugin?`${R(e.plugin)}:`:``;return t&&e.name.startsWith(t)&&e.name.length>t.length?e.name.slice(t.length):e.name}var W={project:p,user:x,plugin:v,system:v,other:v};function G({groups:e,openId:t,searching:n,runner:r,account:i}){let[a,o]=(0,I.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,L.jsx)(`div`,{"data-slot":`skills-list`,className:`overflow-hidden rounded-xl border border-border bg-card`,children:e.map(e=>{let o=n||!a.has(e.key);return(0,L.jsxs)(`section`,{"data-slot":`skill-group`,"aria-label":e.label,className:`border-border not-first:border-t`,children:[(0,L.jsx)(K,{group:e,open:o,onToggle:()=>s(e.key)}),o?e.skills.map(e=>(0,L.jsx)(q,{skill:e,open:e.id===t,runner:r,account:i},k(e))):null]},e.key)})})}function K({group:e,open:t,onToggle:n}){let i=W[e.kind];return(0,L.jsx)(`h2`,{className:`m-0`,children:(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:n,className:`flex min-h-10 w-full items-center gap-2 bg-muted/45 px-3.5 text-left text-xs font-semibold text-muted-foreground focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:text-foreground`,children:[(0,L.jsx)(_,{"aria-hidden":`true`,className:r(`size-3.5 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,L.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,L.jsx)(`span`,{className:`font-medium text-soft-foreground`,children:e.skills.length})]})})}function q({skill:e,open:t,runner:n,account:r}){let i=M({skill:e.id,skillPath:e.path,runner:n,...r?{account:r}:{}});return(0,L.jsxs)(`details`,{"data-slot":`skill-row`,"data-skill":e.id,"data-skill-path":e.path,name:`skill-details`,open:t||void 0,className:`group/skill border-t border-border/60 open:bg-sidebar-row-selected`,children:[(0,L.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center gap-3 py-2 pr-3.5 pl-9 focus-visible:outline-2 focus-visible:-outline-offset-2 pointer-hover:bg-sidebar-row-hover [&::-webkit-details-marker]:hidden`,children:[(0,L.jsxs)(`span`,{className:`grid min-w-0 flex-1 grid-cols-1 items-center gap-x-4 gap-y-0.5 sm:grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)]`,children:[(0,L.jsx)(`span`,{className:`truncate text-[13.5px] leading-snug font-semibold text-foreground`,title:e.name,children:U(e)}),e.description?(0,L.jsx)(`span`,{className:`min-w-0 line-clamp-2 text-[13px] leading-snug text-muted-foreground [overflow-wrap:anywhere] group-open/skill:hidden`,title:e.description,children:e.description}):null]}),(0,L.jsx)(b,{"data-slot":`skill-row-cue`,"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform group-open/skill:rotate-180 motion-reduce:transition-none`})]}),(0,L.jsx)(`div`,{className:`pr-3.5 pb-4 pl-9`,children:(0,L.jsx)(N,{skill:e,heading:null,actions:(0,L.jsx)(S,{asChild:!0,size:`sm`,"data-action":`start-task`,children:(0,L.jsx)(C,{to:i,children:`Start task`})})})})]})}function J(){let e=a(),[t,n]=(0,I.useState)(null),[i,o]=(0,I.useState)(null),[l,u]=(0,I.useState)(``),[d]=f(),p=t??e.data?.defaultRunner,{runner:g}=c(p??`claude`),_=i?.runner===g?i.id:null,v=e=>o(e===null?null:{runner:g,id:e}),y=s(p,_),b=$(g,y.account),x=y.data??[],O=A(x,l);return(0,L.jsxs)(T,{route:`skills`,density:y.isPending?`full`:E(O.length),className:`max-md:[padding-block-end:5rem]`,bodyClassName:`gap-5`,header:{title:`Skills`,subtitle:`The skills each agent loads in this project, as its runner reports them.`,secondaryActions:(0,L.jsxs)(w,{variant:`outline`,onClick:()=>void b.run(),disabled:b.running||y.isPending,"data-slot":`skills-refresh`,children:[(0,L.jsx)(h,{"aria-hidden":`true`,className:r(`size-3.5`,b.running&&`motion-safe:animate-spin`)}),`Re-read`]})},sparseFooter:!y.isPending&&O.length>0?(0,L.jsx)(D,{summary:`${O.length} ${O.length===1?`skill`:`skills`} available for this runner. Type / in New task to invoke one, or chain them into a workflow.`,actions:(0,L.jsx)(S,{variant:`outline`,size:`sm`,asChild:!0,children:(0,L.jsx)(C,{to:`/workflows`,children:`Open workflows`})})}):void 0,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(X,{runner:g,onChange:e=>{n(e),v(null)}}),(0,L.jsx)(Z,{runner:g,account:_,onChange:v}),(0,L.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,"data-slot":`skills-count`,children:y.list?`${x.length} ${x.length===1?`skill`:`skills`}${y.list.source===`cache`?` · from cache`:``}`:null})]}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(m,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(P,{"aria-label":`Search skills`,placeholder:`Filter by name or description…`,value:l,onChange:e=>u(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-9 text-[13px]`})]}),(0,L.jsx)(Q,{query:y}),y.isPending?(0,L.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Loading skills…`}):(0,L.jsx)(Y,{skills:x,matches:O,search:l,onClearSearch:()=>u(``),onRefresh:()=>void b.run(),openId:d.get(`skill`),runner:g,account:y.account??null,unchecked:y.unchecked})]})}function Y({skills:e,matches:t,search:n,onClearSearch:r,onRefresh:i,openId:a,runner:o,account:s,unchecked:c}){return e.length===0?c?null:(0,L.jsx)(O,{icon:(0,L.jsx)(y,{}),title:`No skills reported by this runner and account.`,description:`Add a skill to this repository or your runner home, then re-read to refresh the inventory.`,actions:(0,L.jsx)(S,{variant:`outline`,onClick:i,children:`Re-read skills`})}):t.length===0?(0,L.jsx)(O,{icon:(0,L.jsx)(m,{}),title:`No skills match “${n.trim()}”.`,description:`Try a different keyword or clear the filter to browse every available skill.`,actions:(0,L.jsx)(S,{variant:`outline`,onClick:r,children:`Clear filter`})}):(0,L.jsx)(G,{groups:H(t),openId:a,searching:n.trim()!==``,runner:o,account:s})}function X({runner:e,onChange:t}){let n=o().data;return n?(0,L.jsx)(`div`,{role:`group`,"aria-label":`Runner`,className:`flex max-w-full gap-1 overflow-x-auto rounded-lg border border-border bg-muted/60 p-1`,children:n.runners.map(n=>(0,L.jsx)(`button`,{type:`button`,"aria-pressed":n.id===e,onClick:()=>t(n.id),className:`h-8 shrink-0 rounded-md border border-transparent px-3 text-[13px] font-normal text-muted-foreground transition-colors focus-visible:outline-2 aria-pressed:border-border aria-pressed:bg-card aria-pressed:font-semibold aria-pressed:text-foreground aria-pressed:shadow-xs pointer-hover:text-foreground max-md:h-11`,children:n.displayName},n.id))}):null}function Z({runner:e,account:t,onChange:n}){let r=j().accounts.filter(t=>t.provider===e);return r.length===0?null:(0,L.jsx)(F,{"aria-label":`Account`,value:t??``,onValueChange:e=>n(e||null),options:[{value:``,label:`Account: project default`},...r.map(e=>({value:e.id,label:e.label}))],className:`rounded-lg border-border bg-card text-[13px] text-foreground md:data-[size=default]:h-[38px]`})}function Q({query:e}){let t=e.list?.problems??[];return!e.unchecked&&t.length===0?null:(0,L.jsxs)(`div`,{className:`grid gap-1.5 rounded-lg border border-pending/40 bg-pending/10 px-3.5 py-2.5 text-[13px]`,children:[e.unchecked&&!e.isPending?(0,L.jsxs)(`p`,{role:`status`,className:`flex gap-2`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.jsxs)(`span`,{children:[`Skill list unavailable. `,e.list?.reason??e.error?.message,` You can still type a skill id when starting a task.`]})]}):null,t.map((e,t)=>(0,L.jsxs)(`p`,{role:`alert`,className:`flex gap-2 break-words`,children:[(0,L.jsx)(g,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-pending-strong`}),(0,L.jsxs)(`span`,{children:[e.message,e.path?` · ${e.path}`:``]})]},t))]})}function $(e,t){let n=d(),[r,a]=(0,I.useState)(!1),o=i.runnerSkills(e,t);return{running:r,run:async()=>{a(!0);try{n.setQueryData(o,await l(e,t,{refresh:!0})),await n.invalidateQueries({queryKey:o.slice(0,3)})}catch(e){u(e instanceof Error?e.message:String(e),{tone:`danger`})}finally{a(!1)}}}}export{J as SkillsRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{o as n}from"./dist-C_rn70hE.js";import{t as r}from"./bot-TkDIw4y-.js";import{r as i}from"./button-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{o as n}from"./dist-C_rn70hE.js";import{t as r}from"./bot-TkDIw4y-.js";import{r as i}from"./button-B22ANdCY.js";e();var a=t(),o=i(`inline-block shrink-0`,{variants:{tone:{success:``,pending:``,danger:``,accent:``,info:``,running:``,neutral:``},shape:{filled:`size-[7px] rounded-full`,ring:`size-[7px] rounded-full border-[1.5px] bg-transparent`,workers:`inline-flex size-[12px] items-center justify-center`},pulse:{true:`animate-pulse motion-reduce:animate-none`,false:``}},compoundVariants:[{shape:`filled`,tone:`success`,className:`bg-success`},{shape:`filled`,tone:`pending`,className:`bg-pending-strong`},{shape:`filled`,tone:`danger`,className:`bg-danger`},{shape:`filled`,tone:`accent`,className:`bg-accent-strong`},{shape:`filled`,tone:`info`,className:`bg-info`},{shape:`filled`,tone:`running`,className:`bg-status-running`},{shape:`filled`,tone:`neutral`,className:`bg-soft-foreground`},{shape:`ring`,tone:`success`,className:`border-success`},{shape:`ring`,tone:`pending`,className:`border-pending-strong`},{shape:`ring`,tone:`danger`,className:`border-danger`},{shape:`ring`,tone:`accent`,className:`border-accent-strong`},{shape:`ring`,tone:`info`,className:`border-info`},{shape:`ring`,tone:`running`,className:`border-status-running`},{shape:`ring`,tone:`neutral`,className:`border-soft-foreground`},{shape:`workers`,tone:`success`,className:`text-success`},{shape:`workers`,tone:`pending`,className:`text-pending-strong`},{shape:`workers`,tone:`danger`,className:`text-danger`},{shape:`workers`,tone:`accent`,className:`text-accent-icon`},{shape:`workers`,tone:`info`,className:`text-info`},{shape:`workers`,tone:`running`,className:`text-status-running`},{shape:`workers`,tone:`neutral`,className:`text-soft-foreground`}],defaultVariants:{tone:`neutral`,shape:`filled`,pulse:!1}});function s({className:e,tone:t=`neutral`,shape:i=`filled`,pulse:s=!1,...c}){return(0,a.jsx)(`span`,{"data-slot":`status-dot`,"data-tone":t,"data-shape":i,"data-pulse":s?`true`:void 0,className:n(o({tone:t,shape:i,pulse:s,className:e})),...c,children:i===`workers`?(0,a.jsx)(r,{className:`size-[12px]`,"aria-hidden":`true`}):null})}export{s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{J as i,S as a,Ut as o,Y as s,un as c,vt as l}from"./queries-CchoEEzj.js";import{Bt as u,Gt as d,Ot as f,Rn as p,Rt as m,Ut as h,ir as g,n as _,st as v,ut as ee,vi as y}from"./toaster-zMN8cNZQ.js";import{h as b}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{M as x,u as S,w as C}from"./design-icons-QbNMZniQ.js";import{t as te}from"./run-header-
|
|
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{J as i,S as a,Ut as o,Y as s,un as c,vt as l}from"./queries-CchoEEzj.js";import{Bt as u,Gt as d,Ot as f,Rn as p,Rt as m,Ut as h,ir as g,n as _,st as v,ut as ee,vi as y}from"./toaster-zMN8cNZQ.js";import{h as b}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{M as x,u as S,w as C}from"./design-icons-QbNMZniQ.js";import{t as te}from"./run-header-BWLcG57S.js";import{i as w,n as ne,r as T}from"./git-toolbar-PM540i_A.js";import{t as E}from"./button-B22ANdCY.js";import{a as D,i as O,o as k,r as A,s as j,t as M}from"./dialog-rpNyAWGb.js";import{b as N,f as P}from"./task-groups-CGCnVqHE.js";import{f as re,l as ie,m as ae}from"./page-shell-BgabWJ3w.js";import{t as F}from"./centered-state-BgSV4e79.js";import{A as oe,Un as se,at as ce,k as I,vn as L}from"./index-UFO7Bk2I.js";import{t as R}from"./textarea-vEsJAUAV.js";import{t as z}from"./markdown-BBDDg-4t.js";import{n as B,t as V}from"./review-notes-drafts-DXxIudVB.js";import{t as H}from"./diff-CC5UqjNZ.js";import{t as U}from"./code-workbench-CUkiQ1pF.js";import{t as W}from"./file-text-nGpo7MVd.js";import{i as le,n as G,r as ue}from"./selected-file-CfBWFB6p.js";var K=e(t(),1),q=`no worktree — this task ran directly in the repo working tree`;function J(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.run.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${q}`)}function Y(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.run.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${q}`)}function de(e){let t=e=>({id:`create-pr`,label:`Draft PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Draft PR unavailable — ${q}`):e.forge===null?t(`Draft PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?g(e.run)?t(`Draft PR unavailable — the run is waiting on a usage-limit hold; choose Don’t resume first`):N(e.run)?t(`Draft PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Draft PR`,enabled:!0}:t(`Draft PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function fe(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:J(e),n=e.prUrl?[J(e),Y(e)]:[Y(e),de(e)],r=[];if(e.localHandoff&&e.cliHandoff!==!1){let t=e.hasSession?N(e.run)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,primaryVariant:e.run.status===`review`?`outline`:`primary`,secondary:n,menu:r}}function pe(e,t){let[n=``,...r]=t.trim().split(`
|
|
2
2
|
`),i=[n,...r.map(e=>e.trim()===``?``:` ${e.trimEnd()}`)].join(`
|
|
3
3
|
`);return`- \`${me(e)}\` — ${i}`}function me({path:e,side:t,line:n}){let r=typeof n==`number`||n.start===n.end?String(typeof n==`number`?n:n.start):`${n.start}-${n.end}`;return t===`old`?`${e} (old ${r})`:`${e}:${r}`}function he(e,t,n){let r=V(e).notes;B(e,{open:!0,notes:`${r}${r===``||r.endsWith(`
|
|
4
4
|
`)?``:`
|
|
@@ -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-BWLcG57S.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,Hn as b,k as x}from"./index-UFO7Bk2I.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-lwVhwbS8.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-UFO7Bk2I.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-DE0wTSnO.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-BwrymAy7.js";import{t as D}from"./button-C8jUIs8Q.js";import{l as O}from"./page-shell-Dky5crRl.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,gr as P,k as F,sr as I,w as L}from"./index-CXvWnyZg.js";import{t as R}from"./task-file-scope-DLVI8zBp.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)(F,{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)(I,{"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:`h-11 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)(P,{"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 max-md:h-11 no-hover:h-11`,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-BWLcG57S.js";import{a as C,i as w,n as T,o as E,r as te}from"./file-preview-C_0CRYAr.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,gr as P,k as F,sr as I,w as L}from"./index-UFO7Bk2I.js";import{t as R}from"./task-file-scope-B63NmSov.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)(F,{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)(I,{"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)(P,{"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-BWLcG57S.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,k as E,pr as D}from"./index-UFO7Bk2I.js";import{l as O,n as k,t as A}from"./use-hand-to-agent-state-CMyKCFeb.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)(E,{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)(D,{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};
|