@useorgx/openclaw-plugin 0.7.2 → 0.7.4

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 (112) hide show
  1. package/dashboard/dist/assets/{CgaottFX.js → B1mDqDdy.js} +1 -1
  2. package/dashboard/dist/assets/B1mDqDdy.js.br +0 -0
  3. package/dashboard/dist/assets/B1mDqDdy.js.gz +0 -0
  4. package/dashboard/dist/assets/BDMstdfu.js +1 -0
  5. package/dashboard/dist/assets/BDMstdfu.js.br +0 -0
  6. package/dashboard/dist/assets/BDMstdfu.js.gz +0 -0
  7. package/dashboard/dist/assets/BTAEErUY.js +1 -0
  8. package/dashboard/dist/assets/BTAEErUY.js.br +0 -0
  9. package/dashboard/dist/assets/BTAEErUY.js.gz +0 -0
  10. package/dashboard/dist/assets/{8dksYiq4.js → BXapfumA.js} +1 -1
  11. package/dashboard/dist/assets/BXapfumA.js.br +0 -0
  12. package/dashboard/dist/assets/BXapfumA.js.gz +0 -0
  13. package/dashboard/dist/assets/BZZKPNDb.css +1 -0
  14. package/dashboard/dist/assets/BZZKPNDb.css.br +0 -0
  15. package/dashboard/dist/assets/BZZKPNDb.css.gz +0 -0
  16. package/dashboard/dist/assets/{rttbDbEx.js → BdusVDcP.js} +1 -1
  17. package/dashboard/dist/assets/BdusVDcP.js.br +0 -0
  18. package/dashboard/dist/assets/BdusVDcP.js.gz +0 -0
  19. package/dashboard/dist/assets/{D8JNX8kq.js → BwkNYH6r.js} +1 -1
  20. package/dashboard/dist/assets/BwkNYH6r.js.br +0 -0
  21. package/dashboard/dist/assets/BwkNYH6r.js.gz +0 -0
  22. package/dashboard/dist/assets/{CzCxAZlW.js → CRhvoVeH.js} +1 -1
  23. package/dashboard/dist/assets/CRhvoVeH.js.br +0 -0
  24. package/dashboard/dist/assets/CRhvoVeH.js.gz +0 -0
  25. package/dashboard/dist/assets/{B6wPWJ35.js → CYchPSem.js} +1 -1
  26. package/dashboard/dist/assets/CYchPSem.js.br +0 -0
  27. package/dashboard/dist/assets/CYchPSem.js.gz +0 -0
  28. package/dashboard/dist/assets/Cn07669c.js +212 -0
  29. package/dashboard/dist/assets/Cn07669c.js.br +0 -0
  30. package/dashboard/dist/assets/Cn07669c.js.gz +0 -0
  31. package/dashboard/dist/assets/{C8uM3AX8.js → DBG89Wsz.js} +1 -1
  32. package/dashboard/dist/assets/DBG89Wsz.js.br +0 -0
  33. package/dashboard/dist/assets/DBG89Wsz.js.gz +0 -0
  34. package/dashboard/dist/assets/{CZaT3ob_.js → DHoYGJ9i.js} +1 -1
  35. package/dashboard/dist/assets/DHoYGJ9i.js.br +0 -0
  36. package/dashboard/dist/assets/DHoYGJ9i.js.gz +0 -0
  37. package/dashboard/dist/assets/DHtZPEKd.js +1 -0
  38. package/dashboard/dist/assets/DHtZPEKd.js.br +0 -0
  39. package/dashboard/dist/assets/DHtZPEKd.js.gz +0 -0
  40. package/dashboard/dist/assets/{B5zYRHc3.js → DUaqjbT7.js} +1 -1
  41. package/dashboard/dist/assets/DUaqjbT7.js.br +0 -0
  42. package/dashboard/dist/assets/DUaqjbT7.js.gz +0 -0
  43. package/dashboard/dist/assets/{IUexzymk.js → Dlz0Cm_E.js} +1 -1
  44. package/dashboard/dist/assets/Dlz0Cm_E.js.br +0 -0
  45. package/dashboard/dist/assets/Dlz0Cm_E.js.gz +0 -0
  46. package/dashboard/dist/assets/{CC63EwFD.js → E8q3xNGK.js} +1 -1
  47. package/dashboard/dist/assets/E8q3xNGK.js.br +0 -0
  48. package/dashboard/dist/assets/E8q3xNGK.js.gz +0 -0
  49. package/dashboard/dist/assets/VH0fzk6I.js +1 -0
  50. package/dashboard/dist/assets/VH0fzk6I.js.br +0 -0
  51. package/dashboard/dist/assets/VH0fzk6I.js.gz +0 -0
  52. package/dashboard/dist/assets/bxgRC96y.js +1 -0
  53. package/dashboard/dist/assets/bxgRC96y.js.br +0 -0
  54. package/dashboard/dist/assets/bxgRC96y.js.gz +0 -0
  55. package/dashboard/dist/index.html +2 -2
  56. package/dashboard/dist/index.html.br +0 -0
  57. package/dashboard/dist/index.html.gz +0 -0
  58. package/dist/http/helpers/auto-continue-engine.js +29 -11
  59. package/dist/http/helpers/autopilot-slice-utils.js +7 -10
  60. package/dist/http/helpers/openclaw-cli.js +2 -2
  61. package/dist/http/index.js +160 -4
  62. package/dist/http/routes/live-legacy.d.ts +2 -0
  63. package/dist/http/routes/live-legacy.js +97 -0
  64. package/dist/http/routes/mission-control-read.js +106 -63
  65. package/dist/openclaw-settings.js +3 -2
  66. package/dist/openclaw.plugin.json +1 -1
  67. package/dist/sync/outbox-replay.js +17 -8
  68. package/openclaw.plugin.json +1 -1
  69. package/package.json +1 -1
  70. package/dashboard/dist/assets/6mILZQ2a.js +0 -1
  71. package/dashboard/dist/assets/6mILZQ2a.js.br +0 -0
  72. package/dashboard/dist/assets/6mILZQ2a.js.gz +0 -0
  73. package/dashboard/dist/assets/8dksYiq4.js.br +0 -0
  74. package/dashboard/dist/assets/8dksYiq4.js.gz +0 -0
  75. package/dashboard/dist/assets/B5zYRHc3.js.br +0 -0
  76. package/dashboard/dist/assets/B5zYRHc3.js.gz +0 -0
  77. package/dashboard/dist/assets/B6wPWJ35.js.br +0 -0
  78. package/dashboard/dist/assets/B6wPWJ35.js.gz +0 -0
  79. package/dashboard/dist/assets/BWEwjt1W.js +0 -1
  80. package/dashboard/dist/assets/BWEwjt1W.js.br +0 -0
  81. package/dashboard/dist/assets/BWEwjt1W.js.gz +0 -0
  82. package/dashboard/dist/assets/BzRbDCAD.css +0 -1
  83. package/dashboard/dist/assets/BzRbDCAD.css.br +0 -0
  84. package/dashboard/dist/assets/BzRbDCAD.css.gz +0 -0
  85. package/dashboard/dist/assets/C8uM3AX8.js.br +0 -0
  86. package/dashboard/dist/assets/C8uM3AX8.js.gz +0 -0
  87. package/dashboard/dist/assets/C9jy61eu.js +0 -212
  88. package/dashboard/dist/assets/C9jy61eu.js.br +0 -0
  89. package/dashboard/dist/assets/C9jy61eu.js.gz +0 -0
  90. package/dashboard/dist/assets/CC63EwFD.js.br +0 -0
  91. package/dashboard/dist/assets/CC63EwFD.js.gz +0 -0
  92. package/dashboard/dist/assets/CZaT3ob_.js.br +0 -0
  93. package/dashboard/dist/assets/CZaT3ob_.js.gz +0 -0
  94. package/dashboard/dist/assets/CgaottFX.js.br +0 -0
  95. package/dashboard/dist/assets/CgaottFX.js.gz +0 -0
  96. package/dashboard/dist/assets/CzCxAZlW.js.br +0 -0
  97. package/dashboard/dist/assets/CzCxAZlW.js.gz +0 -0
  98. package/dashboard/dist/assets/D3iMTYEj.js +0 -1
  99. package/dashboard/dist/assets/D3iMTYEj.js.br +0 -0
  100. package/dashboard/dist/assets/D3iMTYEj.js.gz +0 -0
  101. package/dashboard/dist/assets/D8JNX8kq.js.br +0 -0
  102. package/dashboard/dist/assets/D8JNX8kq.js.gz +0 -0
  103. package/dashboard/dist/assets/DnA8dpj6.js +0 -1
  104. package/dashboard/dist/assets/DnA8dpj6.js.br +0 -0
  105. package/dashboard/dist/assets/DnA8dpj6.js.gz +0 -0
  106. package/dashboard/dist/assets/IUexzymk.js.br +0 -0
  107. package/dashboard/dist/assets/IUexzymk.js.gz +0 -0
  108. package/dashboard/dist/assets/ic2FaMnh.js +0 -1
  109. package/dashboard/dist/assets/ic2FaMnh.js.br +0 -0
  110. package/dashboard/dist/assets/ic2FaMnh.js.gz +0 -0
  111. package/dashboard/dist/assets/rttbDbEx.js.br +0 -0
  112. package/dashboard/dist/assets/rttbDbEx.js.gz +0 -0
@@ -1,2 +1,2 @@
1
- import{r as p,j as e}from"./cNrhgGc1.js";import{r as D,E as W,d as x,K}from"./C9jy61eu.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";const q={blocked:0,failed:1,running:2,active:2,queued:3,in_progress:3,pending:4,paused:5,cancelled:6,completed:7,archived:8};function Q(n){if(!n)return 0;const b=Date.parse(n);return Number.isFinite(b)?b:0}function F(n){return Q(n.updatedAt??n.lastEventAt??n.startedAt)}function Y(n,b){const i=q[(n.status??"").toLowerCase()]??99,y=q[(b.status??"").toLowerCase()]??99;return i!==y?i-y:F(b)-F(n)}function G(n,b){const i=n.trim().toLowerCase();return i==="failed"?x.red:i==="blocked"||b>0?x.red:i==="running"||i==="active"||i==="in_progress"?x.lime:i==="queued"||i==="pending"?x.amber:i==="completed"?x.teal:x.textMuted}function H(n){switch(n){case"active":return{title:"Active Sessions",subtitle:"Running and queued work across agents."};case"blocked":return{title:"Blocked Sessions",subtitle:"Work that needs attention before it can proceed."};case"failed":return{title:"Failed Sessions",subtitle:"Runs that exited with an error and may need a retry."};default:return{title:"Sessions",subtitle:"All sessions visible to this dashboard."}}}function J(n,b){var j;const i=(b.status??"").toLowerCase(),y=((j=b.blockers)==null?void 0:j.length)??0;return n==="active"?["running","active","queued","pending","in_progress"].includes(i):n==="blocked"?i==="blocked"||y>0:n==="failed"?i==="failed":!0}function se({open:n,onClose:b,mode:i,sessions:y,onOpenSession:j,onRunAction:A,onRefetch:L,onSetNotice:v}){const{title:I,subtitle:P}=H(i),[S,_]=p.useState(""),[w,B]=p.useState(new Set),[d,k]=p.useState(null),[M,h]=p.useState(null),[N,C]=p.useState(null);p.useEffect(()=>{n&&(h(null),C(null))},[n]);const f=p.useMemo(()=>y.filter(t=>J(i,t)),[i,y]),g=p.useMemo(()=>{const t={};for(const o of f){const a=(o.status??"unknown").toLowerCase();t[a]=(t[a]??0)+1}const r=f.filter(o=>{var a;return(o.status??"").toLowerCase()==="blocked"||(((a=o.blockers)==null?void 0:a.length)??0)>0}).length,s=f.filter(o=>(o.status??"").toLowerCase()==="failed").length,l=f.filter(o=>["running","active","queued","pending","in_progress"].includes((o.status??"").toLowerCase())).length;return{total:f.length,active:l,blocked:r,failed:s,byStatus:t}},[f]),u=p.useMemo(()=>{const t=S.trim().toLowerCase(),r=[...f].sort(Y);return t?r.filter(s=>[s.title,s.agentName,s.agentId,s.runId,s.lastEventSummary].filter(Boolean).join(" ").toLowerCase().includes(t)):r},[S,f]);p.useEffect(()=>{n&&B(t=>{const r=new Set(u.map(l=>l.id)),s=new Set;for(const l of t)r.has(l)&&s.add(l);return s})},[u,n]);const m=w.size,T=u.length>0&&u.every(t=>w.has(t.id)),R=()=>{d||B(t=>u.length===0?t:T?new Set:new Set(u.map(r=>r.id)))},U=t=>{d||B(r=>{const s=new Set(r);return s.has(t)?s.delete(t):s.add(t),s})},O=async()=>{if(m===0||d)return;const t=[];for(const s of u){if(!w.has(s.id))continue;const l=s.blockers??[];if(l.length!==0){t.push(`- ${s.title} (${l.length} blocker${l.length===1?"":"s"})`);for(const o of l)t.push(` - ${o}`)}}const r=t.length>0?t.join(`
1
+ import{r as p,j as e}from"./cNrhgGc1.js";import{r as D,E as W,d as x,K}from"./Cn07669c.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";const q={blocked:0,failed:1,running:2,active:2,queued:3,in_progress:3,pending:4,paused:5,cancelled:6,completed:7,archived:8};function Q(n){if(!n)return 0;const b=Date.parse(n);return Number.isFinite(b)?b:0}function F(n){return Q(n.updatedAt??n.lastEventAt??n.startedAt)}function Y(n,b){const i=q[(n.status??"").toLowerCase()]??99,y=q[(b.status??"").toLowerCase()]??99;return i!==y?i-y:F(b)-F(n)}function G(n,b){const i=n.trim().toLowerCase();return i==="failed"?x.red:i==="blocked"||b>0?x.red:i==="running"||i==="active"||i==="in_progress"?x.lime:i==="queued"||i==="pending"?x.amber:i==="completed"?x.teal:x.textMuted}function H(n){switch(n){case"active":return{title:"Active Sessions",subtitle:"Running and queued work across agents."};case"blocked":return{title:"Blocked Sessions",subtitle:"Work that needs attention before it can proceed."};case"failed":return{title:"Failed Sessions",subtitle:"Runs that exited with an error and may need a retry."};default:return{title:"Sessions",subtitle:"All sessions visible to this dashboard."}}}function J(n,b){var j;const i=(b.status??"").toLowerCase(),y=((j=b.blockers)==null?void 0:j.length)??0;return n==="active"?["running","active","queued","pending","in_progress"].includes(i):n==="blocked"?i==="blocked"||y>0:n==="failed"?i==="failed":!0}function se({open:n,onClose:b,mode:i,sessions:y,onOpenSession:j,onRunAction:A,onRefetch:L,onSetNotice:v}){const{title:I,subtitle:P}=H(i),[S,_]=p.useState(""),[w,B]=p.useState(new Set),[d,k]=p.useState(null),[M,h]=p.useState(null),[N,C]=p.useState(null);p.useEffect(()=>{n&&(h(null),C(null))},[n]);const f=p.useMemo(()=>y.filter(t=>J(i,t)),[i,y]),g=p.useMemo(()=>{const t={};for(const o of f){const a=(o.status??"unknown").toLowerCase();t[a]=(t[a]??0)+1}const r=f.filter(o=>{var a;return(o.status??"").toLowerCase()==="blocked"||(((a=o.blockers)==null?void 0:a.length)??0)>0}).length,s=f.filter(o=>(o.status??"").toLowerCase()==="failed").length,l=f.filter(o=>["running","active","queued","pending","in_progress"].includes((o.status??"").toLowerCase())).length;return{total:f.length,active:l,blocked:r,failed:s,byStatus:t}},[f]),u=p.useMemo(()=>{const t=S.trim().toLowerCase(),r=[...f].sort(Y);return t?r.filter(s=>[s.title,s.agentName,s.agentId,s.runId,s.lastEventSummary].filter(Boolean).join(" ").toLowerCase().includes(t)):r},[S,f]);p.useEffect(()=>{n&&B(t=>{const r=new Set(u.map(l=>l.id)),s=new Set;for(const l of t)r.has(l)&&s.add(l);return s})},[u,n]);const m=w.size,T=u.length>0&&u.every(t=>w.has(t.id)),R=()=>{d||B(t=>u.length===0?t:T?new Set:new Set(u.map(r=>r.id)))},U=t=>{d||B(r=>{const s=new Set(r);return s.has(t)?s.delete(t):s.add(t),s})},O=async()=>{if(m===0||d)return;const t=[];for(const s of u){if(!w.has(s.id))continue;const l=s.blockers??[];if(l.length!==0){t.push(`- ${s.title} (${l.length} blocker${l.length===1?"":"s"})`);for(const o of l)t.push(` - ${o}`)}}const r=t.length>0?t.join(`
2
2
  `):"No blockers found for selected sessions.";try{await navigator.clipboard.writeText(r),h("Copied blockers to clipboard.")}catch{h("Copy failed (clipboard unavailable).")}},$=async t=>{if(m===0||d)return;if(t==="cancel"){C({text:""});return}const r=u.filter(a=>w.has(a.id));h(null),k({action:t,processed:0,total:r.length});let s=0;const l=[];for(const a of r)try{await A(a,t)}catch(c){s+=1;const E=c instanceof Error?c.message:"unknown error";l.push(`${a.title||a.runId}: ${E}`)}finally{k(c=>c&&{...c,processed:Math.min(c.total,c.processed+1)})}const o=r.length-s;if(k(null),s>0){const a=l.length>0?` — ${l[0]}${l.length>1?` (+${l.length-1} more)`:""}`:"";h(`${t} finished: ${o} ok, ${s} failed.${a}`)}else h(`${t} finished: ${o} session${o===1?"":"s"}.`);try{await L()}catch{}t==="resume"?v(`Bulk resume requested: ${o} ok${s?`, ${s} failed`:""}.`):t==="pause"?v(`Bulk pause requested: ${o} ok${s?`, ${s} failed`:""}.`):t==="complete"&&v(`Bulk mark completed requested: ${o} ok${s?`, ${s} failed`:""}.`)},z=async()=>{if(!N||d||N.text.trim().toUpperCase()!=="CANCEL")return;const t=u.filter(a=>w.has(a.id));h(null),k({action:"cancel",processed:0,total:t.length}),C(null);let r=0;const s=[];for(const a of t)try{await A(a,"cancel")}catch(c){r+=1;const E=c instanceof Error?c.message:"unknown error";s.push(`${a.title||a.runId}: ${E}`)}finally{k(c=>c&&{...c,processed:Math.min(c.total,c.processed+1)})}const l=t.length-r;k(null);const o=s.length>0?` — ${s[0]}${s.length>1?` (+${s.length-1} more)`:""}`:"";h(`cancel finished: ${l} ok${r?`, ${r} failed`:""}.${o}`),v(`Bulk cancel requested: ${l} ok${r?`, ${r} failed`:""}.`);try{await L()}catch{}};return e.jsx(D,{open:n,onClose:b,maxWidth:"max-w-4xl",children:e.jsxs("div",{className:"flex h-full w-full flex-col",children:[e.jsxs("div",{className:"border-b border-subtle px-5 pt-5 pb-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"inline-flex items-center gap-2 text-heading font-semibold text-white",children:[e.jsx(W,{type:"session",size:14}),e.jsx("span",{className:"truncate",children:I}),e.jsx("span",{className:"rounded-full border border-strong bg-white/[0.04] px-2 py-0.5 text-caption font-semibold text-primary",children:g.total})]}),e.jsx("p",{className:"mt-1 text-body leading-relaxed text-secondary",children:P}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:x.teal}}),"Total ",e.jsx("span",{className:"font-semibold text-white",children:g.total})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:g.active>0?x.lime:x.textMuted}}),"Active ",e.jsx("span",{className:"font-semibold text-white",children:g.active})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:g.blocked>0?x.red:x.textMuted}}),"Blocked ",e.jsx("span",{className:"font-semibold text-white",children:g.blocked})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-white/[0.1] bg-white/[0.03] px-2 py-0.5 text-micro text-secondary",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:g.failed>0?x.red:x.textMuted}}),"Failed ",e.jsx("span",{className:"font-semibold text-white",children:g.failed})]})]})]}),e.jsx("button",{type:"button",onClick:b,className:"rounded-md border border-strong bg-white/[0.03] px-2.5 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08]","aria-label":"Close bulk modal",children:"Close"})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"sr-only",htmlFor:"bulk-sessions-search",children:"Search sessions"}),e.jsx("input",{id:"bulk-sessions-search",value:S,onChange:t=>_(t.target.value),placeholder:"Search title, agent, run id…","data-modal-autofocus":"true",className:"w-full rounded-lg border border-strong bg-black/25 px-3 py-2 text-body text-white placeholder:text-muted focus:outline-none focus:ring-1 focus:ring-[#BFFF00]/35"})]}),e.jsx("button",{type:"button",onClick:R,disabled:u.length===0||!!d,className:"rounded-lg border border-strong bg-white/[0.03] px-3 py-2 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:T?"Clear all":`Select all (${u.length})`})]}),M&&e.jsx("div",{className:"mt-3 rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-2 text-body text-secondary",children:M}),N&&e.jsxs("div",{className:"mt-3 rounded-xl border border-red-400/25 bg-red-500/[0.06] px-3 py-2.5",children:[e.jsxs("p",{className:"text-body font-semibold text-red-200",children:["Cancel ",m," session",m===1?"":"s","?"]}),e.jsxs("p",{className:"mt-1 text-caption text-red-200/70",children:["This is destructive. Type ",e.jsx("span",{className:"font-semibold",children:"CANCEL"})," to confirm."]}),e.jsxs("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("input",{value:N.text,onChange:t=>C({text:t.target.value}),placeholder:"CANCEL",className:"flex-1 rounded-lg border border-red-300/25 bg-black/30 px-3 py-2 text-body text-white placeholder:text-muted focus:outline-none focus:ring-1 focus:ring-red-300/40"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>C(null),className:"rounded-lg border border-strong bg-white/[0.03] px-3 py-2 text-caption text-primary transition-colors hover:bg-white/[0.08]",children:"Back"}),e.jsx("button",{type:"button",onClick:z,disabled:N.text.trim().toUpperCase()!=="CANCEL",className:"rounded-lg border border-red-300/25 bg-red-500/15 px-3 py-2 text-caption font-semibold text-red-200 transition-colors hover:bg-red-500/20 disabled:opacity-45",children:"Confirm cancel"})]})]})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:u.length===0?e.jsx("div",{className:"rounded-xl border border-subtle bg-white/[0.02] p-4 text-body text-secondary",children:"No sessions match this view."}):e.jsx("div",{className:"space-y-2",children:u.map(t=>{const r=w.has(t.id),s=t.blockers??[],l=G(t.status??"",s.length),o=t.updatedAt??t.lastEventAt??t.startedAt,a=[(t.agentName??t.agentId??"").trim()||"Unknown agent",(t.status??"unknown").toLowerCase(),o?K(o):null].filter(Boolean);return e.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-white/[0.02] px-3 py-2.5 transition-colors hover:bg-white/[0.04]",style:{borderColor:r?`${x.lime}40`:"rgba(255,255,255,0.08)"},children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:()=>U(t.id),disabled:!!d,className:"mt-0.5 h-4 w-4 rounded border-white/20 bg-black/40 text-lime focus:ring-lime/40","aria-label":`Select session ${t.title}`}),e.jsx("button",{type:"button",onClick:()=>j(t),disabled:!!d,className:"min-w-0 flex-1 text-left",title:"Open session inspector",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-body font-medium text-white",children:t.title}),e.jsx("p",{className:"mt-0.5 text-caption text-secondary",children:a.join(" · ")}),t.lastEventSummary&&e.jsx("p",{className:"mt-1 line-clamp-2 text-caption text-secondary",children:t.lastEventSummary}),s.length>0&&e.jsxs("p",{className:"mt-1 text-micro text-red-200/80",children:[s.length," blocker",s.length===1?"":"s"," · ",s[0]]})]}),e.jsx("span",{className:"shrink-0 rounded-full border px-2 py-0.5 text-micro font-semibold uppercase tracking-[0.08em]",style:{borderColor:`${l}30`,backgroundColor:`${l}14`,color:l},children:(t.status??"unknown").toUpperCase()})]})})]})},t.id)})})}),e.jsxs("div",{className:"flex flex-col gap-2 border-t border-subtle px-5 py-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-caption text-secondary",children:[d?e.jsxs("span",{children:[d.action," ",d.processed,"/",d.total]}):e.jsx("span",{children:m>0?`${m} selected`:"No selection"}),i==="blocked"&&e.jsx("button",{type:"button",onClick:O,disabled:m===0||!!d,className:"rounded-md border border-strong bg-white/[0.03] px-2.5 py-1.5 text-caption text-secondary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:"Copy blockers"})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{const t=u.find(r=>w.has(r.id))??null;t&&j(t)},disabled:m!==1||!!d,className:"rounded-md border border-strong bg-white/[0.03] px-3 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:"Open inspector"}),e.jsx("button",{type:"button",onClick:()=>void $("resume"),disabled:m===0||!!d,className:"rounded-md border border-lime/25 bg-lime/10 px-3 py-1.5 text-caption font-semibold text-lime transition-colors hover:bg-lime/20 disabled:opacity-45",children:"Resume selected"}),e.jsx("button",{type:"button",onClick:()=>void $("complete"),disabled:m===0||!!d,className:"rounded-md border border-teal/25 bg-teal/10 px-3 py-1.5 text-caption font-semibold text-teal transition-colors hover:bg-teal/20 disabled:opacity-45",children:"Mark completed"}),e.jsx("button",{type:"button",onClick:()=>void $("pause"),disabled:m===0||!!d,className:"rounded-md border border-strong bg-white/[0.03] px-3 py-1.5 text-caption text-primary transition-colors hover:bg-white/[0.08] disabled:opacity-45",children:"Pause selected"}),e.jsx("button",{type:"button",onClick:()=>void $("cancel"),disabled:m===0||!!d,className:"rounded-md border border-red-300/25 bg-red-500/10 px-3 py-1.5 text-caption font-semibold text-red-200 transition-colors hover:bg-red-500/15 disabled:opacity-45",children:"Cancel selected"})]})]})]})})}export{se as BulkSessionsModal};
@@ -1 +1 @@
1
- import{r as x,a as S,j as e}from"./cNrhgGc1.js";import{k as T,q as V,r as W,Z as u,d as o,M as $,b as E}from"./C9jy61eu.js";import{S as b}from"./CZaT3ob_.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";const f={draft:o.textMuted,in_review:o.amber,approved:o.lime,changes_requested:o.red,superseded:o.textMuted,archived:o.textMuted},U={draft:"Draft",in_review:"In Review",approved:"Approved",changes_requested:"Changes Requested",superseded:"Superseded",archived:"Archived"};function D(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:o.cyan,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),e.jsx("path",{d:"M10 9H8"}),e.jsx("path",{d:"M16 13H8"}),e.jsx("path",{d:"M16 17H8"})]})}function z(){var M,_,C,L,I,q;const{state:l,close:m}=T(),g=null,j=!1,[c,p]=x.useState(null),{data:a,isLoading:F,isFetching:v,error:y,refetch:H}=S({queryKey:V.artifactDetail({artifactId:l.artifactId??"",authToken:g,embedMode:j}),enabled:!!l.artifactId,queryFn:async()=>{const i=E({authToken:g,embedMode:j}),s=await fetch(`/orgx/api/artifacts/${encodeURIComponent(l.artifactId)}`,{headers:i});if(!s.ok){const r=await s.json().catch(()=>null),d=(typeof(r==null?void 0:r.error)=="string"?r.error:null)??(r!=null&&r.error&&typeof r.error=="object"&&typeof r.error.message=="string"?r.error.message:null)??(typeof(r==null?void 0:r.message)=="string"?r.message:null),R=s.status===401?"Authentication required to view this artifact.":`Failed to fetch artifact (${s.status}).`;throw new Error(d!=null&&d.trim().length?d.trim():R)}return s.json()}}),t=a==null?void 0:a.artifact,A=(a==null?void 0:a.localFallback)===!0||((M=t==null?void 0:t.metadata)==null?void 0:M.local_fallback)===!0,w=(typeof(a==null?void 0:a.warning)=="string"&&a.warning.trim().length>0?a.warning:(_=t==null?void 0:t.metadata)==null?void 0:_.local_warning)??null,h=((C=t==null?void 0:t.metadata)==null?void 0:C.preview_markdown)??null,n=x.useMemo(()=>{if(!(t!=null&&t.metadata))return null;const i=[t.metadata.local_source_path,t.metadata.url,t.metadata.path,t.metadata.file_path,t.metadata.filepath,t.metadata.artifact_path,t.metadata.output_path];for(const s of i)if(typeof s=="string"&&s.trim().length>0)return s.trim();return null},[t==null?void 0:t.metadata]),k=x.useMemo(()=>n?/^https?:\/\//i.test(n)?n:`/orgx/api/live/filesystem/open?path=${encodeURIComponent(n)}`:null,[n]),N=((L=t==null?void 0:t.metadata)==null?void 0:L.external_url)??(t==null?void 0:t.artifact_url);x.useEffect(()=>{if(!c)return;const i=window.setTimeout(()=>p(null),2e3);return()=>window.clearTimeout(i)},[c]);const B=async(i,s)=>{try{await navigator.clipboard.writeText(i),p(`${s} copied`)}catch{p("Copy failed")}};return e.jsxs(W,{open:!!l.artifactId,onClose:m,maxWidth:"max-w-3xl",children:[F&&e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx(b,{className:"h-6 w-2/3"}),e.jsx(b,{className:"h-4 w-1/3"}),e.jsx(b,{className:"h-32 w-full"})]}),y&&e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"rounded-xl border border-red-300/22 bg-red-500/[0.08] p-4",children:[e.jsx("p",{className:"text-body font-semibold text-red-200",children:"Failed to load artifact"}),e.jsx("p",{className:"mt-1 text-caption leading-relaxed text-red-100/80",children:y.message})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:m,className:"rounded-full border border-strong bg-white/[0.03] px-3 py-1.5 text-caption font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:"Back to activity"}),e.jsx("button",{type:"button",onClick:()=>void H(),disabled:v,className:"rounded-full border border-red-300/22 bg-red-500/[0.08] px-3 py-1.5 text-caption font-semibold text-red-100 transition-colors hover:bg-red-500/[0.14] disabled:opacity-45",children:v?"Retrying…":"Retry"})]})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-subtle px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(D,{}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"truncate text-sm font-medium text-white",children:t.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(u,{tone:"muted",className:"text-micro uppercase tracking-[0.06em]",children:((I=t.catalog)==null?void 0:I.label)??t.artifact_type}),e.jsx(u,{tone:"neutral",className:"text-micro font-semibold uppercase tracking-[0.06em]",style:{color:f[t.status]??o.textMuted,backgroundColor:`${f[t.status]??o.textMuted}20`,borderColor:`${f[t.status]??o.textMuted}44`},children:U[t.status]??t.status}),((q=t.catalog)==null?void 0:q.domain)&&e.jsxs("span",{className:"text-micro text-faint",children:[t.catalog.domain," / ",t.catalog.stage]}),c&&e.jsx(u,{tone:"neutral",className:"text-micro text-secondary",children:c})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[N&&e.jsx("a",{href:N,target:"_blank",rel:"noopener noreferrer",className:"rounded-lg p-2 text-secondary transition-colors hover:bg-white/[0.08] hover:text-white",title:"Open source",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}),e.jsx("button",{onClick:m,className:"p-2 rounded-lg hover:bg-white/[0.06] text-secondary hover:text-white transition-colors",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})]})]}),e.jsxs("div",{className:"max-h-[65vh] overflow-y-auto px-5 py-4 sm:px-6 space-y-4",children:[A&&e.jsxs("div",{className:"rounded-xl border border-amber-300/25 bg-amber-500/[0.09] p-4",children:[e.jsx("p",{className:"text-caption font-semibold uppercase tracking-[0.08em] text-amber-100/90",children:"Local fallback artifact"}),e.jsx("p",{className:"mt-1 text-body text-amber-50/90",children:"This artifact is buffered locally because OrgX registration is currently unavailable."}),w&&e.jsxs("p",{className:"mt-1.5 text-caption text-amber-100/70",children:["Upstream error: ",w]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[k&&e.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",className:"rounded-full border border-amber-200/25 bg-black/25 px-3 py-1 text-caption font-semibold text-amber-100 transition-colors hover:bg-black/35",children:"Open local artifact"}),n&&e.jsx("button",{type:"button",onClick:()=>void B(n,"Artifact path"),className:"rounded-full border border-amber-200/25 bg-black/20 px-3 py-1 text-caption font-semibold text-amber-100 transition-colors hover:bg-black/35",children:"Copy path"})]})]}),t.description&&e.jsx("div",{children:e.jsx("p",{className:"text-body leading-relaxed text-primary",children:t.description})}),h&&e.jsx("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-4",children:e.jsx($,{mode:"block",text:h,className:"text-body leading-relaxed text-primary"})}),!t.description&&!h&&e.jsxs("div",{className:"py-12 text-center text-muted",children:[e.jsxs("svg",{className:"mx-auto mb-3 opacity-50",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})]}),e.jsx("p",{className:"text-sm",children:"No preview available"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1.5 text-micro text-faint",children:[e.jsxs("span",{children:["Entity: ",t.entity_type,"/",t.entity_id.slice(0,8)]}),e.jsxs("span",{children:["Version: ",t.version]}),e.jsxs("span",{children:["Updated:"," ",new Date(t.updated_at).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]})]})]})]})}export{z as ArtifactViewerModal};
1
+ import{r as x,a as S,j as e}from"./cNrhgGc1.js";import{k as T,q as V,r as W,_ as u,d as o,M as $,b as E}from"./Cn07669c.js";import{S as b}from"./DHoYGJ9i.js";import"./C-KIc3Wc.js";import"./BJgZIVUQ.js";import"./CxQ08qFN.js";const f={draft:o.textMuted,in_review:o.amber,approved:o.lime,changes_requested:o.red,superseded:o.textMuted,archived:o.textMuted},U={draft:"Draft",in_review:"In Review",approved:"Approved",changes_requested:"Changes Requested",superseded:"Superseded",archived:"Archived"};function D(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:o.cyan,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),e.jsx("path",{d:"M10 9H8"}),e.jsx("path",{d:"M16 13H8"}),e.jsx("path",{d:"M16 17H8"})]})}function z(){var M,_,C,L,I,q;const{state:l,close:m}=T(),g=null,j=!1,[c,p]=x.useState(null),{data:a,isLoading:F,isFetching:v,error:y,refetch:H}=S({queryKey:V.artifactDetail({artifactId:l.artifactId??"",authToken:g,embedMode:j}),enabled:!!l.artifactId,queryFn:async()=>{const i=E({authToken:g,embedMode:j}),s=await fetch(`/orgx/api/artifacts/${encodeURIComponent(l.artifactId)}`,{headers:i});if(!s.ok){const r=await s.json().catch(()=>null),d=(typeof(r==null?void 0:r.error)=="string"?r.error:null)??(r!=null&&r.error&&typeof r.error=="object"&&typeof r.error.message=="string"?r.error.message:null)??(typeof(r==null?void 0:r.message)=="string"?r.message:null),R=s.status===401?"Authentication required to view this artifact.":`Failed to fetch artifact (${s.status}).`;throw new Error(d!=null&&d.trim().length?d.trim():R)}return s.json()}}),t=a==null?void 0:a.artifact,A=(a==null?void 0:a.localFallback)===!0||((M=t==null?void 0:t.metadata)==null?void 0:M.local_fallback)===!0,w=(typeof(a==null?void 0:a.warning)=="string"&&a.warning.trim().length>0?a.warning:(_=t==null?void 0:t.metadata)==null?void 0:_.local_warning)??null,h=((C=t==null?void 0:t.metadata)==null?void 0:C.preview_markdown)??null,n=x.useMemo(()=>{if(!(t!=null&&t.metadata))return null;const i=[t.metadata.local_source_path,t.metadata.url,t.metadata.path,t.metadata.file_path,t.metadata.filepath,t.metadata.artifact_path,t.metadata.output_path];for(const s of i)if(typeof s=="string"&&s.trim().length>0)return s.trim();return null},[t==null?void 0:t.metadata]),k=x.useMemo(()=>n?/^https?:\/\//i.test(n)?n:`/orgx/api/live/filesystem/open?path=${encodeURIComponent(n)}`:null,[n]),N=((L=t==null?void 0:t.metadata)==null?void 0:L.external_url)??(t==null?void 0:t.artifact_url);x.useEffect(()=>{if(!c)return;const i=window.setTimeout(()=>p(null),2e3);return()=>window.clearTimeout(i)},[c]);const B=async(i,s)=>{try{await navigator.clipboard.writeText(i),p(`${s} copied`)}catch{p("Copy failed")}};return e.jsxs(W,{open:!!l.artifactId,onClose:m,maxWidth:"max-w-3xl",children:[F&&e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsx(b,{className:"h-6 w-2/3"}),e.jsx(b,{className:"h-4 w-1/3"}),e.jsx(b,{className:"h-32 w-full"})]}),y&&e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsxs("div",{className:"rounded-xl border border-red-300/22 bg-red-500/[0.08] p-4",children:[e.jsx("p",{className:"text-body font-semibold text-red-200",children:"Failed to load artifact"}),e.jsx("p",{className:"mt-1 text-caption leading-relaxed text-red-100/80",children:y.message})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:m,className:"rounded-full border border-strong bg-white/[0.03] px-3 py-1.5 text-caption font-semibold text-primary transition-colors hover:bg-white/[0.08]",children:"Back to activity"}),e.jsx("button",{type:"button",onClick:()=>void H(),disabled:v,className:"rounded-full border border-red-300/22 bg-red-500/[0.08] px-3 py-1.5 text-caption font-semibold text-red-100 transition-colors hover:bg-red-500/[0.14] disabled:opacity-45",children:v?"Retrying…":"Retry"})]})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-subtle px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(D,{}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"truncate text-sm font-medium text-white",children:t.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(u,{tone:"muted",className:"text-micro uppercase tracking-[0.06em]",children:((I=t.catalog)==null?void 0:I.label)??t.artifact_type}),e.jsx(u,{tone:"neutral",className:"text-micro font-semibold uppercase tracking-[0.06em]",style:{color:f[t.status]??o.textMuted,backgroundColor:`${f[t.status]??o.textMuted}20`,borderColor:`${f[t.status]??o.textMuted}44`},children:U[t.status]??t.status}),((q=t.catalog)==null?void 0:q.domain)&&e.jsxs("span",{className:"text-micro text-faint",children:[t.catalog.domain," / ",t.catalog.stage]}),c&&e.jsx(u,{tone:"neutral",className:"text-micro text-secondary",children:c})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[N&&e.jsx("a",{href:N,target:"_blank",rel:"noopener noreferrer",className:"rounded-lg p-2 text-secondary transition-colors hover:bg-white/[0.08] hover:text-white",title:"Open source",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15 3h6v6"}),e.jsx("path",{d:"M10 14 21 3"}),e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}),e.jsx("button",{onClick:m,className:"p-2 rounded-lg hover:bg-white/[0.06] text-secondary hover:text-white transition-colors",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 6 6 18"}),e.jsx("path",{d:"m6 6 12 12"})]})})]})]}),e.jsxs("div",{className:"max-h-[65vh] overflow-y-auto px-5 py-4 sm:px-6 space-y-4",children:[A&&e.jsxs("div",{className:"rounded-xl border border-amber-300/25 bg-amber-500/[0.09] p-4",children:[e.jsx("p",{className:"text-caption font-semibold uppercase tracking-[0.08em] text-amber-100/90",children:"Local fallback artifact"}),e.jsx("p",{className:"mt-1 text-body text-amber-50/90",children:"This artifact is buffered locally because OrgX registration is currently unavailable."}),w&&e.jsxs("p",{className:"mt-1.5 text-caption text-amber-100/70",children:["Upstream error: ",w]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[k&&e.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",className:"rounded-full border border-amber-200/25 bg-black/25 px-3 py-1 text-caption font-semibold text-amber-100 transition-colors hover:bg-black/35",children:"Open local artifact"}),n&&e.jsx("button",{type:"button",onClick:()=>void B(n,"Artifact path"),className:"rounded-full border border-amber-200/25 bg-black/20 px-3 py-1 text-caption font-semibold text-amber-100 transition-colors hover:bg-black/35",children:"Copy path"})]})]}),t.description&&e.jsx("div",{children:e.jsx("p",{className:"text-body leading-relaxed text-primary",children:t.description})}),h&&e.jsx("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-4",children:e.jsx($,{mode:"block",text:h,className:"text-body leading-relaxed text-primary"})}),!t.description&&!h&&e.jsxs("div",{className:"py-12 text-center text-muted",children:[e.jsxs("svg",{className:"mx-auto mb-3 opacity-50",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),e.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})]}),e.jsx("p",{className:"text-sm",children:"No preview available"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-1.5 text-micro text-faint",children:[e.jsxs("span",{children:["Entity: ",t.entity_type,"/",t.entity_id.slice(0,8)]}),e.jsxs("span",{children:["Version: ",t.version]}),e.jsxs("span",{children:["Updated:"," ",new Date(t.updated_at).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]})]})]})]})}export{z as ArtifactViewerModal};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./cNrhgGc1.js";import{d as i}from"./C9jy61eu.js";import{A as m,m as x}from"./CxQ08qFN.js";function f({message:l,durationMs:s=5e3,onUndo:d,onExpire:r}){const[t,c]=a.useState(!0),o=a.useRef();a.useEffect(()=>(o.current=setTimeout(()=>{c(!1),r()},s),()=>clearTimeout(o.current)),[s,r]);const n=()=>{clearTimeout(o.current),c(!1),d()};return e.jsx(m,{children:t&&e.jsx(x.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},transition:{duration:.22,ease:[.22,1,.36,1]},className:"fixed bottom-6 left-1/2 z-50 -translate-x-1/2",children:e.jsxs("div",{className:"flex items-center gap-3 rounded-xl px-4 py-2.5 shadow-lg",style:{backgroundColor:i.cardBgElevated,border:`1px solid ${i.cardBorderStrong}`},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:i.lime,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),e.jsx("span",{className:"text-body text-primary",children:l}),e.jsx("button",{onClick:n,className:"ml-1 rounded-md px-2.5 py-1 text-caption font-semibold transition-colors hover:bg-white/[0.08]",style:{color:i.lime},children:"Undo"}),e.jsx("div",{className:"absolute bottom-0 left-3 right-3 h-0.5 overflow-hidden rounded-full",children:e.jsx("div",{className:"h-full origin-left rounded-full",style:{backgroundColor:i.lime,opacity:.4,animation:`undoCountdown ${s}ms linear forwards`}})})]})})})}function y(){const[l,s]=a.useState([]),d=o=>{const n=`undo-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;return s(u=>[...u,{...o,id:n}]),n},r=o=>{s(n=>n.filter(u=>u.id!==o))},t=l[0]??null;return{enqueue:d,ToastRenderer:()=>t?e.jsx(f,{message:t.message,onUndo:()=>{t.onUndo(),r(t.id)},onExpire:()=>{t.onCommit(),r(t.id)}},t.id):null}}export{y as u};
1
+ import{r as a,j as e}from"./cNrhgGc1.js";import{d as i}from"./Cn07669c.js";import{A as m,m as x}from"./CxQ08qFN.js";function f({message:l,durationMs:s=5e3,onUndo:d,onExpire:r}){const[t,c]=a.useState(!0),o=a.useRef();a.useEffect(()=>(o.current=setTimeout(()=>{c(!1),r()},s),()=>clearTimeout(o.current)),[s,r]);const n=()=>{clearTimeout(o.current),c(!1),d()};return e.jsx(m,{children:t&&e.jsx(x.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},transition:{duration:.22,ease:[.22,1,.36,1]},className:"fixed bottom-6 left-1/2 z-50 -translate-x-1/2",children:e.jsxs("div",{className:"flex items-center gap-3 rounded-xl px-4 py-2.5 shadow-lg",style:{backgroundColor:i.cardBgElevated,border:`1px solid ${i.cardBorderStrong}`},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:i.lime,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),e.jsx("span",{className:"text-body text-primary",children:l}),e.jsx("button",{onClick:n,className:"ml-1 rounded-md px-2.5 py-1 text-caption font-semibold transition-colors hover:bg-white/[0.08]",style:{color:i.lime},children:"Undo"}),e.jsx("div",{className:"absolute bottom-0 left-3 right-3 h-0.5 overflow-hidden rounded-full",children:e.jsx("div",{className:"h-full origin-left rounded-full",style:{backgroundColor:i.lime,opacity:.4,animation:`undoCountdown ${s}ms linear forwards`}})})]})})})}function y(){const[l,s]=a.useState([]),d=o=>{const n=`undo-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;return s(u=>[...u,{...o,id:n}]),n},r=o=>{s(n=>n.filter(u=>u.id!==o))},t=l[0]??null;return{enqueue:d,ToastRenderer:()=>t?e.jsx(f,{message:t.message,onUndo:()=>{t.onUndo(),r(t.id)},onExpire:()=>{t.onCommit(),r(t.id)}},t.id):null}}export{y as u};