@hearsay-tools/squawk 0.19.0-dev.9155 → 0.19.0-dev.9162

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 (163) hide show
  1. package/dist/ci-wait/controller.d.ts +7 -7
  2. package/dist/features/reports/routes.d.ts +2 -2
  3. package/dist/server/activity-routes.d.ts +23 -23
  4. package/dist/server/project-settings-routes.d.ts +107 -107
  5. package/dist/server/projects-routes.d.ts +41 -41
  6. package/dist/server/provider-sign-in-routes.d.ts +2 -2
  7. package/dist/server/runner-install-routes.d.ts +10 -10
  8. package/dist/server/runs-routes.d.ts +311 -311
  9. package/dist/server/server.d.ts +1170 -1170
  10. package/dist/server/workspace-identity-routes.d.ts +5 -5
  11. package/package.json +4 -4
  12. package/web/dist/assets/accounts-section-m_1ntZJh.js +1 -0
  13. package/web/dist/assets/activity-motion-DDqgr8eF.js +1 -0
  14. package/web/dist/assets/activity-route-BlEZZxyI.js +1 -0
  15. package/web/dist/assets/agent-accounts-D_ZKAmaW.js +1 -0
  16. package/web/dist/assets/{agent-config-section-D8pxNy2V.js → agent-config-section-wICtFVks.js} +2 -2
  17. package/web/dist/assets/agent-defaults-section-BC9Ypg0g.js +1 -0
  18. package/web/dist/assets/{appearance-D_t3wCjY.js → appearance-fkDdWPlG.js} +1 -1
  19. package/web/dist/assets/{archive-on-merge-field-C63xRNFZ.js → archive-on-merge-field-B6kX09p-.js} +1 -1
  20. package/web/dist/assets/{ask-card-kqWOqKIc.js → ask-card-Cue5EajQ.js} +5 -5
  21. package/web/dist/assets/attention-BI6592lk.js +1 -0
  22. package/web/dist/assets/{automation-format-DB34jUyF.js → automation-format-jKMOXcHS.js} +1 -1
  23. package/web/dist/assets/automations-route-BfOpJjLK.js +2 -0
  24. package/web/dist/assets/{badge-DVxxThpb.js → badge-DAnkqD7i.js} +1 -1
  25. package/web/dist/assets/{button-B22ANdCY.js → button-BV_AiLj2.js} +1 -1
  26. package/web/dist/assets/{centered-state-BgSV4e79.js → centered-state-N8vWM_Hw.js} +1 -1
  27. package/web/dist/assets/{cez-idle-CdswdDRd.js → cez-idle-C0drOeLs.js} +1 -1
  28. package/web/dist/assets/{change-counts-wqSYI3W8.js → change-counts-BLLRvt46.js} +1 -1
  29. package/web/dist/assets/chunk-KS7C4IRE-BdLLx37K.js +3 -0
  30. package/web/dist/assets/{code-editor-GfQChdgl.js → code-editor-DZMD1guX.js} +1 -1
  31. package/web/dist/assets/{code-workbench-CUkiQ1pF.js → code-workbench-B0GIezrD.js} +1 -1
  32. package/web/dist/assets/{collapsible-Bx2vViFx.js → collapsible-D5i3hm2L.js} +1 -1
  33. package/web/dist/assets/{command-B2Y0By1v.js → command-4D8sPZJy.js} +1 -1
  34. package/web/dist/assets/{commit-list-Bjc-pQxv.js → commit-list-StLehTiQ.js} +1 -1
  35. package/web/dist/assets/{dialog-rpNyAWGb.js → dialog-DKr-j9S6.js} +1 -1
  36. package/web/dist/assets/diff-DEw-tkVq.js +3 -0
  37. package/web/dist/assets/{diff-controls-CaCUSyxs.js → diff-controls-CSO8HgZ0.js} +1 -1
  38. package/web/dist/assets/{diff-stat-Dy4uLuyP.js → diff-stat-DCO_BkZB.js} +1 -1
  39. package/web/dist/assets/{diff-view-4wxDvYXE.js → diff-view-BcU4Rnuo.js} +3 -3
  40. package/web/dist/assets/discard-changes-dialog-BEsdWdyJ.js +1 -0
  41. package/web/dist/assets/{dist-BSUJIXeE.js → dist-B2_vvox1.js} +1 -1
  42. package/web/dist/assets/dist-CCX8mhHc.js +1 -0
  43. package/web/dist/assets/{dist-BuF3mvCA.js → dist-ClMNSUvT.js} +1 -1
  44. package/web/dist/assets/{dist--f2yFdPY.js → dist-CyFJ-9Ex.js} +1 -1
  45. package/web/dist/assets/{dist-DudPJH39.js → dist-Du6flkGD.js} +1 -1
  46. package/web/dist/assets/{dropdown-menu-DjtKUK8F.js → dropdown-menu-NJZfnQCU.js} +1 -1
  47. package/web/dist/assets/{es2015-CUEfzDjB.js → es2015-BHonSvOU.js} +1 -1
  48. package/web/dist/assets/file-preview-_4nAs_Ai.js +2 -0
  49. package/web/dist/assets/{folder-browser-Civftk0W.js → folder-browser-CFd1U5hn.js} +1 -1
  50. package/web/dist/assets/{git-toolbar-CepvG0Ng.js → git-toolbar-DXnIUFi1.js} +1 -1
  51. package/web/dist/assets/github-g-Ykk4uE.js +1 -0
  52. package/web/dist/assets/{global-activity-route-DhmrWj31.js → global-activity-route-OsAvUny-.js} +2 -2
  53. package/web/dist/assets/highlighter-Crq-WTmN.js +3 -0
  54. package/web/dist/assets/host-context-DDbYAKpm.js +1 -0
  55. package/web/dist/assets/host-storage-B72yoDU1.js +1 -0
  56. package/web/dist/assets/hosts-CpDMDiQW.js +1 -0
  57. package/web/dist/assets/{html-report-frame-Ck76gKfA.js → html-report-frame-Bk6UkqKa.js} +1 -1
  58. package/web/dist/assets/{image-preview-CeEKI2T5.js → image-preview-CdL9a1Zj.js} +1 -1
  59. package/web/dist/assets/index-D_WkVdwL.css +1 -0
  60. package/web/dist/assets/index-Dp7K74Jw.js +21 -0
  61. package/web/dist/assets/label-CgU9vxuM.js +1 -0
  62. package/web/dist/assets/{live-protocol-DMhTnCmf.js → live-protocol-CNUmr-VT.js} +1 -1
  63. package/web/dist/assets/markdown-BB-PN03o.js +2 -0
  64. package/web/dist/assets/{middle-truncated-name-D41ibfXD.js → middle-truncated-name-jUQS2QzL.js} +1 -1
  65. package/web/dist/assets/{nav-row-styles-CgP5uNp4.js → nav-row-styles-CIedRn3A.js} +1 -1
  66. package/web/dist/assets/{open-in-menu-CbQWVBD0.js → open-in-menu-BI7mnPPf.js} +1 -1
  67. package/web/dist/assets/{option-select-BwSkbCrQ.js → option-select-Bmm4ktgQ.js} +1 -1
  68. package/web/dist/assets/{page-shell-BgabWJ3w.js → page-shell-BdjH5hyc.js} +1 -1
  69. package/web/dist/assets/{popover-CvL6hQ5c.js → popover-BQolmvDR.js} +1 -1
  70. package/web/dist/assets/{preferences-section-Cvh644K0.js → preferences-section-dKDCZSWD.js} +1 -1
  71. package/web/dist/assets/preview-EtD19mg1.js +1 -0
  72. package/web/dist/assets/preview-pane-connected-DBbCXW1b.js +3 -0
  73. package/web/dist/assets/{project-location-DR8go8oL.js → project-location-DJjcFmsE.js} +1 -1
  74. package/web/dist/assets/project-router-Dc6KBQsv.js +1 -0
  75. package/web/dist/assets/projects-section-CVFyzORg.js +1 -0
  76. package/web/dist/assets/{prompt-templates-section-DcxD28iA.js → prompt-templates-section-Jj1YbCwG.js} +2 -2
  77. package/web/dist/assets/queries-IlC9MZgh.js +1 -0
  78. package/web/dist/assets/{read-state-c_RNJaXO.js → read-state-BeVNfGkB.js} +1 -1
  79. package/web/dist/assets/{reference-chip-z7dZJVH-.js → reference-chip-BjerVjzM.js} +1 -1
  80. package/web/dist/assets/{remote-settings-notice-Dtaa3ovl.js → remote-settings-notice-Czl9yS5W.js} +1 -1
  81. package/web/dist/assets/repo-git-C9N9wa5l.js +1 -0
  82. package/web/dist/assets/{report-reader-mbkd2DKt.js → report-reader-Ci4sWoe1.js} +1 -1
  83. package/web/dist/assets/report-selection-CZ8eb9QP.js +1 -0
  84. package/web/dist/assets/reports-CQPRtR5G.js +1 -0
  85. package/web/dist/assets/{resources-section-g5XRlefz.js → resources-section-lLpdP6MD.js} +1 -1
  86. package/web/dist/assets/{review-notes-drafts-BdBvLP6E.js → review-notes-drafts-BjXqp0gY.js} +1 -1
  87. package/web/dist/assets/{review-panel-Ba8yb8Fu.js → review-panel-B4dp-Rol.js} +1 -1
  88. package/web/dist/assets/{review-strip-CdlMeV2i.js → review-strip-BE71YjB6.js} +1 -1
  89. package/web/dist/assets/{run-detail-refresh-C5qmRdgD.js → run-detail-refresh-CE0vyYYA.js} +1 -1
  90. package/web/dist/assets/{run-diff-BDMdnSv7.js → run-diff-ClfLRsHF.js} +3 -3
  91. package/web/dist/assets/run-header-DvbVw3uo.js +2 -0
  92. package/web/dist/assets/{select-DdH25sWT.js → select-CYo1lo6a.js} +1 -1
  93. package/web/dist/assets/{session-context-section-BqEdLdTv.js → session-context-section-B_NEOGby.js} +2 -2
  94. package/web/dist/assets/{settings-agent-picker-b4M6fQ8m.js → settings-agent-picker-DeAST7qR.js} +1 -1
  95. package/web/dist/assets/{settings-field-Bhh8I9fJ.js → settings-field-AyinSFR_.js} +1 -1
  96. package/web/dist/assets/{settings-list-detail-D3ibaYUj.js → settings-list-detail-BlEEuyae.js} +1 -1
  97. package/web/dist/assets/settings-save-bar-Dd3bTznK.js +1 -0
  98. package/web/dist/assets/{settings-shell-BUwdvhI9.js → settings-shell-Bt7NYun7.js} +1 -1
  99. package/web/dist/assets/sidebar-section-DdrFJBTL.js +1 -0
  100. package/web/dist/assets/{skills-BLkPhZO8.js → skills-DNCuhhKf.js} +1 -1
  101. package/web/dist/assets/status-dot-Bmn4xhch.js +1 -0
  102. package/web/dist/assets/{switch-CAKeV99j.js → switch-B9OfOEzC.js} +1 -1
  103. package/web/dist/assets/{tab-link-BKlpD9sn.js → tab-link-6TltE1jl.js} +1 -1
  104. package/web/dist/assets/{task-changes-Drvnew5P.js → task-changes-CdAzeh9M.js} +2 -2
  105. package/web/dist/assets/{task-commits-1MJHuX1i.js → task-commits-CzZJZj2x.js} +1 -1
  106. package/web/dist/assets/{task-file-scope-CB3L3KQl.js → task-file-scope-BuFeMG6a.js} +1 -1
  107. package/web/dist/assets/task-files-BFdMVAb3.js +1 -0
  108. package/web/dist/assets/{task-github-item-CMNk7FxR.js → task-github-item-Dv0Uflz7.js} +1 -1
  109. package/web/dist/assets/{task-groups-CGCnVqHE.js → task-groups-DCg4iOB9.js} +1 -1
  110. package/web/dist/assets/task-thread-C98mqSie.js +2 -0
  111. package/web/dist/assets/{textarea-vEsJAUAV.js → textarea-BGp28xFr.js} +1 -1
  112. package/web/dist/assets/thread-state-DqBwIoCM.js +4 -0
  113. package/web/dist/assets/toaster-DNnL8v10.js +4 -0
  114. package/web/dist/assets/{tool-display-B9NN44oU.js → tool-display-CTbToGmi.js} +1 -1
  115. package/web/dist/assets/use-finish-run-CFEVvqeg.js +1 -0
  116. package/web/dist/assets/use-hand-to-agent-state-BYN578_s.js +1 -0
  117. package/web/dist/assets/use-path-bases-B238cLk1.js +1 -0
  118. package/web/dist/assets/{use-search-params-writer-ClMScnNe.js → use-search-params-writer-DD5PEEZw.js} +1 -1
  119. package/web/dist/assets/use-workspace-config-save-DScW6_8J.js +1 -0
  120. package/web/dist/assets/{workflows-BUcx-n8J.js → workflows-IT5WTfLr.js} +3 -3
  121. package/web/dist/assets/{workspace-tools-dbiR1fzO.js → workspace-tools-D_opTe6D.js} +1 -1
  122. package/web/dist/assets/{worktrees-section-Dyb_QkSd.js → worktrees-section-B8ycJMoK.js} +4 -4
  123. package/web/dist/assets/zoomable-image-CULOtYYp.js +1 -0
  124. package/web/dist/index.html +41 -37
  125. package/web/dist/live-worker.js +2 -2
  126. package/web/dist/assets/accounts-section-BsgnDmow.js +0 -1
  127. package/web/dist/assets/activity-motion-Ckq9kC3I.js +0 -1
  128. package/web/dist/assets/activity-route-5S9WhN9U.js +0 -1
  129. package/web/dist/assets/agent-accounts-D_7QcFSx.js +0 -1
  130. package/web/dist/assets/agent-defaults-section-et5LHv9W.js +0 -1
  131. package/web/dist/assets/attention-DnxGjw_R.js +0 -1
  132. package/web/dist/assets/automations-route-B5YBpGMc.js +0 -2
  133. package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +0 -3
  134. package/web/dist/assets/diff-lwWO-At7.js +0 -3
  135. package/web/dist/assets/discard-changes-dialog-B3gvm7lX.js +0 -1
  136. package/web/dist/assets/dist-C_rn70hE.js +0 -1
  137. package/web/dist/assets/file-preview-98pJhZJj.js +0 -2
  138. package/web/dist/assets/github-4Jhl7lLG.js +0 -1
  139. package/web/dist/assets/highlighter-Cfo7mLVB.js +0 -3
  140. package/web/dist/assets/index-BK1FcZrA.css +0 -1
  141. package/web/dist/assets/index-DJB0lid-.js +0 -21
  142. package/web/dist/assets/label-feCJ3WOT.js +0 -1
  143. package/web/dist/assets/markdown-BAPhDASs.js +0 -2
  144. package/web/dist/assets/preview-pane-connected-B08ZdGux.js +0 -3
  145. package/web/dist/assets/project-router-j0uBi7Ep.js +0 -1
  146. package/web/dist/assets/projects-section-XDboHBFP.js +0 -1
  147. package/web/dist/assets/queries-CchoEEzj.js +0 -1
  148. package/web/dist/assets/repo-git-Dp9R2TuI.js +0 -1
  149. package/web/dist/assets/report-selection-BdGxjISG.js +0 -1
  150. package/web/dist/assets/reports-ya2OW-iR.js +0 -1
  151. package/web/dist/assets/run-header-BTRXYB4W.js +0 -2
  152. package/web/dist/assets/settings-save-bar-DFY_Km4X.js +0 -1
  153. package/web/dist/assets/sidebar-section-CcucfASN.js +0 -1
  154. package/web/dist/assets/status-dot-Drd4-nfa.js +0 -1
  155. package/web/dist/assets/task-files-B9okW1TC.js +0 -1
  156. package/web/dist/assets/task-thread-_2ch8BRt.js +0 -2
  157. package/web/dist/assets/thread-state-qNczqxZQ.js +0 -4
  158. package/web/dist/assets/toaster-zMN8cNZQ.js +0 -4
  159. package/web/dist/assets/use-finish-run-Dvm4JnAH.js +0 -1
  160. package/web/dist/assets/use-hand-to-agent-state-CBJvP-US.js +0 -1
  161. package/web/dist/assets/use-path-bases-C9yvZF5B.js +0 -1
  162. package/web/dist/assets/use-workspace-config-save-9jm9qV6u.js +0 -1
  163. package/web/dist/assets/zoomable-image-BUTgYpld.js +0 -1
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{vt as i,xt as a}from"./queries-CchoEEzj.js";import{f as o,n as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{A as c,C as l,D as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as ee,S as v,T as y,_ as b,a as x,b as S,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./activity-motion-Ckq9kC3I.js";import{t as A}from"./button-B22ANdCY.js";import{a as j,f as M,n as N,t as P}from"./page-shell-BgabWJ3w.js";import{i as F}from"./project-order-AcHI4Dcl.js";import{kn as I}from"./index-DJB0lid-.js";var L=e(t(),1),R=(e,t)=>({x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)});function z(e,t,n=1){return t.some(t=>t.x+n<e.x1&&e.x0<t.x+t.w-n&&t.y+n<e.y1&&e.y0<t.y+t.h-n)}var he=(e,...t)=>e.filter(e=>!t.some(t=>ge(e,t))),ge=(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h,B=e=>Math.round(e*10)/10,V=e=>`${B(e.x)} ${B(e.y)}`;function _e(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&e.x===n.x&&e.y===n.y)continue;let r=t[t.length-2];r&&e&&(r.x===e.x&&e.x===n.x||r.y===e.y&&e.y===n.y)&&t.pop(),t.push(n)}return t}function ve(e,t=8){let n=_e(e),r=n[0];if(!r)return``;let i=`M${V(r)}`;for(let e=1;e<n.length;e++){let r=n[e],a=n[e-1],o=n[e+1];if(!o){i+=` L ${V(r)}`;continue}let s=Math.min(t,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(o.x-r.x,o.y-r.y)/2),c=(e,t,n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y)||1;return{x:e.x+(t.x-e.x)/r*n,y:e.y+(t.y-e.y)/r*n}};i+=` L ${V(c(r,a,s))} Q ${V(r)}, ${V(c(r,o,s))}`}return i}function H(e,t,n){let r=[];for(let i of[...e].sort((e,n)=>t(e)-t(n))){let e=r[r.length-1];e&&Math.abs(t(i)-e.from)<=2?e.to=Math.max(e.to,n(i)):r.push({from:t(i),to:n(i)})}return r}function ye(e){return{rows:H(e,e=>e.y,e=>e.y+e.h).map(({from:e,to:t})=>({top:e,bottom:t})),cols:H(e,e=>e.x,e=>e.x+e.w).map(({from:e,to:t})=>({left:e,right:t}))}}var U=(e,t,n)=>Math.max(0,e.findIndex(e=>Math.abs(t(e)-n)<=2)),W=(e,t)=>((e.rows[t]?.bottom??0)+(e.rows[t+1]?.top??(e.rows[t]?.bottom??0)+16))/2;function be(e,t,n){let r=e.cols,i=e=>((r[e]?.right??0)+(r[e+1]?.left??0))/2;return t<n?i(t):t>n?i(t-1):t+1<r.length?i(t):t>0?i(t-1):(r[t]?.right??0)+8}function xe(e,t,n,r=0){let i=ye(n),a=U(i.rows,e=>e.top,e.y),o=U(i.rows,e=>e.top,t.y),s=o>a,c=e.x+e.w/2+r,l=t.x+t.w/2+r,u=(s?W(i,a):W(i,a-1))+r/2,d=(s?W(i,o-1):W(i,o))+r/2,f=be(i,U(i.cols,e=>e.left,e.x),U(i.cols,e=>e.left,t.x))+r/2,p={x:c,y:s?e.y+e.h+1:e.y-1},m={x:l,y:s?t.y-3:t.y+t.h+3};return{points:[p,{x:c,y:u},{x:f,y:u},{x:f,y:d},{x:l,y:d},m],label:{x:(c+f)/2,y:u}}}function Se(e){let t=new Map;for(let n of e){let e=[n.senderRunId,n.recipientRunId].sort().join(`
2
- `);t.set(e,[...t.get(e)??[],n.requestId])}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,(r-(e.length-1)/2)*12));return n}function Ce(e,t,n,r=4){let i=[],a=new Map;for(let{id:o,at:s}of e){let e={...s};for(let a=0;a<=i.length;a++){let a=i.find(n=>Math.abs(e.x-n.x)<t.w+r&&Math.abs(e.y-n.y)<t.h+r);if(!a)break;n===`x`?e.x=a.x+t.w+r:e.y=a.y+t.h+r}i.push(e),a.set(o,e)}return a}var G=e=>Math.round(e*10)/10,K=e=>`${G(e.x)} ${G(e.y)}`;function we(e,t,n=[],r=0){let i=e.x+e.w/2+r,a=t.x+t.w/2+r;if(t.y>=e.y+e.h||t.y+t.h<=e.y){let o=t.y>e.y,s=o?e.y+e.h+1:e.y-1,c=o?t.y-3:t.y+t.h+3,l=(c-s)/2;if(z(R({x:i,y:s},{x:a,y:c}),he(n,e,t))){let i=xe(e,t,n,r);return{d:ve(i.points),label:i.label}}return{d:`M${K({x:i,y:s})} C ${K({x:i,y:s+l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:c})}`,label:{x:(i+a)/2,y:(s+c)/2}}}let o=e.y-1,s=t.y-1,c=Math.min(o,s),l=Math.max(8,Math.min(30,18+Math.abs(a-i)*.05)+r);return{d:`M${K({x:i,y:o})} C ${K({x:i,y:c-l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:s-3})}`,label:{x:(i+a)/2,y:c-l*.75}}}function Te(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}}function Ee(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function De(e){let t=[],n=[];for(let r of e)v(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function Oe(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function ke(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function Ae(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>m(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function je(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),Me={w:104,h:20};function Ne(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,Te(r.getBoundingClientRect(),t))}return n}function Pe(e,t,n=[]){let r=Ne(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...re(e),kind:`wait`}))],o=Se(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...we(t,n,i,o.get(e.requestId))})}let c=Ce(s.map(e=>({id:e.id,at:e.label})),Me,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function Fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-xs whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function Ie({arc:e,wait:t,now:n,motion:i}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(J,`border-dashed border-message-peer-accent`,t.id in i.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,_(f(t.since,n))]})}function Le({arc:e,request:t,now:n,motion:i}){let a=te(i,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(J,a?`border-success`:`border-message-peer-accent`,C(i,e.id)===`fade`&&`activity-line-out`),children:[a?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,_(f(t.createdAt,n))]})}var Re=[],ze=new Set;function Be({arcs:e,waits:t=Re,active:n=ze,layoutKey:i,now:a,motion:o=b,paused:s=!1}){let c=L.useRef(null),l=T(c,L.useCallback(n=>Pe(n,e,t),[e,t]),Fe,`[data-activity-pill]`,i),u=L.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=ne(o.comets,u,s),f=new Map(e.map(e=>[e.requestId,e])),p=new Map(t.map(e=>[e.id,e])),m=L.useId().replace(/[^a-zA-Z0-9_-]/g,``),h=`activity-arrow-arc-${m}`,g=`activity-ring-arc-${m}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:h,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(x,{id:g})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${g})`,className:r(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,le(o,e.id))},e.id)}let t=C(o,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${h})`,className:r(`stroke-message-peer-accent`,fe(t,e.id in o.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?p.get(e.id):void 0;if(t)return(0,q.jsx)(Ie,{arc:e,wait:t,now:a,motion:o},e.id);let n=f.get(e.id);return n?(0,q.jsx)(Le,{arc:e,request:n,now:a,motion:o},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,Ve=[],He=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function Ue({task:e}){let t=e.workers.filter(e=>m(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(c,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function We({projectId:e,task:t,requests:n,waits:i=Ve,index:a,ctx:o,motion:l=b,linked:u=!1,onHover:g}){let _=h(t,o);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":_.action,"data-linked":u?`true`:void 0,...ae(t.runId,g),className:r(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,_.action?_.tone===`info`?`border-info/70`:`border-pending/70`:t.rung===`running`&&m(t.status)?`border-status-running/60`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in l.entering&&`activity-card-enter`),children:[(0,q.jsx)(pe,{task:t,motion:l,glow:_.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(c,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(s,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(ce,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums`,children:[(0,q.jsx)(se,{"data-slot":`activity-verb`,tone:_.tone,className:`font-semibold`,children:_.verb}),_.action&&_.since?(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsx)(`span`,{"data-slot":`activity-pill-age`,title:d(_.since),children:p(f(_.since,o.now))})]}):null,` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:r(_.mono&&`font-mono text-xs`),children:_.main})]}),_.action?(0,q.jsx)(A,{asChild:!0,size:`sm`,variant:_.action===`answer`?`primary`:`outline`,className:`relative z-[1] px-2 text-[12px]`,children:(0,q.jsx)(s,{"data-slot":`activity-pill-action`,to:Y(e,t.runId),children:_.action===`answer`?`Answer`:`Open task`})}):null]}),(0,q.jsx)(ue,{texts:k(t.runId,n,a,i)}),(0,q.jsx)(Ue,{task:t}),(0,q.jsx)(ie,{runId:t.runId,requests:n,waits:i,index:a,link:s,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:He})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Ge=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-card-edge bg-card shadow-card px-4 pt-3.5 pb-4`,Q=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(s,{to:r,className:Q,children:i})]})}function Ke({project:e,notice:t}){let n=L.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)($,{project:e,headingId:n,detail:t,to:Ge(e.projectId),label:`Open project →`})})}function qe(e,t){return L.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return Oe({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Je({project:e,now:t,motion:n=b,paused:i=!1}){let a=L.useId(),o=L.useMemo(()=>l(e),[e]),s=qe(e,n),c=L.useMemo(()=>O(e.tasks),[e.tasks]),u=L.useMemo(()=>ke(e.tasks,[...c,...E(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=oe(c),f={now:t,titleOf:e=>S(o,e)},p=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${u.map(e=>e.id).join(`,`)}`,m=s.length>0||u.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)($,{project:e,headingId:a,detail:Ae(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:r(`relative mt-3`,m&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:r(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,m&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(We,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:o,ctx:f,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),m?(0,q.jsx)(Be,{arcs:s,waits:u,active:d.active,layoutKey:p,now:t,motion:n,paused:i}):null]})]})}function Ye(e){let t=v(e.project);return t===void 0?(0,q.jsx)(Je,{...e}):(0,q.jsx)(Ke,{project:e.project,notice:t})}function Xe({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[je(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(L.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(s,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ze={kind:`workspace`};function Qe(){let e=a().data?.projects,{order:t}=I();return L.useMemo(()=>e?F(e,t).map(e=>e.id):void 0,[e,t])}function $e(){let e=a().data,t=i(),n=o().state?.activityProjectId,r=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:r;return{id:s,name:e?.projects.find(e=>e.id===s)?.name,projects:e?.projects}}function et(){let e=ee(Ze),t=$e(),n=Qe(),[r,i]=L.useState(!1),a=w(e.data?.generatedAt,e.dataUpdatedAt),o=e.data?.projects,c=L.useMemo(()=>Ee(o??[],n),[o,n]),l=L.useMemo(()=>De(c),[c]),d=L.useMemo(()=>l.panels.filter(e=>v(e)===void 0),[l.panels]),f=L.useMemo(()=>l.panels.filter(e=>v(e)!==void 0),[l.panels]),p=L.useMemo(()=>c.map(e=>e.projectId),[c]),{motion:m,feed:h,paused:_,reduced:b}=de(e.data,`workspace`),x=d.reduce((e,t)=>e+t.tasks.length,0);return(0,q.jsxs)(j,{route:`activity-global`,density:o?M(x+f.length):`full`,headerSpacing:`compact`,rootProps:{"data-activity-paused":_?`true`:void 0},bodyClassName:`gap-3.5`,header:g({name:`All projects`,now:e.data?a:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,scopeSwitch:(0,q.jsx)(y,{scope:`all`,projects:t.projects,projectId:t.id,projectName:t.name,grouped:r,onToggleGroup:()=>i(e=>!e)})}),sparseFooter:o&&l.panels.length>0?(0,q.jsx)(N,{summary:`${d.length} active ${d.length===1?`project`:`projects`} with live work.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(s,{to:`/tasks`,children:`View all tasks`})})}):void 0,children:[o?(0,q.jsx)(u,{summary:D(o),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!o?(0,q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-xl border border-border bg-card p-5 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(A,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),children:`Retry`})]}):null,o&&l.panels.length===0&&l.idle.length===0?(0,q.jsx)(P,{slot:`activity-empty`,title:`No projects to show.`,description:`Register a project in Workspace tools to monitor live agent work across repositories.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(s,{to:`/tools`,children:`Open workspace tools`})})}):null,d.length>0||h.length>0?(0,q.jsx)(me,{projects:d,now:a,global:!0,grouped:r,projectOrder:p,motion:m,feed:h,still:b,paused:_}):null,f.length>0?(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:f.map(e=>(0,q.jsx)(Ye,{project:e,now:a,motion:m,paused:_||b},e.projectId))}):null,(0,q.jsx)(Xe,{projects:l.idle,belowPanels:l.panels.length>0})]})}export{et as GlobalActivityRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{vt as r,xt as i}from"./queries-IlC9MZgh.js";import{n as a,p as o}from"./chunk-KS7C4IRE-BdLLx37K.js";import{o as s}from"./dist-CCX8mhHc.js";import{A as c,C as l,D as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as ee,S as v,T as y,_ as b,a as x,b as S,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as se,k as ce,l as le,m as ue,n as de,o as fe,p as pe,r as me,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./activity-motion-DDqgr8eF.js";import{t as A}from"./button-BV_AiLj2.js";import{a as j,f as M,n as N,t as P}from"./page-shell-BdjH5hyc.js";import{i as F}from"./project-order-AcHI4Dcl.js";import{En as I}from"./index-Dp7K74Jw.js";var L=e(t(),1),R=(e,t)=>({x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)});function z(e,t,n=1){return t.some(t=>t.x+n<e.x1&&e.x0<t.x+t.w-n&&t.y+n<e.y1&&e.y0<t.y+t.h-n)}var he=(e,...t)=>e.filter(e=>!t.some(t=>ge(e,t))),ge=(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h,B=e=>Math.round(e*10)/10,V=e=>`${B(e.x)} ${B(e.y)}`;function _e(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&e.x===n.x&&e.y===n.y)continue;let r=t[t.length-2];r&&e&&(r.x===e.x&&e.x===n.x||r.y===e.y&&e.y===n.y)&&t.pop(),t.push(n)}return t}function ve(e,t=8){let n=_e(e),r=n[0];if(!r)return``;let i=`M${V(r)}`;for(let e=1;e<n.length;e++){let r=n[e],a=n[e-1],o=n[e+1];if(!o){i+=` L ${V(r)}`;continue}let s=Math.min(t,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(o.x-r.x,o.y-r.y)/2),c=(e,t,n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y)||1;return{x:e.x+(t.x-e.x)/r*n,y:e.y+(t.y-e.y)/r*n}};i+=` L ${V(c(r,a,s))} Q ${V(r)}, ${V(c(r,o,s))}`}return i}function H(e,t,n){let r=[];for(let i of[...e].sort((e,n)=>t(e)-t(n))){let e=r[r.length-1];e&&Math.abs(t(i)-e.from)<=2?e.to=Math.max(e.to,n(i)):r.push({from:t(i),to:n(i)})}return r}function ye(e){return{rows:H(e,e=>e.y,e=>e.y+e.h).map(({from:e,to:t})=>({top:e,bottom:t})),cols:H(e,e=>e.x,e=>e.x+e.w).map(({from:e,to:t})=>({left:e,right:t}))}}var U=(e,t,n)=>Math.max(0,e.findIndex(e=>Math.abs(t(e)-n)<=2)),W=(e,t)=>((e.rows[t]?.bottom??0)+(e.rows[t+1]?.top??(e.rows[t]?.bottom??0)+16))/2;function be(e,t,n){let r=e.cols,i=e=>((r[e]?.right??0)+(r[e+1]?.left??0))/2;return t<n?i(t):t>n?i(t-1):t+1<r.length?i(t):t>0?i(t-1):(r[t]?.right??0)+8}function xe(e,t,n,r=0){let i=ye(n),a=U(i.rows,e=>e.top,e.y),o=U(i.rows,e=>e.top,t.y),s=o>a,c=e.x+e.w/2+r,l=t.x+t.w/2+r,u=(s?W(i,a):W(i,a-1))+r/2,d=(s?W(i,o-1):W(i,o))+r/2,f=be(i,U(i.cols,e=>e.left,e.x),U(i.cols,e=>e.left,t.x))+r/2,p={x:c,y:s?e.y+e.h+1:e.y-1},m={x:l,y:s?t.y-3:t.y+t.h+3};return{points:[p,{x:c,y:u},{x:f,y:u},{x:f,y:d},{x:l,y:d},m],label:{x:(c+f)/2,y:u}}}function Se(e){let t=new Map;for(let n of e){let e=[n.senderRunId,n.recipientRunId].sort().join(`
2
+ `);t.set(e,[...t.get(e)??[],n.requestId])}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,(r-(e.length-1)/2)*12));return n}function Ce(e,t,n,r=4){let i=[],a=new Map;for(let{id:o,at:s}of e){let e={...s};for(let a=0;a<=i.length;a++){let a=i.find(n=>Math.abs(e.x-n.x)<t.w+r&&Math.abs(e.y-n.y)<t.h+r);if(!a)break;n===`x`?e.x=a.x+t.w+r:e.y=a.y+t.h+r}i.push(e),a.set(o,e)}return a}var G=e=>Math.round(e*10)/10,K=e=>`${G(e.x)} ${G(e.y)}`;function we(e,t,n=[],r=0){let i=e.x+e.w/2+r,a=t.x+t.w/2+r;if(t.y>=e.y+e.h||t.y+t.h<=e.y){let o=t.y>e.y,s=o?e.y+e.h+1:e.y-1,c=o?t.y-3:t.y+t.h+3,l=(c-s)/2;if(z(R({x:i,y:s},{x:a,y:c}),he(n,e,t))){let i=xe(e,t,n,r);return{d:ve(i.points),label:i.label}}return{d:`M${K({x:i,y:s})} C ${K({x:i,y:s+l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:c})}`,label:{x:(i+a)/2,y:(s+c)/2}}}let o=e.y-1,s=t.y-1,c=Math.min(o,s),l=Math.max(8,Math.min(30,18+Math.abs(a-i)*.05)+r);return{d:`M${K({x:i,y:o})} C ${K({x:i,y:c-l})}, ${K({x:a,y:c-l})}, ${K({x:a,y:s-3})}`,label:{x:(i+a)/2,y:c-l*.75}}}function Te(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}}function Ee(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function De(e){let t=[],n=[];for(let r of e)v(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function Oe(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function ke(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function Ae(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>m(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function je(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),Me={w:104,h:20};function Ne(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,Te(r.getBoundingClientRect(),t))}return n}function Pe(e,t,n=[]){let r=Ne(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...re(e),kind:`wait`}))],o=Se(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...we(t,n,i,o.get(e.requestId))})}let c=Ce(s.map(e=>({id:e.id,at:e.label})),Me,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function Fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-xs whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function Ie({arc:e,wait:t,now:n,motion:r}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:s(J,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,_(f(t.since,n))]})}function Le({arc:e,request:t,now:n,motion:r}){let i=te(r,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:s(J,i?`border-success`:`border-message-peer-accent`,C(r,e.id)===`fade`&&`activity-line-out`),children:[i?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,_(f(t.createdAt,n))]})}var Re=[],ze=new Set;function Be({arcs:e,waits:t=Re,active:n=ze,layoutKey:r,now:i,motion:a=b,paused:o=!1}){let c=L.useRef(null),l=T(c,L.useCallback(n=>Pe(n,e,t),[e,t]),Fe,`[data-activity-pill]`,r),u=L.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=ne(a.comets,u,o),f=new Map(e.map(e=>[e.requestId,e])),p=new Map(t.map(e=>[e.id,e])),m=L.useId().replace(/[^a-zA-Z0-9_-]/g,``),h=`activity-arrow-arc-${m}`,g=`activity-ring-arc-${m}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:h,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(x,{id:g})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${g})`,className:s(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,le(a,e.id))},e.id)}let t=C(a,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${h})`,className:s(`stroke-message-peer-accent`,fe(t,e.id in a.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?p.get(e.id):void 0;if(t)return(0,q.jsx)(Ie,{arc:e,wait:t,now:i,motion:a},e.id);let n=f.get(e.id);return n?(0,q.jsx)(Le,{arc:e,request:n,now:i,motion:a},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,Ve=[],He=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function Ue({task:e}){let t=e.workers.filter(e=>m(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(c,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function We({projectId:e,task:t,requests:n,waits:r=Ve,index:i,ctx:o,motion:l=b,linked:u=!1,onHover:g}){let _=h(t,o);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":_.action,"data-linked":u?`true`:void 0,...ae(t.runId,g),className:s(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,_.action?_.tone===`info`?`border-info/70`:`border-pending/70`:t.rung===`running`&&m(t.status)?`border-status-running/60`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in l.entering&&`activity-card-enter`),children:[(0,q.jsx)(pe,{task:t,motion:l,glow:_.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(c,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(a,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(ce,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-xs text-muted-foreground tabular-nums`,children:[(0,q.jsx)(se,{"data-slot":`activity-verb`,tone:_.tone,className:`font-semibold`,children:_.verb}),_.action&&_.since?(0,q.jsxs)(q.Fragment,{children:[` · `,(0,q.jsx)(`span`,{"data-slot":`activity-pill-age`,title:d(_.since),children:p(f(_.since,o.now))})]}):null,` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:s(_.mono&&`font-mono text-xs`),children:_.main})]}),_.action?(0,q.jsx)(A,{asChild:!0,size:`sm`,variant:_.action===`answer`?`primary`:`outline`,className:`relative z-[1] px-2 text-[12px]`,children:(0,q.jsx)(a,{"data-slot":`activity-pill-action`,to:Y(e,t.runId),children:_.action===`answer`?`Answer`:`Open task`})}):null]}),(0,q.jsx)(ue,{texts:k(t.runId,n,i,r)}),(0,q.jsx)(Ue,{task:t}),(0,q.jsx)(ie,{runId:t.runId,requests:n,waits:r,index:i,link:a,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:He})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Ge=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-card-edge bg-card shadow-card px-4 pt-3.5 pb-4`,Q=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(a,{to:r,className:Q,children:i})]})}function Ke({project:e,notice:t}){let n=L.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)($,{project:e,headingId:n,detail:t,to:Ge(e.projectId),label:`Open project →`})})}function qe(e,t){return L.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return Oe({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Je({project:e,now:t,motion:n=b,paused:r=!1}){let i=L.useId(),a=L.useMemo(()=>l(e),[e]),o=qe(e,n),c=L.useMemo(()=>O(e.tasks),[e.tasks]),u=L.useMemo(()=>ke(e.tasks,[...c,...E(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=oe(c),f={now:t,titleOf:e=>S(a,e)},p=`${e.tasks.map(e=>e.runId).join(`,`)}:${o.map(e=>e.requestId).join(`,`)}:${u.map(e=>e.id).join(`,`)}`,m=o.length>0||u.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":i,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)($,{project:e,headingId:i,detail:Ae(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:s(`relative mt-3`,m&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:s(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,m&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(We,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:a,ctx:f,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),m?(0,q.jsx)(Be,{arcs:o,waits:u,active:d.active,layoutKey:p,now:t,motion:n,paused:r}):null]})]})}function Ye(e){let t=v(e.project);return t===void 0?(0,q.jsx)(Je,{...e}):(0,q.jsx)(Ke,{project:e.project,notice:t})}function Xe({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[je(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(L.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(a,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ze={kind:`workspace`};function Qe(){let e=i().data?.projects,{order:t}=I();return L.useMemo(()=>e?F(e,t).map(e=>e.id):void 0,[e,t])}function $e(){let e=i().data,t=r(),n=o().state?.activityProjectId,a=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:a;return{id:s,name:e?.projects.find(e=>e.id===s)?.name,projects:e?.projects}}function et(){let e=ee(Ze),t=$e(),n=Qe(),[r,i]=L.useState(!1),o=w(e.data?.generatedAt,e.dataUpdatedAt),s=e.data?.projects,c=L.useMemo(()=>Ee(s??[],n),[s,n]),l=L.useMemo(()=>De(c),[c]),d=L.useMemo(()=>l.panels.filter(e=>v(e)===void 0),[l.panels]),f=L.useMemo(()=>l.panels.filter(e=>v(e)!==void 0),[l.panels]),p=L.useMemo(()=>c.map(e=>e.projectId),[c]),{motion:m,feed:h,paused:_,reduced:b}=de(e.data,`workspace`),x=d.reduce((e,t)=>e+t.tasks.length,0);return(0,q.jsxs)(j,{route:`activity-global`,density:s?M(x+f.length):`full`,headerSpacing:`compact`,rootProps:{"data-activity-paused":_?`true`:void 0},bodyClassName:`gap-3.5`,header:g({name:`All projects`,now:e.data?o:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,scopeSwitch:(0,q.jsx)(y,{scope:`all`,projects:t.projects,projectId:t.id,projectName:t.name,grouped:r,onToggleGroup:()=>i(e=>!e)})}),sparseFooter:s&&l.panels.length>0?(0,q.jsx)(N,{summary:`${d.length} active ${d.length===1?`project`:`projects`} with live work.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(a,{to:`/tasks`,children:`View all tasks`})})}):void 0,children:[s?(0,q.jsx)(u,{summary:D(s),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!s?(0,q.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-xl border border-border bg-card p-5 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(A,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),children:`Retry`})]}):null,s&&l.panels.length===0&&l.idle.length===0?(0,q.jsx)(P,{slot:`activity-empty`,title:`No projects to show.`,description:`Register a project in Workspace tools to monitor live agent work across repositories.`,actions:(0,q.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,q.jsx)(a,{to:`/tools`,children:`Open workspace tools`})})}):null,d.length>0||h.length>0?(0,q.jsx)(me,{projects:d,now:o,global:!0,grouped:r,projectOrder:p,motion:m,feed:h,still:b,paused:_}):null,f.length>0?(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:f.map(e=>(0,q.jsx)(Ye,{project:e,now:o,motion:m,paused:_||b},e.projectId))}):null,(0,q.jsx)(Xe,{projects:l.idle,belowPanels:l.panels.length>0})]})}export{et as GlobalActivityRoute};
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-BY76lXLH.js","assets/css-BsVw1vtW.js","assets/javascript-BgS3c2Ky.js","assets/core-DzoyrHjB.js","assets/lib-DrPFkMXk.js","assets/rolldown-runtime-QTnfLwEv.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-Czpn1I53.js";import{c as t}from"./dist-CCX8mhHc.js";import{t as n}from"./own-lookup-DS54wXvD.js";var r={core:null,langs:new Map},i={name:`cezar-syn`,type:`dark`,fg:`var(--syn-var)`,bg:`transparent`,settings:[{scope:[`keyword`,`storage`,`constant.language`,`variable.language`,`entity.other.attribute-name`,`support.type.property-name`],settings:{foreground:`var(--syn-key)`}},{scope:[`string`,`punctuation.definition.string`],settings:{foreground:`var(--syn-str)`}},{scope:[`entity.name.function`,`support.function`,`entity.name.tag`,`entity.name.type`,`entity.name.class`,`support.class`,`support.type`],settings:{foreground:`var(--syn-fn)`}},{scope:[`comment`,`punctuation.definition.comment`],settings:{foreground:`var(--syn-com)`}},{scope:[`constant.numeric`,`constant.character`,`constant.other`,`support.constant`,`keyword.other.unit`],settings:{foreground:`var(--syn-num)`}},{scope:[`punctuation`,`keyword.operator`,`meta.brace`,`punctuation.separator`,`punctuation.terminator`],settings:{foreground:`var(--syn-punc)`}},{scope:[`variable`,`entity.name.variable`],settings:{foreground:`var(--syn-var)`}}]},a={typescript:()=>e(()=>import(`./typescript-bsJCZSQ-.js`),[]),tsx:()=>e(()=>import(`./tsx-udAQXfEw.js`),[]),javascript:()=>e(()=>import(`./javascript-BgS3c2Ky.js`),[]),jsx:()=>e(()=>import(`./jsx-Bz0zcwM4.js`),[]),json:()=>e(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>e(()=>import(`./jsonc-CYpm1nAK.js`),[]),shellscript:()=>e(()=>import(`./shellscript-CLZ0U2zV.js`),[]),python:()=>e(()=>import(`./python-gzcpVVnB.js`),[]),markdown:()=>e(()=>import(`./markdown-BYOwaDjH.js`),[]),css:()=>e(()=>import(`./css-BsVw1vtW.js`),[]),html:()=>e(()=>import(`./html-BY76lXLH.js`),__vite__mapDeps([0,1,2])),diff:()=>e(()=>import(`./diff-woXpYk--.js`),[]),yaml:()=>e(()=>import(`./yaml-rwi0_p6S.js`),[]),toml:()=>e(()=>import(`./toml-CcmNWLt0.js`),[]),go:()=>e(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>e(()=>import(`./rust-Cfkwpbl8.js`),[]),sql:()=>e(()=>import(`./sql-BsFa4tDR.js`),[])},o={ts:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,bash:`shellscript`,sh:`shellscript`,shell:`shellscript`,zsh:`shellscript`,console:`shellscript`,py:`python`,md:`markdown`,yml:`yaml`,golang:`go`,rs:`rust`,vue:`html`,xml:`html`},s=new Set([``,`plaintext`,`text`,`txt`,`plain`]);function c(e){let t=e.trim().toLowerCase();return Object.hasOwn(a,t)?t:n(o,t)??null}function l(e){return s.has(e.trim().toLowerCase())}function u(){return[...Object.keys(a),...Object.keys(o),...s].filter(e=>e!==``)}function d(e){let t=e.slice(e.lastIndexOf(`/`)+1),r=t.lastIndexOf(`.`);if(r<=0)return null;let i=t.slice(r+1).toLowerCase();return c(n({mts:`typescript`,cts:`typescript`,htm:`html`},i)??i)}var f=null,p=new Set;function m(){return r.core??=Promise.all([e(()=>import(`./core-DzoyrHjB.js`),__vite__mapDeps([3,4,5])),e(()=>import(`./engine-javascript-FQvzRocB.js`),[])]).then(async([{createHighlighterCore:e},{createJavaScriptRegexEngine:t}])=>(f=await e({themes:[i],langs:[],engine:t({forgiving:!0})}),f)),r.core}function h(e){let t=c(e);if(t===null||p.has(t))return Promise.resolve();let n=r.langs.get(t);return n||(n=m().then(async e=>{await e.loadLanguage(await a[t]()),p.add(t)}).catch(()=>{r.langs.delete(t)}),r.langs.set(t,n)),n}function g(e){return{tokens:e.split(`
3
+ `).map(e=>[{content:e}]),fg:`var(--syn-var)`,bg:`transparent`}}function _(e,n,r={}){if(l(n))return g(e);let a=c(n);if(a===null)return g(e);if(!f||!p.has(a))return null;try{let n=f.codeToTokens(e,{lang:a,theme:i.name,...t({tokenizeTimeLimit:r.tokenizeTimeLimit})});return{tokens:n.tokens.map(e=>e.map(({content:e,color:n})=>({content:e,...t({color:n})}))),fg:n.fg??`var(--syn-var)`,bg:`transparent`}}catch{return g(e)}}async function v(e,t,n={}){return _(e,t,n)||(await h(t),_(e,t,n)??g(e))}export{d as a,_ as i,c as n,u as o,v as r,i as t};
@@ -0,0 +1 @@
1
+ var e=`/api/v1`,t=``;function n(e){t=e.replace(/\/+$/,``)}function r(){return t}var i=null;function a(e){i=e===``?null:e}function o(){return i}function s(){return i??`default`}var c=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function l(n){return`${t}${e}${u(n)}`}function u(e){return i===null||c.test(e)?e:`/p/${encodeURIComponent(i)}${e}`}var d=/^\/api(?:\/v1)?(\/.*)$/;function f(e){let n=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(n){let t=e.indexOf(`//`,n[0].length);if(t!==n[0].length)return e;let r=e.indexOf(`/`,t+2);if(r===-1)return e;let i=e.slice(0,r),a=p(e.slice(r));return a===null?e:`${i}${a}`}let r=p(t&&e.startsWith(t)?e.slice(t.length):e);return r===null?e:`${t}${r}`}function p(t){let n=d.exec(t);if(!n)return null;let r=n[1];return r.startsWith(`/p/`)?`${e}${r}`:`${e}${u(r)}`}var m=/^\/h\/([^/]+)(?=\/|$)/,h=/(?:^|\/)api\/v1\/hosts\/([^/]+)$/,g=``,_;function v(e){return e.replace(/\/+$/,``)}function y(e){try{return decodeURIComponent(e)}catch{return e}}function b(e){let t=m.exec(e);if(!t)return null;let n=t[1];return{hostId:y(n),basename:`/h/${n}`}}function x(e){let t=v(e);if(!t)return null;let n=h.exec(t);return n?y(n[1]):null}function S(e){g=v(e.mainApiBase??``);let t=b(e.pathname);if(!t)return _=void 0,n(g),{hostId:null,basename:void 0,apiBase:g,mainApiBase:g};_=t.basename;let r=`${g}/api/v1/hosts/${encodeURIComponent(t.hostId)}`;return n(r),{hostId:t.hostId,basename:t.basename,apiBase:r,mainApiBase:g}}function C(){return g}function w(){return x(r())}function T(){return w()!==null}function E(){let e=w();if(e!==null)return _&&b(`${_}/`)?.hostId===e?_:`/h/${encodeURIComponent(e)}`}function D(e){return e===null?`/`:`/h/${encodeURIComponent(e)}/`}function O(e,t){let n=`/p/${encodeURIComponent(t)}/`;return e===null?n:`/h/${encodeURIComponent(e)}${n}`}export{D as a,T as c,r as d,o as f,a as h,E as i,e as l,f as m,w as n,O as o,s as p,C as r,S as s,x as t,l as u};
@@ -0,0 +1 @@
1
+ import{n as e}from"./host-context-DDbYAKpm.js";var t=`cez-host:`;function n(n){let r=e();return r===null?n:`${t}${encodeURIComponent(r)}:${n}`}export{n as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{on as n}from"./queries-IlC9MZgh.js";import{c as r,n as i}from"./host-context-DDbYAKpm.js";import{Br as a,Fi as o,Fr as s,Jr as c,Nr as l,Pr as u,Qn as d,Rr as f,Vr as p,Wr as m,Yr as h,Zn as g,er as _,jn as v,tr as y,wi as b}from"./toaster-DNnL8v10.js";import{c as x}from"./dist-CCX8mhHc.js";var S=e(t(),1);async function C(e){return _(await d.api.v1.health.$get({},g(e)),`/health`)}async function w(e){return y(await d.api.v1.hosts.$get({},g(e)),`/hosts`,c)}async function T(e){return y(await d.api.v1.hosts.projects.$get({},g(e)),`/hosts/projects`,h)}async function E(e){return _(await d.api.v1.workspace[`ui-state`].$get({},g(e)),`/workspace/ui-state`)}async function D(e,t={}){return _(await d.api.v1.workspace[`ui-state`].$put({json:e},{init:{...x({keepalive:t.keepalive})}}),`/workspace/ui-state`)}var O=3e3,k=3e4,A=new WeakMap,j={health:[`main`,`health`],hosts:[`main`,`hosts`],hostsProjects:[`main`,`hosts`,`projects`],uiState:[`main`,`workspace`,`ui-state`]};function M(e){let t=l();return b({queryKey:j.health,queryFn:({signal:e})=>C({signal:e}),enabled:e,...r()?{networkMode:`always`}:{},staleTime:k,refetchOnWindowFocus:e?`always`:!1,refetchInterval:n(e&&t?k:!1)})}function N(e={}){let{enabled:t=!0,pollWhileOffline:o=!1}=e,c=l(),d=p(),f=i(),m=!t||!c?!1:o&&d.offline?O:n(k),h=b({queryKey:j.hosts,queryFn:async({signal:e})=>{let t=u(),n=await w({signal:e});A.set(n,t);let r=i(),c=r?n.hosts.find(e=>e.id===r):void 0;if(r&&c){a(r,c.state,Date.now(),t);let n=s();o&&c.state===`connected`&&n.offline&&n.gatewayCode===`host-unreachable`&&v({signal:e}).catch(()=>void 0)}return n},enabled:t,...r()?{networkMode:`always`}:{},structuralSharing:!1,staleTime:1e4,refetchInterval:m,refetchOnWindowFocus:t?`always`:!1});return(0,S.useEffect)(()=>{if(!f||!h.data)return;let e=h.data.hosts.find(e=>e.id===f);e&&a(f,e.state,h.dataUpdatedAt,A.get(h.data))},[f,h.data,h.dataUpdatedAt]),h}function P(e,t){return t?!0:e?e.hosts.length>0||!!e.warning:!1}function F(e={}){let{enabled:t=!0}=e,i=l();return b({queryKey:j.hostsProjects,queryFn:({signal:e})=>T({signal:e}),enabled:t,...r()?{networkMode:`always`}:{},staleTime:k,retry:!1,refetchOnWindowFocus:e=>t&&P(e.state.data,e.state.status===`error`)?`always`:!1,refetchInterval:e=>!t||!i||!P(e.state.data,e.state.status===`error`)?!1:n(k)})}function I(e){return b({queryKey:j.uiState,queryFn:({signal:e})=>E({signal:e}),enabled:e,...r()?{networkMode:`always`}:{}})}function L(){let e=o(),{hostId:t,offline:n}=p(),i=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(r())return f(()=>{e.refetchQueries({queryKey:j.hosts,exact:!0})})},[e]),(0,S.useEffect)(()=>{if(t===null){i.current=!1;return}i.current!==n&&e.invalidateQueries({queryKey:j.hostsProjects}),i.current=n},[t,n,e])}function R(){let e=i(),t=p(),n=N({enabled:e!==null,pollWhileOffline:!0});if(e===null)return null;let r=n.data?.hosts.find(t=>t.id===e),a=r?.label??e;return t.offline?{hostId:e,hostLabel:a,offline:!0,state:(r&&r.state!==`connected`?r.state:t.reportedState&&t.reportedState!==`connected`?t.reportedState:t.gatewayCode?m(t.gatewayCode):null)??`unreachable`,gatewayCode:t.gatewayCode}:{hostId:e,hostLabel:a,offline:!1,state:null,gatewayCode:null}}export{M as a,I as c,L as i,D as l,P as n,N as o,R as r,F as s,j as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-C_rn70hE.js";import{a as i,i as a,n as o,o as s,s as c,t as l}from"./html-report-BX3msvci.js";var u=e(t(),1),d=n(),f=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function p(e){let t=f.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var m={};function h(e){let t=(0,u.useMemo)(()=>s(e),[e]).join(` `),[n,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!t)return;let e=!0;return c(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:m}function g({html:e,title:t,fragment:n,className:i}){let a=h(e);return a?(0,d.jsx)(_,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,d.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function _({html:e,title:t,fragment:n,className:s,libraries:c}){let{srcdoc:f,blocked:m}=(0,u.useMemo)(()=>{let n=a(e,c);return{srcdoc:i(n.srcdoc,t),blocked:n.blocked}},[e,c,t]),h=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},g=p(m);return(0,d.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,s),children:[g?(0,d.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,g,`. Reports show only what they carry inside the file.`]}):null,(0,d.jsx)(`div`,{"data-slot":`html-report-viewport`,className:`flex min-h-0 flex-1 flex-col bg-muted/40 p-2 md:p-4`,children:(0,d.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:o,allow:l,srcDoc:f,referrerPolicy:`no-referrer`,onLoad:h,className:`block min-h-0 w-full flex-1 rounded-md border border-border bg-report-canvas shadow-sm`})})]})}export{g as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{a as i,i as a,n as o,o as s,s as c,t as l}from"./html-report-BX3msvci.js";var u=e(t(),1),d=n(),f=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function p(e){let t=f.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var m={};function h(e){let t=(0,u.useMemo)(()=>s(e),[e]).join(` `),[n,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!t)return;let e=!0;return c(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:m}function g({html:e,title:t,fragment:n,className:i}){let a=h(e);return a?(0,d.jsx)(_,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,d.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function _({html:e,title:t,fragment:n,className:s,libraries:c}){let{srcdoc:f,blocked:m}=(0,u.useMemo)(()=>{let n=a(e,c);return{srcdoc:i(n.srcdoc,t),blocked:n.blocked}},[e,c,t]),h=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},g=p(m);return(0,d.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,s),children:[g?(0,d.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,g,`. Reports show only what they carry inside the file.`]}):null,(0,d.jsx)(`div`,{"data-slot":`html-report-viewport`,className:`flex min-h-0 flex-1 flex-col bg-muted/40 p-2 md:p-4`,children:(0,d.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:o,allow:l,srcDoc:f,referrerPolicy:`no-referrer`,onLoad:h,className:`block min-h-0 w-full flex-1 rounded-md border border-border bg-report-canvas shadow-sm`})})]})}export{g as t};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./diff-stat-Dy4uLuyP.js";import{t as n}from"./zoomable-image-BUTgYpld.js";var r=e();function i({stat:e,hidden:n=!1}){return(0,r.jsxs)(`p`,{"data-slot":`diff-totals`,hidden:n,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{children:[e.files,` `,e.files===1?`file`:`files`,` changed`]}),(0,r.jsx)(t,{stat:e})]})}function a(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function o({file:e,imageSrc:t,onOpenInApp:i}){return e.status===`deleted`?(0,r.jsx)(s,{children:`Image deleted — only the new side can be previewed.`}):t?(0,r.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,r.jsx)(n,{src:t(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,r.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,r.jsx)(s,{children:`Binary file — no text diff.`})}function s({children:e}){return(0,r.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}export{a as n,i as r,o as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./diff-stat-DCO_BkZB.js";import{t as n}from"./zoomable-image-CULOtYYp.js";var r=e();function i({stat:e,hidden:n=!1}){return(0,r.jsxs)(`p`,{"data-slot":`diff-totals`,hidden:n,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{children:[e.files,` `,e.files===1?`file`:`files`,` changed`]}),(0,r.jsx)(t,{stat:e})]})}function a(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function o({file:e,imageSrc:t,onOpenInApp:i}){return e.status===`deleted`?(0,r.jsx)(s,{children:`Image deleted — only the new side can be previewed.`}):t?(0,r.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,r.jsx)(n,{src:t(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,r.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-xs font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,r.jsx)(s,{children:`Binary file — no text diff.`})}function s({children:e}){return(0,r.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}export{a as n,i as r,o as t};