bunqueue-dashboard 0.0.42 → 0.0.44

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 (49) hide show
  1. package/README.md +30 -12
  2. package/agent/flow/routes.ts +2 -0
  3. package/agent/flow/service.ts +7 -2
  4. package/agent/managedConnection.ts +35 -0
  5. package/agent/manager/config.ts +1 -1
  6. package/agent/queue/runtime.ts +2 -2
  7. package/agent/workflow/runtime.ts +2 -6
  8. package/agent/workflow/runtimeConfig.ts +2 -2
  9. package/dist/.vite/manifest.json +40 -39
  10. package/dist/assets/{Alerts-BvWBv-z7.js → Alerts-C961Al5D.js} +1 -1
  11. package/dist/assets/{Benchmark-BywalSmU.js → Benchmark-DQNZV7dM.js} +1 -1
  12. package/dist/assets/{CopilotPanel-CH2jbbYA.js → CopilotPanel-Dlm8XwBj.js} +1 -1
  13. package/dist/assets/{Database-BzEkXws0.js → Database-DGM2BIHy.js} +1 -1
  14. package/dist/assets/{Diagnostics-CPqhV3er.js → Diagnostics-_Sh3UyaT.js} +1 -1
  15. package/dist/assets/{Dlq-CbLN0zQ5.js → Dlq-mtInIoTh.js} +1 -1
  16. package/dist/assets/{DlqControl-C5Bgzmk0.js → DlqControl-Lq9ISb9b.js} +1 -1
  17. package/dist/assets/{DlqPro-Cgaxtuwh.js → DlqPro-0_75vrd1.js} +1 -1
  18. package/dist/assets/Flows-CE7KzaFN.js +2 -0
  19. package/dist/assets/{JobInspector-DsOt4mLJ.js → JobInspector-DyWZk1eW.js} +1 -1
  20. package/dist/assets/{Jobs-BTMpbAHD.js → Jobs-ELSH1Wbd.js} +1 -1
  21. package/dist/assets/JobsPro-BlWwDeFN.js +1 -0
  22. package/dist/assets/{Logs-uuzU5ohI.js → Logs-DMukqmHy.js} +1 -1
  23. package/dist/assets/{LogsPro-DHWbhWyq.js → LogsPro-BfYbmZHi.js} +1 -1
  24. package/dist/assets/{McpServer-BqmbhrKh.js → McpServer-DNrOEp9j.js} +1 -1
  25. package/dist/assets/{Metrics-DKyBZoFa.js → Metrics-Cm5ZvfTo.js} +1 -1
  26. package/dist/assets/{MetricsPro-BR2ULqIc.js → MetricsPro-C9g1sp-u.js} +1 -1
  27. package/dist/assets/{Overview-ClsyxH2e.js → Overview-CKAA3h9f.js} +1 -1
  28. package/dist/assets/{QueueControl-BW0XXd0B.js → QueueControl-Bvm8GUQa.js} +1 -1
  29. package/dist/assets/{QueueDetail-C1dXXN70.js → QueueDetail-BRDATlp0.js} +1 -1
  30. package/dist/assets/{QueueDetailPro-DDGxs2J2.js → QueueDetailPro-Dkz4-1wn.js} +1 -1
  31. package/dist/assets/{Queues-DkPuIy1C.js → Queues-BV99vr68.js} +1 -1
  32. package/dist/assets/{QueuesOverview-COo-V8D_.js → QueuesOverview-CT6JBaim.js} +1 -1
  33. package/dist/assets/{S3BackupPro-DxNVFvY1.js → S3BackupPro-CjR0y18n.js} +1 -1
  34. package/dist/assets/{ServerControl-B0Po974t.js → ServerControl-BH6Doax0.js} +1 -1
  35. package/dist/assets/{Settings-z9k4EVa_.js → Settings-CL7odwoU.js} +1 -1
  36. package/dist/assets/{Usage-cdWDQUaq.js → Usage-BWZkz7Se.js} +1 -1
  37. package/dist/assets/{UsagePro-DLuwnM8n.js → UsagePro-CoBbI-Cl.js} +1 -1
  38. package/dist/assets/{Workers-CVo9rJ_V.js → Workers-CBEDvXm_.js} +1 -1
  39. package/dist/assets/{WorkersPro-BYaredE9.js → WorkersPro-Dk4NfplT.js} +1 -1
  40. package/dist/assets/flowOperationPolicy-B2Etcb3f.js +1 -0
  41. package/dist/assets/{index-mID5W7vq.js → index-BFW2_47n.js} +3 -3
  42. package/dist/assets/{install-D4uRZ7XA.js → install-oydLpc1T.js} +1 -1
  43. package/dist/index.html +1 -1
  44. package/package.json +8 -5
  45. package/scripts/embedded.gen.ts +164 -164
  46. package/shared/flowOperationPolicy.ts +66 -0
  47. package/dist/assets/Flows-BtUGOaif.js +0 -2
  48. package/dist/assets/JobsPro-BfXTm9gH.js +0 -1
  49. package/dist/assets/jobActions-LQD4KfCc.js +0 -1
package/dist/index.html CHANGED
@@ -49,7 +49,7 @@
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-mID5W7vq.js"></script>
52
+ <script type="module" crossorigin src="./assets/index-BFW2_47n.js"></script>
53
53
  <link rel="modulepreload" crossorigin href="./assets/cn-zFEt5SO8.js">
54
54
  <link rel="modulepreload" crossorigin href="./assets/react-vendor-CvwrP0tU.js">
55
55
  <link rel="modulepreload" crossorigin href="./assets/connectionStore-BJLihGaC.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunqueue-dashboard",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
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.0).",
6
6
  "packageManager": "bun@1.4.0",
@@ -14,7 +14,8 @@
14
14
  "scripts/servePolicy.ts",
15
15
  "scripts/bunVersion.ts",
16
16
  "scripts/embedded.gen.ts",
17
- "agent"
17
+ "agent",
18
+ "shared"
18
19
  ],
19
20
  "publishConfig": {
20
21
  "access": "public"
@@ -55,8 +56,9 @@
55
56
  "dev": "vite",
56
57
  "agent": "bun run agent/index.ts",
57
58
  "build": "bun run typecheck && vite build",
58
- "typecheck": "tsc --noEmit && bun run typecheck:agent",
59
+ "typecheck": "tsc --noEmit && bun run typecheck:agent && bun run typecheck:examples",
59
60
  "typecheck:agent": "tsc -p tsconfig.agent.json",
61
+ "typecheck:examples": "tsc -p tsconfig.examples.json",
60
62
  "size": "bun run scripts/check-bundle.ts",
61
63
  "version:check": "bun run scripts/check-bun-version.ts",
62
64
  "architecture": "bun run scripts/check-file-size.ts",
@@ -71,7 +73,8 @@
71
73
  "test:e2e:upgrade": "bun run scripts/validate-sqlite-upgrade-runtime.ts",
72
74
  "test:e2e:workflow": "bun run scripts/validate-workflow-runtime.ts",
73
75
  "test:e2e:postgres-fleet": "bun run scripts/validate-postgres-fleet-runtime.ts",
74
- "test:e2e": "bun run test:e2e:upgrade && bun run test:e2e:flow && bun run test:e2e:workflow && bun run test:e2e:queue-operations && bun run test:e2e:postgres-fleet",
76
+ "test:e2e:tls": "bun run scripts/validate-tls-runtime.ts",
77
+ "test:e2e": "bun run test:e2e:tls && bun run test:e2e:upgrade && bun run test:e2e:flow && bun run test:e2e:workflow && bun run test:e2e:queue-operations && bun run test:e2e:postgres-fleet",
75
78
  "test:e2e:browser:install": "playwright install chromium firefox webkit",
76
79
  "test:e2e:browser:serve": "bun e2e/runtime.ts",
77
80
  "test:e2e:browser:postgres-fleet": "bun run scripts/validate-postgres-fleet-dashboard-runtime.ts",
@@ -130,7 +133,7 @@
130
133
  "postcss": "^8.5.25"
131
134
  },
132
135
  "dependencies": {
133
- "bunqueue": "2.9.3",
136
+ "bunqueue": "2.9.4",
134
137
  "msgpackr": "^1.11.8"
135
138
  }
136
139
  }
@@ -1,169 +1,169 @@
1
1
  // @ts-nocheck
2
2
  // AUTO-GENERATED by scripts/gen-embed.ts — do not edit, not committed.
3
- import f0 from "../dist/index.html" with { type: 'file' };
4
- import f1 from "../dist/favicon.svg" with { type: 'file' };
5
- import f2 from "../dist/og.png" with { type: 'file' };
6
- import f3 from "../dist/assets/usePolledData-0CVelkl2.js" with { type: 'file' };
7
- import f4 from "../dist/assets/Cron-1DZTZWXO.js" with { type: 'file' };
8
- import f5 from "../dist/assets/Webhooks-DT2LK17V.js" with { type: 'file' };
9
- import f6 from "../dist/assets/McpServer-BqmbhrKh.js" with { type: 'file' };
10
- import f7 from "../dist/assets/flowMutationSafety-YKTHxqKv.js" with { type: 'file' };
11
- import f8 from "../dist/assets/BulkAddJobs-IiL1uud0.js" with { type: 'file' };
12
- import f9 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
13
- import f10 from "../dist/assets/icons-BVzwsfbG.js" with { type: 'file' };
14
- import f11 from "../dist/assets/Workers-CVo9rJ_V.js" with { type: 'file' };
15
- import f12 from "../dist/assets/feedback-QDN1AsYt.js" with { type: 'file' };
16
- import f13 from "../dist/assets/connectionStore-BJLihGaC.js" with { type: 'file' };
17
- import f14 from "../dist/assets/react-vendor-CvwrP0tU.js" with { type: 'file' };
18
- import f15 from "../dist/assets/S3Backup-DNABHR2Q.js" with { type: 'file' };
19
- import f16 from "../dist/assets/StatusBadge-BoOVTnKu.js" with { type: 'file' };
20
- import f17 from "../dist/assets/Button-Ch1W94fJ.js" with { type: 'file' };
21
- import f18 from "../dist/assets/exportFile-C7xhE8Yh.js" with { type: 'file' };
22
- import f19 from "../dist/assets/Usage-cdWDQUaq.js" with { type: 'file' };
23
- import f20 from "../dist/assets/responses-BkR2JTH9.js" with { type: 'file' };
24
- import f21 from "../dist/assets/dist-DjvZiKhB.js" with { type: 'file' };
25
- import f22 from "../dist/assets/Logs-uuzU5ohI.js" with { type: 'file' };
26
- import f23 from "../dist/assets/CopilotPanel-CH2jbbYA.js" with { type: 'file' };
27
- import f24 from "../dist/assets/Dlq-CbLN0zQ5.js" with { type: 'file' };
28
- import f25 from "../dist/assets/Overview-ClsyxH2e.js" with { type: 'file' };
29
- import f26 from "../dist/assets/form-C4oby9pI.js" with { type: 'file' };
30
- import f27 from "../dist/assets/DlqPro-Cgaxtuwh.js" with { type: 'file' };
31
- import f28 from "../dist/assets/Jobs-BTMpbAHD.js" with { type: 'file' };
32
- import f29 from "../dist/assets/QueueDetailPro-DDGxs2J2.js" with { type: 'file' };
33
- import f30 from "../dist/assets/Settings-z9k4EVa_.js" with { type: 'file' };
34
- import f31 from "../dist/assets/controlConnectionEpoch-CZsS0wAb.js" with { type: 'file' };
35
- import f32 from "../dist/assets/AddJob-FNaPbs_V.js" with { type: 'file' };
36
- import f33 from "../dist/assets/AreaChart-DEAalJ6P.js" with { type: 'file' };
37
- import f34 from "../dist/assets/MetricsPro-BR2ULqIc.js" with { type: 'file' };
38
- import f35 from "../dist/assets/Pagination-x-Cwgrul.js" with { type: 'file' };
39
- import f36 from "../dist/assets/UsagePro-DLuwnM8n.js" with { type: 'file' };
40
- import f37 from "../dist/assets/Diagnostics-CPqhV3er.js" with { type: 'file' };
41
- import f38 from "../dist/assets/Database-BzEkXws0.js" with { type: 'file' };
42
- import f39 from "../dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2" with { type: 'file' };
43
- import f40 from "../dist/assets/QueueControl-BW0XXd0B.js" with { type: 'file' };
44
- import f41 from "../dist/assets/dist-DpZcbP9W.js" with { type: 'file' };
45
- import f42 from "../dist/assets/Queues-DkPuIy1C.js" with { type: 'file' };
46
- import f43 from "../dist/assets/bq-F5BbTG1T.js" with { type: 'file' };
47
- import f44 from "../dist/assets/QueuesOverview-COo-V8D_.js" with { type: 'file' };
48
- import f45 from "../dist/assets/S3BackupPro-DxNVFvY1.js" with { type: 'file' };
49
- import f46 from "../dist/assets/cn-zFEt5SO8.js" with { type: 'file' };
50
- import f47 from "../dist/assets/useServerActionGuard-uGePilQQ.js" with { type: 'file' };
51
- import f48 from "../dist/assets/ServerControl-B0Po974t.js" with { type: 'file' };
52
- import f49 from "../dist/assets/PageHeader-CvIyaFOO.js" with { type: 'file' };
53
- import f50 from "../dist/assets/Fleet-Bdrj9bLI.js" with { type: 'file' };
54
- import f51 from "../dist/assets/index-mID5W7vq.js" with { type: 'file' };
55
- import f52 from "../dist/assets/upstreamPaths-DQeKSxGc.js" with { type: 'file' };
56
- import f53 from "../dist/assets/useControlActionGuard-B-bzKZKI.js" with { type: 'file' };
57
- import f54 from "../dist/assets/WorkersPro-BYaredE9.js" with { type: 'file' };
58
- import f55 from "../dist/assets/api-BgWE-705.js" with { type: 'file' };
59
- import f56 from "../dist/assets/Metrics-DKyBZoFa.js" with { type: 'file' };
60
- import f57 from "../dist/assets/useThroughputSeries-DgO8uicf.js" with { type: 'file' };
61
- import f58 from "../dist/assets/Alerts-BvWBv-z7.js" with { type: 'file' };
62
- import f59 from "../dist/assets/DlqControl-C5Bgzmk0.js" with { type: 'file' };
63
- import f60 from "../dist/assets/toastStore-IZn6OPLZ.js" with { type: 'file' };
64
- import f61 from "../dist/assets/QueueDetail-C1dXXN70.js" with { type: 'file' };
65
- import f62 from "../dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2" with { type: 'file' };
66
- import f63 from "../dist/assets/format-Cg7VCIZW.js" with { type: 'file' };
67
- import f64 from "../dist/assets/JobInspector-DsOt4mLJ.js" with { type: 'file' };
68
- import f65 from "../dist/assets/LogsPro-DHWbhWyq.js" with { type: 'file' };
69
- import f66 from "../dist/assets/dist-1f1fMHVO.js" with { type: 'file' };
70
- import f67 from "../dist/assets/QueueActions-BWnmNEqV.js" with { type: 'file' };
71
- import f68 from "../dist/assets/CronManager-B6xLLgI5.js" with { type: 'file' };
72
- import f69 from "../dist/assets/promisePool-BVfQ9n9Q.js" with { type: 'file' };
73
- import f70 from "../dist/assets/JobsPro-BfXTm9gH.js" with { type: 'file' };
74
- import f71 from "../dist/assets/Flows-BtUGOaif.js" with { type: 'file' };
75
- import f72 from "../dist/assets/Benchmark-BywalSmU.js" with { type: 'file' };
76
- import f73 from "../dist/assets/Workflows-DZZA6aGW.js" with { type: 'file' };
77
- import f74 from "../dist/assets/index-C9yGKhQ8.css" with { type: 'file' };
78
- import f75 from "../dist/assets/Card-CWxrC8OY.js" with { type: 'file' };
79
- import f76 from "../dist/assets/dist-BlWBaCN6.js" with { type: 'file' };
80
- import f77 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
81
- import f78 from "../dist/assets/jobActions-LQD4KfCc.js" with { type: 'file' };
82
- import f79 from "../dist/assets/install-D4uRZ7XA.js" with { type: 'file' };
83
- import f80 from "../dist/assets/dist-DZL8soAh.js" with { type: 'file' };
84
- import f81 from "../dist/.vite/manifest.json" with { type: 'file' };
3
+ import f0 from "../dist/.vite/manifest.json" with { type: 'file' };
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/Alerts-C961Al5D.js" with { type: 'file' };
14
+ import f11 from "../dist/assets/dist-DjvZiKhB.js" with { type: 'file' };
15
+ import f12 from "../dist/assets/WorkersPro-Dk4NfplT.js" with { type: 'file' };
16
+ import f13 from "../dist/assets/QueueDetail-BRDATlp0.js" with { type: 'file' };
17
+ import f14 from "../dist/assets/Dlq-mtInIoTh.js" with { type: 'file' };
18
+ import f15 from "../dist/assets/icons-BVzwsfbG.js" with { type: 'file' };
19
+ import f16 from "../dist/assets/JobInspector-DyWZk1eW.js" with { type: 'file' };
20
+ import f17 from "../dist/assets/Workers-CBEDvXm_.js" with { type: 'file' };
21
+ import f18 from "../dist/assets/CopilotPanel-Dlm8XwBj.js" with { type: 'file' };
22
+ import f19 from "../dist/assets/Flows-CE7KzaFN.js" with { type: 'file' };
23
+ import f20 from "../dist/assets/JobsPro-BlWwDeFN.js" with { type: 'file' };
24
+ import f21 from "../dist/assets/McpServer-DNrOEp9j.js" with { type: 'file' };
25
+ import f22 from "../dist/assets/Pagination-x-Cwgrul.js" with { type: 'file' };
26
+ import f23 from "../dist/assets/S3BackupPro-CjR0y18n.js" with { type: 'file' };
27
+ import f24 from "../dist/assets/feedback-QDN1AsYt.js" with { type: 'file' };
28
+ import f25 from "../dist/assets/useServerActionGuard-uGePilQQ.js" with { type: 'file' };
29
+ import f26 from "../dist/assets/install-oydLpc1T.js" with { type: 'file' };
30
+ import f27 from "../dist/assets/useControlActionGuard-B-bzKZKI.js" with { type: 'file' };
31
+ import f28 from "../dist/assets/Button-Ch1W94fJ.js" with { type: 'file' };
32
+ import f29 from "../dist/assets/QueueControl-Bvm8GUQa.js" with { type: 'file' };
33
+ import f30 from "../dist/assets/Fleet-Bdrj9bLI.js" with { type: 'file' };
34
+ import f31 from "../dist/assets/Overview-CKAA3h9f.js" with { type: 'file' };
35
+ import f32 from "../dist/assets/Metrics-Cm5ZvfTo.js" with { type: 'file' };
36
+ import f33 from "../dist/assets/ServerControl-BH6Doax0.js" with { type: 'file' };
37
+ import f34 from "../dist/assets/Queues-BV99vr68.js" with { type: 'file' };
38
+ import f35 from "../dist/assets/MetricsPro-C9g1sp-u.js" with { type: 'file' };
39
+ import f36 from "../dist/assets/connectionStore-BJLihGaC.js" with { type: 'file' };
40
+ import f37 from "../dist/assets/usePolledData-0CVelkl2.js" with { type: 'file' };
41
+ import f38 from "../dist/assets/api-BgWE-705.js" with { type: 'file' };
42
+ import f39 from "../dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2" with { type: 'file' };
43
+ import f40 from "../dist/assets/DlqPro-0_75vrd1.js" with { type: 'file' };
44
+ import f41 from "../dist/assets/Workflows-DZZA6aGW.js" with { type: 'file' };
45
+ import f42 from "../dist/assets/format-Cg7VCIZW.js" with { type: 'file' };
46
+ import f43 from "../dist/assets/Jobs-ELSH1Wbd.js" with { type: 'file' };
47
+ import f44 from "../dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2" with { type: 'file' };
48
+ import f45 from "../dist/assets/BulkAddJobs-IiL1uud0.js" with { type: 'file' };
49
+ import f46 from "../dist/assets/dist-BlWBaCN6.js" with { type: 'file' };
50
+ import f47 from "../dist/assets/flowMutationSafety-YKTHxqKv.js" with { type: 'file' };
51
+ import f48 from "../dist/assets/upstreamPaths-DQeKSxGc.js" with { type: 'file' };
52
+ import f49 from "../dist/assets/Usage-BWZkz7Se.js" with { type: 'file' };
53
+ import f50 from "../dist/assets/Settings-CL7odwoU.js" with { type: 'file' };
54
+ import f51 from "../dist/assets/LogsPro-BfYbmZHi.js" with { type: 'file' };
55
+ import f52 from "../dist/assets/Webhooks-DT2LK17V.js" with { type: 'file' };
56
+ import f53 from "../dist/assets/Card-CWxrC8OY.js" with { type: 'file' };
57
+ import f54 from "../dist/assets/S3Backup-DNABHR2Q.js" with { type: 'file' };
58
+ import f55 from "../dist/assets/DlqControl-Lq9ISb9b.js" with { type: 'file' };
59
+ import f56 from "../dist/assets/controlConnectionEpoch-CZsS0wAb.js" with { type: 'file' };
60
+ import f57 from "../dist/assets/exportFile-C7xhE8Yh.js" with { type: 'file' };
61
+ import f58 from "../dist/assets/StatusBadge-BoOVTnKu.js" with { type: 'file' };
62
+ import f59 from "../dist/assets/CronManager-B6xLLgI5.js" with { type: 'file' };
63
+ import f60 from "../dist/assets/dist-DZL8soAh.js" with { type: 'file' };
64
+ import f61 from "../dist/assets/Logs-DMukqmHy.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/QueueDetailPro-Dkz4-1wn.js" with { type: 'file' };
70
+ import f67 from "../dist/assets/Database-DGM2BIHy.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/index-BFW2_47n.js" with { type: 'file' };
76
+ import f73 from "../dist/assets/dist-DpZcbP9W.js" with { type: 'file' };
77
+ import f74 from "../dist/assets/Diagnostics-_Sh3UyaT.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/QueuesOverview-CT6JBaim.js" with { type: 'file' };
81
+ import f78 from "../dist/assets/UsagePro-CoBbI-Cl.js" with { type: 'file' };
82
+ import f79 from "../dist/assets/Cron-1DZTZWXO.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/Benchmark-DQNZV7dM.js" with { type: 'file' };
85
85
 
86
86
  export const ASSETS: Record<string, string> = {
87
- "/index.html": f0,
88
- "/favicon.svg": f1,
89
- "/og.png": f2,
90
- "/assets/usePolledData-0CVelkl2.js": f3,
91
- "/assets/Cron-1DZTZWXO.js": f4,
92
- "/assets/Webhooks-DT2LK17V.js": f5,
93
- "/assets/McpServer-BqmbhrKh.js": f6,
94
- "/assets/flowMutationSafety-YKTHxqKv.js": f7,
95
- "/assets/BulkAddJobs-IiL1uud0.js": f8,
96
- "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f9,
97
- "/assets/icons-BVzwsfbG.js": f10,
98
- "/assets/Workers-CVo9rJ_V.js": f11,
99
- "/assets/feedback-QDN1AsYt.js": f12,
100
- "/assets/connectionStore-BJLihGaC.js": f13,
101
- "/assets/react-vendor-CvwrP0tU.js": f14,
102
- "/assets/S3Backup-DNABHR2Q.js": f15,
103
- "/assets/StatusBadge-BoOVTnKu.js": f16,
104
- "/assets/Button-Ch1W94fJ.js": f17,
105
- "/assets/exportFile-C7xhE8Yh.js": f18,
106
- "/assets/Usage-cdWDQUaq.js": f19,
107
- "/assets/responses-BkR2JTH9.js": f20,
108
- "/assets/dist-DjvZiKhB.js": f21,
109
- "/assets/Logs-uuzU5ohI.js": f22,
110
- "/assets/CopilotPanel-CH2jbbYA.js": f23,
111
- "/assets/Dlq-CbLN0zQ5.js": f24,
112
- "/assets/Overview-ClsyxH2e.js": f25,
113
- "/assets/form-C4oby9pI.js": f26,
114
- "/assets/DlqPro-Cgaxtuwh.js": f27,
115
- "/assets/Jobs-BTMpbAHD.js": f28,
116
- "/assets/QueueDetailPro-DDGxs2J2.js": f29,
117
- "/assets/Settings-z9k4EVa_.js": f30,
118
- "/assets/controlConnectionEpoch-CZsS0wAb.js": f31,
119
- "/assets/AddJob-FNaPbs_V.js": f32,
120
- "/assets/AreaChart-DEAalJ6P.js": f33,
121
- "/assets/MetricsPro-BR2ULqIc.js": f34,
122
- "/assets/Pagination-x-Cwgrul.js": f35,
123
- "/assets/UsagePro-DLuwnM8n.js": f36,
124
- "/assets/Diagnostics-CPqhV3er.js": f37,
125
- "/assets/Database-BzEkXws0.js": f38,
126
- "/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2": f39,
127
- "/assets/QueueControl-BW0XXd0B.js": f40,
128
- "/assets/dist-DpZcbP9W.js": f41,
129
- "/assets/Queues-DkPuIy1C.js": f42,
130
- "/assets/bq-F5BbTG1T.js": f43,
131
- "/assets/QueuesOverview-COo-V8D_.js": f44,
132
- "/assets/S3BackupPro-DxNVFvY1.js": f45,
133
- "/assets/cn-zFEt5SO8.js": f46,
134
- "/assets/useServerActionGuard-uGePilQQ.js": f47,
135
- "/assets/ServerControl-B0Po974t.js": f48,
136
- "/assets/PageHeader-CvIyaFOO.js": f49,
137
- "/assets/Fleet-Bdrj9bLI.js": f50,
138
- "/assets/index-mID5W7vq.js": f51,
139
- "/assets/upstreamPaths-DQeKSxGc.js": f52,
140
- "/assets/useControlActionGuard-B-bzKZKI.js": f53,
141
- "/assets/WorkersPro-BYaredE9.js": f54,
142
- "/assets/api-BgWE-705.js": f55,
143
- "/assets/Metrics-DKyBZoFa.js": f56,
144
- "/assets/useThroughputSeries-DgO8uicf.js": f57,
145
- "/assets/Alerts-BvWBv-z7.js": f58,
146
- "/assets/DlqControl-C5Bgzmk0.js": f59,
147
- "/assets/toastStore-IZn6OPLZ.js": f60,
148
- "/assets/QueueDetail-C1dXXN70.js": f61,
149
- "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f62,
150
- "/assets/format-Cg7VCIZW.js": f63,
151
- "/assets/JobInspector-DsOt4mLJ.js": f64,
152
- "/assets/LogsPro-DHWbhWyq.js": f65,
153
- "/assets/dist-1f1fMHVO.js": f66,
154
- "/assets/QueueActions-BWnmNEqV.js": f67,
155
- "/assets/CronManager-B6xLLgI5.js": f68,
156
- "/assets/promisePool-BVfQ9n9Q.js": f69,
157
- "/assets/JobsPro-BfXTm9gH.js": f70,
158
- "/assets/Flows-BtUGOaif.js": f71,
159
- "/assets/Benchmark-BywalSmU.js": f72,
160
- "/assets/Workflows-DZZA6aGW.js": f73,
161
- "/assets/index-C9yGKhQ8.css": f74,
162
- "/assets/Card-CWxrC8OY.js": f75,
163
- "/assets/dist-BlWBaCN6.js": f76,
164
- "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f77,
165
- "/assets/jobActions-LQD4KfCc.js": f78,
166
- "/assets/install-D4uRZ7XA.js": f79,
167
- "/assets/dist-DZL8soAh.js": f80,
168
- "/.vite/manifest.json": f81,
87
+ "/.vite/manifest.json": f0,
88
+ "/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/Alerts-C961Al5D.js": f10,
98
+ "/assets/dist-DjvZiKhB.js": f11,
99
+ "/assets/WorkersPro-Dk4NfplT.js": f12,
100
+ "/assets/QueueDetail-BRDATlp0.js": f13,
101
+ "/assets/Dlq-mtInIoTh.js": f14,
102
+ "/assets/icons-BVzwsfbG.js": f15,
103
+ "/assets/JobInspector-DyWZk1eW.js": f16,
104
+ "/assets/Workers-CBEDvXm_.js": f17,
105
+ "/assets/CopilotPanel-Dlm8XwBj.js": f18,
106
+ "/assets/Flows-CE7KzaFN.js": f19,
107
+ "/assets/JobsPro-BlWwDeFN.js": f20,
108
+ "/assets/McpServer-DNrOEp9j.js": f21,
109
+ "/assets/Pagination-x-Cwgrul.js": f22,
110
+ "/assets/S3BackupPro-CjR0y18n.js": f23,
111
+ "/assets/feedback-QDN1AsYt.js": f24,
112
+ "/assets/useServerActionGuard-uGePilQQ.js": f25,
113
+ "/assets/install-oydLpc1T.js": f26,
114
+ "/assets/useControlActionGuard-B-bzKZKI.js": f27,
115
+ "/assets/Button-Ch1W94fJ.js": f28,
116
+ "/assets/QueueControl-Bvm8GUQa.js": f29,
117
+ "/assets/Fleet-Bdrj9bLI.js": f30,
118
+ "/assets/Overview-CKAA3h9f.js": f31,
119
+ "/assets/Metrics-Cm5ZvfTo.js": f32,
120
+ "/assets/ServerControl-BH6Doax0.js": f33,
121
+ "/assets/Queues-BV99vr68.js": f34,
122
+ "/assets/MetricsPro-C9g1sp-u.js": f35,
123
+ "/assets/connectionStore-BJLihGaC.js": f36,
124
+ "/assets/usePolledData-0CVelkl2.js": f37,
125
+ "/assets/api-BgWE-705.js": f38,
126
+ "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": f39,
127
+ "/assets/DlqPro-0_75vrd1.js": f40,
128
+ "/assets/Workflows-DZZA6aGW.js": f41,
129
+ "/assets/format-Cg7VCIZW.js": f42,
130
+ "/assets/Jobs-ELSH1Wbd.js": f43,
131
+ "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": f44,
132
+ "/assets/BulkAddJobs-IiL1uud0.js": f45,
133
+ "/assets/dist-BlWBaCN6.js": f46,
134
+ "/assets/flowMutationSafety-YKTHxqKv.js": f47,
135
+ "/assets/upstreamPaths-DQeKSxGc.js": f48,
136
+ "/assets/Usage-BWZkz7Se.js": f49,
137
+ "/assets/Settings-CL7odwoU.js": f50,
138
+ "/assets/LogsPro-BfYbmZHi.js": f51,
139
+ "/assets/Webhooks-DT2LK17V.js": f52,
140
+ "/assets/Card-CWxrC8OY.js": f53,
141
+ "/assets/S3Backup-DNABHR2Q.js": f54,
142
+ "/assets/DlqControl-Lq9ISb9b.js": f55,
143
+ "/assets/controlConnectionEpoch-CZsS0wAb.js": f56,
144
+ "/assets/exportFile-C7xhE8Yh.js": f57,
145
+ "/assets/StatusBadge-BoOVTnKu.js": f58,
146
+ "/assets/CronManager-B6xLLgI5.js": f59,
147
+ "/assets/dist-DZL8soAh.js": f60,
148
+ "/assets/Logs-DMukqmHy.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/QueueDetailPro-Dkz4-1wn.js": f66,
154
+ "/assets/Database-DGM2BIHy.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/index-BFW2_47n.js": f72,
160
+ "/assets/dist-DpZcbP9W.js": f73,
161
+ "/assets/Diagnostics-_Sh3UyaT.js": f74,
162
+ "/assets/PageHeader-CvIyaFOO.js": f75,
163
+ "/assets/flowOperationPolicy-B2Etcb3f.js": f76,
164
+ "/assets/QueuesOverview-CT6JBaim.js": f77,
165
+ "/assets/UsagePro-CoBbI-Cl.js": f78,
166
+ "/assets/Cron-1DZTZWXO.js": f79,
167
+ "/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2": f80,
168
+ "/assets/Benchmark-DQNZV7dM.js": f81,
169
169
  };
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Which job actions the server will actually accept for a given state. Shared
3
+ * between JobInspector (single job) and JobsPro (bulk/per-row) so the two
4
+ * surfaces never drift on what's legal to attempt.
5
+ *
6
+ * Mirrors the location-based gating in src/application/operations/jobManagement.ts
7
+ * only where the upstream operation is safe for an HTTP client. `waiting-children`
8
+ * is NOT in the runnable heap, so priority and delay are unavailable there.
9
+ * Cancel and Discard are deliberately unavailable in every state: v2.9.3 cannot
10
+ * inspect reverse dependencies or make either transition conditional on the state
11
+ * that the dashboard read. Discard also bypasses terminal flow-failure resolution
12
+ * and accepts a job that became active after the snapshot, which can strand its
13
+ * parent while the worker continues external side effects. DLQ retry is also
14
+ * unavailable: a read followed by retry is subject to id-reuse TOCTOU, and the
15
+ * endpoint has no atomic generation/topology precondition. Completed requeue is
16
+ * unavailable because v2.9.3 does not rebuild a child's dependency registration.
17
+ *
18
+ * Active state transitions are deliberately absent. Bunqueue v2.9.3 removes
19
+ * the broker processing record but cannot cancel the already-running worker;
20
+ * retry/discard/fail/move-to-delayed can therefore duplicate external side
21
+ * effects. The dashboard only permits the non-transitioning progress update.
22
+ */
23
+ export function actionGates(state: string | undefined) {
24
+ const inRunQueue = state === 'waiting' || state === 'delayed' || state === 'prioritized';
25
+ return {
26
+ cancel: false,
27
+ discard: false,
28
+ promote: state === 'delayed',
29
+ retryDlq: false,
30
+ requeueCompleted: false,
31
+ setPriority: inRunQueue,
32
+ setDelay: inRunQueue,
33
+ };
34
+ }
35
+
36
+ /** Shared by the UI and agent: the SDK does not add atomic topology guards. */
37
+ export function flowOperationError(operation: string): string | null {
38
+ if (operation === 'updateData') {
39
+ return 'Flow data is read-only: replacing the payload can remove dependency metadata.';
40
+ }
41
+ if (operation === 'retry') {
42
+ return 'Flow retry is unavailable: Bunqueue has no atomic job-generation or state precondition.';
43
+ }
44
+ if (operation === 'remove' || operation === 'removeUnprocessedChildren') {
45
+ return 'Flow removal is unavailable: Bunqueue cannot atomically protect reverse dependencies.';
46
+ }
47
+ return null;
48
+ }
49
+
50
+ export function assertFlowOperationAllowed(operation: string): void {
51
+ const error = flowOperationError(operation);
52
+ if (error) throw new Error(error);
53
+ }
54
+
55
+ export function assertFlowOperationState(operation: string, state: string): void {
56
+ const gates = actionGates(state);
57
+ const allowed =
58
+ operation === 'promote'
59
+ ? gates.promote
60
+ : operation === 'changePriority'
61
+ ? gates.setPriority
62
+ : operation === 'changeDelay'
63
+ ? gates.setDelay
64
+ : true;
65
+ if (!allowed) throw new Error(`Flow ${operation} is unavailable for a ${state} job.`);
66
+ }
@@ -1,2 +0,0 @@
1
- import{i as e,t}from"./cn-zFEt5SO8.js";import{f as n,g as r,r as i,t as a}from"./react-vendor-CvwrP0tU.js";import{a as o,o as s}from"./connectionStore-BJLihGaC.js";import{i as c}from"./upstreamPaths-DQeKSxGc.js";import{a as l,d as u,f as d,s as f}from"./bq-F5BbTG1T.js";import{t as p}from"./Card-CWxrC8OY.js";import{i as m,n as h,r as g}from"./feedback-QDN1AsYt.js";import{t as _}from"./PageHeader-CvIyaFOO.js";import{i as v}from"./index-mID5W7vq.js";import{n as y,t as b}from"./controlConnectionEpoch-CZsS0wAb.js";import{t as x}from"./useControlActionGuard-B-bzKZKI.js";var S={nodeWidth:168,nodeHeight:60},C=`flow-order-9a3f`,w={completed:`border-success/50 bg-success/10 text-success`,failed:`border-danger/50 bg-danger/10 text-danger`,active:`border-blue-400/60 bg-blue-400/10 text-blue-400`,delayed:`border-accent/50 bg-accent/10 text-accent`,waiting:`border-warning/50 bg-warning/10 text-warning`,prioritized:`border-warning/50 bg-warning/10 text-warning`,"waiting-children":`border-cyan-400/60 bg-cyan-400/10 text-cyan-400`},T=e=>e&&w[e]||`border-line bg-surface-2 text-muted`,E=e=>e.length>12?`${e.slice(0,6)}…${e.slice(-4)}`:e,D=class extends Error{constructor(e,t){super(e,t),this.name=`FlowSnapshotError`}};function O(e,t,n){if(!Array.isArray(e)||e.some(e=>typeof e!=`string`||c(e)!==null))throw new D(`Job ${n} returned an invalid ${t} list`);return e}function k(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw new D(`GET /jobs/${t} returned an invalid response`);let n=e;if(n.ok!==!0)throw new D(`GET /jobs/${t} returned an invalid success envelope`);let r=n.job;if(typeof r!=`object`||!r||Array.isArray(r))throw new D(`GET /jobs/${t} returned no job snapshot`);let i=r;if(i.id!==t)throw new D(`GET /jobs/${t} returned the wrong job id (${String(i.id)})`);if(typeof i.queue!=`string`||i.queue.length===0)throw new D(`Job ${t} returned an invalid queue`);if(typeof i.state!=`string`||i.state.length===0)throw new D(`Job ${t} returned an invalid state`);if(!Object.hasOwn(i,`parentId`)||i.parentId!==null&&(typeof i.parentId!=`string`||c(i.parentId)!==null))throw new D(`Job ${t} returned an invalid parentId`);return{...r,parentId:i.parentId,childrenIds:O(i.childrenIds,`childrenIds`,t),dependsOn:O(i.dependsOn,`dependsOn`,t)}}async function A(e,t,n){n?.throwIfAborted();let r=await d(e,t,n);return n?.throwIfAborted(),k(r,t)}function j(e){let t=c(e);return t?`Job ID: ${t}`:null}async function ee(e,t={}){let n=j(e);if(n)throw new D(n);let r=t.target??u(),{signal:i}=t,a=e,o=new Set([e]),s=[];for(let e=0;;e++){i?.throwIfAborted();let t;try{t=await A(r,a,i)}catch(t){if(i?.throwIfAborted(),e===0)throw t;if(t instanceof l&&t.status===404){let e=s.at(-1);if(!e)throw t;return{id:e.id,job:e,hops:Math.max(0,s.length-1),path:s,missingParent:a}}throw new D(`Could not resolve the flow root because parent ${a} could not be loaded: ${t instanceof Error?t.message:String(t)}`,{cause:t})}s.push(t);let n=t.parentId;if(!n)return{id:a,job:t,hops:e,path:s};if(o.has(n))throw new D(`Flow parent cycle detected at job ${n}`);if(e>=100)throw new D(`Flow parent chain exceeds the Bunqueue 2.9.3 limit of 100 levels`);o.add(n),a=n}}function te(e,t){let n=new Set(e),r=new Map(e.map(e=>[e,[]]));for(let e of t)n.has(e.from)&&n.has(e.to)&&r.get(e.from)?.push(e.to);let i=new Map,a=[],o=e=>{i.set(e,1),a.push(e);for(let t of r.get(e)??[]){if(i.get(t)===1){let e=a.lastIndexOf(t);return[...a.slice(Math.max(0,e)),t]}if(i.get(t)!==2){let e=o(t);if(e)return e}}return a.pop(),i.set(e,2),null};for(let t of e)if(!i.has(t)){let e=o(t);if(e)return e}return null}var M=[`failParentOnFailure`,`removeDependencyOnFailure`,`continueParentOnFailure`,`ignoreDependencyOnFailure`];function N(e){return M.filter(t=>e[t]===!0)}function P(e,t){if(e?.parentId!==t)return null;let n=N(e);return n.length===1?n[0]===`continueParentOnFailure`?{scope:`parent`,policy:`continueParentOnFailure`}:n[0]===`removeDependencyOnFailure`?{scope:`child`,policy:`removeDependencyOnFailure`}:n[0]===`ignoreDependencyOnFailure`?{scope:`child`,policy:`ignoreDependencyOnFailure`}:null:null}async function ne(e,t,n={}){let r=j(e);if(r)throw new D(r);let i=n.target??u(),{signal:a}=n,o=new Map,s=[],c=[],l=new Set,d=new Set,f=new Map,p=new Set,m=new Set,h=new Set(n.limitations??[]),g=[{id:e,depth:0}],_=new Set([e]),v=new Map;t&&v.set(e,k({ok:!0,job:t},e));let y=[...n.seedPath??[]].reverse(),b=!1;if(y.length>0&&y[0]?.id!==e)throw new D(`Resolved seed path does not start at the requested flow root`);for(let[e,t]of y.entries()){let n=k({ok:!0,job:t},t.id);if(v.set(n.id,n),e!==0){if(e>100||_.size>=500){b=!0;continue}_.has(n.id)||(_.add(n.id),g.push({id:n.id,depth:e}))}}let x=new Set,S=b;for(;g.length;){a?.throwIfAborted();let{id:t,depth:n}=g.shift();if(x.has(t))continue;x.add(t);let r=null;try{r=v.get(t)??await A(i,t,a)}catch(n){if(a?.throwIfAborted(),t===e)throw n;f.set(t,n instanceof Error?n.message:String(n))}if(o.set(t,r??{id:t,state:`unknown`}),!r)continue;if(n>=100){(r.childrenIds?.length??0)+(r.dependsOn?.length??0)>0&&(S=!0);continue}let u=e=>_.has(e)?!0:_.size>=500?(S=!0,!1):(_.add(e),g.push({id:e,depth:n+1}),!0),m=(e,t,n,r)=>{if(!u(r))return;let i=`${e}->${t}:${n}`;l.has(i)||(l.add(i),s.push({from:e,to:t,kind:n}))},h=r.childrenIds??[],y=r.dependsOn??[],b=new Set(h),C=new Set(y);b.size!==h.length&&p.add(`Job ${t} lists a child more than once`),C.size!==y.length&&p.add(`Job ${t} lists a dependency more than once`);for(let e of h)m(t,e,`child`,e);for(let e of y)if(u(e)){let n=`${e}->${t}`;d.has(n)||(d.add(n),c.push({from:e,to:t,kind:`depends`})),b.has(e)||m(e,t,`depends`,e)}}for(let[e,t]of o)!f.has(e)&&N(t).length>1&&p.add(`Job ${e} enables mutually exclusive failure policies`);for(let e of s){if(e.kind!==`child`||f.has(e.to))continue;let t=o.get(e.to);t&&t.parentId!==e.from&&p.add(`Child ${e.to} points to parent ${String(t.parentId??`none`)}, not ${e.from}`)}for(let[e,t]of o){if(f.has(e))continue;let n=t.childrenIds??[];if(n.some(e=>!o.has(e)||f.has(e)))continue;let r=n.map(t=>({childId:t,release:P(o.get(t),e)})).find(({release:e})=>e?.scope===`parent`);for(let i of n){if(t.dependsOn?.includes(i))continue;if(r?.release?.scope===`parent`){m.add(`Parent ${e} is missing dependency ${i}; ${r.release.policy} on child ${r.childId} may have released all parent dependencies, but the HTTP snapshot cannot prove whether the policy fired`);continue}let n=P(o.get(i),e);if(n?.scope===`child`){m.add(`Parent ${e} is missing dependency ${i}; ${n.policy} may have released it, but the HTTP snapshot cannot prove whether the policy fired`);continue}p.add(`Parent ${e} lists child ${i} without the matching dependency`)}}for(let[e,t]of o){if(f.has(e)||!t.parentId)continue;let n=o.get(t.parentId);!n||f.has(t.parentId)||n.childrenIds?.includes(e)||p.add(`Parent ${t.parentId} does not list child ${e}`)}let C=te([...o.keys()],c);return{jobs:o,edges:s,truncated:S,failed:f.size,failures:f,issues:[...p],policyNotes:[...m],cycle:C,limitations:[...h]}}var re=`bq-dash-recent-flows`,F=8;function I(e){return`${re}:${encodeURIComponent(e.trim()||`/api`)}`}function L(e,t){if(!t)return[];try{let t=JSON.parse(localStorage.getItem(I(e))??`[]`);return Array.isArray(t)?t.filter(e=>typeof e?.root==`string`&&e.root.length>0&&e.root.length<=1024&&Number.isSafeInteger(e?.nodes)&&e.nodes>1&&e.nodes<=500&&Number.isFinite(e?.at)&&e.at>=0).slice(0,F):[]}catch{return[]}}function ie(e,t,n,r){let i=[n,...t.filter(e=>e.root!==n.root)].slice(0,F);if(!r)return i;try{localStorage.setItem(I(e),JSON.stringify(i))}catch{}return i}var R=e(r(),1),ae=new Set([`explore`,`create`,`operations`]);function oe(e,t=``){let n=e.get(`root`),r=le(n)?n:t,i=e.get(`mode`),a=ae.has(i)?i:`explore`,o=e.get(`node`);return{root:r,mode:a,node:r&&le(o)?o:null}}function se(e){let t=new URLSearchParams;return e.root&&t.set(`root`,e.root),e.mode!==`explore`&&t.set(`mode`,e.mode),e.root&&e.node&&t.set(`node`,e.node),t}function ce(e,t,n=``){return se({...oe(e,n),...t})}function le(e){return!!(e&&j(e)===null)}function ue(){let[e,t]=n(),r=v()?C:``,i=e.toString(),a=(0,R.useMemo)(()=>oe(new URLSearchParams(i),r),[r,i]),c=a.root,l=s(e=>e.baseUrl),d=s(e=>e.token),f=o(),[p,m]=(0,R.useState)(c),[h,g]=(0,R.useState)(null),[_,y]=(0,R.useState)(!!c),[b,x]=(0,R.useState)(null),[S,w]=(0,R.useState)(()=>L(f,d.length===0)),T=(0,R.useRef)(0),E=(0,R.useRef)(null),O=(0,R.useRef)(!1),k=(0,R.useRef)(z()),A=h?.seed===c?h.graph:null,te=A?a.node&&A.jobs.has(a.node)?a.node:h?.defaultSelected??null:null,M=(0,R.useCallback)((e,n=!1)=>{t(t=>ce(t,e,r),{replace:n})},[r,t]),N=(0,R.useCallback)(async e=>{let t=s.getState();if(t.baseUrl!==l||t.token!==d)return;E.current?.abort(),E.current=null;let n=++T.current,r=e.trim();if(g(null),x(null),!r)return y(!1);let i=j(r);if(i)return x(new D(i)),y(!1);let a=u(),o=z(),c=new AbortController;E.current=c;let f=()=>O.current&&n===T.current&&!c.signal.aborted&&o===z();y(!0);try{let e={target:a,signal:c.signal},t=await ee(r,e),n=t.missingParent?[`Ancestor ${t.missingParent} is no longer available. The graph starts at the oldest surviving node.`]:[],i=await ne(t.id,t.job,{...e,seedPath:t.path,limitations:n});if(!f())return;g({seed:r,graph:i,defaultSelected:t.id}),i.jobs.size>1&&w(e=>ie(a.baseUrl,e,{root:t.id,nodes:i.jobs.size,at:Date.now()},s.getState().token.length===0))}catch(e){f()&&x(e instanceof Error?e:Error(`Failed to load flow`))}finally{E.current===c&&(E.current=null),f()&&y(!1)}},[l,d]);return(0,R.useEffect)(()=>{O.current=!0,k.current=z();let e=s.subscribe(()=>{let e=z();e!==k.current&&(k.current=e,T.current+=1,E.current?.abort(),E.current=null,O.current&&(g(null),x(null),y(!1)))});return()=>{O.current=!1,e(),T.current+=1,E.current?.abort()}},[]),(0,R.useEffect)(()=>w(d?[]:L(f,!0)),[f,d]),(0,R.useEffect)(()=>{let e={...a};A&&(!e.node||!A.jobs.has(e.node))&&(e.node=h?.defaultSelected??null);let n=se(e).toString();n!==i&&t(n,{replace:!0})},[A,i,t,h?.defaultSelected,a]),(0,R.useEffect)(()=>{m(c),N(c)},[c,N]),{input:p,setInput:m,rootParam:c,mode:a.mode,setMode:e=>M({mode:e}),graph:A,selected:te,setSelected:e=>{A?.jobs.has(e)&&M({node:e})},loading:_,error:b,recent:S,load:N,submit:e=>{e.preventDefault();let t=p.trim();if(t){if(j(t))return void N(t);t===c?N(t):M({root:t,mode:`explore`,node:null})}},openRecent:e=>{if(m(e),j(e))return void N(e);let t=e===c;M({root:e,mode:`explore`,node:null}),t&&N(e)}}}function z(){let{token:e}=s.getState();return JSON.stringify([o(),e])}function de(e){return e instanceof l&&e.status===0||[`TypeError`,`AbortError`,`TimeoutError`].includes(e.name)}var B=e=>({method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),fe=new Set([`removeChildDependency`,`removeUnprocessedChildren`,`removeDeduplicationKey`,`retry`,`promote`,`remove`]),pe=e=>e+5e3,V={create:(e,t)=>f(`/flows/create?target=${encodeURIComponent(o())}`,B({operation:e,...t})),getFlow:e=>{let t=new URLSearchParams({id:e.id,queueName:e.queueName,target:o()});return e.depth!==void 0&&t.set(`depth`,String(e.depth)),e.maxChildren!==void 0&&t.set(`maxChildren`,String(e.maxChildren)),f(`/flows/tree?${t}`)},inspect:(e,t)=>f(`/flows/jobs/${encodeURIComponent(e.id)}/${t}?${new URLSearchParams({queueName:e.queueName,target:o()})}`),getParentResult:e=>f(`/flows/results?target=${encodeURIComponent(o())}`,B({operation:`getParentResult`,parentId:e})),getParentResults:e=>f(`/flows/results?target=${encodeURIComponent(o())}`,B({operation:`getParentResults`,parentIds:e})),waitUntilFinished:(e,t)=>f(`/flows/jobs/${encodeURIComponent(e.id)}/waitUntilFinished?${new URLSearchParams({queueName:e.queueName,target:o(),ttl:String(t)})}`,void 0,pe(t)),mutate:(e,t,n)=>f(`/flows/jobs/${encodeURIComponent(e.id)}/${t}?${new URLSearchParams({queueName:e.queueName,target:o()})}`,fe.has(t)?{method:`POST`}:B(n??{}))},H=a();function U({value:e}){return(0,H.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-md border border-line bg-bg p-3 font-mono text-xs text-muted`,children:JSON.stringify(e,null,2)})}function W(...e){return JSON.stringify(e)}function G(e,t=`shared`){let n=y(),r=`flow-exclusive:${t}`,i=x(r),a=(0,R.useMemo)(()=>({key:e,connectionEpoch:n}),[n,e]),o=(0,R.useRef)(a),s=(0,R.useRef)(void 0),c=(0,R.useRef)(void 0),l=(0,R.useRef)(void 0),u=(0,R.useRef)(0),d=(0,R.useRef)(!0),[f,p]=(0,R.useState)(),[m,h]=(0,R.useState)(),[g,_]=(0,R.useState)();return(0,R.useLayoutEffect)(()=>{o.current.connectionEpoch!==a.connectionEpoch&&(c.current=void 0),o.current=a,s.current=void 0,l.current=void 0},[a]),(0,R.useEffect)(()=>(d.current=!0,()=>{d.current=!1,s.current=void 0,c.current=void 0,l.current=void 0}),[]),{busy:f?.exclusive&&f.identity.connectionEpoch===a.connectionEpoch||f?.identity===a?f.label:``,error:g?.identity===a?g.message:``,result:m?.identity===a?m.value:void 0,reject:e=>{c.current||b()!==a.connectionEpoch||(l.current=void 0,s.current=void 0,p(void 0),h(void 0),_({identity:a,message:e}))},run:async(e,t,n={})=>{let f=n.exclusive===!0;if(c.current||s.current?.identity===a||b()!==a.connectionEpoch)return;let m=i.begin(r);if(!m)return;f||m.finish();let g={id:++u.current,identity:a};f?c.current=g:s.current=g,l.current=g,p({...g,exclusive:f,label:e}),h(void 0),_(void 0);try{let e=await t();d.current&&o.current===a&&b()===a.connectionEpoch&&l.current===g&&h({identity:a,value:e})}catch(e){d.current&&o.current===a&&b()===a.connectionEpoch&&l.current===g&&_({identity:a,message:me(e)})}finally{f&&m.finish(),c.current===g&&(c.current=void 0),s.current===g&&(s.current=void 0),d.current&&p(e=>e?.id===g.id?void 0:e)}}}}function me(e){return e instanceof Error?e.message:String(e)}var K={add:{flow:{name:`aggregate`,queueName:`reports`,data:{},children:[{name:`fetch`,queueName:`io`,data:{source:`orders`}}]},options:{queuesOptions:{io:{attempts:3,backoff:1e3}}}},addBulk:{flows:[{name:`report-a`,queueName:`reports`,data:{region:`eu`}},{name:`report-b`,queueName:`reports`,data:{region:`us`}}]},addChain:{steps:[{name:`extract`,queueName:`pipeline`,data:{}},{name:`transform`,queueName:`pipeline`,data:{}},{name:`load`,queueName:`pipeline`,data:{}}]},addBulkThen:{parallel:[{name:`part-a`,queueName:`parallel`,data:{}},{name:`part-b`,queueName:`parallel`,data:{}}],final:{name:`merge`,queueName:`final`,data:{}}},addTree:{root:{name:`root`,queueName:`tree`,data:{},children:[{name:`child`,queueName:`tree`,data:{}}]}}};function he({repository:e=V,onOpen:t}){let[n,r]=(0,R.useState)(`add`),[i,a]=(0,R.useState)(()=>JSON.stringify(K.add,null,2)),o=G(W(n,i),`creator`),s=!!o.busy,c=e=>{r(e),a(JSON.stringify(K[e],null,2))},l=async t=>{t.preventDefault();let r;try{r=JSON.parse(i)}catch{return o.reject(`The definition must be valid JSON.`)}if(!r||typeof r!=`object`||Array.isArray(r))return o.reject(`The definition must be a JSON object.`);let a=n;await o.run(a,()=>e.create(a,r),{exclusive:!0})},u=ge(o.result);return(0,H.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(300px,0.7fr)]`,children:[(0,H.jsxs)(`form`,{onSubmit:l,className:`rounded-lg border border-line bg-surface p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,H.jsxs)(`label`,{className:`text-xs text-faint`,children:[`FlowProducer method`,(0,H.jsx)(`select`,{"aria-label":`FlowProducer method`,value:n,onChange:e=>c(e.target.value),className:`mt-1 block h-9 rounded-lg border border-line bg-surface-2 px-3 text-sm text-fg`,children:Object.keys(K).map(e=>(0,H.jsx)(`option`,{children:e},e))})]}),(0,H.jsx)(`button`,{type:`submit`,disabled:s,className:`rounded-lg bg-accent px-4 py-2 text-sm font-medium text-accent-fg disabled:opacity-50`,children:s?`Creating…`:`Run ${n}`})]}),(0,H.jsxs)(`label`,{className:`mt-4 block text-xs text-faint`,children:[`Definition`,(0,H.jsx)(`textarea`,{"aria-label":`Flow definition JSON`,spellCheck:!1,value:i,onChange:e=>a(e.target.value),className:`mt-1 min-h-80 w-full resize-y rounded-lg border border-line bg-bg p-3 font-mono text-xs text-fg outline-none focus:ring-2 focus:ring-accent/50`})]})]}),(0,H.jsxs)(`section`,{className:`rounded-lg border border-line bg-surface p-4`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Atomic commit result`}),(0,H.jsx)(`p`,{className:`mt-1 mb-4 text-xs text-faint`,children:`Validation is performed by Bunqueue before the graph is committed.`}),o.error&&(0,H.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-danger`,children:o.error}),o.result===void 0?(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:`No flow created in this session.`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{value:o.result}),u&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>t(u),className:`mt-3 rounded-lg border border-line px-3 py-2 text-xs text-fg`,children:`Open created flow`})]})]})]})}function ge(e){let t=e,n=t?.result?.root?.id??t?.result?.roots?.[0]?.id??t?.result?.finalId??t?.result?.jobIds?.at(-1);return typeof n==`string`?n:null}function _e({recent:e,onOpen:t}){return(0,H.jsx)(p,{children:(0,H.jsxs)(`div`,{className:`py-16 text-center`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:`No flow loaded.`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:`Enter a job ID, or choose “View flow” from Job Inspector.`}),e.length>0&&(0,H.jsxs)(`div`,{className:`mt-6`,children:[(0,H.jsx)(`p`,{className:`mb-2 text-[11px] font-medium uppercase tracking-wider text-faint`,children:`Recently viewed`}),(0,H.jsx)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:e.map(e=>(0,H.jsxs)(`button`,{type:`button`,title:e.root,onClick:()=>t(e.root),className:`min-h-10 rounded-lg border border-line bg-surface-2 px-3 py-1.5 font-mono text-xs text-muted hover:text-fg`,children:[(0,H.jsx)(`span`,{translate:`no`,children:E(e.root)}),(0,H.jsxs)(`span`,{className:`ml-2 text-faint`,children:[e.nodes,` nodes`]})]},e.root))})]})]})})}function q({target:e,onChange:t}){return(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,H.jsxs)(`label`,{className:`text-xs text-faint`,children:[`Job ID`,(0,H.jsx)(`input`,{"aria-label":`Flow job ID`,value:e.id,onChange:n=>t({...e,id:n.target.value}),className:`mt-1 h-9 w-full rounded-lg border border-line bg-surface-2 px-3 font-mono text-sm text-fg`})]}),(0,H.jsxs)(`label`,{className:`text-xs text-faint`,children:[`Queue name`,(0,H.jsx)(`input`,{"aria-label":`Flow queue name`,value:e.queueName,onChange:n=>t({...e,queueName:n.target.value}),className:`mt-1 h-9 w-full rounded-lg border border-line bg-surface-2 px-3 text-sm text-fg`})]})]})}var ve=[`getChildrenValues`,`getDependencies`,`getDependenciesCount`,`getFailedChildrenValues`,`getIgnoredChildrenFailures`],ye=[{id:`removeChildDependency`,label:`Release dependency`,dangerous:!0},{id:`removeUnprocessedChildren`,label:`Remove unprocessed children`,dangerous:!0},{id:`retry`,label:`Retry job`},{id:`promote`,label:`Promote delayed job`},{id:`remove`,label:`Remove job`,dangerous:!0}];function be({repository:e=V,initialTarget:t={id:``,queueName:``},target:n,onTargetChange:r,showTarget:i=!0}){let[a,o]=(0,R.useState)(t),s=n??a,c=r??o,l=G(W(s.id,s.queueName),`dependency-console`),u=l.busy,d=!!(s.id.trim()&&s.queueName.trim()),f=t=>{let n=xe(s);l.run(t,()=>e.inspect(n,t))},p=t=>{let n=xe(s);window.confirm(`${t} on ${n.id} in ${n.queueName}? This changes durable queue state and has no compare-and-swap precondition.`)&&l.run(t,()=>e.mutate(n,t),{exclusive:!0})};return(0,H.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(360px,0.8fr)_minmax(0,1.2fr)]`,children:[(0,H.jsxs)(`section`,{className:`rounded-lg border border-line bg-surface p-4`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Dependency control`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:`Run the official Flow Job dependency methods against the managed server TCP endpoint.`}),i&&(0,H.jsx)(`div`,{className:`mt-4`,children:(0,H.jsx)(q,{target:s,onChange:c})}),(0,H.jsx)(`h3`,{className:`mt-5 mb-2 text-[10px] font-semibold uppercase tracking-wider text-faint`,children:`Inspect`}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ve.map(e=>(0,H.jsx)(`button`,{type:`button`,disabled:!d||!!u,onClick:()=>f(e),className:`rounded-md border border-line px-2.5 py-1.5 font-mono text-[11px] text-muted disabled:opacity-40`,children:e},e))}),(0,H.jsx)(`h3`,{className:`mt-5 mb-2 text-[10px] font-semibold uppercase tracking-wider text-faint`,children:`Mutate`}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ye.map(e=>(0,H.jsx)(`button`,{type:`button`,disabled:!d||!!u,onClick:()=>p(e.id),className:e.dangerous?`rounded-md border border-danger/40 px-2.5 py-1.5 text-xs text-danger disabled:opacity-40`:`rounded-md border border-line px-2.5 py-1.5 text-xs text-muted disabled:opacity-40`,children:e.label},e.id))})]}),(0,H.jsxs)(`section`,{className:`rounded-lg border border-line bg-surface p-4`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Operation result`}),(0,H.jsx)(`p`,{className:`mt-1 mb-4 text-xs text-faint`,children:u?`Running ${u}…`:`The last authoritative broker response appears here.`}),l.error&&(0,H.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-danger`,children:l.error}),l.result===void 0?(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:`Choose an inspection or mutation.`}):(0,H.jsx)(U,{value:l.result})]})]})}var xe=e=>({id:e.id.trim(),queueName:e.queueName.trim()});function Se({repository:e=V,initialIds:t=``}){let[n,r]=(0,R.useState)(t),i=G(W(n)),a=i.busy,o=Ce(n),s=async t=>{if(o.length===0)return;let n=[...o];await i.run(t,async()=>t===`one`?await e.getParentResult(n[0]):await e.getParentResults(n))};return(0,H.jsxs)(`section`,{className:`grid gap-5 rounded-lg border border-line bg-surface p-4 xl:grid-cols-[minmax(320px,0.8fr)_minmax(0,1.2fr)]`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Parent results`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:`Resolve completed parent values through the official FlowProducer result API.`}),(0,H.jsxs)(`label`,{className:`mt-4 block text-xs text-faint`,children:[`Parent IDs, one per line`,(0,H.jsx)(`textarea`,{"aria-label":`Flow parent IDs`,value:n,onChange:e=>r(e.target.value),placeholder:`parent-job-id
2
- another-parent-id`,className:`mt-1 min-h-28 w-full resize-y rounded-lg border border-line bg-surface-2 p-3 font-mono text-xs text-fg`})]}),(0,H.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:o.length===0||!!a,onClick:()=>void s(`one`),className:`rounded-md border border-line px-3 py-1.5 font-mono text-xs text-muted disabled:opacity-40`,children:`getParentResult`}),(0,H.jsxs)(`button`,{type:`button`,disabled:o.length===0||!!a,onClick:()=>void s(`many`),className:`rounded-md border border-line px-3 py-1.5 font-mono text-xs text-muted disabled:opacity-40`,children:[`getParentResults (`,o.length,`)`]})]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:`Resolved values`}),(0,H.jsx)(`p`,{className:`mt-1 mb-4 text-xs text-faint`,children:a?`Reading durable results…`:`Falsy values and input ordering are preserved.`}),i.error&&(0,H.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-danger`,children:i.error}),i.result===void 0?(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:`No parent result requested.`}):(0,H.jsx)(U,{value:i.result})]})]})}function Ce(e){return e.split(/[,\n]/).map(e=>e.trim()).filter(Boolean).slice(0,1e3)}function we({repository:e=V,target:t,onTargetChange:n}){let[r,i]=(0,R.useState)(`10`),[a,o]=(0,R.useState)(`100`),s=G(W(t.id,t.queueName,r,a)),c=!!s.busy,l=!!(t.id.trim()&&t.queueName.trim())&&ke(r)&&ke(a),u=async()=>{if(!l)return;let n={target:{id:t.id.trim(),queueName:t.queueName.trim()},depth:Number(r),maxChildren:Number(a)};await s.run(`getFlow`,async()=>{let t=await e.getFlow({...n.target,depth:n.depth,maxChildren:n.maxChildren});return{...n,value:t}})};return(0,H.jsxs)(`section`,{className:`rounded-lg border border-line bg-surface p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`FlowProducer.getFlow`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:`Read the broker-native tree with explicit traversal limits. Results are bound to the target and limits that produced them.`})]}),(0,H.jsx)(`button`,{type:`button`,disabled:!l||c,onClick:()=>void u(),className:`rounded-md bg-accent px-3 py-2 text-xs font-medium text-accent-fg disabled:opacity-40`,children:c?`Loading tree...`:`Load getFlow tree`})]}),(0,H.jsx)(`div`,{className:`mt-4`,children:(0,H.jsx)(q,{target:t,onChange:n})}),(0,H.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,H.jsx)(Te,{label:`Depth`,value:r,onChange:i}),(0,H.jsx)(Te,{label:`Children per level`,value:a,onChange:o})]}),(0,H.jsx)(`p`,{className:`mt-2 text-[11px] text-faint`,children:`Both limits accept integers from 0 to 500.`}),s.error&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:s.error}),s.result&&(0,H.jsx)(Ee,{loaded:s.result})]})}function Te({label:e,value:t,onChange:n}){return(0,H.jsxs)(`label`,{className:`text-xs text-faint`,children:[e,(0,H.jsx)(`input`,{"aria-label":`getFlow ${e}`,type:`number`,min:`0`,max:`500`,step:`1`,value:t,onChange:e=>n(e.target.value),className:`mt-1 h-9 w-full rounded-lg border border-line bg-surface-2 px-3 text-sm text-fg`})]})}function Ee({loaded:e}){let t=De(e.value),n=t?Oe(t):[];return(0,H.jsxs)(`div`,{className:`mt-4 border-t border-line pt-4`,"aria-live":`polite`,children:[(0,H.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,H.jsxs)(`span`,{className:`font-mono text-fg`,children:[e.target.queueName,`/`,e.target.id]}),(0,H.jsxs)(`span`,{className:`text-faint`,children:[`depth `,e.depth,`, max children `,e.maxChildren]})]}),t===null?(0,H.jsx)(`p`,{className:`rounded-md border border-line bg-bg p-3 text-sm text-muted`,children:`Bunqueue returned no flow for this target.`}):n.length>0?(0,H.jsx)(`ul`,{"aria-label":`getFlow tree result`,className:`max-h-72 overflow-auto rounded-md border border-line bg-bg`,children:n.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-max items-center gap-2 border-b border-line/60 px-3 py-2 last:border-b-0`,style:{paddingLeft:`${12+Math.min(e.level,20)*18}px`},children:[(0,H.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] ${T(e.state)}`,children:e.state}),(0,H.jsx)(`span`,{className:`font-mono text-xs text-fg`,children:e.id}),(0,H.jsx)(`span`,{className:`text-xs text-muted`,children:e.name}),(0,H.jsx)(`span`,{className:`text-[11px] text-faint`,children:e.queueName})]},e.id))}):(0,H.jsx)(`p`,{role:`alert`,className:`rounded-md border border-warning/40 p-3 text-sm text-warning`,children:`The agent returned an unrecognized getFlow payload. Inspect the raw JSON below.`}),(0,H.jsxs)(`details`,{className:`mt-3`,open:!0,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted`,children:`Raw getFlow JSON`}),(0,H.jsx)(`div`,{className:`mt-2`,children:(0,H.jsx)(U,{value:e.value})})]})]})}function De(e){let t=J(e),n=J(t?.result)??t;if(!(!n||!Object.hasOwn(n,`flow`)))return n.flow===null?null:J(n.flow)}function Oe(e){let t=[],n=[{node:e,level:0}],r=new WeakSet;for(;n.length>0&&t.length<1e3;){let e=n.shift();if(!e||r.has(e.node))continue;r.add(e.node),t.push({id:Y(e.node.id,`(missing id)`),name:Y(e.node.name,`(unnamed)`),queueName:Y(e.node.queueName,`(missing queue)`),state:Y(e.node.state,`unknown`),level:e.level});let i=Array.isArray(e.node.children)?e.node.children:[];n.unshift(...i.map(J).filter(e=>e!==void 0).map(t=>({node:t,level:e.level+1})))}return t}var ke=e=>/^\d+$/.test(e)&&Number(e)<=500,J=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:void 0,Y=(e,t)=>typeof e==`string`&&e.length>0?e:t,Ae=[`getState`,`isWaiting`,`isActive`,`isDelayed`,`isCompleted`,`isFailed`,`isWaitingChildren`,`toJSON`,`asJSON`],X={updateData:{data:{}},updateProgress:{progress:50,message:`Halfway`},log:{message:`Operator note`},changeDelay:{delay:1e3},changePriority:{priority:1,lifo:!1},clearLogs:{keepLogs:0},removeDeduplicationKey:{}},je={progress:{stage:`hydrate`,completed:4,total:10}};function Me({repository:e=V,initialTarget:t={id:``,queueName:``}}){let[n,r]=(0,R.useState)(t),[i,a]=(0,R.useState)(`updateData`),[o,s]=(0,R.useState)(JSON.stringify(X.updateData,null,2)),[c,l]=(0,R.useState)(`30000`),u=G(W(n.id,n.queueName,i,o,c),`job-toolkit`),d=u.busy,f=!!(n.id.trim()&&n.queueName.trim()),p=e=>{a(e),s(JSON.stringify(X[e],null,2))};return(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsx)(we,{repository:e,target:n,onTargetChange:r}),(0,H.jsxs)(`section`,{className:`rounded-lg border border-line bg-surface p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Flow Job methods`}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-faint`,children:`State predicates, serialization, bounded waiting, and durable mutations from Bunqueue 2.9.3.`})]}),d&&(0,H.jsxs)(`span`,{className:`font-mono text-xs text-accent`,children:[d,`…`]})]}),(0,H.jsx)(`div`,{className:`mt-4`,children:(0,H.jsx)(q,{target:n,onChange:r})}),(0,H.jsx)(`h3`,{className:`mt-5 mb-2 text-[10px] font-semibold uppercase tracking-wider text-faint`,children:`Inspect state and wire JSON`}),(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ae.map(t=>(0,H.jsx)(`button`,{type:`button`,disabled:!f||!!d,onClick:()=>{let r=Z(n);u.run(t,()=>e.inspect(r,t))},className:`rounded-md border border-line px-2.5 py-1.5 font-mono text-[11px] text-muted disabled:opacity-40`,children:t},t))}),(0,H.jsxs)(`div`,{className:`mt-5 grid gap-4 xl:grid-cols-[minmax(0,1fr)_minmax(300px,0.7fr)]`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,H.jsxs)(`label`,{className:`text-xs text-faint`,children:[`Mutation`,(0,H.jsx)(`select`,{"aria-label":`Flow Job mutation`,value:i,onChange:e=>p(e.target.value),className:`mt-1 block h-9 rounded-lg border border-line bg-surface-2 px-3 font-mono text-xs text-fg`,children:Object.keys(X).map(e=>(0,H.jsx)(`option`,{children:e},e))})]}),(0,H.jsx)(`button`,{type:`button`,disabled:!f||!!d,onClick:()=>{let t;try{t=JSON.parse(o)}catch{return u.reject(`Mutation payload must be valid JSON.`)}if(!t||typeof t!=`object`||Array.isArray(t))return u.reject(`Mutation payload must be a JSON object.`);let r=Z(n),a=i;window.confirm(`${a} on ${r.id}? This writes durable job state without a compare-and-swap precondition.`)&&u.run(a,()=>e.mutate(r,a,t),{exclusive:!0})},className:`h-9 rounded-md border border-warning/40 px-3 text-xs text-warning disabled:opacity-40`,children:`Apply mutation`}),i===`updateProgress`&&(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>s(JSON.stringify(X.updateProgress,null,2)),className:`h-9 rounded-md border border-line px-3 text-xs text-muted`,children:`Numeric progress`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>s(JSON.stringify(je,null,2)),className:`h-9 rounded-md border border-line px-3 text-xs text-muted`,children:`Object progress`})]})]}),(0,H.jsx)(`textarea`,{"aria-label":`Flow Job mutation JSON`,value:o,onChange:e=>s(e.target.value),className:`mt-3 min-h-32 w-full resize-y rounded-lg border border-line bg-bg p-3 font-mono text-xs text-fg`})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`label`,{className:`text-xs text-faint`,children:[`waitUntilFinished TTL (ms)`,(0,H.jsx)(`input`,{"aria-label":`Flow wait TTL`,type:`number`,min:`1`,max:`60000`,value:c,onChange:e=>l(e.target.value),className:`mt-1 block h-9 w-full rounded-lg border border-line bg-surface-2 px-3 text-sm text-fg`})]}),(0,H.jsx)(`button`,{type:`button`,disabled:!f||!!d||!Ne(c),onClick:()=>{let t=Z(n),r=Number(c);u.run(`waitUntilFinished`,()=>e.waitUntilFinished(t,r))},className:`mt-3 rounded-md border border-line px-3 py-2 font-mono text-xs text-muted disabled:opacity-40`,children:`waitUntilFinished`}),(0,H.jsx)(`p`,{className:`mt-3 text-[11px] leading-5 text-faint`,children:`Lease-only methods are not forged here: extendLock and worker state transitions require the active worker token; discard is process-local and non-awaitable.`})]})]}),u.error&&(0,H.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:u.error}),u.result!==void 0&&(0,H.jsx)(`div`,{className:`mt-4`,children:(0,H.jsx)(U,{value:u.result})})]}),(0,H.jsx)(be,{repository:e,target:n,onTargetChange:r,showTarget:!1}),(0,H.jsx)(Se,{repository:e})]})}var Z=e=>({id:e.id.trim(),queueName:e.queueName.trim()}),Ne=e=>Number.isSafeInteger(Number(e))&&Number(e)>=1&&Number(e)<=6e4;function Pe({input:e,loading:t,onInput:n,onSubmit:r}){return(0,H.jsxs)(p,{className:`mb-6`,children:[(0,H.jsxs)(`form`,{onSubmit:r,className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsx)(`input`,{name:`flow-job-id`,autoComplete:`off`,spellCheck:!1,maxLength:1024,value:e,onChange:e=>n(e.target.value),placeholder:`Flow job ID`,"aria-label":`Root job ID`,"aria-describedby":`flow-input-help`,className:`min-w-0 flex-1 rounded-lg border border-line bg-surface-2 px-3 py-2 font-mono text-sm text-fg outline-none placeholder:text-faint focus-visible:ring-2 focus-visible:ring-accent/50`}),(0,H.jsx)(`button`,{type:`submit`,disabled:t||!e.trim(),className:`rounded-lg bg-accent px-4 py-2 text-sm font-medium text-accent-fg disabled:opacity-50`,children:t?`Loading…`:`Load Flow`})]}),(0,H.jsxs)(`p`,{id:`flow-input-help`,className:`mt-2 text-xs text-faint`,children:[`Start from any surviving structural node. Bunqueue 2.9.3 flow topology is resolved from durable parent, children, and dependency contracts. Up to `,500,` nodes are rendered.`]})]})}var Fe={nodeWidth:168,nodeHeight:60,colGap:72,rowGap:20,padding:24};function Ie(e,t){let n=new Map,r=new Map,i=new Map;for(let t of e)n.set(t,0),r.set(t,0),i.set(t,[]);for(let e of t)!n.has(e.from)||!n.has(e.to)||e.from===e.to||(i.get(e.from)?.push(e.to),r.set(e.to,(r.get(e.to)??0)+1));let a=e.filter(e=>(r.get(e)??0)===0),o=new Set;for(;o.size<n.size;){for(;a.length;){let e=a.shift();if(!o.has(e)){o.add(e);for(let t of i.get(e)??[]){if(o.has(t))continue;n.set(t,Math.max(n.get(t)??0,(n.get(e)??0)+1));let i=(r.get(t)??0)-1;r.set(t,i),i===0&&a.push(t)}}}let t=e.find(e=>!o.has(e));if(t===void 0)break;a.push(t)}return n}function Le(e,t,n={}){let r={...Fe,...n},i=Ie(e,t),a=new Map,o=0;for(let t of e){let e=i.get(t)??0;o=Math.max(o,e);let n=a.get(e);n?n.push(t):a.set(e,[t])}let s=0;for(let e of a.values())s=Math.max(s,e.length);let c=s*r.nodeHeight+Math.max(0,s-1)*r.rowGap,l=[];for(let e=0;e<=o;e++){let t=a.get(e)??[],n=t.length*r.nodeHeight+Math.max(0,t.length-1)*r.rowGap,i=r.padding+(c-n)/2;t.forEach((t,n)=>{l.push({id:t,layer:e,x:r.padding+e*(r.nodeWidth+r.colGap),y:i+n*(r.nodeHeight+r.rowGap)})})}return{nodes:l,width:r.padding*2+(o+1)*r.nodeWidth+o*r.colGap,height:r.padding*2+c}}function Re({graph:e,layout:n,selected:r,onSelect:i}){let a=new Map(n.nodes.map(e=>[e.id,e]));return(0,H.jsxs)(p,{padded:!1,className:`max-h-[70vh] overflow-auto overscroll-contain p-4`,children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Flow Graph`}),(0,H.jsx)(`ul`,{className:`sr-only`,"aria-label":`Flow relationships`,children:e.edges.map(e=>(0,H.jsx)(`li`,{children:e.kind===`child`?`${e.from} has child ${e.to}`:`${e.to} depends on ${e.from}`},`accessible-${e.from}-${e.to}-${e.kind}`))}),(0,H.jsxs)(`div`,{className:`relative`,style:{width:n.width,height:n.height},children:[(0,H.jsxs)(`svg`,{"aria-hidden":`true`,className:`absolute inset-0 text-line`,width:n.width,height:n.height,children:[(0,H.jsxs)(`defs`,{children:[(0,H.jsx)(`marker`,{id:`flow-arrow-child`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`,children:(0,H.jsx)(`path`,{d:`M0,0 L6,3 L0,6 Z`,fill:`currentColor`})}),(0,H.jsx)(`marker`,{id:`flow-arrow-dependency`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`,children:(0,H.jsx)(`path`,{d:`M0,0 L6,3 L0,6 Z`,fill:`currentColor`})})]}),e.edges.map(e=>{let t=a.get(e.from),n=a.get(e.to);return!t||!n?null:(0,H.jsx)(`path`,{d:Be(t,n),fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeDasharray:e.kind===`depends`?`4 4`:void 0,markerEnd:`url(#flow-arrow-${e.kind===`depends`?`dependency`:`child`})`,opacity:.5},`${e.from}-${e.to}-${e.kind}`)})]}),n.nodes.map(n=>{let a=e.jobs.get(n.id),o=e.failures.has(n.id)?`unavailable`:a?.state??`unknown`;return(0,H.jsxs)(`button`,{type:`button`,"data-flow-node":n.id,onClick:()=>i(n.id),"aria-pressed":r===n.id,"aria-label":`${n.id}, queue ${a?.queue??`unknown`}, state ${o}`,title:n.id,style:{left:n.x,top:n.y,width:168,height:60},className:t(`absolute flex flex-col justify-center gap-0.5 rounded-lg border px-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/70`,T(a?.state),r===n.id&&`ring-2 ring-accent`),children:[(0,H.jsx)(`span`,{translate:`no`,className:`truncate font-mono text-xs text-fg`,children:E(n.id)}),(0,H.jsxs)(`span`,{className:`flex items-center justify-between gap-2 text-[11px]`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:a?.queue??`—`}),(0,H.jsx)(`span`,{className:`font-medium`,children:o})]})]},n.id)})]})]})}function ze(e,t,n,r){let i=(e+n)/2;return`M${e},${t} C${i},${t} ${i},${r} ${n},${r}`}function Be(e,t){return e.x<=t.x?ze(e.x+168,e.y+60/2,t.x,t.y+60/2):ze(e.x,e.y+60/2,t.x+168,t.y+60/2)}function Ve({graph:e,selected:t}){let n=t?e.jobs.get(t):void 0,r=t?e.failures.get(t):void 0;return(0,H.jsx)(`aside`,{"aria-label":`Selected job details`,"aria-live":`polite`,children:(0,H.jsxs)(p,{children:[n?(0,H.jsx)(He,{job:n,failure:r}):(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:`Select a node to inspect it.`}),(0,H.jsx)(Ue,{graph:e})]})})}function He({job:e,failure:t}){return(0,H.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-xs text-faint`,children:`Job`}),(0,H.jsx)(`div`,{translate:`no`,className:`break-all font-mono text-xs text-fg`,children:e.id})]}),t&&(0,H.jsxs)(`p`,{role:`alert`,className:`break-words text-xs text-warning`,children:[`Snapshot unavailable: `,t]}),(0,H.jsx)($,{label:`Queue`,value:e.queue??`—`}),(0,H.jsx)($,{label:`State`,value:t?`unavailable`:e.state??`unknown`}),(0,H.jsx)($,{label:`Priority`,value:e.priority===void 0?`—`:String(e.priority)}),(0,H.jsx)($,{label:`Parent`,value:e.parentId??`—`}),(0,H.jsx)($,{label:`Children`,value:t?`—`:String(e.childrenIds?.length??0)}),(0,H.jsx)($,{label:`Depends on`,value:t?`—`:String(e.dependsOn?.length??0)}),(0,H.jsx)(i,{to:`/job?id=${encodeURIComponent(e.id)}`,className:`inline-block rounded-lg border border-line px-3 py-1.5 text-xs text-muted hover:bg-surface-2 hover:text-fg`,children:`Open in Job Inspector`})]})}function Ue({graph:e}){return(0,H.jsxs)(`div`,{className:`mt-4 border-t border-line pt-3 text-xs text-faint`,"aria-live":`polite`,children:[e.truncated&&(0,H.jsxs)(`div`,{className:`mb-1 text-warning`,children:[`Graph truncated at `,500,` nodes / depth `,100,`.`]}),(0,H.jsx)(Q,{label:`known snapshot limitation`,pluralLabel:`known snapshot limitations`,values:e.limitations,tone:`text-warning`}),(0,H.jsx)(Q,{label:`unavailable node`,pluralLabel:`unavailable nodes`,values:[...e.failures].map(([e,t])=>`${e}: ${t}`),tone:`text-warning`}),e.cycle&&(0,H.jsxs)(`div`,{className:`mb-1 break-words text-danger`,children:[`Dependency cycle: `,(0,H.jsx)(`span`,{className:`font-mono`,children:e.cycle.join(` → `)})]}),(0,H.jsx)(Q,{label:`snapshot inconsistency`,pluralLabel:`snapshot inconsistencies`,values:e.issues,tone:`text-warning`}),e.policyNotes.length>0&&(0,H.jsx)(`p`,{className:`mb-1 text-muted`,children:`Failure-policy notes are informational; the HTTP snapshot cannot prove that a policy fired.`}),(0,H.jsx)(Q,{label:`failure-policy ambiguity`,pluralLabel:`failure-policy ambiguities`,values:e.policyNotes,tone:`text-muted`}),(0,H.jsxs)(`div`,{className:`mb-1`,children:[e.jobs.size,` nodes · `,e.edges.length,` edges`]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block h-px w-4 bg-current`}),` child`]}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`inline-block h-px w-4 border-t border-dashed border-current`}),` depends`]})]})]})}function Q({label:e,pluralLabel:t,values:n,tone:r}){return n.length?(0,H.jsxs)(`details`,{className:`mb-1 ${r}`,children:[(0,H.jsxs)(`summary`,{className:`cursor-pointer`,children:[n.length,` `,n.length===1?e:t]}),(0,H.jsx)(`ul`,{className:`mt-1 space-y-1 pl-3`,children:n.map(e=>(0,H.jsx)(`li`,{className:`break-words`,children:e},e))})]}):null}function $({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`shrink-0 text-xs text-faint`,children:e}),(0,H.jsx)(`span`,{className:`min-w-0 break-all text-right text-fg`,children:t})]})}function We({graph:e,selected:t,onSelect:n}){return(0,H.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,H.jsx)(Re,{graph:e,layout:(0,R.useMemo)(()=>Le([...e.jobs.keys()],e.edges,S),[e]),selected:t,onSelect:n}),(0,H.jsx)(Ve,{graph:e,selected:t})]})}function Ge(){let e=ue();return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(_,{title:`Job Flows`,description:`Inspect Bunqueue 2.9.3 parent, child, and dependency topology as an operational DAG.`,actions:e.graph&&(0,H.jsx)(`button`,{type:`button`,disabled:e.loading,onClick:()=>void e.load(e.rootParam),className:`rounded-lg border border-line px-3 py-1.5 text-sm text-muted hover:bg-surface-2 hover:text-fg disabled:opacity-50`,children:`Refresh`})}),(0,H.jsx)(`nav`,{"aria-label":`Job Flow tools`,className:`mb-5 flex border-b border-line`,children:[`explore`,`create`,`operations`].map(t=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":e.mode===t,onClick:()=>e.setMode(t),className:e.mode===t?`border-b-2 border-accent px-4 py-2 text-sm capitalize text-fg`:`border-b-2 border-transparent px-4 py-2 text-sm capitalize text-faint hover:text-fg`,children:t===`operations`?`Job methods`:t},t))}),e.mode===`create`&&(0,H.jsx)(he,{onOpen:e.openRecent}),e.mode===`operations`&&(0,H.jsx)(Me,{initialTarget:v()?{id:`flow-order-9a3f`,queueName:`orders`}:void 0}),e.mode===`explore`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Pe,{input:e.input,loading:e.loading,onInput:e.setInput,onSubmit:e.submit}),(0,H.jsxs)(`div`,{"aria-live":`polite`,children:[e.error&&(de(e.error)?(0,H.jsx)(m,{message:`Could not load the flow — ${e.error.message}`,onRetry:()=>void e.load(e.rootParam)}):(0,H.jsx)(h,{error:e.error,onRetry:()=>void e.load(e.rootParam)})),e.loading&&(0,H.jsx)(g,{label:`Loading flow…`})]}),!e.loading&&!e.graph&&!e.error&&(0,H.jsx)(_e,{recent:e.recent,onOpen:e.openRecent}),e.graph&&(0,H.jsx)(We,{graph:e.graph,selected:e.selected,onSelect:e.setSelected})]})]})}export{Ge as Flows};