tide-commander 1.32.0 → 1.32.2

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.
Files changed (37) hide show
  1. package/dist/assets/{BossLogsModal-CxnuaVLt.js → BossLogsModal-2lqGyuCD.js} +1 -1
  2. package/dist/assets/{BossSpawnModal-DqRZg6S9.js → BossSpawnModal-CR-ofDeB.js} +1 -1
  3. package/dist/assets/{ControlsModal-XewABbt7.js → ControlsModal-DQ8QVshA.js} +1 -1
  4. package/dist/assets/{DockerLogsModal-DO1NwVtl.js → DockerLogsModal-D6yQTHy7.js} +1 -1
  5. package/dist/assets/{EmbeddedEditor-C-wR7ibp.js → EmbeddedEditor-wechGxGl.js} +1 -1
  6. package/dist/assets/{GmailOAuthSetup-DIiLdCF_.js → GmailOAuthSetup-B2GDjROU.js} +1 -1
  7. package/dist/assets/{GoogleOAuthSetup-zOIJjUby.js → GoogleOAuthSetup-BcpJEydM.js} +1 -1
  8. package/dist/assets/{IframeModal-DIXSiM8q.js → IframeModal-E2E7NR08.js} +1 -1
  9. package/dist/assets/{IntegrationsPanel-DSRso07J.js → IntegrationsPanel-CrS2QOFR.js} +2 -2
  10. package/dist/assets/{LogViewerModal-wxMGICHp.js → LogViewerModal-BpIPZeFr.js} +1 -1
  11. package/dist/assets/{MonitoringModal-lQ3QOOu_.js → MonitoringModal-CIF9MUm9.js} +1 -1
  12. package/dist/assets/{PM2LogsModal-65TlIP3m.js → PM2LogsModal-CDk_2mi1.js} +1 -1
  13. package/dist/assets/{RestoreArchivedAreaModal-DyAX7sAk.js → RestoreArchivedAreaModal-BmgBrk9J.js} +1 -1
  14. package/dist/assets/{SaveSnapshotModal-DklbWMfv.js → SaveSnapshotModal-DWta9pcx.js} +1 -1
  15. package/dist/assets/{Scene2DCanvas-BKRmz7p_.js → Scene2DCanvas-C3CcFsjU.js} +1 -1
  16. package/dist/assets/{SceneManager-BateiUMw.js → SceneManager-mFUakRNl.js} +3 -3
  17. package/dist/assets/{SkillsPanel-31iFedsY.js → SkillsPanel-Br3h8GNh.js} +1 -1
  18. package/dist/assets/{SnapshotManager-Dx_v2771.js → SnapshotManager-CPYWfnPR.js} +1 -1
  19. package/dist/assets/{SpawnModal-BuoXaLE_.js → SpawnModal-DSDirR0j.js} +1 -1
  20. package/dist/assets/{SubordinateAssignmentModal-D3q_V3qk.js → SubordinateAssignmentModal-Daz67phV.js} +1 -1
  21. package/dist/assets/{SupervisorPanel-Bwsa2-p3.js → SupervisorPanel-DoAl5e8W.js} +1 -1
  22. package/dist/assets/{TriggerManagerPanel-B6PNSeOY.js → TriggerManagerPanel-CVIHbqDt.js} +1 -1
  23. package/dist/assets/{WorkflowEditorPanel-C3OdjvW1.js → WorkflowEditorPanel-C4BRfmDM.js} +1 -1
  24. package/dist/assets/{camera-BhjTfRae.js → camera-8crtHeRa.js} +1 -1
  25. package/dist/assets/{index-4NqCkCfM.js → index--PCy0J0f.js} +3 -3
  26. package/dist/assets/{index-DtNo7816.js → index-CE_GbjZ6.js} +1 -1
  27. package/dist/assets/{index-Byp5m0Pl.js → index-Chrxgrys.js} +1 -1
  28. package/dist/assets/{index-4As-DWAf.js → index-CvMf5n2v.js} +1 -1
  29. package/dist/assets/{index-Bqki7fY3.js → index-DOzx4Y9b.js} +2 -2
  30. package/dist/assets/{index-BTFdFRqb.js → index-DWVQ48nQ.js} +1 -1
  31. package/dist/assets/{index-TeF1kOMZ.js → index-I-I3pPPW.js} +1 -1
  32. package/dist/assets/{index-Baose4ZS.js → index-uXOqPsuU.js} +1 -1
  33. package/dist/assets/{main-CRaSsX9C.js → main-DahZb6P4.js} +79 -79
  34. package/dist/assets/{web-CiJi8SUi.js → web-DdRt5c0R.js} +1 -1
  35. package/dist/assets/{web-BKrOO-a3.js → web-IWJRtE3-.js} +1 -1
  36. package/dist/index.html +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- import{r as i,L as j,p as w,j as e}from"./main-CRaSsX9C.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";const O=[{id:"triggers",label:"Triggers",icon:"⚡"},{id:"workflows",label:"Workflows",icon:"⚙️"},{id:"messages",label:"Messages",icon:"💬"},{id:"stats",label:"Stats",icon:"📊"}],_={trigger:"#89b4fa",slack:"#cba6f7",email:"#f9e2af",calendar:"#a6e3a1",document:"#fab387",jira:"#89dceb",workflow:"#f38ba8",system:"#6c7086",step:"#f38ba8",variable_change:"#cba6f7",approval:"#a6e3a1",audit:"#6c7086"},J={trigger:"Trigger",slack:"Slack",email:"Email",calendar:"Calendar",document:"Document",jira:"Jira",workflow:"Workflow",system:"System",step:"Step",variable_change:"Variable",approval:"Approval",audit:"Audit"};function Z({isOpen:n,onClose:t}){const[r,h]=i.useState("triggers"),[S,o]=i.useState([]),[l,u]=i.useState(!0),[$,c]=i.useState(null),[m,R]=i.useState("24h"),[C,z]=i.useState(""),[W,I]=i.useState(null),[D,M]=i.useState(null),[P,U]=i.useState([]),T=i.useCallback(async()=>{if(r!=="stats"){u(!0);try{const a=Date.now(),b={"1h":36e5,"6h":216e5,"24h":864e5,"7d":6048e5,all:0},d=b[m]>0?String(a-b[m]):void 0;let v=[];if(r==="triggers"){const g=new URLSearchParams({limit:"200"});d&&g.set("since",d);const p=await j(w(`/api/events/triggers?${g}`));if(!p.ok){c(`HTTP ${p.status}`);return}v=((await p.json()).events||[]).map(x=>({type:"trigger",timestamp:x.firedAt,data:x}))}else if(r==="workflows"){const g=new URLSearchParams({limit:"200",category:"workflow"});d&&g.set("since",d);const p=await j(w(`/api/events/audit?${g}`));if(!p.ok){c(`HTTP ${p.status}`);return}v=((await p.json()).entries||[]).map(x=>({type:"workflow",timestamp:x.createdAt,data:x}))}else if(r==="messages"){const g=new URLSearchParams({limit:"200"}),p=new URLSearchParams({limit:"200"}),E=new URLSearchParams({limit:"200"});d&&(g.set("since",d),p.set("since",d));const[x,F,N]=await Promise.all([j(w(`/api/events/slack?${g}`)),j(w(`/api/events/email?${p}`)),j(w(`/api/events/approvals?${E}`))]);if(x.ok){const y=await x.json();for(const f of y.messages||[])v.push({type:"slack",timestamp:f.receivedAt,data:f})}if(F.ok){const y=await F.json();for(const f of y.messages||[])v.push({type:"email",timestamp:f.receivedAt,data:f})}if(N.ok){const y=await N.json();for(const f of y.events||[])v.push({type:"approval",timestamp:f.recordedAt,data:f})}v.sort((y,f)=>f.timestamp-y.timestamp)}o(v),c(null)}catch(a){c(`Failed to load events: ${a}`)}finally{u(!1)}}},[r,m]),A=i.useCallback(async()=>{u(!0);try{const[a,b]=await Promise.all([j(w("/api/events/stats")),j(w("/api/integrations"))]);if(a.ok&&M(await a.json()),b.ok){const d=await b.json();U(Array.isArray(d)?d:[])}c(null)}catch(a){c(`Failed to load stats: ${a}`)}finally{u(!1)}},[]);i.useEffect(()=>{n&&(r==="stats"?A():T())},[n,r,T,A]);const B=S.filter(a=>{if(!C)return!0;const b=C.toLowerCase();return JSON.stringify(a.data).toLowerCase().includes(b)});if(!n)return null;const H=P.filter(a=>a.status.connected).length;return e.jsx("div",{style:s.overlay,onClick:t,children:e.jsxs("div",{style:s.modal,onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{style:s.header,children:[e.jsxs("div",{style:s.headerTitle,children:[e.jsx("span",{children:"📊"}),e.jsx("span",{children:"Monitoring & Logs"})]}),e.jsx("button",{style:s.closeBtn,onClick:t,title:"Close",children:"×"})]}),e.jsx("div",{style:s.tabs,children:O.map(a=>e.jsxs("button",{style:s.tab(r===a.id),onClick:()=>{h(a.id),z(""),I(null)},children:[e.jsx("span",{children:a.icon}),e.jsx("span",{children:a.label})]},a.id))}),r!=="stats"&&e.jsxs("div",{style:s.filters,children:[e.jsx("div",{style:{display:"flex",gap:4},children:["1h","6h","24h","7d","all"].map(a=>e.jsx("button",{style:{...s.timeBtn,background:m===a?"#89b4fa":"transparent",color:m===a?"#1e1e2e":"#a6adc8"},onClick:()=>R(a),children:a},a))}),e.jsx("input",{style:s.searchInput,placeholder:"Search events...",value:C,onChange:a=>z(a.target.value)}),e.jsx("button",{style:s.refreshBtn,onClick:T,children:"Refresh"})]}),e.jsx("div",{style:s.content,children:r==="stats"?e.jsx(V,{loading:l,error:$,stats:D,integrations:P,connectedCount:H,onRefresh:A}):e.jsx(G,{loading:l,error:$,entries:B,expandedId:W,onToggleExpand:a=>I(W===a?null:a)})}),r!=="stats"&&e.jsx("div",{style:s.footer,children:e.jsxs("span",{style:{color:"#6c7086",fontSize:11},children:[B.length," event",B.length!==1?"s":""," shown",C&&` (filtered from ${S.length})`]})})]})})}function G({loading:n,error:t,entries:r,expandedId:h,onToggleExpand:S}){return n?e.jsx("div",{style:{color:"#a6adc8",padding:20},children:"Loading events..."}):t?e.jsx("div",{style:{color:"#f38ba8",padding:20},children:t}):r.length===0?e.jsx("div",{style:{color:"#6c7086",textAlign:"center",padding:40},children:"No events found for the selected filters."}):e.jsx(e.Fragment,{children:r.map((o,l)=>{const u=`${o.type}-${o.timestamp}-${l}`,$=h===u,c=_[o.type]||"#6c7086",m=Y(o),R=new Date(o.timestamp);return e.jsxs("div",{style:{...s.eventRow,borderLeft:`3px solid ${c}`,background:$?"rgba(137,180,250,0.05)":"transparent"},onClick:()=>S(u),children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{...s.tag,background:`${c}22`,color:c},children:J[o.type]||o.type}),e.jsx("span",{style:{color:"#cdd6f4",fontSize:12,flex:1},children:m}),e.jsxs("span",{style:{color:"#6c7086",fontSize:10,whiteSpace:"nowrap"},children:[R.toLocaleTimeString()," ",R.toLocaleDateString()]})]}),$&&e.jsx("pre",{style:s.detail,children:JSON.stringify(o.data,null,2)})]},u)})})}function V({loading:n,error:t,stats:r,integrations:h,connectedCount:S,onRefresh:o}){return n?e.jsx("div",{style:{color:"#a6adc8",padding:20},children:"Loading stats..."}):t?e.jsx("div",{style:{color:"#f38ba8",padding:20},children:t}):e.jsxs("div",{style:{padding:20},children:[e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:16},children:e.jsx("button",{style:s.refreshBtn,onClick:o,children:"Refresh"})}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:s.section,children:[e.jsx("h3",{style:s.sectionTitle,children:"Workflows"}),e.jsxs("div",{style:s.grid,children:[e.jsx(k,{label:"Active",value:r.activeWorkflows,color:"#89b4fa"}),e.jsx(k,{label:"Completed",value:r.completedWorkflows,color:"#a6e3a1"}),e.jsx(k,{label:"Failed",value:r.failedWorkflows,color:"#f38ba8"})]})]}),e.jsxs("div",{style:s.section,children:[e.jsx("h3",{style:s.sectionTitle,children:"Events (Today)"}),e.jsxs("div",{style:s.grid,children:[e.jsx(k,{label:"Triggers Fired",value:r.triggersFiredToday,color:"#f9e2af"}),e.jsx(k,{label:"Slack Messages",value:r.slackMessageCount,color:"#cba6f7"}),e.jsx(k,{label:"Emails",value:r.emailCount,color:"#fab387"})]})]}),e.jsxs("div",{style:s.section,children:[e.jsxs("h3",{style:s.sectionTitle,children:["Integrations (",S,"/",h.length," connected)"]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[h.map(l=>e.jsxs("div",{style:s.integrationRow,children:[e.jsx("span",{style:{color:"#cdd6f4",fontSize:13},children:l.name}),e.jsx("span",{style:{...s.statusBadge,background:l.status.connected?"rgba(166,227,161,0.15)":"rgba(108,112,134,0.15)",color:l.status.connected?"#a6e3a1":"#6c7086"},children:l.status.error?"Error":l.status.connected?"Connected":"Disconnected"})]},l.id)),h.length===0&&e.jsx("div",{style:{color:"#6c7086",fontSize:12},children:"No integrations configured"})]})]})]}),!r&&e.jsx("div",{style:{color:"#6c7086",textAlign:"center",padding:40},children:"No stats available. The event store may not have any data yet."})]})}function k({label:n,value:t,color:r}){return e.jsxs("div",{style:s.card,children:[e.jsx("div",{style:{color:r,fontSize:28,fontWeight:700,lineHeight:1},children:t}),e.jsx("div",{style:{color:"#a6adc8",fontSize:11,marginTop:4},children:n})]})}function Y(n){const t=n.data;switch(n.type){case"trigger":return`Trigger "${t.triggerName||t.triggerId}" ${t.status||"fired"}`;case"slack":return`${t.direction==="outbound"?"Sent":"Received"} in #${t.channelName||t.channelId}: ${L(t.text,60)}`;case"email":return`${t.direction==="outbound"?"Sent to":"From"} ${t.direction==="outbound"?t.toAddresses:t.fromAddress}: ${L(t.subject,50)}`;case"approval":return`${t.approved?"Approved":"Rejected"} by ${t.approverEmail}`;case"document":return`Generated "${t.outputFilename}" from template "${t.templateName}"`;case"calendar":return`Calendar event ${t.action}: "${t.summary}"`;case"jira":return`${t.ticketKey} ${t.action}: ${L(t.summary,50)}`;case"step":return`Workflow step: ${t.toStateName} (${t.status})`;case"variable_change":return`Variable "${t.variableName}" changed by ${t.changedBy}`;case"audit":return`[${(t.level||"info").toUpperCase()}] ${t.category}: ${t.action}`;default:return JSON.stringify(t).slice(0,80)}}function L(n,t){return n?n.length>t?n.slice(0,t)+"...":n:""}const s={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,backdropFilter:"blur(4px)"},modal:{background:"var(--surface-0, #1e1e2e)",borderRadius:12,border:"1px solid var(--border, #313244)",width:"90vw",maxWidth:1e3,height:"85vh",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--border, #313244)",background:"var(--surface-1, #181825)"},headerTitle:{fontSize:16,fontWeight:600,color:"var(--text-primary, #cdd6f4)",display:"flex",alignItems:"center",gap:8},closeBtn:{background:"none",border:"none",color:"var(--text-secondary, #a6adc8)",fontSize:20,cursor:"pointer",padding:"4px 8px",borderRadius:6,lineHeight:1},tabs:{display:"flex",borderBottom:"1px solid var(--border, #313244)",background:"var(--surface-1, #181825)",overflowX:"auto",scrollbarWidth:"none"},tab:n=>({padding:"10px 16px",background:"none",border:"none",borderBottom:n?"2px solid var(--accent, #89b4fa)":"2px solid transparent",color:n?"var(--accent, #89b4fa)":"var(--text-secondary, #a6adc8)",fontSize:13,fontWeight:n?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",transition:"color 0.15s, border-color 0.15s",flexShrink:0}),filters:{display:"flex",gap:8,alignItems:"center",padding:"10px 20px",borderBottom:"1px solid var(--border, #313244)",flexWrap:"wrap"},timeBtn:{border:"1px solid #45475a",borderRadius:4,padding:"4px 8px",fontSize:10,fontWeight:600,cursor:"pointer"},searchInput:{background:"#313244",border:"1px solid #45475a",borderRadius:6,padding:"5px 10px",color:"#cdd6f4",fontSize:12,flex:1,minWidth:120,outline:"none"},refreshBtn:{background:"transparent",border:"1px solid #45475a",borderRadius:6,padding:"5px 12px",color:"#a6adc8",fontSize:11,cursor:"pointer"},content:{flex:1,overflow:"auto",padding:"0 20px"},eventRow:{padding:"8px 12px",borderBottom:"1px solid #313244",cursor:"pointer",transition:"background 0.1s"},tag:{fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap"},detail:{marginTop:8,padding:10,background:"#181825",borderRadius:6,fontSize:11,fontFamily:"monospace",color:"#a6adc8",overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-all"},footer:{padding:"8px 20px",borderTop:"1px solid #313244"},section:{marginBottom:24},sectionTitle:{color:"#a6adc8",fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:1,marginBottom:12,margin:0},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12},card:{background:"#313244",borderRadius:8,padding:"16px 14px",textAlign:"center"},integrationRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 12px",background:"#313244",borderRadius:6},statusBadge:{fontSize:10,fontWeight:600,padding:"3px 8px",borderRadius:4}};export{Z as MonitoringModal};
1
+ import{r as i,L as j,p as w,j as e}from"./main-DahZb6P4.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";const O=[{id:"triggers",label:"Triggers",icon:"⚡"},{id:"workflows",label:"Workflows",icon:"⚙️"},{id:"messages",label:"Messages",icon:"💬"},{id:"stats",label:"Stats",icon:"📊"}],_={trigger:"#89b4fa",slack:"#cba6f7",email:"#f9e2af",calendar:"#a6e3a1",document:"#fab387",jira:"#89dceb",workflow:"#f38ba8",system:"#6c7086",step:"#f38ba8",variable_change:"#cba6f7",approval:"#a6e3a1",audit:"#6c7086"},J={trigger:"Trigger",slack:"Slack",email:"Email",calendar:"Calendar",document:"Document",jira:"Jira",workflow:"Workflow",system:"System",step:"Step",variable_change:"Variable",approval:"Approval",audit:"Audit"};function Z({isOpen:n,onClose:t}){const[r,h]=i.useState("triggers"),[S,o]=i.useState([]),[l,u]=i.useState(!0),[$,c]=i.useState(null),[m,R]=i.useState("24h"),[C,z]=i.useState(""),[W,I]=i.useState(null),[D,M]=i.useState(null),[P,U]=i.useState([]),T=i.useCallback(async()=>{if(r!=="stats"){u(!0);try{const a=Date.now(),b={"1h":36e5,"6h":216e5,"24h":864e5,"7d":6048e5,all:0},d=b[m]>0?String(a-b[m]):void 0;let v=[];if(r==="triggers"){const g=new URLSearchParams({limit:"200"});d&&g.set("since",d);const p=await j(w(`/api/events/triggers?${g}`));if(!p.ok){c(`HTTP ${p.status}`);return}v=((await p.json()).events||[]).map(x=>({type:"trigger",timestamp:x.firedAt,data:x}))}else if(r==="workflows"){const g=new URLSearchParams({limit:"200",category:"workflow"});d&&g.set("since",d);const p=await j(w(`/api/events/audit?${g}`));if(!p.ok){c(`HTTP ${p.status}`);return}v=((await p.json()).entries||[]).map(x=>({type:"workflow",timestamp:x.createdAt,data:x}))}else if(r==="messages"){const g=new URLSearchParams({limit:"200"}),p=new URLSearchParams({limit:"200"}),E=new URLSearchParams({limit:"200"});d&&(g.set("since",d),p.set("since",d));const[x,F,N]=await Promise.all([j(w(`/api/events/slack?${g}`)),j(w(`/api/events/email?${p}`)),j(w(`/api/events/approvals?${E}`))]);if(x.ok){const y=await x.json();for(const f of y.messages||[])v.push({type:"slack",timestamp:f.receivedAt,data:f})}if(F.ok){const y=await F.json();for(const f of y.messages||[])v.push({type:"email",timestamp:f.receivedAt,data:f})}if(N.ok){const y=await N.json();for(const f of y.events||[])v.push({type:"approval",timestamp:f.recordedAt,data:f})}v.sort((y,f)=>f.timestamp-y.timestamp)}o(v),c(null)}catch(a){c(`Failed to load events: ${a}`)}finally{u(!1)}}},[r,m]),A=i.useCallback(async()=>{u(!0);try{const[a,b]=await Promise.all([j(w("/api/events/stats")),j(w("/api/integrations"))]);if(a.ok&&M(await a.json()),b.ok){const d=await b.json();U(Array.isArray(d)?d:[])}c(null)}catch(a){c(`Failed to load stats: ${a}`)}finally{u(!1)}},[]);i.useEffect(()=>{n&&(r==="stats"?A():T())},[n,r,T,A]);const B=S.filter(a=>{if(!C)return!0;const b=C.toLowerCase();return JSON.stringify(a.data).toLowerCase().includes(b)});if(!n)return null;const H=P.filter(a=>a.status.connected).length;return e.jsx("div",{style:s.overlay,onClick:t,children:e.jsxs("div",{style:s.modal,onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{style:s.header,children:[e.jsxs("div",{style:s.headerTitle,children:[e.jsx("span",{children:"📊"}),e.jsx("span",{children:"Monitoring & Logs"})]}),e.jsx("button",{style:s.closeBtn,onClick:t,title:"Close",children:"×"})]}),e.jsx("div",{style:s.tabs,children:O.map(a=>e.jsxs("button",{style:s.tab(r===a.id),onClick:()=>{h(a.id),z(""),I(null)},children:[e.jsx("span",{children:a.icon}),e.jsx("span",{children:a.label})]},a.id))}),r!=="stats"&&e.jsxs("div",{style:s.filters,children:[e.jsx("div",{style:{display:"flex",gap:4},children:["1h","6h","24h","7d","all"].map(a=>e.jsx("button",{style:{...s.timeBtn,background:m===a?"#89b4fa":"transparent",color:m===a?"#1e1e2e":"#a6adc8"},onClick:()=>R(a),children:a},a))}),e.jsx("input",{style:s.searchInput,placeholder:"Search events...",value:C,onChange:a=>z(a.target.value)}),e.jsx("button",{style:s.refreshBtn,onClick:T,children:"Refresh"})]}),e.jsx("div",{style:s.content,children:r==="stats"?e.jsx(V,{loading:l,error:$,stats:D,integrations:P,connectedCount:H,onRefresh:A}):e.jsx(G,{loading:l,error:$,entries:B,expandedId:W,onToggleExpand:a=>I(W===a?null:a)})}),r!=="stats"&&e.jsx("div",{style:s.footer,children:e.jsxs("span",{style:{color:"#6c7086",fontSize:11},children:[B.length," event",B.length!==1?"s":""," shown",C&&` (filtered from ${S.length})`]})})]})})}function G({loading:n,error:t,entries:r,expandedId:h,onToggleExpand:S}){return n?e.jsx("div",{style:{color:"#a6adc8",padding:20},children:"Loading events..."}):t?e.jsx("div",{style:{color:"#f38ba8",padding:20},children:t}):r.length===0?e.jsx("div",{style:{color:"#6c7086",textAlign:"center",padding:40},children:"No events found for the selected filters."}):e.jsx(e.Fragment,{children:r.map((o,l)=>{const u=`${o.type}-${o.timestamp}-${l}`,$=h===u,c=_[o.type]||"#6c7086",m=Y(o),R=new Date(o.timestamp);return e.jsxs("div",{style:{...s.eventRow,borderLeft:`3px solid ${c}`,background:$?"rgba(137,180,250,0.05)":"transparent"},onClick:()=>S(u),children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{...s.tag,background:`${c}22`,color:c},children:J[o.type]||o.type}),e.jsx("span",{style:{color:"#cdd6f4",fontSize:12,flex:1},children:m}),e.jsxs("span",{style:{color:"#6c7086",fontSize:10,whiteSpace:"nowrap"},children:[R.toLocaleTimeString()," ",R.toLocaleDateString()]})]}),$&&e.jsx("pre",{style:s.detail,children:JSON.stringify(o.data,null,2)})]},u)})})}function V({loading:n,error:t,stats:r,integrations:h,connectedCount:S,onRefresh:o}){return n?e.jsx("div",{style:{color:"#a6adc8",padding:20},children:"Loading stats..."}):t?e.jsx("div",{style:{color:"#f38ba8",padding:20},children:t}):e.jsxs("div",{style:{padding:20},children:[e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:16},children:e.jsx("button",{style:s.refreshBtn,onClick:o,children:"Refresh"})}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:s.section,children:[e.jsx("h3",{style:s.sectionTitle,children:"Workflows"}),e.jsxs("div",{style:s.grid,children:[e.jsx(k,{label:"Active",value:r.activeWorkflows,color:"#89b4fa"}),e.jsx(k,{label:"Completed",value:r.completedWorkflows,color:"#a6e3a1"}),e.jsx(k,{label:"Failed",value:r.failedWorkflows,color:"#f38ba8"})]})]}),e.jsxs("div",{style:s.section,children:[e.jsx("h3",{style:s.sectionTitle,children:"Events (Today)"}),e.jsxs("div",{style:s.grid,children:[e.jsx(k,{label:"Triggers Fired",value:r.triggersFiredToday,color:"#f9e2af"}),e.jsx(k,{label:"Slack Messages",value:r.slackMessageCount,color:"#cba6f7"}),e.jsx(k,{label:"Emails",value:r.emailCount,color:"#fab387"})]})]}),e.jsxs("div",{style:s.section,children:[e.jsxs("h3",{style:s.sectionTitle,children:["Integrations (",S,"/",h.length," connected)"]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[h.map(l=>e.jsxs("div",{style:s.integrationRow,children:[e.jsx("span",{style:{color:"#cdd6f4",fontSize:13},children:l.name}),e.jsx("span",{style:{...s.statusBadge,background:l.status.connected?"rgba(166,227,161,0.15)":"rgba(108,112,134,0.15)",color:l.status.connected?"#a6e3a1":"#6c7086"},children:l.status.error?"Error":l.status.connected?"Connected":"Disconnected"})]},l.id)),h.length===0&&e.jsx("div",{style:{color:"#6c7086",fontSize:12},children:"No integrations configured"})]})]})]}),!r&&e.jsx("div",{style:{color:"#6c7086",textAlign:"center",padding:40},children:"No stats available. The event store may not have any data yet."})]})}function k({label:n,value:t,color:r}){return e.jsxs("div",{style:s.card,children:[e.jsx("div",{style:{color:r,fontSize:28,fontWeight:700,lineHeight:1},children:t}),e.jsx("div",{style:{color:"#a6adc8",fontSize:11,marginTop:4},children:n})]})}function Y(n){const t=n.data;switch(n.type){case"trigger":return`Trigger "${t.triggerName||t.triggerId}" ${t.status||"fired"}`;case"slack":return`${t.direction==="outbound"?"Sent":"Received"} in #${t.channelName||t.channelId}: ${L(t.text,60)}`;case"email":return`${t.direction==="outbound"?"Sent to":"From"} ${t.direction==="outbound"?t.toAddresses:t.fromAddress}: ${L(t.subject,50)}`;case"approval":return`${t.approved?"Approved":"Rejected"} by ${t.approverEmail}`;case"document":return`Generated "${t.outputFilename}" from template "${t.templateName}"`;case"calendar":return`Calendar event ${t.action}: "${t.summary}"`;case"jira":return`${t.ticketKey} ${t.action}: ${L(t.summary,50)}`;case"step":return`Workflow step: ${t.toStateName} (${t.status})`;case"variable_change":return`Variable "${t.variableName}" changed by ${t.changedBy}`;case"audit":return`[${(t.level||"info").toUpperCase()}] ${t.category}: ${t.action}`;default:return JSON.stringify(t).slice(0,80)}}function L(n,t){return n?n.length>t?n.slice(0,t)+"...":n:""}const s={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,backdropFilter:"blur(4px)"},modal:{background:"var(--surface-0, #1e1e2e)",borderRadius:12,border:"1px solid var(--border, #313244)",width:"90vw",maxWidth:1e3,height:"85vh",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.5)"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--border, #313244)",background:"var(--surface-1, #181825)"},headerTitle:{fontSize:16,fontWeight:600,color:"var(--text-primary, #cdd6f4)",display:"flex",alignItems:"center",gap:8},closeBtn:{background:"none",border:"none",color:"var(--text-secondary, #a6adc8)",fontSize:20,cursor:"pointer",padding:"4px 8px",borderRadius:6,lineHeight:1},tabs:{display:"flex",borderBottom:"1px solid var(--border, #313244)",background:"var(--surface-1, #181825)",overflowX:"auto",scrollbarWidth:"none"},tab:n=>({padding:"10px 16px",background:"none",border:"none",borderBottom:n?"2px solid var(--accent, #89b4fa)":"2px solid transparent",color:n?"var(--accent, #89b4fa)":"var(--text-secondary, #a6adc8)",fontSize:13,fontWeight:n?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",transition:"color 0.15s, border-color 0.15s",flexShrink:0}),filters:{display:"flex",gap:8,alignItems:"center",padding:"10px 20px",borderBottom:"1px solid var(--border, #313244)",flexWrap:"wrap"},timeBtn:{border:"1px solid #45475a",borderRadius:4,padding:"4px 8px",fontSize:10,fontWeight:600,cursor:"pointer"},searchInput:{background:"#313244",border:"1px solid #45475a",borderRadius:6,padding:"5px 10px",color:"#cdd6f4",fontSize:12,flex:1,minWidth:120,outline:"none"},refreshBtn:{background:"transparent",border:"1px solid #45475a",borderRadius:6,padding:"5px 12px",color:"#a6adc8",fontSize:11,cursor:"pointer"},content:{flex:1,overflow:"auto",padding:"0 20px"},eventRow:{padding:"8px 12px",borderBottom:"1px solid #313244",cursor:"pointer",transition:"background 0.1s"},tag:{fontSize:10,fontWeight:600,padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap"},detail:{marginTop:8,padding:10,background:"#181825",borderRadius:6,fontSize:11,fontFamily:"monospace",color:"#a6adc8",overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-all"},footer:{padding:"8px 20px",borderTop:"1px solid #313244"},section:{marginBottom:24},sectionTitle:{color:"#a6adc8",fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:1,marginBottom:12,margin:0},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12},card:{background:"#313244",borderRadius:8,padding:"16px 14px",textAlign:"center"},integrationRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 12px",background:"#313244",borderRadius:6},statusBadge:{fontSize:10,fontWeight:600,padding:"3px 8px",borderRadius:4}};export{Z as MonitoringModal};
@@ -1,2 +1,2 @@
1
- import{u as L,f as d,r as m,s as o,j as x}from"./main-CRaSsX9C.js";import{L as S}from"./LogViewerModal-wxMGICHp.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";function $({building:t,isOpen:e,onClose:n}){var a;const{t:i}=L(["terminal"]),{streamingBuildingLogs:p,streamingBuildingIds:c}=d(),r=p.get(t.id)||"",g=c.has(t.id);m.useEffect(()=>{var s;return e&&((s=t.pm2)!=null&&s.enabled)&&o.startLogStreaming(t.id,200),()=>{t.id&&o.stopLogStreaming(t.id)}},[e,t.id,(a=t.pm2)==null?void 0:a.enabled]);const f=m.useMemo(()=>r.split(`
1
+ import{u as L,f as d,r as m,s as o,j as x}from"./main-DahZb6P4.js";import{L as S}from"./LogViewerModal-BpIPZeFr.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";function $({building:t,isOpen:e,onClose:n}){var a;const{t:i}=L(["terminal"]),{streamingBuildingLogs:p,streamingBuildingIds:c}=d(),r=p.get(t.id)||"",g=c.has(t.id);m.useEffect(()=>{var s;return e&&((s=t.pm2)!=null&&s.enabled)&&o.startLogStreaming(t.id,200),()=>{t.id&&o.stopLogStreaming(t.id)}},[e,t.id,(a=t.pm2)==null?void 0:a.enabled]);const f=m.useMemo(()=>r.split(`
2
2
  `).map((s,l)=>({text:s,lineNumber:l+1})),[r]);return x.jsx(S,{isOpen:e,onClose:n,title:`${t.name} - ${i("terminal:logs.pm2Logs")}`,icon:"📄",lines:f,isStreaming:g,onClear:()=>o.clearStreamingLogs(t.id)})}export{$ as PM2LogsModal};
@@ -1 +1 @@
1
- import{u as m,B as f,j as e,s as d}from"./main-CRaSsX9C.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";function N(r){const t=Date.now()-r,i=Math.floor(t/1e3),a=Math.floor(i/60),c=Math.floor(a/60),n=Math.floor(c/24);return n>0?`${n} day${n>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:a>0?`${a} min${a>1?"s":""} ago`:"just now"}function k({isOpen:r,restorePosition:l,onClose:t,onRestored:i}){const{t:a}=m(["terminal","common"]),c=f(),n=Array.from(c.values()).filter(s=>s.archived===!0),o=(s,j)=>{const x=j?void 0:l||void 0;d.restoreArchivedArea(s,x),i==null||i(),t()},h=()=>{for(const s of n)d.restoreArchivedArea(s.id);i==null||i(),t()},v=s=>{s.target===s.currentTarget&&t()},u=s=>{s.key==="Escape"&&t()};return r?e.jsx("div",{className:`modal-overlay ${r?"visible":""}`,onClick:v,onKeyDown:u,children:e.jsxs("div",{className:"modal restore-archived-modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("span",{className:"header-icon",children:"📦"}),a("terminal:areas.restoreArchivedZone")]}),e.jsx("div",{className:"modal-body restore-archived-body",children:n.length===0?e.jsx("div",{className:"archived-empty",children:a("terminal:areas.noArchivedZones")}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"restore-info",children:a("terminal:areas.restoreInfo")}),e.jsx("div",{className:"archived-list",children:n.map(s=>e.jsx(g,{area:s,onRestoreHere:()=>o(s.id,!1),onRestoreOriginal:()=>o(s.id,!0),hasRestorePosition:!!l},s.id))}),n.length>1&&e.jsx("div",{className:"restore-all-section",children:e.jsx("button",{className:"btn btn-secondary",onClick:h,children:a("terminal:areas.restoreAllOriginal")})})]})}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn btn-secondary",onClick:t,children:a("common:buttons.cancel")})})]})}):null}function g({area:r,onRestoreHere:l,onRestoreOriginal:t,hasRestorePosition:i}){const{t:a}=m(["terminal","common"]),c=r.assignedAgentIds.length,n=r.directories.length;return e.jsxs("div",{className:"archived-item",children:[e.jsx("div",{className:"archived-item-color",style:{backgroundColor:r.color}}),e.jsxs("div",{className:"archived-item-info",children:[e.jsx("div",{className:"archived-item-name",children:r.name}),e.jsxs("div",{className:"archived-item-meta",children:[e.jsx("span",{className:"archived-item-type",children:r.type}),c>0&&e.jsx("span",{className:"archived-item-agents",children:a("terminal:areas.agentCount",{count:c})}),n>0&&e.jsx("span",{className:"archived-item-dirs",children:a("terminal:areas.folderCount",{count:n})}),r.archivedAt&&e.jsx("span",{className:"archived-item-time",children:N(r.archivedAt)})]})]}),e.jsxs("div",{className:"archived-item-actions",children:[i&&e.jsx("button",{className:"btn btn-small btn-primary",onClick:l,title:a("terminal:areas.placeAtClickedPosition"),children:a("terminal:areas.restoreHere")}),e.jsx("button",{className:"btn btn-small",onClick:t,title:a("terminal:areas.restoreToOriginal"),children:a(i?"terminal:areas.original":"terminal:areas.restore")})]})]})}export{k as RestoreArchivedAreaModal};
1
+ import{u as m,B as f,j as e,s as d}from"./main-DahZb6P4.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";function N(r){const t=Date.now()-r,i=Math.floor(t/1e3),a=Math.floor(i/60),c=Math.floor(a/60),n=Math.floor(c/24);return n>0?`${n} day${n>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:a>0?`${a} min${a>1?"s":""} ago`:"just now"}function k({isOpen:r,restorePosition:l,onClose:t,onRestored:i}){const{t:a}=m(["terminal","common"]),c=f(),n=Array.from(c.values()).filter(s=>s.archived===!0),o=(s,j)=>{const x=j?void 0:l||void 0;d.restoreArchivedArea(s,x),i==null||i(),t()},h=()=>{for(const s of n)d.restoreArchivedArea(s.id);i==null||i(),t()},v=s=>{s.target===s.currentTarget&&t()},u=s=>{s.key==="Escape"&&t()};return r?e.jsx("div",{className:`modal-overlay ${r?"visible":""}`,onClick:v,onKeyDown:u,children:e.jsxs("div",{className:"modal restore-archived-modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("span",{className:"header-icon",children:"📦"}),a("terminal:areas.restoreArchivedZone")]}),e.jsx("div",{className:"modal-body restore-archived-body",children:n.length===0?e.jsx("div",{className:"archived-empty",children:a("terminal:areas.noArchivedZones")}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"restore-info",children:a("terminal:areas.restoreInfo")}),e.jsx("div",{className:"archived-list",children:n.map(s=>e.jsx(g,{area:s,onRestoreHere:()=>o(s.id,!1),onRestoreOriginal:()=>o(s.id,!0),hasRestorePosition:!!l},s.id))}),n.length>1&&e.jsx("div",{className:"restore-all-section",children:e.jsx("button",{className:"btn btn-secondary",onClick:h,children:a("terminal:areas.restoreAllOriginal")})})]})}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn btn-secondary",onClick:t,children:a("common:buttons.cancel")})})]})}):null}function g({area:r,onRestoreHere:l,onRestoreOriginal:t,hasRestorePosition:i}){const{t:a}=m(["terminal","common"]),c=r.assignedAgentIds.length,n=r.directories.length;return e.jsxs("div",{className:"archived-item",children:[e.jsx("div",{className:"archived-item-color",style:{backgroundColor:r.color}}),e.jsxs("div",{className:"archived-item-info",children:[e.jsx("div",{className:"archived-item-name",children:r.name}),e.jsxs("div",{className:"archived-item-meta",children:[e.jsx("span",{className:"archived-item-type",children:r.type}),c>0&&e.jsx("span",{className:"archived-item-agents",children:a("terminal:areas.agentCount",{count:c})}),n>0&&e.jsx("span",{className:"archived-item-dirs",children:a("terminal:areas.folderCount",{count:n})}),r.archivedAt&&e.jsx("span",{className:"archived-item-time",children:N(r.archivedAt)})]})]}),e.jsxs("div",{className:"archived-item-actions",children:[i&&e.jsx("button",{className:"btn btn-small btn-primary",onClick:l,title:a("terminal:areas.placeAtClickedPosition"),children:a("terminal:areas.restoreHere")}),e.jsx("button",{className:"btn btn-small",onClick:t,title:a("terminal:areas.restoreToOriginal"),children:a(i?"terminal:areas.original":"terminal:areas.restore")})]})]})}export{k as RestoreArchivedAreaModal};
@@ -1 +1 @@
1
- import{u as D,r as h,j as s}from"./main-CRaSsX9C.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";function B({isOpen:t,onClose:n,agent:d,outputCount:b,trackedFiles:p,onSave:g,isSaving:l=!1,error:x}){const{t:a}=D(["terminal","common"]),m=h.useCallback(()=>{const z=new Date().toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return`${d.name} - ${z}`},[d.name]),[r,u]=h.useState(m()),[j,N]=h.useState("");h.useEffect(()=>{t&&(u(m()),N(""))},[t,m]);const y=async e=>{e.preventDefault(),r.trim()&&await g({agentId:d.id,title:r.trim(),description:j.trim()||void 0})},w=e=>{e.key==="Escape"&&n()};if(!t)return null;const i=(p==null?void 0:p.files)||[],o=i.filter(e=>e.type==="created"),c=i.filter(e=>e.type==="modified");return s.jsx("div",{className:"modal-overlay visible",onClick:n,onKeyDown:w,children:s.jsxs("div",{className:"modal snapshot-modal",onClick:e=>e.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("span",{className:"snapshot-modal-icon",children:"⭐"}),a("terminal:snapshot.save")]}),s.jsxs("form",{onSubmit:y,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.title")," ",s.jsx("span",{className:"snapshot-required",children:"*"})]}),s.jsx("input",{type:"text",className:"snapshot-input",value:r,onChange:e=>u(e.target.value),placeholder:a("terminal:snapshot.enterTitle"),autoFocus:!0,disabled:l})]}),s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.description")," ",s.jsx("span",{className:"snapshot-optional",children:a("common:labels.optional")})]}),s.jsx("textarea",{className:"snapshot-textarea",value:j,onChange:e=>N(e.target.value),placeholder:a("terminal:snapshot.whatWasAccomplished"),rows:3,disabled:l})]}),s.jsxs("div",{className:"snapshot-preview",children:[s.jsx("div",{className:"snapshot-preview-header",children:a("terminal:snapshot.whatWillBeCaptured")}),s.jsxs("div",{className:"snapshot-preview-stats",children:[s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"💬"}),s.jsx("span",{className:"snapshot-stat-value",children:b}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.messages")})]}),s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"📄"}),s.jsx("span",{className:"snapshot-stat-value",children:i.length}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.files")})]})]}),i.length>0&&s.jsxs("div",{className:"snapshot-files-preview",children:[o.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type created",children:"+"}),a("terminal:snapshot.createdFiles",{count:o.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[o.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),o.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:o.length-5})})]})]}),c.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type modified",children:"~"}),a("terminal:snapshot.modifiedFiles",{count:c.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[c.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),c.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:c.length-5})})]})]})]}),i.length===0&&s.jsx("div",{className:"snapshot-no-files",children:a("terminal:snapshot.noFilesChanged")})]}),x&&s.jsx("div",{className:"snapshot-error",children:x})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:n,disabled:l,children:a("common:buttons.cancel")}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!r.trim()||l,children:l?a("terminal:snapshot.saving"):`⭐ ${a("terminal:snapshot.save")}`})]})]})]})})}function v(t){const n=t.split("/");return n[n.length-1]||t}function f(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}export{B as SaveSnapshotModal};
1
+ import{u as D,r as h,j as s}from"./main-DahZb6P4.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";function B({isOpen:t,onClose:n,agent:d,outputCount:b,trackedFiles:p,onSave:g,isSaving:l=!1,error:x}){const{t:a}=D(["terminal","common"]),m=h.useCallback(()=>{const z=new Date().toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return`${d.name} - ${z}`},[d.name]),[r,u]=h.useState(m()),[j,N]=h.useState("");h.useEffect(()=>{t&&(u(m()),N(""))},[t,m]);const y=async e=>{e.preventDefault(),r.trim()&&await g({agentId:d.id,title:r.trim(),description:j.trim()||void 0})},w=e=>{e.key==="Escape"&&n()};if(!t)return null;const i=(p==null?void 0:p.files)||[],o=i.filter(e=>e.type==="created"),c=i.filter(e=>e.type==="modified");return s.jsx("div",{className:"modal-overlay visible",onClick:n,onKeyDown:w,children:s.jsxs("div",{className:"modal snapshot-modal",onClick:e=>e.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("span",{className:"snapshot-modal-icon",children:"⭐"}),a("terminal:snapshot.save")]}),s.jsxs("form",{onSubmit:y,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.title")," ",s.jsx("span",{className:"snapshot-required",children:"*"})]}),s.jsx("input",{type:"text",className:"snapshot-input",value:r,onChange:e=>u(e.target.value),placeholder:a("terminal:snapshot.enterTitle"),autoFocus:!0,disabled:l})]}),s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.description")," ",s.jsx("span",{className:"snapshot-optional",children:a("common:labels.optional")})]}),s.jsx("textarea",{className:"snapshot-textarea",value:j,onChange:e=>N(e.target.value),placeholder:a("terminal:snapshot.whatWasAccomplished"),rows:3,disabled:l})]}),s.jsxs("div",{className:"snapshot-preview",children:[s.jsx("div",{className:"snapshot-preview-header",children:a("terminal:snapshot.whatWillBeCaptured")}),s.jsxs("div",{className:"snapshot-preview-stats",children:[s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"💬"}),s.jsx("span",{className:"snapshot-stat-value",children:b}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.messages")})]}),s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"📄"}),s.jsx("span",{className:"snapshot-stat-value",children:i.length}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.files")})]})]}),i.length>0&&s.jsxs("div",{className:"snapshot-files-preview",children:[o.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type created",children:"+"}),a("terminal:snapshot.createdFiles",{count:o.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[o.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),o.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:o.length-5})})]})]}),c.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type modified",children:"~"}),a("terminal:snapshot.modifiedFiles",{count:c.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[c.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),c.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:c.length-5})})]})]})]}),i.length===0&&s.jsx("div",{className:"snapshot-no-files",children:a("terminal:snapshot.noFilesChanged")})]}),x&&s.jsx("div",{className:"snapshot-error",children:x})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:n,disabled:l,children:a("common:buttons.cancel")}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!r.trim()||l,children:l?a("terminal:snapshot.saving"):`⭐ ${a("terminal:snapshot.save")}`})]})]})]})})}function v(t){const n=t.split("/");return n[n.length-1]||t}function f(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}export{B as SaveSnapshotModal};