bunqueue-dashboard 0.0.46 → 1.0.1

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 (148) hide show
  1. package/README.md +6 -6
  2. package/agent/compiledRuntime.ts +27 -0
  3. package/agent/db/boundedStream.ts +18 -0
  4. package/agent/db/exportTimeout.ts +8 -6
  5. package/agent/db/processWorker.ts +121 -0
  6. package/agent/db/queryTimeout.ts +62 -50
  7. package/agent/db/readAdmission.ts +53 -0
  8. package/agent/db/readOperations.ts +27 -0
  9. package/agent/db/readProcessMain.ts +64 -0
  10. package/agent/db/types.ts +3 -0
  11. package/agent/db/workerFactory.ts +12 -10
  12. package/agent/dbReadWorker.ts +21 -0
  13. package/agent/index.ts +2 -1
  14. package/agent/managedTarget.ts +3 -1
  15. package/agent/manager/commandLine.ts +33 -0
  16. package/agent/manager/configStore.ts +65 -0
  17. package/agent/manager/errors.ts +4 -0
  18. package/agent/manager/process.ts +12 -3
  19. package/agent/manager.ts +1 -0
  20. package/agent/server/controlRoutes.ts +10 -0
  21. package/agent/server/controlStatus.ts +26 -5
  22. package/agent/server/databaseRoutes.ts +13 -17
  23. package/agent/server/errors.ts +6 -0
  24. package/agent/server/handler.ts +2 -1
  25. package/agent/server/router.ts +2 -1
  26. package/agent/server/workflowReadRoutes.ts +9 -11
  27. package/agent/shutdown.ts +3 -2
  28. package/agent/workflow/sqlite.ts +1 -1
  29. package/dist/.vite/manifest.json +537 -575
  30. package/dist/assets/AddJob-CiwWycYG.js +3 -0
  31. package/dist/assets/Alerts-DzKKoA9U.js +1 -0
  32. package/dist/assets/AreaChart-Db2UVnaK.js +1 -0
  33. package/dist/assets/Benchmark-CHYDL31K.js +1 -0
  34. package/dist/assets/BulkAddJobs-GRMVnf0j.js +5 -0
  35. package/dist/assets/Button-_aSJvRoW.js +1 -0
  36. package/dist/assets/Card-egIDLwVk.js +1 -0
  37. package/dist/assets/Cron-XL0PdUEc.js +1 -0
  38. package/dist/assets/CronManager-Cqtg9Zr8.js +1 -0
  39. package/dist/assets/{Database-DV2pcDLL.js → Database-BoxVpjts.js} +3 -3
  40. package/dist/assets/Diagnostics-B3QSQuFF.js +1 -0
  41. package/dist/assets/Dlq-DHOfgORa.js +1 -0
  42. package/dist/assets/DlqControl-BY1e55-x.js +1 -0
  43. package/dist/assets/DlqPro-CfwKDcpc.js +1 -0
  44. package/dist/assets/Fleet-Bkbq0dFB.js +1 -0
  45. package/dist/assets/Flows-CDCQrPit.js +2 -0
  46. package/dist/assets/JobInspector-Bw3Gs1Iy.js +2 -0
  47. package/dist/assets/Jobs-IrlneOy6.js +1 -0
  48. package/dist/assets/JobsPro-vlPd6Ows.js +1 -0
  49. package/dist/assets/Logs-DG7cK-tF.js +1 -0
  50. package/dist/assets/LogsPro-ClSqFKys.js +1 -0
  51. package/dist/assets/{McpServer-fVy27Mof.js → McpServer-DoNFY0Pj.js} +1 -1
  52. package/dist/assets/{Metrics-Ba46pdzT.js → Metrics-BkePZiCZ.js} +1 -1
  53. package/dist/assets/MetricsPro-ooSvpQ3H.js +1 -0
  54. package/dist/assets/{Overview-DV2qo5v3.js → Overview-CuWmPRra.js} +1 -1
  55. package/dist/assets/{PageHeader-CvIyaFOO.js → PageHeader-CQzNsw8r.js} +1 -1
  56. package/dist/assets/Pagination-CSkzhNW6.js +1 -0
  57. package/dist/assets/QueueActions-BBxRt-t0.js +1 -0
  58. package/dist/assets/QueueControl-C01l6bBJ.js +1 -0
  59. package/dist/assets/QueueDetail-gSf9Tb7G.js +1 -0
  60. package/dist/assets/QueueDetailPro-BKszqI0M.js +1 -0
  61. package/dist/assets/Queues-BAg2nSz0.js +1 -0
  62. package/dist/assets/QueuesOverview-BLSjiYsA.js +1 -0
  63. package/dist/assets/{S3Backup-DNABHR2Q.js → S3Backup-Ci4dJPP_.js} +1 -1
  64. package/dist/assets/S3BackupPro-DcjlrzC5.js +3 -0
  65. package/dist/assets/ServerControl-SiZBNo9P.js +3 -0
  66. package/dist/assets/Settings-DR_iqW0T.js +1 -0
  67. package/dist/assets/StatusBadge-DereLzOj.js +1 -0
  68. package/dist/assets/{Usage-1KxG1mJ9.js → Usage-ZWfB7PcR.js} +1 -1
  69. package/dist/assets/UsagePro-BjdeS2zb.js +1 -0
  70. package/dist/assets/Webhooks-BonYUgMo.js +1 -0
  71. package/dist/assets/Workers-C1h6hCPp.js +1 -0
  72. package/dist/assets/WorkersPro-B0f_Nfdz.js +1 -0
  73. package/dist/assets/Workflows-CqZZ96EK.js +1 -0
  74. package/dist/assets/{api-BgWE-705.js → api-D9aT0ND7.js} +1 -1
  75. package/dist/assets/bq-DR2BTISO.js +1 -0
  76. package/dist/assets/classicJobsData-Csj4iihY.js +1 -0
  77. package/dist/assets/connectionStore-CVjQyIZv.js +1 -0
  78. package/dist/assets/controlConnectionEpoch-ChAeMMLk.js +1 -0
  79. package/dist/assets/feedback-CtGN_kqB.js +1 -0
  80. package/dist/assets/form-DG3X6cLL.js +1 -0
  81. package/dist/assets/{icons-BVzwsfbG.js → icons-DH9SS1DA.js} +1 -1
  82. package/dist/assets/index-Bat1DN5U.js +8 -0
  83. package/dist/assets/react-vendor-CFL9l8LK.js +11 -0
  84. package/dist/assets/{cn-zFEt5SO8.js → rolldown-runtime-QTnfLwEv.js} +1 -1
  85. package/dist/assets/{toastStore-IZn6OPLZ.js → toastStore-XmMX7A5W.js} +1 -1
  86. package/dist/assets/useControlActionGuard-1i7aFA7E.js +1 -0
  87. package/dist/assets/usePolledData-CEyyLRYa.js +1 -0
  88. package/dist/assets/useServerActionGuard-CUx8TOAC.js +1 -0
  89. package/dist/assets/useThroughputSeries-CeFx-Mwq.js +1 -0
  90. package/dist/index.html +14 -14
  91. package/package.json +16 -10
  92. package/scripts/embedded.gen.ts +152 -162
  93. package/scripts/serve.ts +10 -15
  94. package/scripts/serveHandler.ts +28 -1
  95. package/dist/assets/AddJob-FNaPbs_V.js +0 -3
  96. package/dist/assets/Alerts-vzIYtFpW.js +0 -1
  97. package/dist/assets/AreaChart-DEAalJ6P.js +0 -1
  98. package/dist/assets/Benchmark-C16tT4pF.js +0 -1
  99. package/dist/assets/BulkAddJobs-IiL1uud0.js +0 -5
  100. package/dist/assets/Button-Ch1W94fJ.js +0 -1
  101. package/dist/assets/Card-CWxrC8OY.js +0 -1
  102. package/dist/assets/CopilotPanel-FlAW3RlL.js +0 -44
  103. package/dist/assets/Cron-1DZTZWXO.js +0 -1
  104. package/dist/assets/CronManager-B6xLLgI5.js +0 -1
  105. package/dist/assets/Diagnostics-B6apZrC5.js +0 -1
  106. package/dist/assets/Dlq-MRmkQrNC.js +0 -1
  107. package/dist/assets/DlqControl-DNJPVOTF.js +0 -1
  108. package/dist/assets/DlqPro-CwtTDwGN.js +0 -1
  109. package/dist/assets/Fleet-Bdrj9bLI.js +0 -1
  110. package/dist/assets/Flows-1dC8F_wx.js +0 -2
  111. package/dist/assets/JobInspector-Ct9Ga-UT.js +0 -2
  112. package/dist/assets/Jobs-Chqv0RuL.js +0 -1
  113. package/dist/assets/JobsPro-CLzOhKAL.js +0 -1
  114. package/dist/assets/Logs-C5PNP9Wq.js +0 -1
  115. package/dist/assets/LogsPro-B3KwTSsn.js +0 -1
  116. package/dist/assets/MetricsPro-B9rD_KQc.js +0 -1
  117. package/dist/assets/Pagination-x-Cwgrul.js +0 -1
  118. package/dist/assets/QueueActions-BWnmNEqV.js +0 -1
  119. package/dist/assets/QueueControl-DqBvuDnF.js +0 -1
  120. package/dist/assets/QueueDetail-COSH9bJl.js +0 -1
  121. package/dist/assets/QueueDetailPro-ClKtyHIf.js +0 -1
  122. package/dist/assets/Queues-D2-R8nYh.js +0 -1
  123. package/dist/assets/QueuesOverview-tokquA3g.js +0 -1
  124. package/dist/assets/S3BackupPro-CDX5WQUY.js +0 -3
  125. package/dist/assets/ServerControl-BmccMNW9.js +0 -3
  126. package/dist/assets/Settings-UcujwvKv.js +0 -1
  127. package/dist/assets/StatusBadge-BoOVTnKu.js +0 -1
  128. package/dist/assets/UsagePro-BGLufsE7.js +0 -1
  129. package/dist/assets/Webhooks-DT2LK17V.js +0 -1
  130. package/dist/assets/Workers-BX1qspaQ.js +0 -1
  131. package/dist/assets/WorkersPro-BsUQVgQZ.js +0 -1
  132. package/dist/assets/Workflows-DZZA6aGW.js +0 -1
  133. package/dist/assets/bq-F5BbTG1T.js +0 -1
  134. package/dist/assets/connectionStore-BJLihGaC.js +0 -1
  135. package/dist/assets/controlConnectionEpoch-CZsS0wAb.js +0 -1
  136. package/dist/assets/dist-1f1fMHVO.js +0 -11
  137. package/dist/assets/dist-BlWBaCN6.js +0 -11
  138. package/dist/assets/dist-DZL8soAh.js +0 -79
  139. package/dist/assets/dist-DjvZiKhB.js +0 -2
  140. package/dist/assets/dist-DpZcbP9W.js +0 -11
  141. package/dist/assets/feedback-QDN1AsYt.js +0 -1
  142. package/dist/assets/form-C4oby9pI.js +0 -1
  143. package/dist/assets/index-8Ii-_Rml.js +0 -8
  144. package/dist/assets/react-vendor-CvwrP0tU.js +0 -11
  145. package/dist/assets/useControlActionGuard-B-bzKZKI.js +0 -1
  146. package/dist/assets/usePolledData-0CVelkl2.js +0 -1
  147. package/dist/assets/useServerActionGuard-uGePilQQ.js +0 -1
  148. package/dist/assets/useThroughputSeries-DgO8uicf.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{g as t}from"./react-vendor-CFL9l8LK.js";import{n,t as r}from"./controlConnectionEpoch-ChAeMMLk.js";var i=e(t(),1),a=new Map;function o(e){let t=n(),o=`${t}\u0000${e}`,s=(0,i.useRef)(!1),c=(0,i.useRef)(0),l=(0,i.useRef)(o);return l.current!==o&&(l.current=o,c.current+=1),(0,i.useEffect)(()=>(s.current=!0,()=>{s.current=!1,c.current+=1}),[]),{scopeKey:o,begin:(e=`action`)=>{let n=[...new Set(typeof e==`string`?[e]:e)],i=n.map(e=>`${t}\u0000${e}`);if(!s.current||n.length===0||l.current!==o||r()!==t||i.some(e=>a.has(e)))return null;let u=Symbol(`control-action`);for(let e of i)a.set(e,u);let d=c.current,f=()=>s.current&&c.current===d&&l.current===o&&r()===t;return{isCurrent:f,finish:()=>{let e=f();for(let e of i)a.get(e)===u&&a.delete(e);return e}}}}}export{o as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{g as t}from"./react-vendor-CFL9l8LK.js";import{o as n}from"./connectionStore-CVjQyIZv.js";var r=e(t(),1);function i(e){let t=!0;return()=>t?(t=!1,!0):!e()}function a(e,t=[],a={}){let o=n(e=>e.refreshMs),s=n(e=>JSON.stringify([e.activeProfileId,e.baseUrl,e.agentBaseUrl,e.token,e.agentToken])),c=a.intervalMs??o,l=(0,r.useRef)(null),u=(0,r.useRef)(0),d=[s,...t];(l.current===null||l.current.length!==d.length||l.current.some((e,t)=>!Object.is(e,d[t])))&&(l.current=d,u.current+=1);let f=u.current,[p,m]=(0,r.useState)(null),[h,g]=(0,r.useState)(null),[_,v]=(0,r.useState)(!0),y=(0,r.useRef)(e);y.current=e;let b=(0,r.useRef)(!0),x=(0,r.useRef)(0),S=(0,r.useRef)(void 0),C=(0,r.useRef)(!0),w=(0,r.useRef)(!1),T=(0,r.useRef)(0),E=(0,r.useRef)(0),D=(0,r.useRef)(()=>Promise.resolve()),O=(0,r.useCallback)(async(e,t,n)=>{try{let r=await y.current(n);if(!b.current||e!==x.current)return;let i;try{i=JSON.stringify(r)}catch{i=String(Math.random())}i===S.current?T.current=t:(S.current=i,T.current=t,m(r)),w.current&&(w.current=!1,E.current=0,g(null))}catch(n){if(!b.current||e!==x.current)return;w.current=!0,E.current=t,g(n)}finally{b.current&&e===x.current&&C.current&&(C.current=!1,v(!1))}},[]),k=(0,r.useCallback)(()=>D.current(),[]);(0,r.useEffect)(()=>{b.current=!0;let e=++x.current,t=new AbortController;S.current=void 0,C.current=!0,m(null),v(!0),w.current&&(w.current=!1,g(null));let n=null,r=!1,a=!1,o=!1,s=[],l=()=>globalThis.document?.hidden??!1,u=i(l),d=()=>{n!==null&&clearTimeout(n),n=null},p=()=>{r||(d(),n=setTimeout(()=>{n=null,_(!1)},c))},h=async()=>{a=!0;try{await O(e,f,t.signal)}finally{if(a=!1,!r)if(o){o=!1;let e=s;s=[],_(!0).finally(()=>{for(let t of e)t()})}else p()}};function _(e){return r?Promise.resolve():a?e?(o=!0,new Promise(e=>s.push(e))):Promise.resolve():(d(),!e&&!u()?(p(),Promise.resolve()):h())}let y=()=>_(!0);D.current=y,_(!1);let T=()=>{l()||r||a||_(!0)};return typeof document<`u`&&document.addEventListener(`visibilitychange`,T),()=>{r=!0,b.current=!1,t.abort(),d();for(let e of s)e();s=[],D.current===y&&(D.current=()=>Promise.resolve()),x.current===e&&(x.current+=1),typeof document<`u`&&document.removeEventListener(`visibilitychange`,T)}},[c,f,O]);let A=T.current===f,j=E.current===f;return{data:A?p:null,error:j?h:null,loading:A||j?_:!0,refetch:k}}export{a as n,i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{g as t}from"./react-vendor-CFL9l8LK.js";import{a as n,o as r}from"./connectionStore-CVjQyIZv.js";var i=e(t(),1),a=new Map;function o(){let e=r.getState().token.trim();return JSON.stringify([n(),e])}var s=0,c=o();r.subscribe(()=>{let e=o();e!==c&&(c=e,s+=1)});function l(e,t=`Operation`){if(typeof e!=`object`||!e||e.ok!==!0)throw Error(`${t} returned a malformed success response`)}function u(e){r(e=>`${e.baseUrl}\u0000${e.token}`);let t=o(),n=s,c=JSON.stringify([n,e]),l=(0,i.useRef)(!1),u=(0,i.useRef)(0),d=(0,i.useRef)(c);return d.current!==c&&(d.current=c,u.current+=1),(0,i.useEffect)(()=>{l.current=!0;let e=o(),t=r.subscribe(()=>{let t=o();t!==e&&(e=t,u.current+=1)});return()=>{l.current=!1,u.current+=1,t()}},[]),{scopeKey:c,begin:(r=`action`)=>{let i=[...new Set(typeof r==`string`?[r]:r)],f=i.map(t=>JSON.stringify([n,e,t]));if(!l.current||i.length===0||d.current!==c||s!==n||o()!==t||f.some(e=>a.has(e)))return null;let p=Symbol(`server-action`);for(let e of f)a.set(e,p);let m=u.current,h=()=>l.current&&u.current===m&&d.current===c&&s===n&&o()===t;return{isCurrent:h,finish:()=>{let e=h();for(let e of f)a.get(e)===p&&a.delete(e);return e}}}}}export{o as n,u as r,l as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{g as t}from"./react-vendor-CFL9l8LK.js";import{o as n}from"./connectionStore-CVjQyIZv.js";import{t as r}from"./bq-DR2BTISO.js";import{t as i}from"./usePolledData-CEyyLRYa.js";var a=e(t(),1),o=1e3,s={push:[],complete:[],fail:[],depth:[]},c=()=>typeof performance<`u`?performance.now():Date.now(),l=(e,t)=>`${e}\u0000${t}`;function u(e=60){let t=l(n(e=>e.baseUrl),n(e=>e.token)),[u,d]=(0,a.useState)(s),[f,p]=(0,a.useState)(null),[m,h]=(0,a.useState)(null),g=(0,a.useRef)(0),_=(0,a.useRef)(0),v=(0,a.useRef)(t),y=v.current===t;return(0,a.useEffect)(()=>{let n=++g.current,a=new AbortController,l=!1;v.current!==t&&(v.current=t,d(s),p(null),h(null),_.current=0);let u=i(()=>globalThis.document?.hidden??!1),f=async()=>{if(l||!u())return;l=!0;let t=c();try{let[i,c]=await Promise.all([r.overview({signal:a.signal}),r.stats({signal:a.signal})]);if(a.signal.aborted||g.current!==n)return;let l=i?.stats,u=i?.throughput,f=c?.stats;if(!l||!u||!f)throw Error(`malformed telemetry body`);if(![l.waiting,l.active,l.delayed,l.completed,l.dlq,l.totalPushed,l.totalPulled,l.totalCompleted,l.totalFailed,l.uptime,u.pushPerSec,u.completePerSec,u.failPerSec,f.waiting,f.prioritized,f.active,f.delayed,f[`waiting-children`]].every(e=>typeof e==`number`&&Number.isFinite(e)))throw Error(`malformed telemetry numeric metrics`);let m=u.pushPerSec,v=u.completePerSec,y=u.failPerSec,b=f.waiting+f.prioritized+f.active+f.delayed+f[`waiting-children`],x=_.current>0&&t-_.current>4*o;_.current=t,p(i),h(null),d(t=>{let n=x?s:t;return{push:[...n.push,m].slice(-e),complete:[...n.complete,v].slice(-e),fail:[...n.fail,y].slice(-e),depth:[...n.depth,b].slice(-e)}})}catch(e){!a.signal.aborted&&g.current===n&&h(e)}finally{l=!1}};f();let m=setInterval(f,o);return()=>{clearInterval(m),a.abort(),g.current===n&&(g.current+=1)}},[e,t]),y?{...u,latest:f,error:m}:{...s,latest:null,error:null}}function d(e,t=o){if(e.length<2)return{slope:0,label:`steady`,draining:!1};let n=e.length,r=(n-1)/2,i=e.reduce((e,t)=>e+t,0)/n,a=0,s=0;for(let t=0;t<n;t++)a+=(t-r)*(e[t]-i),s+=(t-r)**2;let c=s===0?0:a/s,l=t>0?o/t*c:c,u=l<-.05;return{slope:l,label:u?`draining`:l>.05?`accumulating`:`steady`,draining:u}}export{u as n,d as t};
package/dist/index.html CHANGED
@@ -49,21 +49,21 @@
49
49
  content="Fully drive a bunqueue server from one UI: queues, jobs, DLQ, cron, webhooks, workers, and start/stop/restart. Live demo, no signup."
50
50
  />
51
51
  <meta name="twitter:image" content="https://egeominotti.github.io/bunqueue-dashboard/og.png" />
52
- <script type="module" crossorigin src="./assets/index-8Ii-_Rml.js"></script>
53
- <link rel="modulepreload" crossorigin href="./assets/cn-zFEt5SO8.js">
54
- <link rel="modulepreload" crossorigin href="./assets/react-vendor-CvwrP0tU.js">
55
- <link rel="modulepreload" crossorigin href="./assets/connectionStore-BJLihGaC.js">
52
+ <script type="module" crossorigin src="./assets/index-Bat1DN5U.js"></script>
53
+ <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-QTnfLwEv.js">
54
+ <link rel="modulepreload" crossorigin href="./assets/react-vendor-CFL9l8LK.js">
55
+ <link rel="modulepreload" crossorigin href="./assets/connectionStore-CVjQyIZv.js">
56
56
  <link rel="modulepreload" crossorigin href="./assets/upstreamPaths-DQeKSxGc.js">
57
- <link rel="modulepreload" crossorigin href="./assets/bq-F5BbTG1T.js">
58
- <link rel="modulepreload" crossorigin href="./assets/toastStore-IZn6OPLZ.js">
59
- <link rel="modulepreload" crossorigin href="./assets/icons-BVzwsfbG.js">
60
- <link rel="modulepreload" crossorigin href="./assets/api-BgWE-705.js">
61
- <link rel="modulepreload" crossorigin href="./assets/usePolledData-0CVelkl2.js">
62
- <link rel="modulepreload" crossorigin href="./assets/Button-Ch1W94fJ.js">
63
- <link rel="modulepreload" crossorigin href="./assets/Card-CWxrC8OY.js">
64
- <link rel="modulepreload" crossorigin href="./assets/feedback-QDN1AsYt.js">
65
- <link rel="modulepreload" crossorigin href="./assets/StatusBadge-BoOVTnKu.js">
66
- <link rel="modulepreload" crossorigin href="./assets/PageHeader-CvIyaFOO.js">
57
+ <link rel="modulepreload" crossorigin href="./assets/bq-DR2BTISO.js">
58
+ <link rel="modulepreload" crossorigin href="./assets/toastStore-XmMX7A5W.js">
59
+ <link rel="modulepreload" crossorigin href="./assets/icons-DH9SS1DA.js">
60
+ <link rel="modulepreload" crossorigin href="./assets/StatusBadge-DereLzOj.js">
61
+ <link rel="modulepreload" crossorigin href="./assets/api-D9aT0ND7.js">
62
+ <link rel="modulepreload" crossorigin href="./assets/usePolledData-CEyyLRYa.js">
63
+ <link rel="modulepreload" crossorigin href="./assets/Button-_aSJvRoW.js">
64
+ <link rel="modulepreload" crossorigin href="./assets/Card-egIDLwVk.js">
65
+ <link rel="modulepreload" crossorigin href="./assets/feedback-CtGN_kqB.js">
66
+ <link rel="modulepreload" crossorigin href="./assets/PageHeader-CQzNsw8r.js">
67
67
  <link rel="modulepreload" crossorigin href="./assets/format-Cg7VCIZW.js">
68
68
  <link rel="stylesheet" crossorigin href="./assets/index-C9yGKhQ8.css">
69
69
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunqueue-dashboard",
3
- "version": "0.0.46",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Web dashboard for a bunqueue server (queues, jobs, DLQ, cron, metrics, workers, live activity). Run with `bunx bunqueue-dashboard` (requires Bun 1.4.2).",
6
6
  "packageManager": "bun@1.4.2",
@@ -66,7 +66,7 @@
66
66
  "docs:dev": "vitepress dev docs",
67
67
  "docs:build": "bun run scripts/build-docs.ts",
68
68
  "docs:preview": "vitepress preview docs",
69
- "build:bin": "bun run build && bun run scripts/gen-embed.ts && bun build scripts/serve.ts agent/dbQueryWorker.ts agent/backup/standaloneWorker.ts --compile --minify --outfile bunqueue-dashboard",
69
+ "build:bin": "bun run build && bun run scripts/gen-embed.ts && bun build scripts/serve.ts agent/dbReadWorker.ts agent/backup/standaloneWorker.ts --compile --minify --outfile bunqueue-dashboard",
70
70
  "preview": "vite preview",
71
71
  "test": "bun test",
72
72
  "test:e2e:flow": "bun run scripts/validate-flow-runtime.ts",
@@ -80,16 +80,19 @@
80
80
  "test:e2e:browser:serve": "bun e2e/runtime.ts",
81
81
  "test:e2e:browser:postgres-fleet": "bun run scripts/validate-postgres-fleet-dashboard-runtime.ts",
82
82
  "test:e2e:browser": "bun run build && bun scripts/gen-embed.ts && playwright test",
83
+ "test:binary": "bun scripts/validate-standalone-runtime.ts ./bunqueue-dashboard",
84
+ "test:runtime": "bun scripts/validate-standalone-runtime.ts --source",
85
+ "test:soak": "bun scripts/validate-resilience.ts",
83
86
  "test:package": "bun run scripts/validate-package-runtime.ts",
84
- "test:coverage": "bun test --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage && bun scripts/check-coverage.ts && bun scripts/check-test-inventory.ts",
87
+ "test:coverage": "bun test --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage && bun scripts/check-coverage.ts && bun scripts/check-critical-coverage.ts && bun scripts/check-test-inventory.ts",
85
88
  "lint": "oxlint . && bun run scripts/check-implicit-any-let.ts",
86
89
  "lint:fix": "oxlint --fix . && bun run scripts/check-implicit-any-let.ts",
87
90
  "format": "oxfmt .",
88
91
  "format:check": "oxfmt --check .",
89
92
  "check": "bun run lint && bun run format:check",
90
93
  "check:fix": "bun run lint:fix && bun run format",
91
- "audit:high": "bun audit --audit-level=high --ignore=GHSA-qwww-vcr4-c8h2",
92
- "quality": "bun run version:check && bun run architecture && bun run check && bun run build && bun run size && bun run docs:build && bun run test:coverage && bun run test:e2e && bun run test:package && bun run audit:high",
94
+ "audit:high": "bun audit --audit-level=high",
95
+ "quality": "bun run version:check && bun run architecture && bun run check && bun run build && bun run size && bun run docs:build && bun run test:coverage && bun run test:e2e && bun run test:package && bun run test:runtime && bun run test:soak && bun run audit:high",
93
96
  "typecheck:e2e": "tsc -p tsconfig.e2e.json",
94
97
  "test:e2e:browser:managed": "bun run build && bun scripts/gen-embed.ts && playwright test -c playwright.managed.config.ts",
95
98
  "test:e2e:docs": "bun run docs:build && playwright test -c playwright.docs.config.ts"
@@ -114,13 +117,13 @@
114
117
  "bun-types": "1.4.2",
115
118
  "bunqueue-v2-9-2": "npm:bunqueue@2.9.2",
116
119
  "happy-dom": "^20.10.6",
117
- "mermaid": "^11.16.0",
120
+ "mermaid": "^11.17.2",
118
121
  "oxfmt": "^0.63.0",
119
122
  "oxlint": "^1.78.0",
120
123
  "oxlint-tsgolint": "^7.0.2001",
121
124
  "react": "^19.2.7",
122
125
  "react-dom": "^19.2.7",
123
- "react-router-dom": "^7.18.1",
126
+ "react-router-dom": "^7.18.4",
124
127
  "tailwindcss": "^4.3.2",
125
128
  "typescript": "^6.0.3",
126
129
  "vite": "^8.1.3",
@@ -131,9 +134,12 @@
131
134
  "zustand": "^5.0.14"
132
135
  },
133
136
  "overrides": {
134
- "brace-expansion": "^5.0.9",
135
- "dompurify": "^3.4.12",
136
- "js-yaml": "^3.15.1",
137
+ "brace-expansion": "^5.0.12",
138
+ "dompurify": "^3.4.16",
139
+ "fast-uri": "^3.1.8",
140
+ "ip-address": "^10.7.2",
141
+ "js-yaml": "^3.15.2",
142
+ "markdown-it": "^14.3.2",
137
143
  "nanoid": "^3.3.18",
138
144
  "postcss": "^8.5.25"
139
145
  },
@@ -1,169 +1,159 @@
1
1
  // @ts-nocheck
2
2
  // AUTO-GENERATED by scripts/gen-embed.ts — do not edit, not committed.
3
- import f0 from "../dist/.vite/manifest.json" with { type: 'file' };
3
+ import f0 from "../dist/favicon.svg" with { type: 'file' };
4
4
  import f1 from "../dist/og.png" with { type: 'file' };
5
- import f2 from "../dist/index.html" with { type: 'file' };
6
- import f3 from "../dist/favicon.svg" with { type: 'file' };
7
- import f4 from "../dist/assets/index-C9yGKhQ8.css" with { type: 'file' };
8
- import f5 from "../dist/assets/react-vendor-CvwrP0tU.js" with { type: 'file' };
9
- import f6 from "../dist/assets/useThroughputSeries-DgO8uicf.js" with { type: 'file' };
10
- import f7 from "../dist/assets/AddJob-FNaPbs_V.js" with { type: 'file' };
11
- import f8 from "../dist/assets/AreaChart-DEAalJ6P.js" with { type: 'file' };
12
- import f9 from "../dist/assets/promisePool-BVfQ9n9Q.js" with { type: 'file' };
13
- import f10 from "../dist/assets/dist-DjvZiKhB.js" with { type: 'file' };
14
- import f11 from "../dist/assets/Benchmark-C16tT4pF.js" with { type: 'file' };
15
- import f12 from "../dist/assets/JobInspector-Ct9Ga-UT.js" with { type: 'file' };
16
- import f13 from "../dist/assets/icons-BVzwsfbG.js" with { type: 'file' };
17
- import f14 from "../dist/assets/Pagination-x-Cwgrul.js" with { type: 'file' };
18
- import f15 from "../dist/assets/index-8Ii-_Rml.js" with { type: 'file' };
19
- import f16 from "../dist/assets/feedback-QDN1AsYt.js" with { type: 'file' };
20
- import f17 from "../dist/assets/Jobs-Chqv0RuL.js" with { type: 'file' };
21
- import f18 from "../dist/assets/useServerActionGuard-uGePilQQ.js" with { type: 'file' };
22
- import f19 from "../dist/assets/install-oydLpc1T.js" with { type: 'file' };
23
- import f20 from "../dist/assets/useControlActionGuard-B-bzKZKI.js" with { type: 'file' };
24
- import f21 from "../dist/assets/Button-Ch1W94fJ.js" with { type: 'file' };
25
- import f22 from "../dist/assets/DlqPro-CwtTDwGN.js" with { type: 'file' };
26
- import f23 from "../dist/assets/Fleet-Bdrj9bLI.js" with { type: 'file' };
27
- import f24 from "../dist/assets/Flows-1dC8F_wx.js" with { type: 'file' };
28
- import f25 from "../dist/assets/connectionStore-BJLihGaC.js" with { type: 'file' };
29
- import f26 from "../dist/assets/usePolledData-0CVelkl2.js" with { type: 'file' };
30
- import f27 from "../dist/assets/api-BgWE-705.js" with { type: 'file' };
31
- import f28 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
32
- import f29 from "../dist/assets/Workflows-DZZA6aGW.js" with { type: 'file' };
33
- import f30 from "../dist/assets/format-Cg7VCIZW.js" with { type: 'file' };
34
- import f31 from "../dist/assets/Alerts-vzIYtFpW.js" with { type: 'file' };
35
- import f32 from "../dist/assets/CopilotPanel-FlAW3RlL.js" with { type: 'file' };
36
- import f33 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
37
- import f34 from "../dist/assets/QueueControl-DqBvuDnF.js" with { type: 'file' };
38
- import f35 from "../dist/assets/JobsPro-CLzOhKAL.js" with { type: 'file' };
39
- import f36 from "../dist/assets/WorkersPro-BsUQVgQZ.js" with { type: 'file' };
40
- import f37 from "../dist/assets/Diagnostics-B6apZrC5.js" with { type: 'file' };
41
- import f38 from "../dist/assets/BulkAddJobs-IiL1uud0.js" with { type: 'file' };
42
- import f39 from "../dist/assets/Database-DV2pcDLL.js" with { type: 'file' };
43
- import f40 from "../dist/assets/S3BackupPro-CDX5WQUY.js" with { type: 'file' };
44
- import f41 from "../dist/assets/dist-BlWBaCN6.js" with { type: 'file' };
45
- import f42 from "../dist/assets/Metrics-Ba46pdzT.js" with { type: 'file' };
46
- import f43 from "../dist/assets/flowMutationSafety-YKTHxqKv.js" with { type: 'file' };
47
- import f44 from "../dist/assets/upstreamPaths-DQeKSxGc.js" with { type: 'file' };
48
- import f45 from "../dist/assets/Settings-UcujwvKv.js" with { type: 'file' };
49
- import f46 from "../dist/assets/Webhooks-DT2LK17V.js" with { type: 'file' };
50
- import f47 from "../dist/assets/Overview-DV2qo5v3.js" with { type: 'file' };
51
- import f48 from "../dist/assets/MetricsPro-B9rD_KQc.js" with { type: 'file' };
52
- import f49 from "../dist/assets/Card-CWxrC8OY.js" with { type: 'file' };
53
- import f50 from "../dist/assets/S3Backup-DNABHR2Q.js" with { type: 'file' };
54
- import f51 from "../dist/assets/QueueDetailPro-ClKtyHIf.js" with { type: 'file' };
55
- import f52 from "../dist/assets/McpServer-fVy27Mof.js" with { type: 'file' };
56
- import f53 from "../dist/assets/ServerControl-BmccMNW9.js" with { type: 'file' };
57
- import f54 from "../dist/assets/Logs-C5PNP9Wq.js" with { type: 'file' };
58
- import f55 from "../dist/assets/controlConnectionEpoch-CZsS0wAb.js" with { type: 'file' };
59
- import f56 from "../dist/assets/exportFile-C7xhE8Yh.js" with { type: 'file' };
60
- import f57 from "../dist/assets/StatusBadge-BoOVTnKu.js" with { type: 'file' };
61
- import f58 from "../dist/assets/LogsPro-B3KwTSsn.js" with { type: 'file' };
62
- import f59 from "../dist/assets/DlqControl-DNJPVOTF.js" with { type: 'file' };
63
- import f60 from "../dist/assets/CronManager-B6xLLgI5.js" with { type: 'file' };
64
- import f61 from "../dist/assets/dist-DZL8soAh.js" with { type: 'file' };
65
- import f62 from "../dist/assets/bq-F5BbTG1T.js" with { type: 'file' };
66
- import f63 from "../dist/assets/responses-BkR2JTH9.js" with { type: 'file' };
67
- import f64 from "../dist/assets/toastStore-IZn6OPLZ.js" with { type: 'file' };
68
- import f65 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
69
- import f66 from "../dist/assets/QueueDetail-COSH9bJl.js" with { type: 'file' };
70
- import f67 from "../dist/assets/QueuesOverview-tokquA3g.js" with { type: 'file' };
71
- import f68 from "../dist/assets/dist-1f1fMHVO.js" with { type: 'file' };
72
- import f69 from "../dist/assets/form-C4oby9pI.js" with { type: 'file' };
73
- import f70 from "../dist/assets/cn-zFEt5SO8.js" with { type: 'file' };
74
- import f71 from "../dist/assets/QueueActions-BWnmNEqV.js" with { type: 'file' };
75
- import f72 from "../dist/assets/Queues-D2-R8nYh.js" with { type: 'file' };
76
- import f73 from "../dist/assets/Workers-BX1qspaQ.js" with { type: 'file' };
77
- import f74 from "../dist/assets/dist-DpZcbP9W.js" with { type: 'file' };
78
- import f75 from "../dist/assets/PageHeader-CvIyaFOO.js" with { type: 'file' };
79
- import f76 from "../dist/assets/flowOperationPolicy-B2Etcb3f.js" with { type: 'file' };
80
- import f77 from "../dist/assets/UsagePro-BGLufsE7.js" with { type: 'file' };
81
- import f78 from "../dist/assets/Cron-1DZTZWXO.js" with { type: 'file' };
82
- import f79 from "../dist/assets/Usage-1KxG1mJ9.js" with { type: 'file' };
83
- import f80 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
84
- import f81 from "../dist/assets/Dlq-MRmkQrNC.js" with { type: 'file' };
5
+ import f2 from "../dist/.vite/manifest.json" with { type: 'file' };
6
+ import f3 from "../dist/assets/Database-BoxVpjts.js" with { type: 'file' };
7
+ import f4 from "../dist/assets/Jobs-IrlneOy6.js" with { type: 'file' };
8
+ import f5 from "../dist/assets/form-DG3X6cLL.js" with { type: 'file' };
9
+ import f6 from "../dist/assets/MetricsPro-ooSvpQ3H.js" with { type: 'file' };
10
+ import f7 from "../dist/assets/react-vendor-CFL9l8LK.js" with { type: 'file' };
11
+ import f8 from "../dist/assets/Workflows-CqZZ96EK.js" with { type: 'file' };
12
+ import f9 from "../dist/assets/controlConnectionEpoch-ChAeMMLk.js" with { type: 'file' };
13
+ import f10 from "../dist/assets/CronManager-Cqtg9Zr8.js" with { type: 'file' };
14
+ import f11 from "../dist/assets/QueueActions-BBxRt-t0.js" with { type: 'file' };
15
+ import f12 from "../dist/assets/connectionStore-CVjQyIZv.js" with { type: 'file' };
16
+ import f13 from "../dist/assets/Benchmark-CHYDL31K.js" with { type: 'file' };
17
+ import f14 from "../dist/assets/UsagePro-BjdeS2zb.js" with { type: 'file' };
18
+ import f15 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
19
+ import f16 from "../dist/assets/ServerControl-SiZBNo9P.js" with { type: 'file' };
20
+ import f17 from "../dist/assets/toastStore-XmMX7A5W.js" with { type: 'file' };
21
+ import f18 from "../dist/assets/WorkersPro-B0f_Nfdz.js" with { type: 'file' };
22
+ import f19 from "../dist/assets/Queues-BAg2nSz0.js" with { type: 'file' };
23
+ import f20 from "../dist/assets/promisePool-BVfQ9n9Q.js" with { type: 'file' };
24
+ import f21 from "../dist/assets/useControlActionGuard-1i7aFA7E.js" with { type: 'file' };
25
+ import f22 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
26
+ import f23 from "../dist/assets/Settings-DR_iqW0T.js" with { type: 'file' };
27
+ import f24 from "../dist/assets/JobInspector-Bw3Gs1Iy.js" with { type: 'file' };
28
+ import f25 from "../dist/assets/install-oydLpc1T.js" with { type: 'file' };
29
+ import f26 from "../dist/assets/QueueDetailPro-BKszqI0M.js" with { type: 'file' };
30
+ import f27 from "../dist/assets/QueueDetail-gSf9Tb7G.js" with { type: 'file' };
31
+ import f28 from "../dist/assets/QueueControl-C01l6bBJ.js" with { type: 'file' };
32
+ import f29 from "../dist/assets/PageHeader-CQzNsw8r.js" with { type: 'file' };
33
+ import f30 from "../dist/assets/index-C9yGKhQ8.css" with { type: 'file' };
34
+ import f31 from "../dist/assets/Button-_aSJvRoW.js" with { type: 'file' };
35
+ import f32 from "../dist/assets/bq-DR2BTISO.js" with { type: 'file' };
36
+ import f33 from "../dist/assets/Workers-C1h6hCPp.js" with { type: 'file' };
37
+ import f34 from "../dist/assets/exportFile-C7xhE8Yh.js" with { type: 'file' };
38
+ import f35 from "../dist/assets/api-D9aT0ND7.js" with { type: 'file' };
39
+ import f36 from "../dist/assets/Card-egIDLwVk.js" with { type: 'file' };
40
+ import f37 from "../dist/assets/Overview-CuWmPRra.js" with { type: 'file' };
41
+ import f38 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
42
+ import f39 from "../dist/assets/Usage-ZWfB7PcR.js" with { type: 'file' };
43
+ import f40 from "../dist/assets/QueuesOverview-BLSjiYsA.js" with { type: 'file' };
44
+ import f41 from "../dist/assets/upstreamPaths-DQeKSxGc.js" with { type: 'file' };
45
+ import f42 from "../dist/assets/index-Bat1DN5U.js" with { type: 'file' };
46
+ import f43 from "../dist/assets/Fleet-Bkbq0dFB.js" with { type: 'file' };
47
+ import f44 from "../dist/assets/responses-BkR2JTH9.js" with { type: 'file' };
48
+ import f45 from "../dist/assets/StatusBadge-DereLzOj.js" with { type: 'file' };
49
+ import f46 from "../dist/assets/AreaChart-Db2UVnaK.js" with { type: 'file' };
50
+ import f47 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
51
+ import f48 from "../dist/assets/Dlq-DHOfgORa.js" with { type: 'file' };
52
+ import f49 from "../dist/assets/Webhooks-BonYUgMo.js" with { type: 'file' };
53
+ import f50 from "../dist/assets/McpServer-DoNFY0Pj.js" with { type: 'file' };
54
+ import f51 from "../dist/assets/S3Backup-Ci4dJPP_.js" with { type: 'file' };
55
+ import f52 from "../dist/assets/BulkAddJobs-GRMVnf0j.js" with { type: 'file' };
56
+ import f53 from "../dist/assets/flowOperationPolicy-B2Etcb3f.js" with { type: 'file' };
57
+ import f54 from "../dist/assets/useServerActionGuard-CUx8TOAC.js" with { type: 'file' };
58
+ import f55 from "../dist/assets/flowMutationSafety-YKTHxqKv.js" with { type: 'file' };
59
+ import f56 from "../dist/assets/Metrics-BkePZiCZ.js" with { type: 'file' };
60
+ import f57 from "../dist/assets/Flows-CDCQrPit.js" with { type: 'file' };
61
+ import f58 from "../dist/assets/rolldown-runtime-QTnfLwEv.js" with { type: 'file' };
62
+ import f59 from "../dist/assets/DlqPro-CfwKDcpc.js" with { type: 'file' };
63
+ import f60 from "../dist/assets/useThroughputSeries-CeFx-Mwq.js" with { type: 'file' };
64
+ import f61 from "../dist/assets/S3BackupPro-DcjlrzC5.js" with { type: 'file' };
65
+ import f62 from "../dist/assets/icons-DH9SS1DA.js" with { type: 'file' };
66
+ import f63 from "../dist/assets/Cron-XL0PdUEc.js" with { type: 'file' };
67
+ import f64 from "../dist/assets/Logs-DG7cK-tF.js" with { type: 'file' };
68
+ import f65 from "../dist/assets/format-Cg7VCIZW.js" with { type: 'file' };
69
+ import f66 from "../dist/assets/feedback-CtGN_kqB.js" with { type: 'file' };
70
+ import f67 from "../dist/assets/JobsPro-vlPd6Ows.js" with { type: 'file' };
71
+ import f68 from "../dist/assets/classicJobsData-Csj4iihY.js" with { type: 'file' };
72
+ import f69 from "../dist/assets/usePolledData-CEyyLRYa.js" with { type: 'file' };
73
+ import f70 from "../dist/assets/Diagnostics-B3QSQuFF.js" with { type: 'file' };
74
+ import f71 from "../dist/assets/LogsPro-ClSqFKys.js" with { type: 'file' };
75
+ import f72 from "../dist/assets/Alerts-DzKKoA9U.js" with { type: 'file' };
76
+ import f73 from "../dist/assets/AddJob-CiwWycYG.js" with { type: 'file' };
77
+ import f74 from "../dist/assets/Pagination-CSkzhNW6.js" with { type: 'file' };
78
+ import f75 from "../dist/assets/DlqControl-BY1e55-x.js" with { type: 'file' };
79
+ import f76 from "../dist/index.html" with { type: 'file' };
85
80
 
86
81
  export const ASSETS: Record<string, string> = {
87
- "/.vite/manifest.json": f0,
82
+ "/favicon.svg": f0,
88
83
  "/og.png": f1,
89
- "/index.html": f2,
90
- "/favicon.svg": f3,
91
- "/assets/index-C9yGKhQ8.css": f4,
92
- "/assets/react-vendor-CvwrP0tU.js": f5,
93
- "/assets/useThroughputSeries-DgO8uicf.js": f6,
94
- "/assets/AddJob-FNaPbs_V.js": f7,
95
- "/assets/AreaChart-DEAalJ6P.js": f8,
96
- "/assets/promisePool-BVfQ9n9Q.js": f9,
97
- "/assets/dist-DjvZiKhB.js": f10,
98
- "/assets/Benchmark-C16tT4pF.js": f11,
99
- "/assets/JobInspector-Ct9Ga-UT.js": f12,
100
- "/assets/icons-BVzwsfbG.js": f13,
101
- "/assets/Pagination-x-Cwgrul.js": f14,
102
- "/assets/index-8Ii-_Rml.js": f15,
103
- "/assets/feedback-QDN1AsYt.js": f16,
104
- "/assets/Jobs-Chqv0RuL.js": f17,
105
- "/assets/useServerActionGuard-uGePilQQ.js": f18,
106
- "/assets/install-oydLpc1T.js": f19,
107
- "/assets/useControlActionGuard-B-bzKZKI.js": f20,
108
- "/assets/Button-Ch1W94fJ.js": f21,
109
- "/assets/DlqPro-CwtTDwGN.js": f22,
110
- "/assets/Fleet-Bdrj9bLI.js": f23,
111
- "/assets/Flows-1dC8F_wx.js": f24,
112
- "/assets/connectionStore-BJLihGaC.js": f25,
113
- "/assets/usePolledData-0CVelkl2.js": f26,
114
- "/assets/api-BgWE-705.js": f27,
115
- "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f28,
116
- "/assets/Workflows-DZZA6aGW.js": f29,
117
- "/assets/format-Cg7VCIZW.js": f30,
118
- "/assets/Alerts-vzIYtFpW.js": f31,
119
- "/assets/CopilotPanel-FlAW3RlL.js": f32,
120
- "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f33,
121
- "/assets/QueueControl-DqBvuDnF.js": f34,
122
- "/assets/JobsPro-CLzOhKAL.js": f35,
123
- "/assets/WorkersPro-BsUQVgQZ.js": f36,
124
- "/assets/Diagnostics-B6apZrC5.js": f37,
125
- "/assets/BulkAddJobs-IiL1uud0.js": f38,
126
- "/assets/Database-DV2pcDLL.js": f39,
127
- "/assets/S3BackupPro-CDX5WQUY.js": f40,
128
- "/assets/dist-BlWBaCN6.js": f41,
129
- "/assets/Metrics-Ba46pdzT.js": f42,
130
- "/assets/flowMutationSafety-YKTHxqKv.js": f43,
131
- "/assets/upstreamPaths-DQeKSxGc.js": f44,
132
- "/assets/Settings-UcujwvKv.js": f45,
133
- "/assets/Webhooks-DT2LK17V.js": f46,
134
- "/assets/Overview-DV2qo5v3.js": f47,
135
- "/assets/MetricsPro-B9rD_KQc.js": f48,
136
- "/assets/Card-CWxrC8OY.js": f49,
137
- "/assets/S3Backup-DNABHR2Q.js": f50,
138
- "/assets/QueueDetailPro-ClKtyHIf.js": f51,
139
- "/assets/McpServer-fVy27Mof.js": f52,
140
- "/assets/ServerControl-BmccMNW9.js": f53,
141
- "/assets/Logs-C5PNP9Wq.js": f54,
142
- "/assets/controlConnectionEpoch-CZsS0wAb.js": f55,
143
- "/assets/exportFile-C7xhE8Yh.js": f56,
144
- "/assets/StatusBadge-BoOVTnKu.js": f57,
145
- "/assets/LogsPro-B3KwTSsn.js": f58,
146
- "/assets/DlqControl-DNJPVOTF.js": f59,
147
- "/assets/CronManager-B6xLLgI5.js": f60,
148
- "/assets/dist-DZL8soAh.js": f61,
149
- "/assets/bq-F5BbTG1T.js": f62,
150
- "/assets/responses-BkR2JTH9.js": f63,
151
- "/assets/toastStore-IZn6OPLZ.js": f64,
152
- "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f65,
153
- "/assets/QueueDetail-COSH9bJl.js": f66,
154
- "/assets/QueuesOverview-tokquA3g.js": f67,
155
- "/assets/dist-1f1fMHVO.js": f68,
156
- "/assets/form-C4oby9pI.js": f69,
157
- "/assets/cn-zFEt5SO8.js": f70,
158
- "/assets/QueueActions-BWnmNEqV.js": f71,
159
- "/assets/Queues-D2-R8nYh.js": f72,
160
- "/assets/Workers-BX1qspaQ.js": f73,
161
- "/assets/dist-DpZcbP9W.js": f74,
162
- "/assets/PageHeader-CvIyaFOO.js": f75,
163
- "/assets/flowOperationPolicy-B2Etcb3f.js": f76,
164
- "/assets/UsagePro-BGLufsE7.js": f77,
165
- "/assets/Cron-1DZTZWXO.js": f78,
166
- "/assets/Usage-1KxG1mJ9.js": f79,
167
- "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f80,
168
- "/assets/Dlq-MRmkQrNC.js": f81,
84
+ "/.vite/manifest.json": f2,
85
+ "/assets/Database-BoxVpjts.js": f3,
86
+ "/assets/Jobs-IrlneOy6.js": f4,
87
+ "/assets/form-DG3X6cLL.js": f5,
88
+ "/assets/MetricsPro-ooSvpQ3H.js": f6,
89
+ "/assets/react-vendor-CFL9l8LK.js": f7,
90
+ "/assets/Workflows-CqZZ96EK.js": f8,
91
+ "/assets/controlConnectionEpoch-ChAeMMLk.js": f9,
92
+ "/assets/CronManager-Cqtg9Zr8.js": f10,
93
+ "/assets/QueueActions-BBxRt-t0.js": f11,
94
+ "/assets/connectionStore-CVjQyIZv.js": f12,
95
+ "/assets/Benchmark-CHYDL31K.js": f13,
96
+ "/assets/UsagePro-BjdeS2zb.js": f14,
97
+ "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f15,
98
+ "/assets/ServerControl-SiZBNo9P.js": f16,
99
+ "/assets/toastStore-XmMX7A5W.js": f17,
100
+ "/assets/WorkersPro-B0f_Nfdz.js": f18,
101
+ "/assets/Queues-BAg2nSz0.js": f19,
102
+ "/assets/promisePool-BVfQ9n9Q.js": f20,
103
+ "/assets/useControlActionGuard-1i7aFA7E.js": f21,
104
+ "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f22,
105
+ "/assets/Settings-DR_iqW0T.js": f23,
106
+ "/assets/JobInspector-Bw3Gs1Iy.js": f24,
107
+ "/assets/install-oydLpc1T.js": f25,
108
+ "/assets/QueueDetailPro-BKszqI0M.js": f26,
109
+ "/assets/QueueDetail-gSf9Tb7G.js": f27,
110
+ "/assets/QueueControl-C01l6bBJ.js": f28,
111
+ "/assets/PageHeader-CQzNsw8r.js": f29,
112
+ "/assets/index-C9yGKhQ8.css": f30,
113
+ "/assets/Button-_aSJvRoW.js": f31,
114
+ "/assets/bq-DR2BTISO.js": f32,
115
+ "/assets/Workers-C1h6hCPp.js": f33,
116
+ "/assets/exportFile-C7xhE8Yh.js": f34,
117
+ "/assets/api-D9aT0ND7.js": f35,
118
+ "/assets/Card-egIDLwVk.js": f36,
119
+ "/assets/Overview-CuWmPRra.js": f37,
120
+ "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f38,
121
+ "/assets/Usage-ZWfB7PcR.js": f39,
122
+ "/assets/QueuesOverview-BLSjiYsA.js": f40,
123
+ "/assets/upstreamPaths-DQeKSxGc.js": f41,
124
+ "/assets/index-Bat1DN5U.js": f42,
125
+ "/assets/Fleet-Bkbq0dFB.js": f43,
126
+ "/assets/responses-BkR2JTH9.js": f44,
127
+ "/assets/StatusBadge-DereLzOj.js": f45,
128
+ "/assets/AreaChart-Db2UVnaK.js": f46,
129
+ "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f47,
130
+ "/assets/Dlq-DHOfgORa.js": f48,
131
+ "/assets/Webhooks-BonYUgMo.js": f49,
132
+ "/assets/McpServer-DoNFY0Pj.js": f50,
133
+ "/assets/S3Backup-Ci4dJPP_.js": f51,
134
+ "/assets/BulkAddJobs-GRMVnf0j.js": f52,
135
+ "/assets/flowOperationPolicy-B2Etcb3f.js": f53,
136
+ "/assets/useServerActionGuard-CUx8TOAC.js": f54,
137
+ "/assets/flowMutationSafety-YKTHxqKv.js": f55,
138
+ "/assets/Metrics-BkePZiCZ.js": f56,
139
+ "/assets/Flows-CDCQrPit.js": f57,
140
+ "/assets/rolldown-runtime-QTnfLwEv.js": f58,
141
+ "/assets/DlqPro-CfwKDcpc.js": f59,
142
+ "/assets/useThroughputSeries-CeFx-Mwq.js": f60,
143
+ "/assets/S3BackupPro-DcjlrzC5.js": f61,
144
+ "/assets/icons-DH9SS1DA.js": f62,
145
+ "/assets/Cron-XL0PdUEc.js": f63,
146
+ "/assets/Logs-DG7cK-tF.js": f64,
147
+ "/assets/format-Cg7VCIZW.js": f65,
148
+ "/assets/feedback-CtGN_kqB.js": f66,
149
+ "/assets/JobsPro-vlPd6Ows.js": f67,
150
+ "/assets/classicJobsData-Csj4iihY.js": f68,
151
+ "/assets/usePolledData-CEyyLRYa.js": f69,
152
+ "/assets/Diagnostics-B3QSQuFF.js": f70,
153
+ "/assets/LogsPro-ClSqFKys.js": f71,
154
+ "/assets/Alerts-DzKKoA9U.js": f72,
155
+ "/assets/AddJob-CiwWycYG.js": f73,
156
+ "/assets/Pagination-CSkzhNW6.js": f74,
157
+ "/assets/DlqControl-BY1e55-x.js": f75,
158
+ "/index.html": f76,
169
159
  };
package/scripts/serve.ts CHANGED
@@ -4,9 +4,10 @@
4
4
  * local control agent through a same-origin /agent bridge.
5
5
  */
6
6
  import { logger } from '../agent/logger';
7
+ import { compiledWorkerUrl } from '../agent/compiledRuntime';
8
+ import { agentConfigStore } from '../agent/manager/configStore';
7
9
  import { BunqueueBackupRunner } from '../agent/backup/runner';
8
10
  import { setBackupWorkerUrl } from '../agent/backup/workerFactory';
9
- import { setQueryWorkerUrl } from '../agent/db';
10
11
  import { QueueOperationsRuntime } from '../agent/queue/runtime';
11
12
  import {
12
13
  AgentLifecycleGate,
@@ -50,18 +51,7 @@ export {
50
51
  } from './servePolicy';
51
52
 
52
53
  async function main(): Promise<void> {
53
- // Compiled Bun entrypoints load the query worker from the embedded bundle.
54
- const compiled = import.meta.url.includes('/$bunfs/');
55
- setQueryWorkerUrl(
56
- compiled
57
- ? new URL('/$bunfs/root/agent/dbQueryWorker.js', 'file:///').href
58
- : new URL('../agent/dbQueryWorker.ts', import.meta.url).href
59
- );
60
- setBackupWorkerUrl(
61
- compiled
62
- ? new URL('/$bunfs/root/agent/backup/standaloneWorker.js', 'file:///').href
63
- : null
64
- );
54
+ setBackupWorkerUrl(compiledWorkerUrl(import.meta.url, 'agent/backup/standaloneWorker.js'));
65
55
 
66
56
  const port = Number(process.env.PORT) || 8080;
67
57
  const host = process.env.BIND_ADDR || '127.0.0.1';
@@ -109,7 +99,7 @@ async function main(): Promise<void> {
109
99
 
110
100
  // Keep ProcessManager out of policy-only test imports.
111
101
  const { ProcessManager } = await import('../agent/manager');
112
- const mgr = new ProcessManager();
102
+ const mgr = new ProcessManager(undefined, agentConfigStore());
113
103
  const workflowRuntime = new WorkflowRuntime();
114
104
  const backupRunner = new BunqueueBackupRunner();
115
105
  const queueRuntime = new QueueOperationsRuntime();
@@ -198,4 +188,9 @@ async function main(): Promise<void> {
198
188
  );
199
189
  }
200
190
 
201
- if (import.meta.main) await main();
191
+ if (import.meta.main) {
192
+ if (process.argv.includes('--bq-db-read')) {
193
+ const { runDatabaseReadProcess } = await import('../agent/db/readProcessMain');
194
+ await runDatabaseReadProcess();
195
+ } else await main();
196
+ }
@@ -26,6 +26,33 @@ function assetContentType(pathname: string): string | undefined {
26
26
  return dot === -1 ? undefined : ASSET_CONTENT_TYPES[pathname.slice(dot).toLowerCase()];
27
27
  }
28
28
 
29
+ // Hop-by-hop and browser-scoped headers that must not reach BUNQUEUE_URL. The
30
+ // upstream Host must come from the target URL (fetch derives it) so host-routed
31
+ // proxies/ingresses in front of bunqueue still match; dashboard cookies stay
32
+ // on the dashboard origin. Authorization is forwarded on purpose.
33
+ const NON_FORWARDED_API_HEADERS = [
34
+ 'host',
35
+ 'cookie',
36
+ 'connection',
37
+ 'keep-alive',
38
+ 'proxy-connection',
39
+ 'te',
40
+ 'trailer',
41
+ 'transfer-encoding',
42
+ 'upgrade',
43
+ ];
44
+
45
+ export function upstreamHeaders(incoming: Headers): Headers {
46
+ const headers = new Headers(incoming);
47
+ // RFC 9110 §7.6.1: headers named in Connection are hop-by-hop as well.
48
+ for (const name of (headers.get('connection') ?? '').split(',')) {
49
+ const option = name.trim();
50
+ if (option) headers.delete(option);
51
+ }
52
+ for (const name of NON_FORWARDED_API_HEADERS) headers.delete(name);
53
+ return headers;
54
+ }
55
+
29
56
  /** Static assets, the admin proxy, and the same-origin agent bridge. */
30
57
  export function createServeHandler(opts: ServeHandlerOptions) {
31
58
  const {
@@ -137,7 +164,7 @@ export function createServeHandler(opts: ServeHandlerOptions) {
137
164
  try {
138
165
  res = await fetch(target, {
139
166
  method: req.method,
140
- headers: req.headers,
167
+ headers: upstreamHeaders(req.headers),
141
168
  body: req.body,
142
169
  redirect: 'manual',
143
170
  signal,
@@ -1,3 +0,0 @@
1
- import{i as e,r as t}from"./cn-zFEt5SO8.js";import{g as n,l as r,r as i,t as a}from"./react-vendor-CvwrP0tU.js";import{i as o}from"./upstreamPaths-DQeKSxGc.js";import{r as s,t as c}from"./bq-F5BbTG1T.js";import{t as l}from"./toastStore-IZn6OPLZ.js";import{n as u}from"./usePolledData-0CVelkl2.js";import{t as d}from"./Button-Ch1W94fJ.js";import{n as f,t as p}from"./Card-CWxrC8OY.js";import{t as m}from"./PageHeader-CvIyaFOO.js";import{a as h,n as g,o as _,t as v}from"./form-C4oby9pI.js";import{r as y}from"./useServerActionGuard-uGePilQQ.js";import{a as b,c as x,d as S,f as C,h as w,i as T,l as E,m as D,n as O,o as k,r as A,s as j,t as M,u as N}from"./responses-BkR2JTH9.js";var P=e(n(),1),F=a();function I({values:e,setValue:t,queueNames:n,queueDiscoveryError:r,onRetryQueues:i,jsonError:a,setJsonError:o}){return(0,F.jsxs)(p,{children:[(0,F.jsx)(f,{title:`Job`}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,F.jsxs)(v,{label:`Queue`,children:[(0,F.jsx)(g,{list:`queue-options`,"aria-label":`Queue`,name:`target-queue`,autoComplete:`off`,value:e.queue,onChange:e=>t(`queue`,e.target.value),placeholder:`queue name (existing or new)`}),(0,F.jsx)(`datalist`,{id:`queue-options`,children:n.map(e=>(0,F.jsx)(`option`,{value:e},e))})]}),(0,F.jsx)(v,{label:`Job name`,hint:`Worker routing name in Bunqueue 2.9.3; separate from the JSON payload.`,children:(0,F.jsx)(g,{name:`job-name`,autoComplete:`off`,maxLength:256,value:e.name,onChange:e=>t(`name`,e.target.value),placeholder:`default`})}),r&&(0,F.jsxs)(`p`,{role:`status`,className:`-mt-2 text-xs text-warning`,children:[`Existing queue suggestions unavailable — `,r.message,`. You can still enter a queue name manually.`,` `,(0,F.jsx)(`button`,{type:`button`,onClick:i,className:`font-medium underline underline-offset-2 hover:text-fg`,children:`Retry`})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(v,{label:`Data (JSON)`,children:(0,F.jsx)(`textarea`,{name:`job-data`,value:e.dataText,onChange:e=>t(`dataText`,e.target.value),onBlur:()=>{let t=w(e.dataText);o(t.ok?null:t.msg)},maxLength:D,spellCheck:!1,rows:7,className:`w-full rounded-lg border border-line bg-surface-2 p-3 font-mono text-sm text-fg focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})}),a&&(0,F.jsx)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:a})]})]})]})}function L({values:e,setValue:t}){return(0,F.jsxs)(p,{children:[(0,F.jsx)(f,{title:`Options`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,F.jsx)(B,{label:e.groupId.trim()?`Group priority`:`Priority`,hint:e.groupId.trim()?`0 is highest within this group`:void 0,name:`priority`,value:e.priority,min:e.groupId.trim()?0:-1e6,max:e.groupId.trim()?k:1e6,placeholder:`0`,onChange:e=>t(`priority`,e)}),(0,F.jsx)(B,{label:`Delay (ms)`,name:`delay`,value:e.delay,min:0,max:T,placeholder:`0`,disabled:e.runAt.trim()!==``,onChange:e=>t(`delay`,e)}),(0,F.jsx)(v,{label:`Run at`,hint:e.runAt.trim()?`Overrides Delay — derived from this time (local time).`:`(local time)`,children:(0,F.jsx)(g,{type:`datetime-local`,name:`run-at`,value:e.runAt,onChange:e=>t(`runAt`,e.target.value)})}),(0,F.jsx)(B,{label:`Max attempts`,hint:`blank = server default`,name:`max-attempts`,value:e.maxAttempts,min:1,max:1e3,placeholder:`3`,onChange:e=>t(`maxAttempts`,e)}),(0,F.jsx)(B,{label:`Backoff (ms)`,hint:`blank = server default`,name:`backoff`,value:e.backoff,min:0,max:b,placeholder:`1000`,onChange:e=>t(`backoff`,e)}),(0,F.jsx)(v,{label:`Backoff strategy`,hint:`flat delay unless set`,children:(0,F.jsxs)(h,{name:`backoff-strategy`,value:e.backoffType,onChange:e=>t(`backoffType`,e.target.value),children:[(0,F.jsx)(`option`,{value:``,children:`flat`}),(0,F.jsx)(`option`,{value:`fixed`,children:`fixed`}),(0,F.jsx)(`option`,{value:`exponential`,children:`exponential`})]})}),(0,F.jsx)(B,{label:`Timeout (ms)`,name:`timeout`,value:e.timeout,min:0,max:b,placeholder:`—`,onChange:e=>t(`timeout`,e)}),(0,F.jsx)(B,{label:`TTL (ms)`,hint:`blank = no expiry`,name:`ttl`,value:e.ttl,min:0,max:T,placeholder:`—`,onChange:e=>t(`ttl`,e)}),(0,F.jsx)(v,{label:`Custom job ID`,children:(0,F.jsx)(g,{name:`custom-job-id`,value:e.jobId,onChange:e=>t(`jobId`,e.target.value),placeholder:`idempotency key`})})]}),(0,F.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-6`,children:[(0,F.jsx)(V,{label:`removeOnComplete`,checked:e.removeOnComplete,onChange:e=>t(`removeOnComplete`,e)}),(0,F.jsx)(V,{label:`removeOnFail`,checked:e.removeOnFail,onChange:e=>t(`removeOnFail`,e)}),(0,F.jsx)(V,{label:`durable`,checked:e.durable,onChange:e=>t(`durable`,e)}),(0,F.jsx)(V,{label:`lifo`,checked:e.lifo,onChange:e=>t(`lifo`,e)})]}),(0,F.jsx)(R,{values:e,setValue:t})]})}function R({values:e,setValue:t}){return(0,F.jsxs)(`div`,{className:`mt-4 border-t border-line pt-4`,children:[(0,F.jsx)(`div`,{className:`mb-3 text-[11px] uppercase tracking-wider text-faint`,children:`Advanced`}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 md:grid-cols-3`,children:[(0,F.jsx)(z,{label:`Tags`,hint:`comma-separated`,name:`tags`,value:e.tags,placeholder:`email, urgent`,onChange:e=>t(`tags`,e)}),(0,F.jsx)(z,{label:`Group ID`,name:`group-id`,value:e.groupId,placeholder:`—`,onChange:e=>t(`groupId`,e)}),(0,F.jsx)(B,{label:`Group max size`,hint:`Atomic pending-job cap (2.9.3)`,name:`group-max-size`,value:e.groupMaxSize,min:1,max:2**53-1,placeholder:`—`,onChange:e=>t(`groupMaxSize`,e)}),(0,F.jsx)(z,{label:`Unique key`,hint:`dedup key`,name:`unique-key`,value:e.uniqueKey,placeholder:`—`,onChange:e=>t(`uniqueKey`,e)}),(0,F.jsx)(z,{label:`Depends on`,hint:`parent job ids, comma-separated`,name:`depends-on`,value:e.dependsOn,placeholder:`job-id-1, job-id-2`,onChange:e=>t(`dependsOn`,e)}),(0,F.jsx)(`div`,{className:`col-span-2 md:col-span-3`,children:(0,F.jsx)(v,{label:`Repeat policy (JSON)`,hint:`v2.9.3-safe form: e.g. {"every":60000,"limit":10}. Use Cron Manager for cron patterns.`,children:(0,F.jsx)(`textarea`,{name:`repeat-policy`,value:e.repeatText,onChange:e=>t(`repeatText`,e.target.value),rows:2,spellCheck:!1,placeholder:`{"every": 60000}`,className:`w-full rounded-lg border border-line bg-surface-2 px-3 py-2 font-mono text-xs text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none focus:ring-2 focus:ring-accent/30`})})})]})]})}function z({label:e,hint:t,name:n,value:r,placeholder:i,onChange:a}){return(0,F.jsx)(v,{label:e,hint:t,children:(0,F.jsx)(g,{name:n,value:r,onChange:e=>a(e.target.value),placeholder:i})})}function B({label:e,hint:t,name:n,value:r,min:i,max:a,placeholder:o,disabled:s,onChange:c}){return(0,F.jsx)(v,{label:e,hint:t,children:(0,F.jsx)(g,{type:`number`,min:i,max:a,step:1,name:n,value:r,onChange:e=>c(e.target.value),placeholder:o,disabled:s})})}function V({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(_,{checked:t,onChange:n,label:e}),(0,F.jsx)(`span`,{className:`font-mono text-xs text-muted`,children:e})]})}function H(e){let t=e?.options??{},n=j(t);return{queue:e?.queue??``,name:e?.name??`default`,dataText:e?.dataText??`{
2
- "hello": "world"
3
- }`,count:`1`,priority:x(t.priority),delay:``,runAt:``,maxAttempts:x(t.maxAttempts),backoff:n.backoff,timeout:x(t.timeout),ttl:n.ttl,jobId:``,removeOnComplete:t.removeOnComplete??!1,removeOnFail:t.removeOnFail??!1,durable:!1,lifo:!1,backoffType:n.backoffType,tags:n.tags,groupId:n.groupId,groupMaxSize:``,dependsOn:``,uniqueKey:``,repeatText:``}}function U(e,t=Date.now()){let n=e.queue.trim(),r=S(n);if(r)return W(r);let i=e.name.trim();if(!i||i.length>256)return W(`Job name must be a non-empty string of at most 256 characters`);let a=w(e.dataText);if(!a.ok)return{ok:!1,msg:a.msg,field:a.kind===`json`?`data`:`result`};let s=e.groupId.trim();if(s.length>256||s.includes(`\0`))return W(`Group ID must contain 1–256 characters and no NUL`);let c=E({priority:e.priority,delay:e.runAt.trim()?``:e.delay,maxAttempts:e.maxAttempts,backoff:e.backoff,timeout:e.timeout,ttl:e.ttl,groupMaxSize:e.groupMaxSize},!!s);if(!c.ok)return W(c.msg);if(c.options.groupMaxSize!==void 0&&!s)return W(`Group max size requires a Group ID`);let l=c.options.delay;if(e.runAt.trim()){let n=new Date(e.runAt).getTime();if(!Number.isFinite(n))return W(`Run at is not a valid date/time`);if(l=Math.max(0,n-t),l>31536e6)return W(`Run at must be within the next 365 days`)}let u=C(c.options.backoff,e.backoffType);if(!u.ok)return W(u.msg);let d=G(e.tags),f=G(e.dependsOn),p=e.jobId.trim();if(p){let e=o(p);if(e)return W(`Job ID: ${e}`)}for(let e of f){let t=o(e);if(t)return W(`Dependency ID "${e}": ${t}`)}let m=N(e.repeatText);if(!m.ok)return W(m.msg);let h=Number(e.count);return!Number.isSafeInteger(h)||h<1||h>1e4?W(`Count must be a whole number from 1 to 10000`):{ok:!0,target:n,count:h,body:{name:i,data:a.data,priority:c.options.priority,delay:l,maxAttempts:c.options.maxAttempts,backoff:u.backoff,timeout:c.options.timeout,ttl:c.options.ttl,jobId:p||void 0,removeOnComplete:e.removeOnComplete||void 0,removeOnFail:e.removeOnFail||void 0,durable:e.durable||void 0,lifo:e.lifo||void 0,tags:d.length?d:void 0,groupId:s||void 0,groupMaxSize:c.options.groupMaxSize,dependsOn:f.length?f:void 0,uniqueKey:e.uniqueKey.trim()||void 0,repeat:m.repeat}}}var W=e=>({ok:!1,msg:e,field:`result`}),G=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),K=t({AddJob:()=>q,MAX_JOB_DATA_BYTES:()=>MAX_JOB_DATA_BYTES,MAX_JOB_DATA_CHARS:()=>D});function q(){let{data:e,error:t,refetch:n}=u(()=>c.queues(),[],{intervalMs:3e4}),a=r().state?.clone,[o,f]=(0,P.useState)(()=>H(a)),[p,h]=(0,P.useState)(!1),[_,b]=(0,P.useState)(null),[x,S]=(0,P.useState)(null),C=y(`add-job`),w=(e,t)=>f(n=>({...n,[e]:t}));(0,P.useEffect)(()=>{h(!1),b(null),S(null)},[C.scopeKey]);let T=async()=>{b(null),S(null);let e=U(o);if(!e.ok){e.field===`data`?S(e.msg):b({ok:!1,msg:e.msg});return}let t=C.begin();if(!t)return;h(!0);let{target:n,body:r,count:i}=e;try{if(i===1&&r.groupMaxSize===void 0){let e=O(await c.addJob(n,r));if(!t.isCurrent())return;b({ok:!0,msg:`Accepted job ID ${e} (it may be an existing deduplicated job)`}),l.success(`Job submission accepted`,`${n} · ${e}`)}else{let e=Array.from({length:i},()=>r),a=s(e);if(a){t.isCurrent()&&b({ok:!1,msg:a});return}let o=M(await c.addJobsBulk(n,e),i);if(!t.isCurrent())return;let u=A(new Set(o).size,i);b(u),l.success(u.msg,`in ${n}`)}}catch(e){if(!t.isCurrent())return;b({ok:!1,msg:e.message}),l.error(`Add job failed`,e.message)}finally{t.finish()&&h(!1)}};return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(m,{title:`Add Job`,description:`Enqueue a job with full options.`,actions:(0,F.jsx)(i,{to:`/jobs/bulk-add`,className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg`,children:`Bulk import`})}),a&&(0,F.jsx)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-accent/30 bg-accent/[0.06] px-4 py-2 text-sm text-accent`,children:`Pre-filled from an existing job. Review the data and options, then enqueue a fresh job.`}),(0,F.jsxs)(`form`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,onSubmit:e=>{e.preventDefault(),T()},children:[(0,F.jsx)(I,{values:o,setValue:w,queueNames:(e?.queues??[]).map(e=>e.name),queueDiscoveryError:t,onRetryQueues:()=>void n(),jsonError:x,setJsonError:S}),(0,F.jsx)(L,{values:o,setValue:w}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3 lg:col-span-2`,children:[(0,F.jsx)(`div`,{className:`w-28`,children:(0,F.jsx)(v,{label:`Count`,hint:`1–10000`,children:(0,F.jsx)(g,{type:`number`,min:1,max:1e4,step:1,name:`count`,value:o.count,onChange:e=>w(`count`,e.target.value)})})}),(0,F.jsx)(d,{type:`submit`,variant:`accent`,disabled:p,children:p?`Adding…`:`Add job`}),_&&(0,F.jsx)(`span`,{role:_.ok?`status`:`alert`,className:_.ok?`text-sm text-success`:`text-sm text-danger`,children:_.msg})]})]})]})}export{K as t};