PageSourceSearch

https://fridayreport.ai/assets/ProjectAgentTab-B5RXW1tA.js

js fridayreport.ai collected 2026-10-05 13:59:06 UTC 8,447 bytes, 1 lines download raw bytes

1import{a as N,b as R,j as e}from"./vendor-query-CS-Sb1c4.js";import{a as M}from"./vendor-router-CZSztoNj.js";import{b as $,q as f,a as o,B as E,C as m,m as x,o as u,v as B,p as j,c as P}from"./index-D-3pbJbQ.js";import{B as V}from"./badge-Dc91IPO4.js";import{S as C}from"./switch-BYyCiy8b.js";import{L as h}from"./label-Umko-O4j.js";import{S as v,a as b,b as w,c as S,d as k}from"./select--txDPtWB.js";import{S as z}from"./scroll-area-BVFhF_YD.js";import{h as K,w as Q,T as Y,cC as G,g as O,cY as H,n as W,ah as X,a_ as Z,ea as J}from"./vendor-icons-B_ClLdji.js";import"./vendor-ui-Cz1dd9Yr.js";import"./vendor-motion-D0xMKZ2p.js";const I=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ee=Array.from({length:24},(a,l)=>{const c=l.toString().padStart(2,"0");return[`${c}:00`,`${c}:30`]}).flat(),se=["America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Kolkata","Asia/Dubai","Australia/Sydney","Pacific/Auckland"];function ue({projectId:a}){const{toast:l}=$(),[c,y]=M.useState(null),{data:n,isLoading:F}=N({queryKey:["/api/projects",a,"agent"],queryFn:()=>o("GET",`/api/projects/${a}/agent`).then(s=>s.json())}),{data:g}=N({queryKey:["/api/projects",a,"agent","stakeholders"],queryFn:()=>o("GET",`/api/projects/${a}/agent/stakeholders`).then(s=>s.json())}),{data:A=[]}=N({queryKey:["/api/projects",a,"agent","logs"],queryFn:()=>o("GET",`/api/projects/${a}/agent/logs`).then(s=>s.json())}),D=R({mutationFn:s=>o("PUT",`/api/projects/${a}/agent`,s).then(i=>i.json()),onSuccess:()=>{f.invalidateQueries({queryKey:["/api/projects",a,"agent"]}),l({title:"Agent configuration updated"})},onError:()=>{l({title:"Error",description:"Failed to update agent",variant:"destructive"})}}),L=R({mutationFn:s=>o("POST",`/api/projects/${a}/agent/trigger/${s}`).then(i=>i.json()),onSuccess:(s,i)=>{f.invalidateQueries({queryKey:["/api/projects",a,"agent","logs"]}),f.invalidateQueries({queryKey:["/api/projects",a,"agent"]}),l({title:`Action '${i}' executed successfully`}),y(null)},onError:s=>{l({title:"Action failed",description:s.message,variant:"destructive"}),y(null)}}),r=n||{enabled:!1,agendaEnabled:!0,agendaDay:1,agendaTime:"09:00",taskFollowUpEnabled:!0,taskFollowUpDay:3,taskFollowUpTime:"09:00",statusReportEnabled:!0,statusReportDay:5,statusReportTime:"09:00",timezone:"America/New_York"},d=s=>{D.mutate({...r,...s})};if(F)return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(E,{size:"sm",className:"h-6 w-6"})});const U=[{key:"agenda",label:"Meeting Agenda",enabledKey:"agendaEnabled",dayKey:"agendaDay",timeKey:"agendaTime",lastRun:n?.lastAgendaRun,nextRun:n?.nextAgendaRun,trigger:"meeting_agenda",icon:K},{key:"taskFollowUp",label:"Task Follow-Up",enabledKey:"taskFollowUpEnabled",dayKey:"taskFollowUpDay",timeKey:"taskFollowUpTime",lastRun:n?.lastTaskFollowUpRun,nextRun:n?.nextTaskFollowUpRun,trigger:"task_follow_up",icon:Q},{key:"statusReport",label:"Status Report",enabledKey:"statusReportEnabled",dayKey:"statusReportDay",timeKey:"statusReportTime",lastRun:n?.lastStatusReportRun,nextRun:n?.nextStatusReportRun,trigger:"status_report",icon:Y}];return e.jsxs("div",{className:"space-y-6 p-1",children:[e.jsx(m,{children:e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-violet-100 dark:bg-violet-900/30",children:e.jsx(G,{className:"h-5 w-5 text-violet-600 dark:text-violet-400"})}),e.jsxs("div",{children:[e.jsx(u,{children:"AI Project Agent"}),e.jsx(B,{children:"Automated meeting agendas, task follow-ups, and status reports"})]})]}),e.jsx(C,{checked:r.enabled,onCheckedChange:s=>d({enabled:s})})]})})}),r.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:U.map(s=>{const i=s.icon,p=r[s.enabledKey],q=r[s.dayKey],_=r[s.timeKey];return e.jsxs(m,{className:p?"":"opacity-60",children:[e.jsx(x,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(i,{className:"h-4 w-4"}),e.jsx(u,{className:"text-sm",children:s.label})]}),e.jsx(C,{checked:p,onCheckedChange:t=>d({[s.enabledKey]:t})})]})}),e.jsxs(j,{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(h,{className:"text-xs text-muted-foreground",children:"Day"}),e.jsxs(v,{value:String(q),onValueChange:t=>d({[s.dayKey]:Number(t)}),disabled:!p,children:[e.jsx(b,{className:"h-8 text-sm",children:e.jsx(w,{})}),e.jsx(S,{children:I.map((t,T)=>e.jsx(k,{value:String(T),children:t},T))})]})]}),e.jsxs("div",{children:[e.jsx(h,{className:"text-xs text-muted-foreground",children:"Time"}),e.jsxs(v,{value:_,onValueChange:t=>d({[s.timeKey]:t}),disabled:!p,children:[e.jsx(b,{className:"h-8 text-sm",children:e.jsx(w,{})}),e.jsx(S,{children:ee.map(t=>e.jsx(k,{value:t,children:t},t))})]})]}),s.lastRun&&e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx(O,{className:"h-3 w-3 inline mr-1"}),"Last: ",new Date(s.lastRun).toLocaleDateString()]}),s.nextRun&&e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx(K,{className:"h-3 w-3 inline mr-1"}),"Next: ",new Date(s.nextRun).toLocaleDateString()," ",new Date(s.nextRun).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]}),e.jsxs(P,{size:"sm",variant:"outline",className:"w-full",disabled:c!==null,onClick:()=>{y(s.trigger),L.mutate(s.trigger)},children:[c===s.trigger?e.jsx(E,{size:"sm",className:"h-3 w-3 mr-1"}):e.jsx(H,{className:"h-3 w-3 mr-1"}),"Run Now"]})]})]},s.key)})}),e.jsxs(m,{children:[e.jsx(x,{className:"pb-3",children:e.jsx(u,{className:"text-sm",children:"Timezone"})}),e.jsx(j,{children:e.jsxs(v,{value:r.timezone,onValueChange:s=>d({timezone:s}),children:[e.jsx(b,{className:"h-8 text-sm w-64",children:e.jsx(w,{})}),e.jsx(S,{children:se.map(s=>e.jsx(k,{value:s,children:s.replace(/_/g," ")},s))})]})})]}),g&&e.jsxs(m,{children:[e.jsx(x,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{className:"h-4 w-4"}),e.jsx(u,{className:"text-sm",children:"Stakeholders (Email Recipients)"})]})}),e.jsxs(j,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx(h,{className:"text-xs text-muted-foreground",children:"Project Manager"}),e.jsx("p",{children:g.managerEmail||e.jsx("span",{className:"text-muted-foreground italic",children:"Not assigned"})})]}),e.jsxs("div",{children:[e.jsx(h,{className:"text-xs text-muted-foreground",children:"Business Sponsor"}),e.jsx("p",{children:g.sponsorEmail||e.jsx("span",{className:"text-muted-foreground italic",children:"Not assigned"})})]}),e.jsxs("div",{children:[e.jsx(h,{className:"text-xs text-muted-foreground",children:"Technical Lead"}),e.jsx("p",{children:g.techLeadEmail||e.jsx("span",{className:"text-muted-foreground italic",children:"Not assigned"})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:"Configure roles in the project Summary tab to set email recipients."})]})]}),A.length>0&&e.jsxs(m,{children:[e.jsx(x,{className:"pb-3",children:e.jsx(u,{className:"text-sm",children:"Activity L
1og"})}),e.jsx(j,{children:e.jsx(z,{className:"h-[300px]",children:e.jsx("div",{className:"space-y-3",children:A.map(s=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border bg-muted/30",children:[e.jsx("div",{className:"mt-0.5",children:s.status==="success"?e.jsx(X,{className:"h-4 w-4 text-green-500"}):s.status==="error"?e.jsx(Z,{className:"h-4 w-4 text-red-500"}):e.jsx(J,{className:"h-4 w-4 text-amber-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(V,{variant:"secondary",className:"text-[10px]",children:s.actionType.replace(/_/g," ")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(s.createdAt).toLocaleString()})]}),e.jsx("p",{className:"text-sm mt-1 truncate",children:s.subject}),s.recipientEmails?.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["To: ",s.recipientEmails.join(", ")]}),s.errorMessage&&e.jsx("p",{className:"text-xs text-red-500 mt-1",children:s.errorMessage})]})]},s.id))})})})]})]})]})}export{ue as default};

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.