1import{j as e,o as ce,b as f,L as B}from"./vendor-De2NIrSl.js";import{H as ue}from"./components-CP2b_EMq.js";import{T as pe,A as me,a as xe,b as he,r as ge,Q as fe}from"./TaskDetailModal-DSGrKbG2.js";import{M as be}from"./MarkdownEditor-BxixOR88.js";import{u as je,a as ke,b as se,c as ye,d as ve,e as we,f as Ne,g as Ie,m as Se,h as Ce,i as Ae}from"./useMonkey-DgvtzD-W.js";import{M as ze,S as Te,L as Ee,E as Me,A as Oe,e as Pe,v as De,m as qe,B as b,t as T}from"./index-BNKu6i1-.js";import{I as F,u as Be}from"./useInboxRealtime-gEW_IqdA.js";import"./actions-Cxry7ls9.js";import"./QuestionFields-CXVHiquB.js";import"./PostBody-BsdhG4pA.js";import"./useVibes-CYKyX4Nk.js";import"./confirm-dialog-BCOjpNLS.js";function Re({taskId:t,projectId:a,onClose:i}){const l=je(t),p=ke(a),m=se(),d={onTransition:(n,r,x)=>p.transition.mutateAsync({taskId:n,action:r,...x}),onClearBlocker:(n,r)=>p.clearBlocker.mutateAsync({taskId:n,...r?{note:r}:{}}),onEdit:(n,r)=>p.editTask.mutateAsync({taskId:n,patch:r}),onDelete:n=>p.deleteTask.mutateAsync(n),onSnooze:(n,r)=>p.snoozeTask.mutateAsync({taskId:n,until:r}),onUnsnooze:n=>p.unsnoozeTask.mutateAsync(n),onCreate:n=>p.createTask.mutateAsync(n),onAccept:n=>m.accept.mutateAsync(n),onRequestChanges:(n,r)=>m.requestChanges.mutateAsync({taskId:n,note:r}),onDecide:(n,r,x)=>r==="delete"?p.deleteTask.mutateAsync(n):r==="approve"?p.transition.mutateAsync({taskId:n,action:"approve",...x?{approvalNotes:x}:{}}):p.transition.mutateAsync({taskId:n,action:"reject",...x?{reason:x}:{}})};return t&&!l.data?e.jsx(ze,{open:!0,onClose:i,title:"Task details",className:"max-w-md",children:l.isError?e.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"Could not load this one. It may have just been decided somewhere else. Close this and refresh."}):e.jsx("div",{className:"grid place-items-center py-10",children:e.jsx(Te,{className:"size-5"})})}):e.jsx(pe,{task:l.data??null,tasks:l.data?[l.data]:[],onClose:i,actions:d,closeAfter:["approve","reject","accept","request_changes"]})}const _e=["approvals","review","questions"],He="past-",ee=t=>t.id.startsWith(He),Le=[{label:"A few hours",hours:4},{label:"Tomorrow",hours:24},{label:"Next week",hours:168}],We={changes:{placeholder:"What should change? This becomes a new backlog task referencing the original.",confirm:"Send request",variant:"secondary"},unblock:{placeholder:"Answer the agent. What should it do?",confirm:"Unblock",variant:"secondary",hint:"Leave this empty to just let it carry on with what it was doing."}},Fe=t=>typeof t=="string"?t:t&&typeof t=="object"&&"taskId"in t?String(t.taskId):null,E=Se;function z(t,a){const i=Fe(t.variables)===a;return{pending:i&&t.isPending,error:i&&t.isError?E(t.error):null}}function te({mode:t,pending:a,error:i,onConfirm:l,onCancel:p}){const m=We[t],[d,n]=f.useState(""),r=t==="changes";return e.jsxs("div",{className:"mt-3 rounded-md border border-border bg-muted/40 p-3",children:[e.jsx(be,{ariaLabel:m.placeholder,placeholder:m.placeholder,value:d,onChange:n,minRows:3}),m.hint&&e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:m.hint}),i&&e.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:i}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(b,{size:"sm",variant:m.variant,disabled:a||r&&!d.trim(),onClick:()=>l(d),children:a?"Workingâ¦":m.confirm}),e.jsx(b,{size:"sm",variant:"ghost",disabled:a,onClick:p,children:"Cancel"})]})]})}function Qe({item:t,onDone:a}){const i=Ae(),l={id:t.id,type:t.questionType??"text",prompt:t.detail??t.title,options:t.questionOptions??null,recommendedAnswer:t.recommendedAnswer??null,rationale:t.rationale??null};return e.jsx(fe,{spec:l,pending:i.isPending,error:i.isError?E(i.error):null,onSubmit:(p,m,d)=>{const n=t.taskId?{taskId:t.taskId}:{projectId:t.projectId};i.mutate({...n,questionId:t.id,answer:p,...d?{answeredVia:d}:{},...m?{moreInfo:m}:{}},{onSuccess:a})},onCancel:a})}const $e="The task finished before this was answered, so the agent carried on without you. Nothing is waiting on you here.",Ge="You dismissed this. The agent is told to use its best judgment on its next check-in.";function Ue({item:t,showProject:a}){return e.jsxs("li",{className:"rounded-lg border border-border bg-card/60 p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"min-w-0 break-words text-sm font-medium",children:t.title}),a&&e.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-[11px] text-muted-foreground",children:t.projectName}),t.createdAt&&e.jsxs("span",{className:"ml-auto text-[11px] tabular-nums text-muted-foreground",children:["asked ",T(t.createdAt)]})]}),t.detail&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t.detail}),t.kind==="question"&&e.jsx("p",{className:"mt-1 text-xs italic text-muted-foreground",children:t.dismissed?Ge:$e}),e.jsx(B,{to:`/code-monkey/p/${t.projectId}`,className:"mt-1.5 inline-block text-xs font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:"Open project"})]})}function Xe({item:t,decisions:a,onOpen:i}){var o;const[l,p]=f.useState(null),[m,d]=f.useState(!1),[n,r]=f.useState(!1),x=Ce(),y=()=>p(null),C=z(a.requestChanges,t.refId),g=z(a.accept,t.refId),j=z(a.clearBlocker,t.refId),k=z(a.restart,t.refId),v=z(a.unsnooze,t.refId),w=z(
1a.snooze,t.refId),N=((o=[g,k,v,w].find(u=>u.error))==null?void 0:o.error)??(x.isError?E(x.error):null);return e.jsxs("div",{className:"rounded-lg border border-border bg-card p-4 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i?e.jsx("button",{type:"button",onClick:i,className:"min-w-0 break-words text-left text-sm font-semibold hover:underline",children:t.title}):e.jsx("p",{className:"min-w-0 break-words text-sm font-semibold",children:t.title}),t.kind!=="task"&&e.jsx("span",{className:"rounded-sm bg-primary/10 px-2 py-0.5 text-[11px] font-medium text-primary",children:t.kind==="question"?"Question":t.kind==="prd_review"?"Product plan":"Survey"}),e.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-[11px] text-muted-foreground",children:t.projectName}),(t.blockedAt??t.createdAt)&&e.jsx("span",{className:"text-[11px] tabular-nums text-muted-foreground",children:t.blockedAt?`blocked ${T(t.blockedAt)}`:`waiting ${T(t.createdAt)}`})]}),t.detail&&(t.folder==="assigned"?e.jsxs("div",{className:"mt-2 rounded-lg border border-border bg-muted/40 p-2.5",children:[e.jsx("p",{className:"text-[11px] font-medium text-muted-foreground",children:"Why your agent stopped"}),e.jsx("p",{className:"mt-0.5 whitespace-pre-wrap text-sm",children:t.detail})]}):e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t.detail})),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[t.folder==="review"&&t.kind!=="prd_review"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"sm",disabled:g.pending,onClick:()=>a.accept.mutate(t.refId),children:g.pending?"Acceptingâ¦":"Accept"}),e.jsx(b,{size:"sm",variant:"secondary",onClick:()=>p("changes"),children:"Request changes"})]}),t.kind==="prd_review"&&e.jsx(b,{asChild:!0,size:"sm",children:e.jsx(B,{to:`/code-monkey/p/${t.projectId}`,children:"Review product plan"})}),t.folder==="assigned"&&e.jsx(b,{size:"sm",disabled:j.pending,onClick:()=>p(l==="unblock"?null:"unblock"),children:j.pending?"Clearingâ¦":"Answer and unblock"}),t.folder==="stalled"&&e.jsx(b,{size:"sm",disabled:k.pending,onClick:()=>a.restart.mutate(t.refId),children:k.pending?"Restartingâ¦":"Restart"}),t.folder==="snoozed"&&e.jsx(b,{size:"sm",variant:"secondary",disabled:v.pending,onClick:()=>a.unsnooze.mutate(t.refId),children:v.pending?"Wakingâ¦":"Unsnooze"}),t.kind==="question"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{size:"sm",onClick:()=>d(u=>!u),children:"Answer"}),e.jsx(b,{size:"sm",variant:"secondary",disabled:x.isPending,onClick:()=>x.mutate({projectId:t.projectId,questionId:t.id,taskId:t.taskId??null}),children:x.isPending?"Dismissingâ¦":"Dismiss"}),e.jsx(b,{asChild:!0,size:"sm",variant:"link",children:e.jsx(B,{to:`/code-monkey/p/${t.projectId}`,children:"Open project"})})]}),t.kind==="survey"&&e.jsx(b,{asChild:!0,size:"sm",variant:"secondary",children:e.jsx(B,{to:`/code-monkey/p/${t.projectId}`,children:"Open project to answer"})}),_e.includes(t.folder)&&t.kind!=="prd_review"&&t.kind!=="survey"&&(t.kind!=="question"||!!t.taskId)&&e.jsx(b,{size:"sm",variant:"ghost",disabled:w.pending,onClick:()=>r(u=>!u),children:w.pending?"Snoozingâ¦":"Snooze"}),i&&e.jsx(b,{size:"sm",variant:"secondary",className:"ml-auto",onClick:i,children:"View details"})]}),n&&e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-md border border-border bg-muted/40 p-3",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Hide this untilâ¦"}),Le.map(u=>e.jsx(b,{size:"sm",variant:"secondary",disabled:w.pending,onClick:()=>a.snooze.mutate({taskId:t.refId,until:new Date(Date.now()+u.hours*36e5).toISOString()},{onSuccess:()=>r(!1)}),children:u.label},u.label)),e.jsx(b,{size:"sm",variant:"ghost",onClick:()=>r(!1),children:"Cancel"})]}),N&&e.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:N}),m&&t.kind==="question"&&e.jsx(Qe,{item:t,onDone:()=>d(!1)}),l==="changes"&&e.jsx(te,{mode:"changes",pending:C.pending,error:C.error,onCancel:y,onConfirm:u=>a.requestChanges.mutate({taskId:t.refId,note:u.trim()},{onSuccess:y})}),l==="unblock"&&e.jsx(te,{mode:"unblock",pending:j.pending,error:j.error,onCancel:y,onConfirm:u=>a.clearBlocker.mutate({taskId:t.refId,...u.trim()?{note:u.trim()}:{}},{onSuccess:y}
1)})]})}function Ye({scope:t}){var N;const{data:a}=ve(),i=(a==null?void 0:a.items)??[],[l,p]=f.useState(""),m=t!=="all"?t:l||(i.length===1?i[0].id:""),d=we(m),n=Ne(),r=Ie(),[x,y]=f.useState(""),[C,g]=f.useState(!1),j=((N=d.data)==null?void 0:N.items)??[],k=C?j:j.slice(0,3),v=m.length>0&&x.trim().length>0&&!n.isPending,w=()=>{v&&n.mutate({projectId:m,body:x.trim()},{onSuccess:()=>y("")})};return e.jsxs("section",{"aria-label":"Message your agent",className:"rounded-lg border border-border bg-card p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Message your agent"}),t==="all"&&i.length>1&&e.jsxs("select",{value:m,onChange:o=>p(o.target.value),"aria-label":"Which project's agent",className:"ml-auto h-8 max-w-52 rounded-lg border border-border bg-card px-2 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{value:"",children:"Pick a projectâ¦"}),i.map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Goes to the agent on its next check-in, ahead of everything else it had planned. It can reply here, ask you questions back, or change course because of what you said."}),e.jsx("textarea",{value:x,onChange:o=>y(o.target.value),"aria-label":"Message for the agent",placeholder:m?"Redirect it, ask what itâs thinking, hand it something newâ¦":"Pick a project first, then write your messageâ¦",rows:3,maxLength:8e3,className:"mt-2 w-full resize-y rounded-lg border border-border bg-background p-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.jsx(b,{size:"sm",disabled:!v,onClick:w,children:n.isPending?"Sendingâ¦":"Send to agent"}),n.isError&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:E(n.error)}),r.isError&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:E(r.error)})]}),k.length>0&&e.jsx("ul",{className:"mt-3 space-y-2 border-t border-border pt-3",children:k.map(o=>{var u,R;return e.jsxs("li",{className:"rounded-md border border-border bg-muted/30 p-2.5",children:[e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm",children:o.body}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"tabular-nums",children:["sent ",T(o.createdAt)]}),o.deliveredAt===null?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"italic",children:"waiting for the agent's next check-in"}),e.jsx("button",{type:"button",disabled:r.isPending&&((u=r.variables)==null?void 0:u.messageId)===o.id,onClick:()=>r.mutate({projectId:m,messageId:o.id}),className:"font-medium underline-offset-2 hover:text-foreground hover:underline",children:r.isPending&&((R=r.variables)==null?void 0:R.messageId)===o.id?"Taking backâ¦":"Take back"})]}):o.response===null?e.jsxs("span",{className:"italic",children:["picked up ",T(o.deliveredAt),", no reply yet"]}):e.jsxs("span",{className:"tabular-nums",children:["picked up ",T(o.deliveredAt)]})]}),o.response!==null&&e.jsxs("div",{className:"mt-2 rounded-md border border-border bg-card p-2",children:[e.jsxs("p",{className:"text-[11px] font-medium text-muted-foreground",children:["Agent reply",o.respondedAt?` · ${T(o.respondedAt)}`:""]}),e.jsx("p",{className:"mt-0.5 whitespace-pre-wrap break-words text-sm",children:o.response})]})]},o.id)})}),j.length>k.length&&e.jsxs("button",{type:"button",onClick:()=>g(!0),className:"mt-2 text-xs font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:["Show all ",j.length," messages"]})]})}function dt(){const[t,a]=ce(),i=t.get("folder"),l=F.some(s=>s.key===i)?i:"approvals",[p,m]=f.useState("oldest"),d=t.get("project")??"all",n=s=>a(s==="all"?{folder:l}:{folder:l,project:s}),[r,x]=f.useState([]),[y,C]=f.useState(!1),[g,j]=f.useState(null),[k,v]=f.useState(null),[w,N]=f.useState(!1),[o,u]=f.useState(null),[R,P]=f.useState(null),[Q,Y]=f.useState(null),[Z,D]=f.useState(null),J=l==="approvals",$=t.get("github"),G=$==="connected"?{tone:"ok",text:"GitHub is connected. Pick a repository on the project you want the hosted runner to work in."}:$==="pending"?{tone:"ok",text:"GitHub has your install request. It will appear here once an organisation owner approves it."}:$==="failed"?{tone:"bad",text:t.get("reason")==="install_state"?"That install link had expired. Start the connection again from Code Monkey and it will go through.":t.get("reason")==="suspended"?"That GitHub installation is suspended. Re-enable it on GitHub, then connect again.":t.get("reason")==="install_attempts"?"Too many install attempts just now. Wait a few minutes and try again.":"That GitHub installation could not be verified. Install the app from C
1ode Monkey and try again."}:null,{data:_,isLoading:ne,isError:re,refetch:ae}=ye();Be();const M=se();f.useEffect(()=>{x([]),D(null),u(null),C(!1)},[l,d]);const K=async(s,c,h)=>{if(c==="delete")return M.remove.mutateAsync({taskId:s});const S={taskId:s,...h?{note:h}:{}};return c==="approve"?M.approve.mutateAsync(S):M.reject.mutateAsync(S)},oe=async s=>{if(!g)return;const{decision:c,ids:h}=g;if(u(null),P(null),D(null),h.length===1){N(!0);try{await K(h[0],c,s),j(null),x(A=>A.filter(q=>q!==h[0]))}catch(A){P(E(A))}finally{N(!1)}return}j(null);const S=await ge(h,c,(A,q)=>K(A,q,""),(A,q)=>Y({done:A,total:q}));Y(null),D({tone:S.tone,text:S.message}),x(S.failed)};if(ne)return e.jsx(Ee,{rows:4,rowClassName:"h-24",className:"py-6"});if(re||!_)return e.jsx(Me,{className:"mx-auto mt-16 max-w-md",message:"Could not load the Command Center.",onRetry:()=>void ae()});const H=_.items.filter(s=>!ee(s)),le=[...new Map(H.map(s=>[s.projectId,s.projectName])).entries()].sort((s,c)=>s[1].localeCompare(c[1])),V=d==="all"?H:H.filter(s=>s.projectId===d),L=F.reduce((s,c)=>({...s,[c.key]:d==="all"?_.counts[c.key]:V.filter(h=>h.folder===c.key).length}),{}),U=V.filter(s=>s.folder===l),de=F.find(s=>s.key===l),I=[...U].sort((s,c)=>p==="oldest"?s.createdAt.localeCompare(c.createdAt):c.createdAt.localeCompare(s.createdAt)),W=d==="all"?0:H.filter(s=>s.folder===l).length-U.length,X=_.items.filter(s=>ee(s)&&s.folder===l&&(d==="all"||s.projectId===d)).sort((s,c)=>c.createdAt.localeCompare(s.createdAt)),ie=d==="all"?Math.max(0,L[l]-I.length):0,O=(g==null?void 0:g.ids.length)===1?I.find(s=>s.refId===g.ids[0])??null:null;return e.jsxs("div",{children:[e.jsxs(B,{to:"/code-monkey",className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",children:[e.jsx(Oe,{className:"size-3.5"})," Code Monkey"]}),G&&e.jsx("div",{role:"status",className:`mt-3 rounded-md border px-3 py-2 text-sm ${G.tone==="ok"?"border-border bg-card":"border-destructive/40 bg-destructive/5 text-destructive"}`,children:G.text}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1",children:[e.jsx("h1",{className:"font-display text-2xl font-bold tracking-tight",children:"Command Center"}),e.jsx(ue,{anchor:"approvals",label:"What are these folders?"}),e.jsxs("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",children:["Showing",e.jsxs("select",{value:d,onChange:s=>n(s.target.value),"aria-label":"Project scope",className:"h-8 max-w-52 rounded-lg border border-border bg-card px-2 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{value:"all",children:"All projects"}),le.map(([s,c])=>e.jsx("option",{value:s,children:c},s))]})]})]}),e.jsxs("div",{className:"mt-5 grid gap-5 md:grid-cols-[220px_1fr]",children:[e.jsx("nav",{"aria-label":"Command Center folders",className:"flex min-w-0 gap-1 overflow-x-auto pb-1 md:flex-col md:overflow-visible md:pb-0",children:F.map(s=>e.jsxs("button",{type:"button","aria-pressed":l===s.key,onClick:()=>a(d==="all"?{folder:s.key}:{folder:s.key,project:d}),className:Pe(De(l===s.key),"flex shrink-0 items-center gap-2 px-3 py-2 font-medium"),children:[e.jsx(s.icon,{className:"size-4"}),e.jsx("span",{className:"flex-1 text-left",children:s.label}),L[s.key]>0&&e.jsx("span",{className:"rounded-sm bg-primary/10 px-2 py-0.5 text-[11px] font-semibold tabular-nums text-primary",children:L[s.key]})]},s.key))}),e.jsxs("div",{className:"min-w-0 space-y-3",children:[l==="questions"&&e.jsx(Ye,{scope:d}),(U.length>1||W>0)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:["Sort",e.jsxs("select",{value:p,onChange:s=>m(s.target.value),"aria-label":"Sort by age",className:"h-8 rounded-lg border border-border bg-card px-2 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{value:"oldest",children:"Waiting longest"}),e.jsx("option",{value:"newest",children:"Newest first"})]})]}),W>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[W," more in y
1our other projects"]}),J&&I.length>0&&e.jsxs("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx("input",{type:"checkbox","aria-label":"Select all shown",className:"size-4 accent-primary",checked:I.every(s=>r.includes(s.refId)),onChange:s=>x(s.target.checked?I.map(c=>c.refId):[])}),"Select all shown"]})]}),ie>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",I.length," of ",L[l],". Deal with these and the rest appear here."]}),J&&(r.length>0||Q||Z)&&e.jsx(me,{count:r.length,busy:Q!==null,progress:Q,result:Z,onDecide:s=>{u(null),P(null),D(null),j({decision:s,ids:r})},onClear:()=>{x([]),D(null)}}),I.length===0?e.jsx(qe,{title:W>0?"Nothing from that project in this folder.":de.empty}):I.map(s=>s.folder==="approvals"?e.jsx(xe,{item:{id:s.refId,title:s.title,operatorSummary:s.operatorSummary,detail:s.detail,category:s.category,priority:s.priority,effort:s.effort,projectName:s.projectName,createdAt:s.createdAt},selectable:!0,showProject:d==="all",selected:r.includes(s.refId),error:(o==null?void 0:o.id)===s.refId?o.message:null,onSelect:c=>x(h=>c?[...h,s.refId]:h.filter(S=>S!==s.refId)),onDecide:c=>{u(null),P(null),j({decision:c,ids:[s.refId]})},snoozing:z(M.snooze,s.refId).pending,onSnooze:c=>M.snooze.mutate({taskId:s.refId,until:c},{onSuccess:()=>u(h=>(h==null?void 0:h.id)===s.refId?null:h),onError:h=>u({id:s.refId,message:E(h)})}),onOpen:()=>v({taskId:s.refId,projectId:s.projectId})},s.id):e.jsx(Xe,{item:s,decisions:M,...s.kind==="task"?{onOpen:()=>v({taskId:s.refId,projectId:s.projectId})}:{}},s.id)),X.length>0&&e.jsxs("div",{className:"pt-1",children:[e.jsxs("button",{type:"button","aria-expanded":y,onClick:()=>C(s=>!s),className:"text-xs font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:[y?"Hide":"Show"," earlier questions (",X.length,")"]}),y&&e.jsx("ul",{className:"mt-2 space-y-2",children:X.map(s=>e.jsx(Ue,{item:s,showProject:d==="all"},s.id))})]})]})]}),e.jsx(he,{decision:(g==null?void 0:g.decision)??null,item:O?{id:O.refId,title:O.title,operatorSummary:O.operatorSummary,detail:O.detail,projectName:O.projectName}:null,bulkCount:g&&g.ids.length>1?g.ids.length:void 0,pending:w,error:R,onClose:()=>{j(null),P(null)},onConfirm:s=>void oe(s)}),k&&e.jsx(Re,{taskId:k.taskId,projectId:k.projectId,onClose:()=>v(null)},k.taskId)]})}export{dt as CodeMonkeyCommandCenterPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.