@overlordai/server 1.0.119 → 1.0.121

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 (82) hide show
  1. package/package.json +4 -4
  2. package/public/assets/{AccessTokensPage-vSpz8li3.js → AccessTokensPage-DjD5LZsA.js} +1 -1
  3. package/public/assets/{AdminPage-CPYnv3Ii.js → AdminPage-BUC4Y85a.js} +1 -1
  4. package/public/assets/{AgentCliPage-Cjbcjh8n.js → AgentCliPage-BlASsz-A.js} +1 -1
  5. package/public/assets/{ApiReferencePage-TkyZAw27.js → ApiReferencePage-C8Bx02qj.js} +1 -1
  6. package/public/assets/{ArchitecturePage-9_RZSDbj.js → ArchitecturePage-CfNRUT_y.js} +1 -1
  7. package/public/assets/{AuditLogPage-Wm3BZbMk.js → AuditLogPage-PWgPA80y.js} +1 -1
  8. package/public/assets/{BindPlatformPage-D6E0Bp3C.js → BindPlatformPage-edTTq_uY.js} +1 -1
  9. package/public/assets/{BotIntegrationPage-BuNytSWX.js → BotIntegrationPage-ONWvd1eX.js} +1 -1
  10. package/public/assets/{BotManage-CUY7KE4f.js → BotManage-BB1hDnX_.js} +1 -1
  11. package/public/assets/{BotSetupPage-BQQI6JOk.js → BotSetupPage-D4935h0w.js} +1 -1
  12. package/public/assets/{ChangelogPage-Ch6-L8hI.js → ChangelogPage-BcVgepLQ.js} +1 -1
  13. package/public/assets/{CliReferencePage-BdiSKoOu.js → CliReferencePage-BAzf89yH.js} +1 -1
  14. package/public/assets/{DeploymentPage-CYr7Ca9n.js → DeploymentPage-21M33DaS.js} +1 -1
  15. package/public/assets/{DevWorkflowPage-DM2uX3L8.js → DevWorkflowPage-DKDSiELE.js} +1 -1
  16. package/public/assets/{DeveloperManage-BMYOz6ZR.js → DeveloperManage-BmdITcZP.js} +1 -1
  17. package/public/assets/{DeveloperSetupPage-BpUDpRJ4.js → DeveloperSetupPage-CBeh_qVr.js} +1 -1
  18. package/public/assets/{DocsIndexPage-DlIN41Vy.js → DocsIndexPage-IQGwIaxX.js} +1 -1
  19. package/public/assets/{DocsLayout-jgGmSplU.js → DocsLayout-D2Mu8hlA.js} +1 -1
  20. package/public/assets/{DocsPrimitives-DE5GURL4.js → DocsPrimitives-BC1kM-J1.js} +1 -1
  21. package/public/assets/{EditProjectPage-BsZhl2Jz.js → EditProjectPage-BImjnYmT.js} +1 -1
  22. package/public/assets/{EmptyState-BXcSX10s.js → EmptyState-CLYS2Xfr.js} +1 -1
  23. package/public/assets/{EnvVariablesPage-CtjfZfYc.js → EnvVariablesPage-6QIcLih_.js} +1 -1
  24. package/public/assets/{HomePage-CpWo0uLv.js → HomePage-B2acOwjz.js} +1 -1
  25. package/public/assets/{InfoRow-DZbyVRFu.js → InfoRow-Br40svWC.js} +1 -1
  26. package/public/assets/{InstallationPage-BQr90Yc3.js → InstallationPage-DN_QajMd.js} +1 -1
  27. package/public/assets/{LandingPage-CaXXw1hm.js → LandingPage-3ulS5Cqn.js} +1 -1
  28. package/public/assets/{LocalDevelopmentPage-CqWzffsm.js → LocalDevelopmentPage-lBHHYq61.js} +1 -1
  29. package/public/assets/{LoginPage-DPpmpzbj.js → LoginPage-Ct_jVDj4.js} +1 -1
  30. package/public/assets/{MetricBar-DiBUQemf.js → MetricBar-Ciyfa0sk.js} +1 -1
  31. package/public/assets/{NotFoundPage-BvcEqyzD.js → NotFoundPage-DveirmMy.js} +1 -1
  32. package/public/assets/{OnboardingGuide-McvDmAkL.js → OnboardingGuide-dABpef73.js} +1 -1
  33. package/public/assets/{PermissionsPage-AKqlLxTT.js → PermissionsPage-BuR4Kbo5.js} +1 -1
  34. package/public/assets/{PipelineConfigPage-BkW3OPg6.js → PipelineConfigPage-Dk6AjEpj.js} +1 -1
  35. package/public/assets/{PipelineEditorPage-CXufzBP3.js → PipelineEditorPage-DAZfSuYk.js} +1 -1
  36. package/public/assets/{ProfilePage-DhX8bJxC.js → ProfilePage-CZQ3htfG.js} +1 -1
  37. package/public/assets/{ProjectDetailPage-uOvkySHD.js → ProjectDetailPage-NnvPZi7k.js} +1 -1
  38. package/public/assets/{ProjectListPage-B4fumD1W.js → ProjectListPage-COMMwrrs.js} +1 -1
  39. package/public/assets/{PtyTerminal-BVx6SZ5w.js → PtyTerminal-CsUopN--.js} +1 -1
  40. package/public/assets/{QuickAuth-DDUuo6k9.js → QuickAuth-B936hKKS.js} +1 -1
  41. package/public/assets/{RemoveMemberConfirmDialog-BXve-xdz.js → RemoveMemberConfirmDialog-51OZ8-DG.js} +1 -1
  42. package/public/assets/{Select-D0J9HUFR.js → Select-BSZv3-zA.js} +1 -1
  43. package/public/assets/{SettingsPage-Bb6I_suM.js → SettingsPage-NfHYjZBQ.js} +1 -1
  44. package/public/assets/{Skeleton--iVaC4a-.js → Skeleton--jhFTD9y.js} +1 -1
  45. package/public/assets/{SkillPage-K2P8B1hJ.js → SkillPage-C082Rzgs.js} +1 -1
  46. package/public/assets/{TaskDetailPage-9aABpX-f.js → TaskDetailPage-CW2ETn6a.js} +1 -1
  47. package/public/assets/{TaskListPage-CPuOkWSi.js → TaskListPage-2YolzAUA.js} +1 -1
  48. package/public/assets/{TaskStatusBadge-DSdEuqKx.js → TaskStatusBadge-CyAFGWdX.js} +1 -1
  49. package/public/assets/{TerminalHomePage-4aRpII1b.js → TerminalHomePage-BEYHtMw1.js} +1 -1
  50. package/public/assets/{TokenManage-DnvaDq52.js → TokenManage-iqPhAikO.js} +1 -1
  51. package/public/assets/{Tooltip-pxF_xi4D.js → Tooltip-CRoEzYUX.js} +1 -1
  52. package/public/assets/{TotpSetupPage-z-YHejVE.js → TotpSetupPage-Cj5ywlij.js} +1 -1
  53. package/public/assets/{WorkerDetailPage-E4zltQ-6.js → WorkerDetailPage-Bu2t2eiz.js} +1 -1
  54. package/public/assets/{WorkerListPage-dqLBDqbD.js → WorkerListPage-xz1kYnO8.js} +1 -1
  55. package/public/assets/{WorkerOperationsPage-6b3TgmF6.js → WorkerOperationsPage-biq5EcKg.js} +1 -1
  56. package/public/assets/{WorkerSetupGuidePage-CBK3ffpd.js → WorkerSetupGuidePage-CQD-nP4Z.js} +1 -1
  57. package/public/assets/{WorkerSetupPage-xeHF-fmM.js → WorkerSetupPage-ODbWtI01.js} +1 -1
  58. package/public/assets/{arrow-left-D5_HxwUX.js → arrow-left-DYegNcmw.js} +1 -1
  59. package/public/assets/{arrow-right-yE4lIa6E.js → arrow-right-n-vPVd-M.js} +1 -1
  60. package/public/assets/{bot-BDqj0UAU.js → bot-BI2BC80I.js} +1 -1
  61. package/public/assets/{chevron-right-BTySCEYh.js → chevron-right-D3qNo9U3.js} +1 -1
  62. package/public/assets/{copy-KeslEmg5.js → copy-BLEXwXKi.js} +1 -1
  63. package/public/assets/{download-CURJKw2s.js → download-K97qc9xO.js} +1 -1
  64. package/public/assets/{external-link-D0UQ0z1b.js → external-link-DsfX53XY.js} +1 -1
  65. package/public/assets/{git-fork-OGh4iolX.js → git-fork-DhJSgdGh.js} +1 -1
  66. package/public/assets/{index-7X0ZuHn2.js → index-x79JUbd5.js} +2 -2
  67. package/public/assets/{key-BHtZ_-rK.js → key-sr7S2rHV.js} +1 -1
  68. package/public/assets/{loader-circle-Cxl8bKaD.js → loader-circle-DUxutFG5.js} +1 -1
  69. package/public/assets/{pencil-_jO5hyDH.js → pencil-D8sL4vSI.js} +1 -1
  70. package/public/assets/{plus-BP7i975G.js → plus-CELW4eN8.js} +1 -1
  71. package/public/assets/{rotate-ccw-Jrq1kHrn.js → rotate-ccw-BfxYzOwW.js} +1 -1
  72. package/public/assets/{scroll-text-BHayKMvT.js → scroll-text-hWEcQGkm.js} +1 -1
  73. package/public/assets/{settings-gFvmeseu.js → settings-Ce0B6REu.js} +1 -1
  74. package/public/assets/{status-colors-CnP7XFET.js → status-colors-BujbjNFH.js} +1 -1
  75. package/public/assets/{task-constants-enU_9SnB.js → task-constants-BMprKABA.js} +1 -1
  76. package/public/assets/{trash-2-CXouO75C.js → trash-2-CeGqIiDL.js} +1 -1
  77. package/public/assets/{useFetch-DBR2vmQR.js → useFetch-Cv9thl8s.js} +1 -1
  78. package/public/assets/{users-ILxUsQk9.js → users-CEeVOWBh.js} +1 -1
  79. package/public/assets/{wifi-0TOHf31V.js → wifi-DqPRFd9H.js} +1 -1
  80. package/public/assets/{workflow-BBfjKI8b.js → workflow-HQWmlzsQ.js} +1 -1
  81. package/public/index.html +1 -1
  82. package/public/sw.js +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./index-7X0ZuHn2.js";function t(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers are the machines that execute tasks. overlord monitors worker health, handles capability degradation, recovers from disconnections, and cleans up orphaned processes — all automatically. this guide covers the operational behavior you should understand when running workers in production."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// health monitoring"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> heartbeat"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["workers send a heartbeat to the server every ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"30 seconds"}),". if the server receives no heartbeat for ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"3 minutes"}),", the worker is marked ",e.jsx("code",{className:"text-[var(--accent)]",children:"OFFLINE"}),"."]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the heartbeat payload includes system metrics (cpu, memory, disk usage) that are displayed in the web dashboard."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> disk usage auto-drain"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["when a worker's disk usage exceeds ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"90%"}),", the server automatically sets the worker status to ",e.jsx("code",{className:"text-[var(--accent)]",children:"DRAINING"}),". draining workers stop accepting new tasks but continue executing any in-progress work."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// auto-drain is not automatically reversed. after freeing disk space, an operator must manually undrain the worker via the dashboard or api."})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability degradation"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["workers track consecutive failures per agent type. after ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"3 consecutive failures"}),", that agent type is marked as degraded on the worker and tasks requiring it will be routed elsewhere."]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"failure types determine the recovery window:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"failure type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"recovery time"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"binary_missing"})}),e.jsx("td",{className:"px-3 py-2",children:"permanent"}),e.jsx("td",{className:"px-3 py-2",children:"agent binary not found — requires manual installation"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"auth_failure"})}),e.jsx("td",{className:"px-3 py-2",children:"5 minutes"}),e.jsx("td",{className:"px-3 py-2",children:"credential or token issue"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"rate_limit"})}),e.jsx("td",{className:"px-3 py-2",children:"1 minute"}),e.jsx("td",{className:"px-3 py-2",children:"upstream rate limit hit"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"unknown"})}),e.jsx("td",{className:"px-3 py-2",children:"10 minutes"}),e.jsx("td",{className:"px-3 py-2",children:"unclassified error"})]})]})]})}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"a single successful execution resets the failure counter for that agent type, restoring the worker's capability."}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// permanent degradation (e.g. binary_missing) persists until the worker is restarted with the missing binary installed."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// orphan reaper"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"on startup, each worker runs an orphan reaper that cleans up processes left behind by a previous crash or unclean shutdown. this prevents zombie processes from consuming resources."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the cleanup sequence:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsx("li",{children:"1. identify orphaned processes from previous worker sessions"}),e.jsxs("li",{children:["2. send ",e.jsx("code",{className:"text-[var(--accent)]",children:"SIGTERM"})," to each process"]}),e.jsxs("li",{children:["3. wait ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"5 seconds"})," for graceful shutdown"]}),e.jsxs("li",{children:["4. send ",e.jsx("code",{className:"text-[var(--accent)]",children:"SIGKILL"})," to any remaining processes"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the orphan reaper supports both linux and macos process management."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cursor remote tunnel"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers can start a cursor remote tunnel for a task's workspace, making it accessible via the web dashboard for interactive debugging."}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"startup timeout:"})," 30 seconds — if the tunnel fails to establish within this window, it is marked as failed"]}),e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"auto-crash recovery:"})," if the tunnel process crashes, the worker retries up to 3 times with exponential backoff (2s, 4s, 8s delays)"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"tunnels are tied to the task lifecycle and are torn down when the task completes or is cancelled."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// reconnection recovery"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["when a worker comes back online after a disconnection, overlord reconciles task state between the worker's local view and the server's records. workers have a ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"10 minute grace window"})," — if they reconnect within this period, recovery is attempted instead of failing all tasks."]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the reconciliation covers six branches:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"server state"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"worker state"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"action"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"suspended"}),e.jsx("td",{className:"px-3 py-2",children:"running"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"resume"})," — task continued running, update server to running"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"suspended"}),e.jsx("td",{className:"px-3 py-2",children:"completed"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"complete"})," — task finished while suspended, accept result"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"failed"}),e.jsx("td",{className:"px-3 py-2",children:"running"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"cancel"})," — server marked it failed, tell worker to stop"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"failed"}),e.jsx("td",{className:"px-3 py-2",children:"completed"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"restore"})," — task actually succeeded, restore result on server"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cancelled"}),e.jsx("td",{className:"px-3 py-2",children:"any"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"stop"})," — user cancelled, ensure worker stops execution"]})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"not reported"}),e.jsx("td",{className:"px-3 py-2",children:"—"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"fail"})," — worker has no record of this task, mark it failed"]})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// the 10 minute grace window is intentionally generous to handle brief network blips, server restarts, and worker reboots without losing in-progress work."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// boot reconciliation"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when the server starts (or restarts), it reconciles all task state to ensure consistency:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"queued tasks"})," — re-enqueued into the dispatch queue"]}),e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"assigned tasks"})," (claimed by a worker but not yet running) — reset to queued for reassignment"]}),e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"stale running tasks"})," (assigned to workers that are now offline) — marked as failed"]})]})]})]})})}export{t as default};
1
+ import{j as e}from"./index-x79JUbd5.js";function t(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers are the machines that execute tasks. overlord monitors worker health, handles capability degradation, recovers from disconnections, and cleans up orphaned processes — all automatically. this guide covers the operational behavior you should understand when running workers in production."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// health monitoring"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> heartbeat"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["workers send a heartbeat to the server every ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"30 seconds"}),". if the server receives no heartbeat for ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"3 minutes"}),", the worker is marked ",e.jsx("code",{className:"text-[var(--accent)]",children:"OFFLINE"}),"."]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the heartbeat payload includes system metrics (cpu, memory, disk usage) that are displayed in the web dashboard."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> disk usage auto-drain"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["when a worker's disk usage exceeds ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"90%"}),", the server automatically sets the worker status to ",e.jsx("code",{className:"text-[var(--accent)]",children:"DRAINING"}),". draining workers stop accepting new tasks but continue executing any in-progress work."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// auto-drain is not automatically reversed. after freeing disk space, an operator must manually undrain the worker via the dashboard or api."})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability degradation"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["workers track consecutive failures per agent type. after ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"3 consecutive failures"}),", that agent type is marked as degraded on the worker and tasks requiring it will be routed elsewhere."]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"failure types determine the recovery window:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"failure type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"recovery time"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"binary_missing"})}),e.jsx("td",{className:"px-3 py-2",children:"permanent"}),e.jsx("td",{className:"px-3 py-2",children:"agent binary not found — requires manual installation"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"auth_failure"})}),e.jsx("td",{className:"px-3 py-2",children:"5 minutes"}),e.jsx("td",{className:"px-3 py-2",children:"credential or token issue"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"rate_limit"})}),e.jsx("td",{className:"px-3 py-2",children:"1 minute"}),e.jsx("td",{className:"px-3 py-2",children:"upstream rate limit hit"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"unknown"})}),e.jsx("td",{className:"px-3 py-2",children:"10 minutes"}),e.jsx("td",{className:"px-3 py-2",children:"unclassified error"})]})]})]})}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"a single successful execution resets the failure counter for that agent type, restoring the worker's capability."}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// permanent degradation (e.g. binary_missing) persists until the worker is restarted with the missing binary installed."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// orphan reaper"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"on startup, each worker runs an orphan reaper that cleans up processes left behind by a previous crash or unclean shutdown. this prevents zombie processes from consuming resources."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the cleanup sequence:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsx("li",{children:"1. identify orphaned processes from previous worker sessions"}),e.jsxs("li",{children:["2. send ",e.jsx("code",{className:"text-[var(--accent)]",children:"SIGTERM"})," to each process"]}),e.jsxs("li",{children:["3. wait ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"5 seconds"})," for graceful shutdown"]}),e.jsxs("li",{children:["4. send ",e.jsx("code",{className:"text-[var(--accent)]",children:"SIGKILL"})," to any remaining processes"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the orphan reaper supports both linux and macos process management."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cursor remote tunnel"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers can start a cursor remote tunnel for a task's workspace, making it accessible via the web dashboard for interactive debugging."}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"startup timeout:"})," 30 seconds — if the tunnel fails to establish within this window, it is marked as failed"]}),e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"auto-crash recovery:"})," if the tunnel process crashes, the worker retries up to 3 times with exponential backoff (2s, 4s, 8s delays)"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"tunnels are tied to the task lifecycle and are torn down when the task completes or is cancelled."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// reconnection recovery"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["when a worker comes back online after a disconnection, overlord reconciles task state between the worker's local view and the server's records. workers have a ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"10 minute grace window"})," — if they reconnect within this period, recovery is attempted instead of failing all tasks."]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the reconciliation covers six branches:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"server state"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"worker state"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"action"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"suspended"}),e.jsx("td",{className:"px-3 py-2",children:"running"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"resume"})," — task continued running, update server to running"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"suspended"}),e.jsx("td",{className:"px-3 py-2",children:"completed"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"complete"})," — task finished while suspended, accept result"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"failed"}),e.jsx("td",{className:"px-3 py-2",children:"running"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"cancel"})," — server marked it failed, tell worker to stop"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"failed"}),e.jsx("td",{className:"px-3 py-2",children:"completed"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"restore"})," — task actually succeeded, restore result on server"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cancelled"}),e.jsx("td",{className:"px-3 py-2",children:"any"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"stop"})," — user cancelled, ensure worker stops execution"]})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"not reported"}),e.jsx("td",{className:"px-3 py-2",children:"—"}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"fail"})," — worker has no record of this task, mark it failed"]})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// the 10 minute grace window is intentionally generous to handle brief network blips, server restarts, and worker reboots without losing in-progress work."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// boot reconciliation"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when the server starts (or restarts), it reconciles all task state to ensure consistency:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"queued tasks"})," — re-enqueued into the dispatch queue"]}),e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"assigned tasks"})," (claimed by a worker but not yet running) — reset to queued for reassignment"]}),e.jsxs("li",{children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"stale running tasks"})," (assigned to workers that are now offline) — marked as failed"]})]})]})]})})}export{t as default};
@@ -1,4 +1,4 @@
1
- import{c as o,f as x,a as i,j as e,z as t}from"./index-7X0ZuHn2.js";import{K as d}from"./key-BHtZ_-rK.js";import{D as l}from"./download-CURJKw2s.js";import{S as m}from"./settings-gFvmeseu.js";import{W as p}from"./wifi-0TOHf31V.js";/**
1
+ import{c as o,f as x,a as i,j as e,z as t}from"./index-x79JUbd5.js";import{K as d}from"./key-sr7S2rHV.js";import{D as l}from"./download-K97qc9xO.js";import{S as m}from"./settings-Ce0B6REu.js";import{W as p}from"./wifi-DqPRFd9H.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-7X0ZuHn2.js";import{I as s,a as t}from"./DocsPrimitives-DE5GURL4.js";import"./copy-KeslEmg5.js";function l(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"each machine that will execute tasks needs the overlord worker package installed. workers connect to the server via websocket, receive task assignments, manage git workspaces, and run ai agents in pty terminals."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// installation"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"on each worker machine:"}),e.jsx(s,{code:"npm install -g @overlordai/cli @overlordai/worker"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// interactive setup"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"run the setup wizard:"}),e.jsx(s,{code:"overlord setup worker"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the wizard prompts for:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["1. ",e.jsx("span",{className:"text-[var(--accent)]",children:"server url"})," — the overlord server address (e.g., ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"https://overlord.yourdomain.com"})," or ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"http://localhost:9000"}),")"]}),e.jsxs("li",{children:["2. ",e.jsx("span",{className:"text-[var(--accent)]",children:"registration token"})," — a one-time token generated in admin → settings → tokens"]}),e.jsxs("li",{children:["3. ",e.jsx("span",{className:"text-[var(--accent)]",children:"machine name"})," — a display name for this worker"]}),e.jsxs("li",{children:["4. ",e.jsx("span",{className:"text-[var(--accent)]",children:"max slots"})," — maximum number of concurrent tasks (default: 2)"]})]}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the wizard writes configuration to ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"})," and starts the worker service."]})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// each worker needs its own unique registration token. generate one per machine in admin → settings → tokens (web dashboard)."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// web ui guided setup"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["alternatively, open ",e.jsx("code",{className:"text-[var(--accent)]",children:"https://your-server/workers/setup"})," in a browser. the page provides step-by-step instructions with the exact commands to run on the worker machine."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// what the worker does"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"once running, the worker:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsx("li",{children:"— connects to the server via websocket (auto-reconnects on failure)"}),e.jsx("li",{children:"— registers with the one-time token on first run, then uses jwt for subsequent connections"}),e.jsx("li",{children:"— sends heartbeats every 30 seconds with cpu, memory, and disk usage"}),e.jsxs("li",{children:["— reports installed agent capabilities (",e.jsx("code",{className:"text-[var(--accent)]",children:"claude"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"codex"}),")"]}),e.jsx("li",{children:"— receives task assignments and creates isolated git worktrees"}),e.jsx("li",{children:"— spawns pty terminals running the configured ai agent"}),e.jsx("li",{children:"— streams terminal output back to the server in real time"}),e.jsx("li",{children:"— manages cursor remote tunnels for workspace access"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configuration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker configuration is stored in ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"}),":"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"variable"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"default"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_HOST"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"server url (required)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_TOKEN"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"one-time registration token"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_NAME"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"hostname"}),e.jsx("td",{className:"px-3 py-2",children:"display name"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKSPACE_ROOT"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker/workspaces"}),e.jsx("td",{className:"px-3 py-2",children:"task workspace directory"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_MAX_SLOTS"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"2"}),e.jsx("td",{className:"px-3 py-2",children:"max concurrent tasks"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_DATA_DIR"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker"}),e.jsx("td",{className:"px-3 py-2",children:"config and jwt storage"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_SSH_KEY_PATH"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"ssh key for git operations"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// non-interactive mode"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["for automation or ci, pass ",e.jsx("code",{className:"text-[var(--accent)]",children:"--server"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"--token"})," as cli flags. non-interactive mode activates automatically when both are provided:"]}),e.jsx(t,{code:`overlord setup worker \\
1
+ import{j as e}from"./index-x79JUbd5.js";import{I as s,a as t}from"./DocsPrimitives-BC1kM-J1.js";import"./copy-BLEXwXKi.js";function l(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"each machine that will execute tasks needs the overlord worker package installed. workers connect to the server via websocket, receive task assignments, manage git workspaces, and run ai agents in pty terminals."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// installation"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"on each worker machine:"}),e.jsx(s,{code:"npm install -g @overlordai/cli @overlordai/worker"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// interactive setup"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"run the setup wizard:"}),e.jsx(s,{code:"overlord setup worker"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the wizard prompts for:"}),e.jsxs("ol",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["1. ",e.jsx("span",{className:"text-[var(--accent)]",children:"server url"})," — the overlord server address (e.g., ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"https://overlord.yourdomain.com"})," or ",e.jsx("code",{className:"text-[var(--text-muted)]",children:"http://localhost:9000"}),")"]}),e.jsxs("li",{children:["2. ",e.jsx("span",{className:"text-[var(--accent)]",children:"registration token"})," — a one-time token generated in admin → settings → tokens"]}),e.jsxs("li",{children:["3. ",e.jsx("span",{className:"text-[var(--accent)]",children:"machine name"})," — a display name for this worker"]}),e.jsxs("li",{children:["4. ",e.jsx("span",{className:"text-[var(--accent)]",children:"max slots"})," — maximum number of concurrent tasks (default: 2)"]})]}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the wizard writes configuration to ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"})," and starts the worker service."]})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// each worker needs its own unique registration token. generate one per machine in admin → settings → tokens (web dashboard)."})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// web ui guided setup"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["alternatively, open ",e.jsx("code",{className:"text-[var(--accent)]",children:"https://your-server/workers/setup"})," in a browser. the page provides step-by-step instructions with the exact commands to run on the worker machine."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// what the worker does"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"once running, the worker:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsx("li",{children:"— connects to the server via websocket (auto-reconnects on failure)"}),e.jsx("li",{children:"— registers with the one-time token on first run, then uses jwt for subsequent connections"}),e.jsx("li",{children:"— sends heartbeats every 30 seconds with cpu, memory, and disk usage"}),e.jsxs("li",{children:["— reports installed agent capabilities (",e.jsx("code",{className:"text-[var(--accent)]",children:"claude"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"codex"}),")"]}),e.jsx("li",{children:"— receives task assignments and creates isolated git worktrees"}),e.jsx("li",{children:"— spawns pty terminals running the configured ai agent"}),e.jsx("li",{children:"— streams terminal output back to the server in real time"}),e.jsx("li",{children:"— manages cursor remote tunnels for workspace access"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configuration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker configuration is stored in ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.overlord-worker/.env"}),":"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"variable"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"default"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_HOST"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"server url (required)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_TOKEN"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"one-time registration token"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_NAME"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"hostname"}),e.jsx("td",{className:"px-3 py-2",children:"display name"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_WORKSPACE_ROOT"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker/workspaces"}),e.jsx("td",{className:"px-3 py-2",children:"task workspace directory"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_MAX_SLOTS"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"2"}),e.jsx("td",{className:"px-3 py-2",children:"max concurrent tasks"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_DATA_DIR"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"~/.overlord-worker"}),e.jsx("td",{className:"px-3 py-2",children:"config and jwt storage"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"OVERLORD_SSH_KEY_PATH"})}),e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"px-3 py-2",children:"ssh key for git operations"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// non-interactive mode"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["for automation or ci, pass ",e.jsx("code",{className:"text-[var(--accent)]",children:"--server"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"--token"})," as cli flags. non-interactive mode activates automatically when both are provided:"]}),e.jsx(t,{code:`overlord setup worker \\
2
2
  --server https://overlord.yourdomain.com \\
3
3
  --token ovw_1_abc123 \\
4
4
  --name worker-01 \\
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-7X0ZuHn2.js";/**
1
+ import{c as e}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as r}from"./index-7X0ZuHn2.js";/**
1
+ import{c as r}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-7X0ZuHn2.js";/**
1
+ import{c as t}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-7X0ZuHn2.js";/**
1
+ import{c as t}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-7X0ZuHn2.js";/**
1
+ import{c}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-7X0ZuHn2.js";/**
1
+ import{c as o}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-7X0ZuHn2.js";/**
1
+ import{c as a}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-7X0ZuHn2.js";/**
1
+ import{c}from"./index-x79JUbd5.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-CaXXw1hm.js","assets/arrow-right-yE4lIa6E.js","assets/bot-BDqj0UAU.js","assets/workflow-BBfjKI8b.js","assets/users-ILxUsQk9.js","assets/copy-KeslEmg5.js","assets/HomePage-CpWo0uLv.js","assets/TaskStatusBadge-DSdEuqKx.js","assets/status-colors-CnP7XFET.js","assets/Skeleton--iVaC4a-.js","assets/OnboardingGuide-McvDmAkL.js","assets/chevron-right-BTySCEYh.js","assets/date-BdNtiQTP.js","assets/useFetch-DBR2vmQR.js","assets/Tooltip-pxF_xi4D.js","assets/TerminalHomePage-4aRpII1b.js","assets/task-constants-enU_9SnB.js","assets/PtyTerminal-BVx6SZ5w.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-D0J9HUFR.js","assets/plus-BP7i975G.js","assets/rotate-ccw-Jrq1kHrn.js","assets/wifi-0TOHf31V.js","assets/TaskListPage-CPuOkWSi.js","assets/git-fork-OGh4iolX.js","assets/EmptyState-BXcSX10s.js","assets/TaskDetailPage-9aABpX-f.js","assets/arrow-left-D5_HxwUX.js","assets/external-link-D0UQ0z1b.js","assets/loader-circle-Cxl8bKaD.js","assets/WorkerListPage-dqLBDqbD.js","assets/MetricBar-DiBUQemf.js","assets/WorkerSetupGuidePage-CBK3ffpd.js","assets/key-BHtZ_-rK.js","assets/download-CURJKw2s.js","assets/settings-gFvmeseu.js","assets/WorkerDetailPage-E4zltQ-6.js","assets/InfoRow-DZbyVRFu.js","assets/trash-2-CXouO75C.js","assets/ProjectListPage-B4fumD1W.js","assets/ProjectDetailPage-uOvkySHD.js","assets/RemoveMemberConfirmDialog-BXve-xdz.js","assets/pencil-_jO5hyDH.js","assets/EditProjectPage-BsZhl2Jz.js","assets/PipelineEditorPage-CXufzBP3.js","assets/ProfilePage-DhX8bJxC.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-vSpz8li3.js","assets/CliReferencePage-BdiSKoOu.js","assets/QuickAuth-DDUuo6k9.js","assets/ApiReferencePage-TkyZAw27.js","assets/SkillPage-K2P8B1hJ.js","assets/DocsPrimitives-DE5GURL4.js","assets/DocsLayout-jgGmSplU.js","assets/InstallationPage-BQr90Yc3.js","assets/DeveloperSetupPage-BpUDpRJ4.js","assets/WorkerSetupPage-xeHF-fmM.js","assets/BotSetupPage-BQQI6JOk.js","assets/LocalDevelopmentPage-CqWzffsm.js","assets/DeploymentPage-CYr7Ca9n.js","assets/PipelineConfigPage-BkW3OPg6.js","assets/DevWorkflowPage-DM2uX3L8.js","assets/EnvVariablesPage-CtjfZfYc.js","assets/ArchitecturePage-9_RZSDbj.js","assets/AgentCliPage-Cjbcjh8n.js","assets/DocsIndexPage-DlIN41Vy.js","assets/AdminPage-CPYnv3Ii.js","assets/scroll-text-BHayKMvT.js","assets/DeveloperManage-BMYOz6ZR.js","assets/BotManage-CUY7KE4f.js","assets/TokenManage-DnvaDq52.js","assets/AuditLogPage-Wm3BZbMk.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-3ulS5Cqn.js","assets/arrow-right-n-vPVd-M.js","assets/bot-BI2BC80I.js","assets/workflow-HQWmlzsQ.js","assets/users-CEeVOWBh.js","assets/copy-BLEXwXKi.js","assets/HomePage-B2acOwjz.js","assets/TaskStatusBadge-CyAFGWdX.js","assets/status-colors-BujbjNFH.js","assets/Skeleton--jhFTD9y.js","assets/OnboardingGuide-dABpef73.js","assets/chevron-right-D3qNo9U3.js","assets/date-BdNtiQTP.js","assets/useFetch-Cv9thl8s.js","assets/Tooltip-CRoEzYUX.js","assets/TerminalHomePage-BEYHtMw1.js","assets/task-constants-BMprKABA.js","assets/PtyTerminal-CsUopN--.js","assets/PtyTerminal-Beg8tuEN.css","assets/Select-BSZv3-zA.js","assets/plus-CELW4eN8.js","assets/rotate-ccw-BfxYzOwW.js","assets/wifi-DqPRFd9H.js","assets/TaskListPage-2YolzAUA.js","assets/git-fork-DhJSgdGh.js","assets/EmptyState-CLYS2Xfr.js","assets/TaskDetailPage-CW2ETn6a.js","assets/arrow-left-DYegNcmw.js","assets/external-link-DsfX53XY.js","assets/loader-circle-DUxutFG5.js","assets/WorkerListPage-xz1kYnO8.js","assets/MetricBar-Ciyfa0sk.js","assets/WorkerSetupGuidePage-CQD-nP4Z.js","assets/key-sr7S2rHV.js","assets/download-K97qc9xO.js","assets/settings-Ce0B6REu.js","assets/WorkerDetailPage-Bu2t2eiz.js","assets/InfoRow-Br40svWC.js","assets/trash-2-CeGqIiDL.js","assets/ProjectListPage-COMMwrrs.js","assets/ProjectDetailPage-NnvPZi7k.js","assets/RemoveMemberConfirmDialog-51OZ8-DG.js","assets/pencil-D8sL4vSI.js","assets/EditProjectPage-BImjnYmT.js","assets/PipelineEditorPage-DAZfSuYk.js","assets/ProfilePage-CZQ3htfG.js","assets/password-CHk45-jw.js","assets/AccessTokensPage-DjD5LZsA.js","assets/CliReferencePage-BAzf89yH.js","assets/QuickAuth-B936hKKS.js","assets/ApiReferencePage-C8Bx02qj.js","assets/SkillPage-C082Rzgs.js","assets/DocsPrimitives-BC1kM-J1.js","assets/DocsLayout-D2Mu8hlA.js","assets/InstallationPage-DN_QajMd.js","assets/DeveloperSetupPage-CBeh_qVr.js","assets/WorkerSetupPage-ODbWtI01.js","assets/BotSetupPage-D4935h0w.js","assets/LocalDevelopmentPage-lBHHYq61.js","assets/DeploymentPage-21M33DaS.js","assets/PipelineConfigPage-Dk6AjEpj.js","assets/DevWorkflowPage-DKDSiELE.js","assets/EnvVariablesPage-6QIcLih_.js","assets/ArchitecturePage-CfNRUT_y.js","assets/AgentCliPage-BlASsz-A.js","assets/DocsIndexPage-IQGwIaxX.js","assets/AdminPage-BUC4Y85a.js","assets/scroll-text-hWEcQGkm.js","assets/DeveloperManage-BmdITcZP.js","assets/BotManage-BB1hDnX_.js","assets/TokenManage-iqPhAikO.js","assets/AuditLogPage-PWgPA80y.js"])))=>i.map(i=>d[i]);
2
2
  var Wg=Object.defineProperty;var Pm=r=>{throw TypeError(r)};var Fg=(r,u,s)=>u in r?Wg(r,u,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[u]=s;var Ve=(r,u,s)=>Fg(r,typeof u!="symbol"?u+"":u,s),gs=(r,u,s)=>u.has(r)||Pm("Cannot "+s);var q=(r,u,s)=>(gs(r,u,"read from private field"),s?s.call(r):u.get(r)),Pt=(r,u,s)=>u.has(r)?Pm("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(r):u.set(r,s),Kt=(r,u,s,o)=>(gs(r,u,"write to private field"),o?o.call(r,s):u.set(r,s),s),ke=(r,u,s)=>(gs(r,u,"access private method"),s);var eh=(r,u,s,o)=>({set _(f){Kt(r,u,f,s)},get _(){return q(r,u,o)}});(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const _ of h.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&o(_)}).observe(document,{childList:!0,subtree:!0});function s(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(f){if(f.ep)return;f.ep=!0;const h=s(f);fetch(f.href,h)}})();function Ig(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ys={exports:{}},ti={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -239,4 +239,4 @@ overlord install`,setup_step_1_link:"installation guide",setup_step_2_title:"reg
239
239
  overlord setup worker`,setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:`npm install -g @overlordai/developer-cli
240
240
  ov login https://overlord.yourdomain.com`,setup_step_3_link:"development workflow",go_to_app:"open app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header",docs_nav_getting_started:"// getting started",docs_nav_guides:"// guides",docs_nav_reference:"// reference",docs_nav_other:"// other",docs_installation:"installation",docs_developer_setup:"developer setup",docs_worker_setup:"worker setup",docs_bot_setup:"bot setup",docs_local_dev:"local development",docs_worker_ops:"worker operations",docs_deployment:"deployment",docs_bot_integration:"bot integration",docs_pipeline:"pipeline config",docs_dev_workflow:"dev workflow",docs_cli:"cli reference",docs_api:"api reference",docs_skill:"skill reference",docs_permissions:"permissions & roles",docs_env_vars:"environment variables",docs_architecture:"architecture",docs_changelog:"changelog",docs_menu:"docs menu",docs_back:"< back",docs_all_title:"// all documentation",docs_all_subtitle:"browse all guides, references, and resources",docs_desc_installation:"install overlord server and cli tools",docs_desc_developer_setup:"set up your local development environment",docs_desc_worker_setup:"register and configure worker machines",docs_desc_bot_setup:"connect lark or slack bots to overlord",docs_desc_local_dev:"run and debug overlord locally",docs_desc_worker_ops:"manage worker lifecycle and monitoring",docs_desc_deployment:"deploy overlord to production servers",docs_desc_bot_integration:"interactive cards, adapter pattern, troubleshooting",docs_desc_pipeline:"define multi-stage task pipelines",docs_desc_dev_workflow:"git workflow, branching, and merge requests",docs_desc_cli:"cli command reference",docs_desc_api:"http api endpoint reference",docs_desc_skill:"custom skill definitions and configuration",docs_desc_permissions:"roles, access control, and authorization",docs_desc_env_vars:"environment variables for server and worker",docs_desc_architecture:"system architecture and component overview",docs_desc_changelog:"version history and release notes",docs_agent_cli:"agent cli",docs_desc_agent_cli:"claude, cursor, and codex cli integration and flag mapping"},onboarding:{getting_started:"// getting started",completed_count:"{done}/{total} completed",dismiss:"dismiss",all_done:"all set! you're ready to go.",admin_create_project_title:"create your first project",admin_create_project_desc:"set up a project with a git repo and pipeline",admin_register_worker_title:"register a worker",admin_register_worker_desc:"generate a token and set up a worker to run tasks",admin_create_developer_title:"create a developer account",admin_create_developer_desc:"add team members who can create and monitor tasks",admin_configure_bot_title:"configure a chat bot",admin_configure_bot_desc:"register a Lark or Slack bot to enable task management via chat",admin_first_task_title:"create your first task",admin_first_task_desc:"verify the full pipeline works end-to-end",lead_view_projects_title:"view your projects",lead_view_projects_desc:"check the projects assigned to you",lead_configure_pipeline_title:"configure a pipeline",lead_configure_pipeline_desc:"set up stages for your project workflow",lead_add_member_title:"add a team member",lead_add_member_desc:"invite developers to your project",lead_first_task_title:"create your first task",lead_first_task_desc:"submit a task and watch it execute",dev_install_cli_title:"install the ov cli",dev_install_cli_desc:"npm install -g @overlordai/developer-cli",dev_setup_cli_title:"run ov setup",dev_setup_cli_desc:"connect to the server and authenticate",dev_link_chat_title:"link your chat account",dev_link_chat_desc:'send "bind" to the bot in Lark or Slack to connect your account',dev_view_projects_title:"explore projects",dev_view_projects_desc:"browse available projects and their pipelines",dev_first_task_title:"create your first task",dev_first_task_desc:"submit a task via web or cli",go_to_projects:"go to projects",go_to_workers:"go to workers",go_to_tasks:"go to tasks",go_to_bots:"manage bots",manage_developers:"manage developers",cli:"cli",setup_guide:"setup guide"},bind:{title:"// link platform account",linking:"linking your account...",success:"account linked successfully!",success_detail:"your {platform} account has been connected. you can now use bot commands.",error:"failed to link account",invalid_token:'this link is invalid or has expired. send "bind" to the bot again to get a new link.',back_to_home:"go to dashboard",no_token:"no bind token provided."},pwa_install:{title:"overlord://install",command:"overlord --install",desc_1:"add to home screen for standalone app experience",desc_2:"works offline · full-screen · instant launch",install:"y — install",skip:"n — skip",ios_command:"install --manual",ios_step_1:"tap share button in safari toolbar",ios_step_2:'scroll down → tap "add to home screen"',ios_step_3:'tap "add" to confirm'},pwa_update:{message:"new version available",reload:"reload"},terminal_home:{title:"terminal",select_project:"project...",all_projects:"all projects",task_description_placeholder:"describe the task...",new_task:"new task",no_active_tasks:"no active tasks",create_task_hint:"create a task using the bar above to get started",confirm_create_title:"create task",confirm_create_message:`create a [{taskType}] task in project [{projectKey}]?
241
241
 
242
- "{description}"`}};function wb(r,u){const s=u.split(".");let o=r;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Tb(r,u){return u?r.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):r}function Br(r,u){return Tb(wb(Eb,r),u)}function Vt(){return{t:g.useCallback((u,s)=>Br(u,s),[])}}function cp(){const{theme:r,setTheme:u}=sp(),{t:s}=Vt(),o=r==="dark"||r==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return m.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?m.jsx(hb,{size:16}):m.jsx(sb,{size:16})})}class Ns extends Error{constructor(s,o,f){const h=s.status||s.status===0?s.status:"",_=s.statusText??"",b=`${h} ${_}`.trim(),y=b?`status code ${b}`:"an unknown error";super(`Request failed with ${y}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class fp extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new fp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const Sh=(()=>{let r=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return r&&!u})(),jb=typeof globalThis.AbortController=="function",dp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Rb=typeof globalThis.ReadableStream=="function",Ab=typeof globalThis.FormData=="function",mp=["get","post","put","patch","head","delete"],zb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},As=2147483647,Ob=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,hp=Symbol("stop");class pp{constructor(u){Ve(this,"options");this.options=u}}const Cb=r=>new pp(r),Db={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Nb={next:!0},Mb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ub=r=>{if(!r)return 0;if(r instanceof FormData){let u=0;for(const[s,o]of r)u+=Ob,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(r instanceof Blob)return r.size;if(r instanceof ArrayBuffer)return r.byteLength;if(typeof r=="string")return new TextEncoder().encode(r).length;if(r instanceof URLSearchParams)return new TextEncoder().encode(r.toString()).length;if("byteLength"in r)return r.byteLength;if(typeof r=="object"&&r!==null)try{const u=JSON.stringify(r);return new TextEncoder().encode(u).length}catch{return 0}return 0},_p=(r,u,s)=>{let o,f=0;return r.pipeThrough(new TransformStream({transform(h,_){if(_.enqueue(h),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=h},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},qb=(r,u)=>{if(!r.body)return r;if(r.status===204)return new Response(null,{status:r.status,statusText:r.statusText,headers:r.headers});const s=Math.max(0,Number(r.headers.get("content-length"))||0);return new Response(_p(r.body,s,u),{status:r.status,statusText:r.statusText,headers:r.headers})},Lb=(r,u,s)=>{if(!r.body)return r;const o=Ub(s??r.body);return new Request(r,{duplex:"half",body:_p(r.body,o,u)})},yn=r=>r!==null&&typeof r=="object",Dr=(...r)=>{for(const u of r)if((!yn(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...r)},gp=(r={},u={})=>{const s=new globalThis.Headers(r),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[h,_]of f.entries())o&&_==="undefined"||_===void 0?s.delete(h):s.set(h,_);return s};function Nr(r,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(r[s]??[],u[s]??[])}const yp=(r={},u={})=>({beforeRequest:Nr(r,u,"beforeRequest"),beforeRetry:Nr(r,u,"beforeRetry"),afterResponse:Nr(r,u,"afterResponse"),beforeError:Nr(r,u,"beforeError")}),Hb=(r,u)=>{const s=new URLSearchParams;for(const o of[r,u])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,h]of o.entries())s.append(f,h);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yn(o))for(const[f,h]of Object.entries(o))h!==void 0&&s.append(f,String(h));else{const f=new URLSearchParams(o);for(const[h,_]of f.entries())s.append(h,_)}return s},Ws=(...r)=>{let u={},s={},o={},f;const h=[];for(const _ of r)if(Array.isArray(_))Array.isArray(u)||(u=[]),u=[...u,..._];else if(yn(_)){for(let[b,y]of Object.entries(_)){if(b==="signal"&&y instanceof globalThis.AbortSignal){h.push(y);continue}if(b==="context"){if(y!=null&&(!yn(y)||Array.isArray(y)))throw new TypeError("The `context` option must be an object");u={...u,context:y==null?{}:{...u.context,...y}};continue}if(b==="searchParams"){y==null?f=void 0:f=f===void 0?y:Hb(f,y);continue}yn(y)&&b in u&&(y=Ws(u[b],y)),u={...u,[b]:y}}yn(_.hooks)&&(o=yp(o,_.hooks),u.hooks=o),yn(_.headers)&&(s=gp(s,_.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),h.length>0&&(h.length===1?u.signal=h[0]:dp?u.signal=AbortSignal.any(h):u.signal=h.at(-1)),u},Bb=r=>mp.includes(r)?r.toUpperCase():r,Yb=["get","put","head","delete","options","trace"],Gb=[408,413,429,500,502,503,504],Vb=[413,429,503],kh={limit:2,methods:Yb,statusCodes:Gb,afterStatusCodes:Vb,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:r=>.3*2**(r-1)*1e3,jitter:void 0,retryOnTimeout:!1},Xb=(r={})=>{if(typeof r=="number")return{...kh,limit:r};if(r.methods&&!Array.isArray(r.methods))throw new Error("retry.methods must be an array");if(r.methods&&(r.methods=r.methods.map(s=>s.toLowerCase())),r.statusCodes&&!Array.isArray(r.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Qb(r,u,s,o){return new Promise((f,h)=>{const _=setTimeout(()=>{s&&s.abort(),h(new Ms(r))},o.timeout);o.fetch(r,u).then(f).catch(h).then(()=>{clearTimeout(_)})})}async function Zb(r,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(h),o(u.reason)}const h=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},r)})}const Kb=(r,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Mb)&&!(o in Db)&&(!(o in r)||o in Nb)&&(s[o]=u[o]);return s},Jb=r=>r===void 0?!1:Array.isArray(r)?r.length>0:r instanceof URLSearchParams?r.size>0:typeof r=="object"?Object.keys(r).length>0:typeof r=="string"?r.trim().length>0:!!r;function $b(r){return r instanceof Ns||(r==null?void 0:r.name)===Ns.name}function Wb(r){return r instanceof Ms||(r==null?void 0:r.name)===Ms.name}var Kr,vp,Jt,Bt,rt,Q,$a,ea,vn,oe,Yr,bp,Us,Gr,Ja,qs,xp,ii,Vr,Ls;const ri=class ri{constructor(u,s={}){Pt(this,oe);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,h,_;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:gp(q(this,rt).headers,s.headers),hooks:yp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Bb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Xb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof q(this,rt)!="string"&&!(q(this,rt)instanceof URL||q(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(q(this,Q).prefixUrl&&typeof q(this,rt)=="string"){if(q(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");q(this,Q).prefixUrl.endsWith("/")||(q(this,Q).prefixUrl+="/"),Kt(this,rt,q(this,Q).prefixUrl+q(this,rt))}jb&&dp&&(Kt(this,ea,q(this,Q).signal??q(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal),Sh&&(q(this,Q).duplex="half"),q(this,Q).json!==void 0&&(q(this,Q).body=((h=(f=q(this,Q)).stringifyJson)==null?void 0:h.call(f,q(this,Q).json))??JSON.stringify(q(this,Q).json),q(this,Q).headers.set("content-type",q(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(q(this,rt)instanceof globalThis.Request&&(Ab&&q(this,Q).body instanceof globalThis.FormData||q(this,Q).body instanceof URLSearchParams)&&!o&&q(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(q(this,rt),q(this,Q)),Jb(q(this,Q).searchParams)){const y="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(_=ri,Kr,vp).call(_,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,y);this.request=new globalThis.Request(p,q(this,Q))}if(q(this,Q).onUploadProgress){if(typeof q(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,oe,Ls).call(this,this.request,q(this,Q).body??void 0)}}static create(u,s){var _,b,y;const o=new ri(u,s),f=async()=>{var w,k,N,Y,L,H,B,U,K,X,ue,ce;if(typeof q(o,Q).timeout=="number"&&q(o,Q).timeout>As)throw new RangeError(`The \`timeout\` option cannot be greater than ${As}`);await Promise.resolve();let p=await ke(w=o,oe,xp).call(w);for(const _e of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await _e(o.request,ke(N=o,oe,ii).call(N),F,{retryCount:q(o,Bt)})}catch(Pe){throw ke(Y=o,oe,Ja).call(Y,F),ke(L=o,oe,Ja).call(L,p),Pe}if(W instanceof pp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new Rs(W.options);const se=W instanceof globalThis.Response?W:p;F!==se&&ke(U=o,oe,Ja).call(U,F),p!==se&&ke(K=o,oe,Ja).call(K,p),p=se}if(ke(X=o,oe,Us).call(X,p),!p.ok&&(typeof q(o,Q).throwHttpErrors=="function"?q(o,Q).throwHttpErrors(p.status):q(o,Q).throwHttpErrors)){let _e=new Ns(p,o.request,ke(ue=o,oe,ii).call(ue));for(const F of q(o,Q).hooks.beforeError)_e=await F(_e,{retryCount:q(o,Bt)});throw _e}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Rb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const _e=p.clone();return ke(ce=o,oe,Ja).call(ce,p),qb(_e,q(o,Q).onDownloadProgress)}return p},h=ke(_=o,oe,qs).call(_,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Gr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Gr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(zb))p==="bytes"&&typeof((y=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:y.bytes)!="function"||(h[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await h;if(p==="json"){if(k.status===204)return"";const N=await k.text();return N===""?"":s.parseJson?s.parseJson(N):JSON.parse(N)}return k[p]()});return h}};Kr=new WeakSet,vp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,oe=new WeakSet,Yr=function(){const u=q(this,Q).retry.delay(q(this,Bt));let s=u;q(this,Q).retry.jitter===!0?s=Math.random()*u:typeof q(this,Q).retry.jitter=="function"&&(s=q(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=q(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},bp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new fp(u);if(s instanceof Rs)return s.customDelay??ke(this,oe,Yr).call(this);if(!q(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(q(this,Q).retry.shouldRetry!==void 0){const o=await q(this,Q).retry.shouldRetry({error:s,retryCount:q(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,oe,Yr).call(this)}if(Wb(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if($b(u)){if(!q(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&q(this,Q).retry.afterStatusCodes.includes(u.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const h=q(this,Q).retry.maxRetryAfter??f;return f<h?f:h}if(u.response.status===413)throw u}return ke(this,oe,Yr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Gr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Gr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,bp).call(this,s),As);if(q(this,Bt)<1)throw s;if(await Zb(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof Rs&&s.customRequest){const f=q(this,Q).signal?new globalThis.Request(s.customRequest,{signal:q(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,oe,Vr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const h=await f({request:this.request,options:ke(this,oe,ii).call(this),error:s,retryCount:q(this,Bt)});if(h instanceof globalThis.Request){ke(this,oe,Vr).call(this,h);break}if(h instanceof globalThis.Response)return h;if(h===hp)return}return ke(this,oe,qs).call(this,u)}},xp=async function(){var s;(s=q(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:q(this,Q).signal}));for(const o of q(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,oe,ii).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Vr).call(this,f);break}}const u=Kb(this.request,q(this,Q));return Kt(this,$a,this.request),this.request=q(this,$a).clone(),q(this,Q).timeout===!1?q(this,Q).fetch(q(this,$a),u):Qb(q(this,$a),u,q(this,Jt),q(this,Q))},ii=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Vr=function(u){Kt(this,vn,void 0),this.request=ke(this,oe,Ls).call(this,u)},Ls=function(u,s){return!q(this,Q).onUploadProgress||!u.body?u:Lb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ri,Kr);let Zr=ri;/*! MIT License © Sindre Sorhus */const Hs=r=>{const u=(s,o)=>Zr.create(s,Dr(r,o));for(const s of mp)u[s]=(o,f)=>Zr.create(o,Dr(r,f,{method:s}));return u.create=s=>Hs(Dr(s)),u.extend=s=>(typeof s=="function"&&(s=s(r??{})),Hs(Dr(r,s))),u.stop=hp,u.retry=Cb,u},Eh=Hs();let Mr=null;const Xr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[r=>{const u=xa.getState().accessToken;u&&r.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(r,u,s)=>{if(s.status===401&&!r.headers.has("X-Retry-After-Refresh")){Mr||(Mr=xa.getState().refresh().finally(()=>{Mr=null}));try{await Mr}catch{throw s}const o=xa.getState().accessToken;return o&&r.headers.set("Authorization",`Bearer ${o}`),r.headers.set("X-Retry-After-Refresh","1"),Eh(r,u)}}]}}),Fb=3e4;function Ib(r){if(r.link)return r.link;const u=(r.title+" "+r.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(r.title+" "+r.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function Sp(){const r=Fa(),[u,s]=g.useState([]),[o,f]=g.useState(0),[h,_]=g.useState(!1),[b,y]=g.useState(!1),p=g.useRef(null),{t:w}=Vt(),k=g.useRef(async()=>{try{y(!0);const H=(await Xr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,B=H.filter(U=>!U.isRead).length;s(U=>U.length===H.length&&U.every((K,X)=>K.id===H[X].id&&K.isRead===H[X].isRead)?U:H),f(U=>U===B?U:B)}catch{}finally{y(!1)}});g.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),Fb);return()=>clearInterval(L)},[]),g.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&_(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Xr.post(`web/notifications/${L}/read`),s(H=>H.map(B=>B.id===L?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}}async function Y(){try{await Xr.post("web/notifications/read-all"),s(L=>L.map(H=>({...H,isRead:!0}))),f(0)}catch{}}return m.jsxs("div",{className:"relative",ref:p,children:[m.jsxs("button",{type:"button",onClick:()=>_(L=>!L),"aria-label":w("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[m.jsx(Kv,{size:16}),o>0&&m.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),h&&m.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&m.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(Jv,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?m.jsx("div",{className:"flex justify-center py-8",children:m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?m.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[m.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),m.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(L=>{const H=Ib(L);return m.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${L.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(L.isRead||N(L.id),_(!1),r(H))},children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"truncate text-sm font-medium",title:L.title,children:L.title}),m.jsx("p",{className:"truncate text-xs text-[var(--text-secondary)]",title:L.body,children:L.body}),m.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(L.createdAt).toLocaleString()})]}),!L.isRead&&m.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),N(L.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:m.jsx($v,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function Pb(r,u=50){return r.name??Wh(r.description,u)}function e0(r){return{tasks:r.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${Pb(u)}`,subtitle:`${u.status} · ${u.project_key}`})),workers:(r.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:r.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const t0=300,wh={tasks:mb,workers:ap,projects:tb},a0={tasks:"tasks",workers:"workers",projects:"projects"};function kp({renderTrigger:r}={}){const[u,s]=g.useState(""),[o,f]=g.useState({tasks:[],workers:[],projects:[]}),[h,_]=g.useState(!1),[b,y]=g.useState(!1),[p,w]=g.useState(0),k=g.useRef(null),N=g.useRef(null),Y=g.useRef(void 0),L=g.useRef(void 0),H=Fa(),{t:B}=Vt(),U=g.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=g.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=L.current)==null||Pe.abort();const se=new AbortController;L.current=se;try{_(!0);const Je=await Xr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(e0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||_(!1)}},[]);g.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),t0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),g.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),y(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),g.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){y(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function ue(W){switch(X(),W.type){case"task":H(`/tasks/${W.id}`);break;case"worker":H(`/workers/${W.id}`);break;case"project":H(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(se=>Math.min(se+1,U.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(se=>Math.max(se-1,0))):W.key==="Enter"&&U[p]&&(W.preventDefault(),ue(U[p]))}const _e=U.length>0;let F=0;return m.jsxs(m.Fragment,{children:[r?r(()=>y(!0)):m.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[m.jsx(tp,{className:"h-3.5 w-3.5"}),m.jsx("span",{children:B("common.search_placeholder")}),m.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),b&&m.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&X()},children:m.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[m.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),m.jsx("input",{ref:N,type:"text",placeholder:B("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),h&&m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),m.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!_e&&!h?m.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:B("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const se=o[W];if(se.length===0)return null;const Pe=wh[W],Je=F;return F+=se.length,m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[m.jsx(Pe,{className:"h-3 w-3"}),m.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:a0[W]})]}),se.map((Ce,At)=>{const ut=Je+At,Me=ut===p;return m.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Me?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>ue(Ce),onMouseEnter:()=>w(ut),children:[m.jsx("span",{className:`text-xs ${Me?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Me?">":" "}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"truncate text-sm",title:Ce.title,children:Ce.title}),Ce.subtitle&&m.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",title:Ce.subtitle,children:Ce.subtitle})]})]},`${Ce.type}-${Ce.id}`)})]},W)})}),m.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",B("common.navigate_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",B("common.select_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",B("common.close_hint")]})]})]})})]})}const n0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function Th(r){return Array.from(r.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function l0({isOpen:r,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:h,cancelLabel:_,confirmVariant:b="danger",isLoading:y,children:p}){const{t:w}=Vt(),k=g.useId(),N=h??w("common.confirm"),Y=_??w("common.cancel"),L=g.useRef(null),H=g.useRef(null),B=n0[b];g.useEffect(()=>{if(!r)return;H.current=document.activeElement;const K=requestAnimationFrame(()=>{if(L.current){const X=Th(L.current);X.length>0&&X[0].focus()}});return()=>{var X;cancelAnimationFrame(K),(X=H.current)==null||X.focus()}},[r]);const U=g.useCallback(K=>{if(K.key==="Escape"){u();return}if(K.key==="Tab"&&L.current){const X=Th(L.current);if(X.length===0)return;const ue=X[0],ce=X[X.length-1];K.shiftKey?document.activeElement===ue&&(K.preventDefault(),ce.focus()):document.activeElement===ce&&(K.preventDefault(),ue.focus())}},[u]);return r?m.jsx("div",{onClick:u,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:m.jsxs("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":k,onClick:K=>K.stopPropagation(),onKeyDown:U,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[m.jsx("div",{style:{marginBottom:"1.25rem"},children:m.jsxs("div",{id:k,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[m.jsx(np,{style:{width:"1rem",height:"1rem"}}),o]})}),m.jsxs("div",{style:{marginBottom:"1.25rem"},children:[m.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f}),p]}),m.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[m.jsx("button",{type:"button",onClick:u,disabled:y,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",cursor:y?"not-allowed":"pointer",opacity:y?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),m.jsx("button",{type:"button",onClick:s,disabled:y,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:y?"not-allowed":"pointer",opacity:y?.7:1},children:y?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function i0(){const r=navigator.userAgent;return/iP(hone|od|ad)/.test(r)&&/WebKit/.test(r)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(r)}function r0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function u0(){const{t:r}=Vt(),[u,s]=g.useState("hidden"),[o,f]=g.useState(!1),h=g.useRef(null),_=g.useRef(void 0);g.useEffect(()=>{if(r0()||localStorage.getItem(jh)||window.innerWidth>=768)return;const p=k=>{k.preventDefault(),h.current=k};window.addEventListener("beforeinstallprompt",p);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",p),clearTimeout(w),clearTimeout(_.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),_.current=setTimeout(()=>s("hidden"),200)}async function y(){if(h.current){await h.current.prompt();const{outcome:p}=await h.current.userChoice;p==="accepted"&&b(),h.current=null}else i0()&&f(!0)}return u==="hidden"?null:m.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":r("pwa_install.title"),children:m.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),m.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:r("pwa_install.title")})]}),m.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:m.jsx(lp,{size:14})})]}),m.jsx("div",{className:"px-3.5 py-3",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.ios_command")]}),m.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[r("pwa_install.ios_step_1"),r("pwa_install.ios_step_2"),r("pwa_install.ios_step_3")].map((p,w)=>m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:m.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),m.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&m.jsx(cb,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),p]})]},w))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.command")]}),m.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",r("pwa_install.desc_1"),m.jsx("br",{}),"→ ",r("pwa_install.desc_2")]}),m.jsxs("div",{className:"mt-2.5 flex gap-2",children:[m.jsx("button",{onClick:y,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_install.install")}),m.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:r("pwa_install.skip")})]})]})})]})})}function o0(){const{t:r}=Vt(),[u,s]=g.useState(!1);return g.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,h=null,_=null,b=null;function y(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",y);function p(k){if(f=k,k.waiting){s(!0);return}_=()=>{const N=k.installing;N&&(h=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",_)}navigator.serviceWorker.getRegistration().then(k=>{k&&!o&&p(k)});const w=setInterval(()=>{navigator.serviceWorker.getRegistration().then(k=>{!k||o||(k.update().catch(()=>{}),k.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(w),navigator.serviceWorker.removeEventListener("controllerchange",y),f&&_&&f.removeEventListener("updatefound",_),h&&b&&h.removeEventListener("statechange",b)}},[]),u?m.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsx(ep,{size:14,className:"shrink-0 text-[var(--accent)]"}),m.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:r("pwa_update.message")}),m.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_update.reload")})]})}):null}const Ur=64,s0=96,Rh=32;function c0({children:r,className:u}){const s=g.useRef(null),o=g.useRef(0),f=g.useRef("idle"),[h,_]=g.useState(0),[b,y]=g.useState("idle"),p=g.useCallback(U=>{f.current=U,y(U)},[]),w=g.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=g.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=g.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(_(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,s0);_(ue),p(ue>=Ur?"ready":"pulling")},[w,p]),Y=g.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),_(Ur),setTimeout(()=>{window.location.reload()},300)):(_(0),p("idle")),o.current=0)},[p]);g.useEffect(()=>{const U=s.current;if(U)return U.addEventListener("touchstart",k,{passive:!0}),U.addEventListener("touchmove",N,{passive:!1}),U.addEventListener("touchend",Y,{passive:!0}),()=>{U.removeEventListener("touchstart",k),U.removeEventListener("touchmove",N),U.removeEventListener("touchend",Y)}},[k,N,Y]);const L=Math.min(h/Ur,1),H=b==="refreshing"?0:h/Ur*180,B=h>0||b==="refreshing";return m.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&m.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:h,transition:b==="idle"?"height 200ms ease-out":void 0},children:m.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Rh,height:Rh,opacity:L,transition:b==="idle"?"opacity 200ms ease-out":void 0},children:b==="refreshing"?m.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),m.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):m.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:b==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${H}deg)`,transition:"color 150ms"},children:m.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),r]})}const Ep=g.createContext({setActions:()=>{}});function B1(r){const{setActions:u}=g.useContext(Ep);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const wp=g.createContext({setSubtitle:()=>{}});function Y1(r){const{setSubtitle:u}=g.useContext(wp);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const f0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih},{to:"/workers",label:"workers",icon:ap},{to:"/projects",label:"projects",icon:ab},{to:"/access-tokens",label:"tokens",icon:lb}],d0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:eb},{to:"/docs/bot",label:"bot",icon:ob},{to:"/docs/skill",label:"skill",icon:db},{to:"/docs/all",label:"all",icon:ib}],m0=[{to:"/admin",label:"admin",icon:fb}],h0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih}],qr={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_tokens",subtitle:"common.breadcrumb_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function p0(r){const{t:u}=Vt();if(qr[r]){const o=qr[r];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+r.split("/").filter(Boolean)[0];if(qr[s]){const o=qr[s],f=r.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:r.slice(1).replace(/\//g," // ")||"home"}}function _0(r,u){return r==="/home"?u==="/home":r==="/dashboard"?u==="/dashboard":u.startsWith(r)}function g0(){const r=gt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title")};return m.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[h0.map(({to:o,label:f,icon:h})=>{const _=_0(o,r.pathname);return m.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(h,{size:18,className:_?"text-[var(--accent)]":"text-[var(--text-muted)]"}),m.jsx("span",{className:`text-[11px] lowercase ${_?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),m.jsx(kp,{renderTrigger:o=>m.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(tp,{size:18,className:"text-[var(--text-muted)]"}),m.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function y0(){const r=Fa(),{t:u}=Vt();return m.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[m.jsxs("button",{onClick:()=>r("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:m.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),m.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{onClick:()=>r("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:m.jsx(pb,{size:18})}),m.jsx(Sp,{}),m.jsx(cp,{})]})]})}function zs({label:r,items:u,collapsed:s}){return m.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&m.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:r}),u.map(({to:o,label:f,icon:h})=>m.jsx(Js,{to:o,className:({isActive:_})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${_?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:_})=>m.jsxs(m.Fragment,{children:[m.jsx(h,{size:14,style:{flexShrink:0}}),!s&&m.jsx("span",{children:_?`> ${f}`:` ${f}`})]})},o))]})}function v0(){const{user:r,logout:u}=xa(),s=Fa(),[o,f]=g.useState(!1),h=vb(),{t:_}=Vt(),{sidebarCollapsed:b,toggleSidebar:y}=xb();function p(){u(),s("/login")}return m.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[m.jsx("div",{className:"flex items-center px-5",style:{height:48},children:m.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:m.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&m.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:_("common.overlord")})]})}),m.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[m.jsx(zs,{label:_("common.navigation"),items:f0,collapsed:b}),m.jsx(zs,{label:_("common.docs_section"),items:d0,collapsed:b}),h&&m.jsx(zs,{label:_("common.admin_section"),items:m0,collapsed:b})]}),m.jsx("div",{className:`px-3 py-1 ${b?"flex justify-center":""}`,children:m.jsx("button",{onClick:y,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":b?"expand sidebar":"collapse sidebar",children:b?m.jsx(Fv,{size:14}):m.jsx(Wv,{size:14})})}),m.jsx("div",{className:"border-t border-[var(--border)] p-3",children:m.jsxs("div",{className:`flex items-center py-2 ${b?"justify-center":"gap-3 px-3"}`,children:[m.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:_("common.profile"),children:((r==null?void 0:r.username)??"u")[0].toUpperCase()}),!b&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:_("common.profile"),children:[m.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.username)??"user"}),m.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(r==null?void 0:r.role)??"user"})]}),m.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":_("common.log_out"),children:m.jsx(ub,{size:14})})]})]})}),m.jsx(l0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:_("common.logout_title"),message:_("common.logout_message"),confirmLabel:_("common.logout"),confirmVariant:"warning"})]})}function b0({headerActions:r,subtitleOverride:u}){const s=gt(),{title:o,subtitle:f}=p0(s.pathname),h=u??f;return m.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[m.jsxs("div",{className:"text-sm lowercase",children:[m.jsx("span",{style:{color:"var(--text-primary)"},children:o}),h&&m.jsxs("span",{style:{color:"var(--text-muted)"},title:h,children:[" ","// ",Wh(h,40)]})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[r,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(kp,{}),m.jsx(Sp,{}),m.jsx(cp,{})]})]})]})}function x0(){const[r,u]=g.useState(null),[s,o]=g.useState(null),f=gt(),h=f.pathname==="/home",_=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return g.useEffect(()=>up.getState().init(),[]),m.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[m.jsx(v0,{}),m.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[m.jsx(y0,{}),!b&&m.jsx(b0,{headerActions:r,subtitleOverride:s}),m.jsx(c0,{className:h||_?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:m.jsx(Ep.Provider,{value:{setActions:u},children:m.jsx(wp.Provider,{value:{setSubtitle:o},children:m.jsx(ov,{})})})}),m.jsx(u0,{}),m.jsx(o0,{}),m.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:m.jsx(g0,{})})]})]})}function Ah(r){var s;const u=(s=r.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:r.pathname,search:r.search}}}function li({children:r,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:h}=xa(),_=gt();if(h)return m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return m.jsx(ll,{to:"/login",state:Ah(_),replace:!0});if(f){const b=Ah(_);return _.pathname!=="/totp-setup"&&_.pathname!=="/bind"?m.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):_.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),m.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):m.jsx(m.Fragment,{children:r})}return u&&(o==null?void 0:o.role)!==ip.ADMIN?m.jsx(ll,{to:"/home",replace:!0}):m.jsx(m.Fragment,{children:r})}function S0({children:r}){const{theme:u,resolved:s,setResolved:o}=sp();return g.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const h=_=>o(_.matches?"dark":"light");return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[u,o]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),m.jsx(m.Fragment,{children:r})}class k0 extends g.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?m.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[m.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Br("common.runtime_error")}),m.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Br("common.an_unexpected_error_occurred")}),m.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(ep,{className:"h-3.5 w-3.5"}),Br("common.reload")]})]}):this.props.children}}function E0({isOpen:r}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function h(){s(),o(!1),u("/login")}return r?m.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[m.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),m.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:m.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[m.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:m.jsx(rb,{className:"h-7 w-7 text-[var(--warning)]"})}),m.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),m.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),m.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:h,children:f("auth.go_to_login")})]})})]}):null}const zh=5;let ba=[];const Bs=new Set;function Tp(){Bs.forEach(r=>r())}function w0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(r,u,s=4e3){const o=w0();return ba=[...ba,{id:o,variant:r,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),Tp(),o}Wa.success=(r,u)=>Wa("success",r,u);Wa.error=(r,u)=>Wa("error",r,u);Wa.warning=(r,u)=>Wa("warning",r,u);Wa.info=(r,u)=>Wa("info",r,u);function T0(r){ba=ba.filter(u=>u.id!==r),Tp()}function j0(){const[,r]=g.useState(0);return g.useEffect(()=>{const u=()=>r(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const R0={success:{icon:Iv,borderColor:"var(--accent)"},error:{icon:Pv,borderColor:"var(--destructive)"},warning:{icon:np,borderColor:"var(--warning)"},info:{icon:nb,borderColor:"var(--info)"}};function A0({item:r}){const u=R0[r.variant],s=u.icon,{t:o}=Vt(),f=g.useCallback(()=>T0(r.id),[r.id]);return g.useEffect(()=>{if(!r.duration)return;const h=setTimeout(f,r.duration);return()=>clearTimeout(h)},[r.duration,f]),m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[m.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),m.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:r.message}),m.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:m.jsx(lp,{className:"h-3.5 w-3.5"})})]})}function z0(){const r=j0();return r.length===0?null:m.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:r.map(u=>m.jsx("div",{className:"pointer-events-auto",children:m.jsx(A0,{item:u})},u.id))})}const O0=g.lazy(()=>ne(()=>import("./LandingPage-CaXXw1hm.js"),__vite__mapDeps([0,1,2,3,4,5]))),C0=g.lazy(()=>ne(()=>import("./LoginPage-DPpmpzbj.js"),[])),D0=g.lazy(()=>ne(()=>import("./TotpSetupPage-z-YHejVE.js"),[])),N0=g.lazy(()=>ne(()=>import("./NotFoundPage-BvcEqyzD.js"),[])),M0=g.lazy(()=>ne(()=>import("./HomePage-CpWo0uLv.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),U0=g.lazy(()=>ne(()=>import("./TerminalHomePage-4aRpII1b.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,13,20,21,22]))),q0=g.lazy(()=>ne(()=>import("./TaskListPage-CPuOkWSi.js"),__vite__mapDeps([23,16,7,8,12,14,24,19,5,25,9,20]))),L0=g.lazy(()=>ne(()=>import("./TaskDetailPage-9aABpX-f.js"),__vite__mapDeps([26,16,17,18,12,19,8,14,27,21,24,28,29]))),H0=g.lazy(()=>ne(()=>import("./WorkerListPage-dqLBDqbD.js"),__vite__mapDeps([30,8,31,32,33,34,35,22,5,29,19,25,9,13,20]))),B0=g.lazy(()=>ne(()=>import("./WorkerDetailPage-E4zltQ-6.js"),__vite__mapDeps([36,12,8,37,31,13,14,38,27]))),Y0=g.lazy(()=>ne(()=>import("./WorkerSetupGuidePage-CBK3ffpd.js"),__vite__mapDeps([32,33,34,35,22]))),G0=g.lazy(()=>ne(()=>import("./ProjectListPage-B4fumD1W.js"),__vite__mapDeps([39,19,25,9,12,13,20]))),V0=g.lazy(()=>ne(()=>import("./ProjectDetailPage-uOvkySHD.js"),__vite__mapDeps([40,41,19,14,12,8,37,13,42,38,20]))),X0=g.lazy(()=>ne(()=>import("./EditProjectPage-BsZhl2Jz.js"),__vite__mapDeps([43,19,41,20]))),Q0=g.lazy(()=>ne(()=>import("./PipelineEditorPage-CXufzBP3.js"),__vite__mapDeps([44,19]))),Z0=g.lazy(()=>ne(()=>import("./ProfilePage-DhX8bJxC.js"),__vite__mapDeps([45,46,37,13]))),K0=g.lazy(()=>ne(()=>import("./BindPlatformPage-D6E0Bp3C.js"),[])),J0=g.lazy(()=>ne(()=>import("./AccessTokensPage-vSpz8li3.js"),__vite__mapDeps([47,19,25,9,12,13,20,5,38]))),$0=g.lazy(()=>ne(()=>import("./CliReferencePage-BdiSKoOu.js"),__vite__mapDeps([48,49,5,20]))),W0=g.lazy(()=>ne(()=>import("./ApiReferencePage-TkyZAw27.js"),__vite__mapDeps([50,49,5,20]))),F0=g.lazy(()=>ne(()=>import("./SkillPage-K2P8B1hJ.js"),__vite__mapDeps([51,52,5,28]))),I0=g.lazy(()=>ne(()=>import("./DocsLayout-jgGmSplU.js"),__vite__mapDeps([53,27]))),P0=g.lazy(()=>ne(()=>import("./InstallationPage-BQr90Yc3.js"),__vite__mapDeps([54,52,5]))),e1=g.lazy(()=>ne(()=>import("./DeveloperSetupPage-BpUDpRJ4.js"),__vite__mapDeps([55,52,5]))),t1=g.lazy(()=>ne(()=>import("./WorkerSetupPage-xeHF-fmM.js"),__vite__mapDeps([56,52,5]))),a1=g.lazy(()=>ne(()=>import("./BotSetupPage-BQQI6JOk.js"),__vite__mapDeps([57,52,5]))),n1=g.lazy(()=>ne(()=>import("./LocalDevelopmentPage-CqWzffsm.js"),__vite__mapDeps([58,52,5]))),l1=g.lazy(()=>ne(()=>import("./WorkerOperationsPage-6b3TgmF6.js"),[])),i1=g.lazy(()=>ne(()=>import("./DeploymentPage-CYr7Ca9n.js"),__vite__mapDeps([59,52,5]))),Oh=g.lazy(()=>ne(()=>import("./BotIntegrationPage-BuNytSWX.js"),[])),r1=g.lazy(()=>ne(()=>import("./PipelineConfigPage-BkW3OPg6.js"),__vite__mapDeps([60,52,5]))),u1=g.lazy(()=>ne(()=>import("./DevWorkflowPage-DM2uX3L8.js"),__vite__mapDeps([61,52,5]))),o1=g.lazy(()=>ne(()=>import("./PermissionsPage-AKqlLxTT.js"),[])),s1=g.lazy(()=>ne(()=>import("./EnvVariablesPage-CtjfZfYc.js"),__vite__mapDeps([62,52,5]))),c1=g.lazy(()=>ne(()=>import("./ArchitecturePage-9_RZSDbj.js"),__vite__mapDeps([63,52,5]))),f1=g.lazy(()=>ne(()=>import("./ChangelogPage-Ch6-L8hI.js"),[])),d1=g.lazy(()=>ne(()=>import("./AgentCliPage-Cjbcjh8n.js"),__vite__mapDeps([64,52,5]))),m1=g.lazy(()=>ne(()=>import("./DocsIndexPage-DlIN41Vy.js"),__vite__mapDeps([65,34,2,3,35]))),h1=g.lazy(()=>ne(()=>import("./AdminPage-CPYnv3Ii.js"),__vite__mapDeps([66,4,2,67,35]))),p1=g.lazy(()=>ne(()=>import("./DeveloperManage-BMYOz6ZR.js"),__vite__mapDeps([68,19,46,25,9,13,8,20,4,42,21]))),_1=g.lazy(()=>ne(()=>import("./BotManage-CUY7KE4f.js"),__vite__mapDeps([69,19,52,5,38,20,25,9,13,8,2,42]))),g1=g.lazy(()=>ne(()=>import("./TokenManage-DnvaDq52.js"),__vite__mapDeps([70,33,5,28,25,9,13,8,20]))),y1=g.lazy(()=>ne(()=>import("./AuditLogPage-Wm3BZbMk.js"),__vite__mapDeps([71,19,25,9,67,11]))),v1=g.lazy(()=>ne(()=>import("./SettingsPage-Bb6I_suM.js"),[]));function b1(){return m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function x1(){const r=xa(u=>u.sessionExpired);return m.jsxs(S0,{children:[m.jsx(z0,{}),m.jsx(k0,{children:m.jsxs(Mv,{children:[m.jsx(E0,{isOpen:r}),m.jsx(g.Suspense,{fallback:m.jsx(b1,{}),children:m.jsxs(cv,{children:[m.jsx(ee,{path:"/",element:m.jsx(O0,{})}),m.jsx(ee,{path:"/login",element:m.jsx(C0,{})}),m.jsx(ee,{path:"/totp-setup",element:m.jsx(li,{children:m.jsx(D0,{})})}),m.jsx(ee,{path:"/bind",element:m.jsx(li,{children:m.jsx(K0,{})})}),m.jsxs(ee,{element:m.jsx(li,{children:m.jsx(x0,{})}),children:[m.jsx(ee,{path:"/home",element:m.jsx(U0,{})}),m.jsx(ee,{path:"/dashboard",element:m.jsx(M0,{})}),m.jsx(ee,{path:"/tasks",element:m.jsx(q0,{})}),m.jsx(ee,{path:"/tasks/:id",element:m.jsx(L0,{})}),m.jsx(ee,{path:"/workers",element:m.jsx(H0,{})}),m.jsx(ee,{path:"/workers/setup",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(Y0,{})})}),m.jsx(ee,{path:"/workers/:id",element:m.jsx(B0,{})}),m.jsx(ee,{path:"/projects",element:m.jsx(G0,{})}),m.jsx(ee,{path:"/projects/:key",element:m.jsx(V0,{})}),m.jsx(ee,{path:"/projects/:key/edit",element:m.jsx(X0,{})}),m.jsx(ee,{path:"/projects/:key/pipeline",element:m.jsx(Q0,{})}),m.jsx(ee,{path:"/profile",element:m.jsx(Z0,{})}),m.jsx(ee,{path:"/access-tokens",element:m.jsx(J0,{})}),m.jsxs(ee,{path:"/docs",element:m.jsx(I0,{}),children:[m.jsx(ee,{index:!0,element:m.jsx(ll,{to:"cli",replace:!0})}),m.jsx(ee,{path:"cli",element:m.jsx($0,{})}),m.jsx(ee,{path:"api",element:m.jsx(W0,{})}),m.jsx(ee,{path:"bot",element:m.jsx(Oh,{})}),m.jsx(ee,{path:"all",element:m.jsx(m1,{})}),m.jsx(ee,{path:"skill",element:m.jsx(F0,{})}),m.jsx(ee,{path:"installation",element:m.jsx(P0,{})}),m.jsx(ee,{path:"developer-setup",element:m.jsx(e1,{})}),m.jsx(ee,{path:"worker-setup",element:m.jsx(t1,{})}),m.jsx(ee,{path:"bot-setup",element:m.jsx(a1,{})}),m.jsx(ee,{path:"local-development",element:m.jsx(n1,{})}),m.jsx(ee,{path:"worker-operations",element:m.jsx(l1,{})}),m.jsx(ee,{path:"deployment",element:m.jsx(i1,{})}),m.jsx(ee,{path:"bot-integration",element:m.jsx(Oh,{})}),m.jsx(ee,{path:"pipeline-config",element:m.jsx(r1,{})}),m.jsx(ee,{path:"dev-workflow",element:m.jsx(u1,{})}),m.jsx(ee,{path:"permissions",element:m.jsx(o1,{})}),m.jsx(ee,{path:"env-variables",element:m.jsx(s1,{})}),m.jsx(ee,{path:"architecture",element:m.jsx(c1,{})}),m.jsx(ee,{path:"agent-cli",element:m.jsx(d1,{})}),m.jsx(ee,{path:"changelog",element:m.jsx(f1,{})})]}),m.jsxs(ee,{path:"/admin",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(h1,{})}),children:[m.jsx(ee,{index:!0,element:m.jsx(ll,{to:"developers",replace:!0})}),m.jsx(ee,{path:"developers",element:m.jsx(p1,{})}),m.jsx(ee,{path:"bots",element:m.jsx(_1,{})}),m.jsx(ee,{path:"tokens",element:m.jsx(g1,{})}),m.jsx(ee,{path:"audit-logs",element:m.jsx(y1,{})}),m.jsx(ee,{path:"settings",element:m.jsx(v1,{})})]})]}),m.jsx(ee,{path:"*",element:m.jsx(N0,{})})]})})]})})]})}function S1(r){var u,s;return((u=r.matchMedia)==null?void 0:u.call(r,"(display-mode: standalone)").matches)===!0||((s=r.navigator)==null?void 0:s.standalone)===!0}function k1(r){var s,o;const u=((s=r.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=r.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function E1(r){const u=r.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function w1(r){const u=r.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return r.innerHeight>=r.innerWidth?Math.max(s,o):Math.min(s,o)}function T1(r=window,u=document){const s=u.documentElement,o=r.visualViewport??null,f=()=>{const h=Math.round((o==null?void 0:o.height)??0),_=Math.round(r.innerHeight);let b=h>0?h:_;if(S1(r)&&k1(r)&&!E1(u)){const y=w1(r);y!==null&&(b=Math.max(b,_,y))}s.style.setProperty("--app-height",`${b}px`)};return f(),r.addEventListener("resize",f),r.addEventListener("orientationchange",f),o==null||o.addEventListener("resize",f),o==null||o.addEventListener("scroll",f),()=>{r.removeEventListener("resize",f),r.removeEventListener("orientationchange",f),o==null||o.removeEventListener("resize",f),o==null||o.removeEventListener("scroll",f)}}xa.getState().initialize();T1(window,document);const j1=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(j1){document.documentElement.classList.add("pwa-standalone");const r=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&r;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}oy.createRoot(document.getElementById("root")).render(m.jsx(g.StrictMode,{children:m.jsx(x1,{})}));export{L1 as $,N1 as A,np as B,$v as C,ip as D,D1 as E,ep as F,U1 as G,Ns as H,iy as I,Wh as J,lb as K,Jh as L,ob as M,ll as N,ub as O,u0 as P,M1 as Q,Rr as R,ap as S,cp as T,eb as U,db as V,C1 as W,lp as X,Js as Y,ov as Z,q1 as _,Vt as a,Pv as a0,$s as b,xe as c,fb as d,ib as e,Fa as f,gt as g,Xr as h,vb as i,m as j,up as k,Pb as l,Fr as m,O1 as n,Y1 as o,l0 as p,B1 as q,g as r,tp as s,Wa as t,xa as u,Ph as v,H1 as w,A1 as x,z1 as y,Iv as z};
242
+ "{description}"`}};function wb(r,u){const s=u.split(".");let o=r;for(const f of s){if(o==null||typeof o!="object")return u;o=o[f]}return typeof o=="string"?o:u}function Tb(r,u){return u?r.replace(/\{(\w+)\}/g,(s,o)=>u[o]!=null?String(u[o]):`{${o}}`):r}function Br(r,u){return Tb(wb(Eb,r),u)}function Vt(){return{t:g.useCallback((u,s)=>Br(u,s),[])}}function cp(){const{theme:r,setTheme:u}=sp(),{t:s}=Vt(),o=r==="dark"||r==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;function f(){u(o?"light":"dark")}return m.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":s(o?"common.switch_to_light":"common.switch_to_dark"),title:s(o?"common.light_mode":"common.dark_mode"),children:o?m.jsx(hb,{size:16}):m.jsx(sb,{size:16})})}class Ns extends Error{constructor(s,o,f){const h=s.status||s.status===0?s.status:"",_=s.statusText??"",b=`${h} ${_}`.trim(),y=b?`status code ${b}`:"an unknown error";super(`Request failed with ${y}: ${o.method} ${o.url}`);Ve(this,"response");Ve(this,"request");Ve(this,"options");this.name="HTTPError",this.response=s,this.request=o,this.options=f}}class fp extends Error{constructor(s){let o="Non-error value was thrown";try{typeof s=="string"?o=s:s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&(o=s.message)}catch{}super(o);Ve(this,"name","NonError");Ve(this,"value");this.value=s}}class Rs extends Error{constructor(s){const o=s!=null&&s.cause?s.cause instanceof Error?s.cause:new fp(s.cause):void 0;super(s!=null&&s.code?`Forced retry: ${s.code}`:"Forced retry",o?{cause:o}:void 0);Ve(this,"name","ForceRetryError");Ve(this,"customDelay");Ve(this,"code");Ve(this,"customRequest");this.customDelay=s==null?void 0:s.delay,this.code=s==null?void 0:s.code,this.customRequest=s==null?void 0:s.request}}const Sh=(()=>{let r=!1,u=!1;const s=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(s&&o)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return r&&!u})(),jb=typeof globalThis.AbortController=="function",dp=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Rb=typeof globalThis.ReadableStream=="function",Ab=typeof globalThis.FormData=="function",mp=["get","post","put","patch","head","delete"],zb={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},As=2147483647,Ob=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,hp=Symbol("stop");class pp{constructor(u){Ve(this,"options");this.options=u}}const Cb=r=>new pp(r),Db={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Nb={next:!0},Mb={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ub=r=>{if(!r)return 0;if(r instanceof FormData){let u=0;for(const[s,o]of r)u+=Ob,u+=new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length,u+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return u}if(r instanceof Blob)return r.size;if(r instanceof ArrayBuffer)return r.byteLength;if(typeof r=="string")return new TextEncoder().encode(r).length;if(r instanceof URLSearchParams)return new TextEncoder().encode(r.toString()).length;if("byteLength"in r)return r.byteLength;if(typeof r=="object"&&r!==null)try{const u=JSON.stringify(r);return new TextEncoder().encode(u).length}catch{return 0}return 0},_p=(r,u,s)=>{let o,f=0;return r.pipeThrough(new TransformStream({transform(h,_){if(_.enqueue(h),o){f+=o.byteLength;let b=u===0?0:f/u;b>=1&&(b=1-Number.EPSILON),s==null||s({percent:b,totalBytes:Math.max(u,f),transferredBytes:f},o)}o=h},flush(){o&&(f+=o.byteLength,s==null||s({percent:1,totalBytes:Math.max(u,f),transferredBytes:f},o))}}))},qb=(r,u)=>{if(!r.body)return r;if(r.status===204)return new Response(null,{status:r.status,statusText:r.statusText,headers:r.headers});const s=Math.max(0,Number(r.headers.get("content-length"))||0);return new Response(_p(r.body,s,u),{status:r.status,statusText:r.statusText,headers:r.headers})},Lb=(r,u,s)=>{if(!r.body)return r;const o=Ub(s??r.body);return new Request(r,{duplex:"half",body:_p(r.body,o,u)})},yn=r=>r!==null&&typeof r=="object",Dr=(...r)=>{for(const u of r)if((!yn(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Ws({},...r)},gp=(r={},u={})=>{const s=new globalThis.Headers(r),o=u instanceof globalThis.Headers,f=new globalThis.Headers(u);for(const[h,_]of f.entries())o&&_==="undefined"||_===void 0?s.delete(h):s.set(h,_);return s};function Nr(r,u,s){return Object.hasOwn(u,s)&&u[s]===void 0?[]:Ws(r[s]??[],u[s]??[])}const yp=(r={},u={})=>({beforeRequest:Nr(r,u,"beforeRequest"),beforeRetry:Nr(r,u,"beforeRetry"),afterResponse:Nr(r,u,"afterResponse"),beforeError:Nr(r,u,"beforeError")}),Hb=(r,u)=>{const s=new URLSearchParams;for(const o of[r,u])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,h]of o.entries())s.append(f,h);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");s.append(String(f[0]),String(f[1]))}else if(yn(o))for(const[f,h]of Object.entries(o))h!==void 0&&s.append(f,String(h));else{const f=new URLSearchParams(o);for(const[h,_]of f.entries())s.append(h,_)}return s},Ws=(...r)=>{let u={},s={},o={},f;const h=[];for(const _ of r)if(Array.isArray(_))Array.isArray(u)||(u=[]),u=[...u,..._];else if(yn(_)){for(let[b,y]of Object.entries(_)){if(b==="signal"&&y instanceof globalThis.AbortSignal){h.push(y);continue}if(b==="context"){if(y!=null&&(!yn(y)||Array.isArray(y)))throw new TypeError("The `context` option must be an object");u={...u,context:y==null?{}:{...u.context,...y}};continue}if(b==="searchParams"){y==null?f=void 0:f=f===void 0?y:Hb(f,y);continue}yn(y)&&b in u&&(y=Ws(u[b],y)),u={...u,[b]:y}}yn(_.hooks)&&(o=yp(o,_.hooks),u.hooks=o),yn(_.headers)&&(s=gp(s,_.headers),u.headers=s)}return f!==void 0&&(u.searchParams=f),h.length>0&&(h.length===1?u.signal=h[0]:dp?u.signal=AbortSignal.any(h):u.signal=h.at(-1)),u},Bb=r=>mp.includes(r)?r.toUpperCase():r,Yb=["get","put","head","delete","options","trace"],Gb=[408,413,429,500,502,503,504],Vb=[413,429,503],kh={limit:2,methods:Yb,statusCodes:Gb,afterStatusCodes:Vb,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:r=>.3*2**(r-1)*1e3,jitter:void 0,retryOnTimeout:!1},Xb=(r={})=>{if(typeof r=="number")return{...kh,limit:r};if(r.methods&&!Array.isArray(r.methods))throw new Error("retry.methods must be an array");if(r.methods&&(r.methods=r.methods.map(s=>s.toLowerCase())),r.statusCodes&&!Array.isArray(r.statusCodes))throw new Error("retry.statusCodes must be an array");const u=Object.fromEntries(Object.entries(r).filter(([,s])=>s!==void 0));return{...kh,...u}};class Ms extends Error{constructor(s){super(`Request timed out: ${s.method} ${s.url}`);Ve(this,"request");this.name="TimeoutError",this.request=s}}async function Qb(r,u,s,o){return new Promise((f,h)=>{const _=setTimeout(()=>{s&&s.abort(),h(new Ms(r))},o.timeout);o.fetch(r,u).then(f).catch(h).then(()=>{clearTimeout(_)})})}async function Zb(r,{signal:u}){return new Promise((s,o)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(h),o(u.reason)}const h=setTimeout(()=>{u==null||u.removeEventListener("abort",f),s()},r)})}const Kb=(r,u)=>{const s={};for(const o in u)Object.hasOwn(u,o)&&!(o in Mb)&&!(o in Db)&&(!(o in r)||o in Nb)&&(s[o]=u[o]);return s},Jb=r=>r===void 0?!1:Array.isArray(r)?r.length>0:r instanceof URLSearchParams?r.size>0:typeof r=="object"?Object.keys(r).length>0:typeof r=="string"?r.trim().length>0:!!r;function $b(r){return r instanceof Ns||(r==null?void 0:r.name)===Ns.name}function Wb(r){return r instanceof Ms||(r==null?void 0:r.name)===Ms.name}var Kr,vp,Jt,Bt,rt,Q,$a,ea,vn,oe,Yr,bp,Us,Gr,Ja,qs,xp,ii,Vr,Ls;const ri=class ri{constructor(u,s={}){Pt(this,oe);Ve(this,"request");Pt(this,Jt);Pt(this,Bt,0);Pt(this,rt);Pt(this,Q);Pt(this,$a);Pt(this,ea);Pt(this,vn);var f,h,_;if(Kt(this,rt,u),Kt(this,Q,{...s,headers:gp(q(this,rt).headers,s.headers),hooks:yp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},s.hooks),method:Bb(s.method??q(this,rt).method??"GET"),prefixUrl:String(s.prefixUrl||""),retry:Xb(s.retry),throwHttpErrors:s.throwHttpErrors??!0,timeout:s.timeout??1e4,fetch:s.fetch??globalThis.fetch.bind(globalThis),context:s.context??{}}),typeof q(this,rt)!="string"&&!(q(this,rt)instanceof URL||q(this,rt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(q(this,Q).prefixUrl&&typeof q(this,rt)=="string"){if(q(this,rt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");q(this,Q).prefixUrl.endsWith("/")||(q(this,Q).prefixUrl+="/"),Kt(this,rt,q(this,Q).prefixUrl+q(this,rt))}jb&&dp&&(Kt(this,ea,q(this,Q).signal??q(this,rt).signal),Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal),Sh&&(q(this,Q).duplex="half"),q(this,Q).json!==void 0&&(q(this,Q).body=((h=(f=q(this,Q)).stringifyJson)==null?void 0:h.call(f,q(this,Q).json))??JSON.stringify(q(this,Q).json),q(this,Q).headers.set("content-type",q(this,Q).headers.get("content-type")??"application/json"));const o=s.headers&&new globalThis.Headers(s.headers).has("content-type");if(q(this,rt)instanceof globalThis.Request&&(Ab&&q(this,Q).body instanceof globalThis.FormData||q(this,Q).body instanceof URLSearchParams)&&!o&&q(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(q(this,rt),q(this,Q)),Jb(q(this,Q).searchParams)){const y="?"+(typeof q(this,Q).searchParams=="string"?q(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ke(_=ri,Kr,vp).call(_,q(this,Q).searchParams)).toString()),p=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,y);this.request=new globalThis.Request(p,q(this,Q))}if(q(this,Q).onUploadProgress){if(typeof q(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Sh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ke(this,oe,Ls).call(this,this.request,q(this,Q).body??void 0)}}static create(u,s){var _,b,y;const o=new ri(u,s),f=async()=>{var w,k,N,Y,L,H,B,U,K,X,ue,ce;if(typeof q(o,Q).timeout=="number"&&q(o,Q).timeout>As)throw new RangeError(`The \`timeout\` option cannot be greater than ${As}`);await Promise.resolve();let p=await ke(w=o,oe,xp).call(w);for(const _e of q(o,Q).hooks.afterResponse){const F=ke(k=o,oe,Us).call(k,p.clone());let W;try{W=await _e(o.request,ke(N=o,oe,ii).call(N),F,{retryCount:q(o,Bt)})}catch(Pe){throw ke(Y=o,oe,Ja).call(Y,F),ke(L=o,oe,Ja).call(L,p),Pe}if(W instanceof pp)throw ke(H=o,oe,Ja).call(H,F),ke(B=o,oe,Ja).call(B,p),new Rs(W.options);const se=W instanceof globalThis.Response?W:p;F!==se&&ke(U=o,oe,Ja).call(U,F),p!==se&&ke(K=o,oe,Ja).call(K,p),p=se}if(ke(X=o,oe,Us).call(X,p),!p.ok&&(typeof q(o,Q).throwHttpErrors=="function"?q(o,Q).throwHttpErrors(p.status):q(o,Q).throwHttpErrors)){let _e=new Ns(p,o.request,ke(ue=o,oe,ii).call(ue));for(const F of q(o,Q).hooks.beforeError)_e=await F(_e,{retryCount:q(o,Bt)});throw _e}if(q(o,Q).onDownloadProgress){if(typeof q(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Rb)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const _e=p.clone();return ke(ce=o,oe,Ja).call(ce,p),qb(_e,q(o,Q).onDownloadProgress)}return p},h=ke(_=o,oe,qs).call(_,f).finally(()=>{var w,k;const p=q(o,$a);ke(w=o,oe,Gr).call(w,(p==null?void 0:p.body)??void 0),ke(k=o,oe,Gr).call(k,o.request.body??void 0)});for(const[p,w]of Object.entries(zb))p==="bytes"&&typeof((y=(b=globalThis.Response)==null?void 0:b.prototype)==null?void 0:y.bytes)!="function"||(h[p]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||w);const k=await h;if(p==="json"){if(k.status===204)return"";const N=await k.text();return N===""?"":s.parseJson?s.parseJson(N):JSON.parse(N)}return k[p]()});return h}};Kr=new WeakSet,vp=function(u){return u&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof URLSearchParams)?Object.fromEntries(Object.entries(u).filter(([,s])=>s!==void 0)):u},Jt=new WeakMap,Bt=new WeakMap,rt=new WeakMap,Q=new WeakMap,$a=new WeakMap,ea=new WeakMap,vn=new WeakMap,oe=new WeakSet,Yr=function(){const u=q(this,Q).retry.delay(q(this,Bt));let s=u;q(this,Q).retry.jitter===!0?s=Math.random()*u:typeof q(this,Q).retry.jitter=="function"&&(s=q(this,Q).retry.jitter(u),(!Number.isFinite(s)||s<0)&&(s=u));const o=q(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,s)},bp=async function(u){if(eh(this,Bt)._++,q(this,Bt)>q(this,Q).retry.limit)throw u;const s=u instanceof Error?u:new fp(u);if(s instanceof Rs)return s.customDelay??ke(this,oe,Yr).call(this);if(!q(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw u;if(q(this,Q).retry.shouldRetry!==void 0){const o=await q(this,Q).retry.shouldRetry({error:s,retryCount:q(this,Bt)});if(o===!1)throw u;if(o===!0)return ke(this,oe,Yr).call(this)}if(Wb(u)&&!q(this,Q).retry.retryOnTimeout)throw u;if($b(u)){if(!q(this,Q).retry.statusCodes.includes(u.response.status))throw u;const o=u.response.headers.get("Retry-After")??u.response.headers.get("RateLimit-Reset")??u.response.headers.get("X-RateLimit-Retry-After")??u.response.headers.get("X-RateLimit-Reset")??u.response.headers.get("X-Rate-Limit-Reset");if(o&&q(this,Q).retry.afterStatusCodes.includes(u.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const h=q(this,Q).retry.maxRetryAfter??f;return f<h?f:h}if(u.response.status===413)throw u}return ke(this,oe,Yr).call(this)},Us=function(u){return q(this,Q).parseJson&&(u.json=async()=>q(this,Q).parseJson(await u.text())),u},Gr=function(u){u&&u.cancel().catch(()=>{})},Ja=function(u){ke(this,oe,Gr).call(this,u.body??void 0)},qs=async function(u){try{return await u()}catch(s){const o=Math.min(await ke(this,oe,bp).call(this,s),As);if(q(this,Bt)<1)throw s;if(await Zb(o,q(this,ea)?{signal:q(this,ea)}:{}),s instanceof Rs&&s.customRequest){const f=q(this,Q).signal?new globalThis.Request(s.customRequest,{signal:q(this,Q).signal}):new globalThis.Request(s.customRequest);ke(this,oe,Vr).call(this,f)}for(const f of q(this,Q).hooks.beforeRetry){const h=await f({request:this.request,options:ke(this,oe,ii).call(this),error:s,retryCount:q(this,Bt)});if(h instanceof globalThis.Request){ke(this,oe,Vr).call(this,h);break}if(h instanceof globalThis.Response)return h;if(h===hp)return}return ke(this,oe,qs).call(this,u)}},xp=async function(){var s;(s=q(this,Jt))!=null&&s.signal.aborted&&(Kt(this,Jt,new globalThis.AbortController),q(this,Q).signal=q(this,ea)?AbortSignal.any([q(this,ea),q(this,Jt).signal]):q(this,Jt).signal,this.request=new globalThis.Request(this.request,{signal:q(this,Q).signal}));for(const o of q(this,Q).hooks.beforeRequest){const f=await o(this.request,ke(this,oe,ii).call(this),{retryCount:q(this,Bt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ke(this,oe,Vr).call(this,f);break}}const u=Kb(this.request,q(this,Q));return Kt(this,$a,this.request),this.request=q(this,$a).clone(),q(this,Q).timeout===!1?q(this,Q).fetch(q(this,$a),u):Qb(q(this,$a),u,q(this,Jt),q(this,Q))},ii=function(){if(!q(this,vn)){const{hooks:u,...s}=q(this,Q);Kt(this,vn,Object.freeze(s))}return q(this,vn)},Vr=function(u){Kt(this,vn,void 0),this.request=ke(this,oe,Ls).call(this,u)},Ls=function(u,s){return!q(this,Q).onUploadProgress||!u.body?u:Lb(u,q(this,Q).onUploadProgress,s??q(this,Q).body??void 0)},Pt(ri,Kr);let Zr=ri;/*! MIT License © Sindre Sorhus */const Hs=r=>{const u=(s,o)=>Zr.create(s,Dr(r,o));for(const s of mp)u[s]=(o,f)=>Zr.create(o,Dr(r,f,{method:s}));return u.create=s=>Hs(Dr(s)),u.extend=s=>(typeof s=="function"&&(s=s(r??{})),Hs(Dr(r,s))),u.stop=hp,u.retry=Cb,u},Eh=Hs();let Mr=null;const Xr=Eh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[r=>{const u=xa.getState().accessToken;u&&r.headers.set("Authorization",`Bearer ${u}`)}],afterResponse:[async(r,u,s)=>{if(s.status===401&&!r.headers.has("X-Retry-After-Refresh")){Mr||(Mr=xa.getState().refresh().finally(()=>{Mr=null}));try{await Mr}catch{throw s}const o=xa.getState().accessToken;return o&&r.headers.set("Authorization",`Bearer ${o}`),r.headers.set("X-Retry-After-Refresh","1"),Eh(r,u)}}]}}),Fb=3e4;function Ib(r){if(r.link)return r.link;const u=(r.title+" "+r.body).match(/task\s*#?(\d+)/i);if(u)return`/tasks/${u[1]}`;const s=(r.title+" "+r.body).match(/worker\s+(\S+)/i);return s?`/workers/${s[1]}`:null}function Sp(){const r=Fa(),[u,s]=g.useState([]),[o,f]=g.useState(0),[h,_]=g.useState(!1),[b,y]=g.useState(!1),p=g.useRef(null),{t:w}=Vt(),k=g.useRef(async()=>{try{y(!0);const H=(await Xr.get("web/notifications",{searchParams:{limit:"20"}}).json()).data,B=H.filter(U=>!U.isRead).length;s(U=>U.length===H.length&&U.every((K,X)=>K.id===H[X].id&&K.isRead===H[X].isRead)?U:H),f(U=>U===B?U:B)}catch{}finally{y(!1)}});g.useEffect(()=>{k.current();const L=setInterval(()=>k.current(),Fb);return()=>clearInterval(L)},[]),g.useEffect(()=>{function L(H){p.current&&!p.current.contains(H.target)&&_(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]);async function N(L){try{await Xr.post(`web/notifications/${L}/read`),s(H=>H.map(B=>B.id===L?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}}async function Y(){try{await Xr.post("web/notifications/read-all"),s(L=>L.map(H=>({...H,isRead:!0}))),f(0)}catch{}}return m.jsxs("div",{className:"relative",ref:p,children:[m.jsxs("button",{type:"button",onClick:()=>_(L=>!L),"aria-label":w("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[m.jsx(Kv,{size:16}),o>0&&m.jsx("span",{className:"absolute right-0 top-0 flex h-3 min-w-3 items-center justify-center rounded-full bg-[var(--destructive)] px-0.5 text-[8px] font-semibold leading-none text-white",children:o})]}),h&&m.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-[min(320px,calc(100vw-2rem))] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm font-semibold",children:w("common.notifications")}),o>0&&m.jsxs("button",{type:"button",onClick:Y,"aria-label":w("common.mark_all_read"),className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(Jv,{className:"h-3.5 w-3.5"}),w("common.mark_all_read")]})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto",children:b&&u.length===0?m.jsx("div",{className:"flex justify-center py-8",children:m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):u.length===0?m.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[m.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),m.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:w("common.no_notifications")})]}):u.map(L=>{const H=Ib(L);return m.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${L.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(L.isRead||N(L.id),_(!1),r(H))},children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"truncate text-sm font-medium",title:L.title,children:L.title}),m.jsx("p",{className:"truncate text-xs text-[var(--text-secondary)]",title:L.body,children:L.body}),m.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(L.createdAt).toLocaleString()})]}),!L.isRead&&m.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),N(L.id)},"aria-label":w("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:m.jsx($v,{className:"h-3.5 w-3.5"})})]},L.id)})})]})]})}function Pb(r,u=50){return r.name??Wh(r.description,u)}function e0(r){return{tasks:r.tasks.map(u=>({type:"task",id:u.id,title:`#${u.id} ${Pb(u)}`,subtitle:`${u.status} · ${u.project_key}`})),workers:(r.workers??[]).map(u=>({type:"worker",id:u.id,title:u.name,subtitle:`${u.hostname} · ${u.status}`})),projects:r.projects.map(u=>({type:"project",id:u.key,title:u.name,subtitle:u.repository}))}}const t0=300,wh={tasks:mb,workers:ap,projects:tb},a0={tasks:"tasks",workers:"workers",projects:"projects"};function kp({renderTrigger:r}={}){const[u,s]=g.useState(""),[o,f]=g.useState({tasks:[],workers:[],projects:[]}),[h,_]=g.useState(!1),[b,y]=g.useState(!1),[p,w]=g.useState(0),k=g.useRef(null),N=g.useRef(null),Y=g.useRef(void 0),L=g.useRef(void 0),H=Fa(),{t:B}=Vt(),U=g.useMemo(()=>[...o.tasks,...o.workers,...o.projects],[o]),K=g.useCallback(async W=>{var Pe;if(!W.trim()){f({tasks:[],workers:[],projects:[]});return}(Pe=L.current)==null||Pe.abort();const se=new AbortController;L.current=se;try{_(!0);const Je=await Xr.get("web/search",{searchParams:{q:W},signal:se.signal}).json();f(e0(Je)),w(0)}catch(Je){if(Je instanceof DOMException&&Je.name==="AbortError")return}finally{se.signal.aborted||_(!1)}},[]);g.useEffect(()=>(Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>K(u),t0),()=>{Y.current&&clearTimeout(Y.current)}),[u,K]),g.useEffect(()=>{function W(se){se.key==="/"&&!b&&!(se.target instanceof HTMLInputElement||se.target instanceof HTMLTextAreaElement)&&(se.preventDefault(),y(!0)),se.key==="Escape"&&b&&(se.preventDefault(),X())}return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[b]),g.useEffect(()=>{b&&setTimeout(()=>{var W;return(W=N.current)==null?void 0:W.focus()},50)},[b]);function X(){y(!1),s(""),f({tasks:[],workers:[],projects:[]}),w(0)}function ue(W){switch(X(),W.type){case"task":H(`/tasks/${W.id}`);break;case"worker":H(`/workers/${W.id}`);break;case"project":H(`/projects/${W.id}`);break}}function ce(W){W.key==="ArrowDown"?(W.preventDefault(),w(se=>Math.min(se+1,U.length-1))):W.key==="ArrowUp"?(W.preventDefault(),w(se=>Math.max(se-1,0))):W.key==="Enter"&&U[p]&&(W.preventDefault(),ue(U[p]))}const _e=U.length>0;let F=0;return m.jsxs(m.Fragment,{children:[r?r(()=>y(!0)):m.jsxs("button",{type:"button",onClick:()=>y(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[m.jsx(tp,{className:"h-3.5 w-3.5"}),m.jsx("span",{children:B("common.search_placeholder")}),m.jsx("kbd",{className:"ml-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[11px] text-[var(--text-muted)]",children:"/"})]}),b&&m.jsx("div",{ref:k,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[calc(var(--safe-area-top,0px)+16px)] md:pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:W=>{W.target===k.current&&X()},children:m.jsxs("div",{className:"mx-3 w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl sm:mx-4 md:mx-0",children:[m.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[m.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),m.jsx("input",{ref:N,type:"text",placeholder:B("common.search_input_placeholder"),value:u,onChange:W=>s(W.target.value),onKeyDown:ce,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),h&&m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),m.jsx("div",{className:"max-h-[50vh] overflow-y-auto sm:max-h-[60vh] md:max-h-[400px]",children:u.trim()&&!_e&&!h?m.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:B("common.no_search_results",{query:u})}):Object.keys(wh).map(W=>{const se=o[W];if(se.length===0)return null;const Pe=wh[W],Je=F;return F+=se.length,m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[m.jsx(Pe,{className:"h-3 w-3"}),m.jsx("span",{className:"text-[11px] lowercase tracking-wider",children:a0[W]})]}),se.map((Ce,At)=>{const ut=Je+At,Me=ut===p;return m.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${Me?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>ue(Ce),onMouseEnter:()=>w(ut),children:[m.jsx("span",{className:`text-xs ${Me?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:Me?">":" "}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:"truncate text-sm",title:Ce.title,children:Ce.title}),Ce.subtitle&&m.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",title:Ce.subtitle,children:Ce.subtitle})]})]},`${Ce.type}-${Ce.id}`)})]},W)})}),m.jsxs("div",{className:"hidden items-center gap-4 border-t border-[var(--border)] px-4 py-2 md:flex",children:[m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↑↓"})," ",B("common.navigate_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"↵"})," ",B("common.select_hint")]}),m.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-[var(--text-muted)]",children:[m.jsx("kbd",{className:"rounded-[4px] border border-[var(--border)] px-1",children:"esc"})," ",B("common.close_hint")]})]})]})})]})}const n0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function Th(r){return Array.from(r.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))}function l0({isOpen:r,onClose:u,onConfirm:s,title:o,message:f,confirmLabel:h,cancelLabel:_,confirmVariant:b="danger",isLoading:y,children:p}){const{t:w}=Vt(),k=g.useId(),N=h??w("common.confirm"),Y=_??w("common.cancel"),L=g.useRef(null),H=g.useRef(null),B=n0[b];g.useEffect(()=>{if(!r)return;H.current=document.activeElement;const K=requestAnimationFrame(()=>{if(L.current){const X=Th(L.current);X.length>0&&X[0].focus()}});return()=>{var X;cancelAnimationFrame(K),(X=H.current)==null||X.focus()}},[r]);const U=g.useCallback(K=>{if(K.key==="Escape"){u();return}if(K.key==="Tab"&&L.current){const X=Th(L.current);if(X.length===0)return;const ue=X[0],ce=X[X.length-1];K.shiftKey?document.activeElement===ue&&(K.preventDefault(),ce.focus()):document.activeElement===ce&&(K.preventDefault(),ue.focus())}},[u]);return r?m.jsx("div",{onClick:u,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"max(1rem, 10vh)",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:m.jsxs("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":k,onClick:K=>K.stopPropagation(),onKeyDown:U,style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem"},children:[m.jsx("div",{style:{marginBottom:"1.25rem"},children:m.jsxs("div",{id:k,style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[m.jsx(np,{style:{width:"1rem",height:"1rem"}}),o]})}),m.jsxs("div",{style:{marginBottom:"1.25rem"},children:[m.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f}),p]}),m.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[m.jsx("button",{type:"button",onClick:u,disabled:y,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",cursor:y?"not-allowed":"pointer",opacity:y?.7:1,transition:"color 0.15s, border-color 0.15s"},children:Y}),m.jsx("button",{type:"button",onClick:s,disabled:y,style:{flex:1,padding:"0.5rem",backgroundColor:B,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,cursor:y?"not-allowed":"pointer",opacity:y?.7:1},children:y?w("common.processing"):N})]})]})}):null}const jh="overlord-pwa-install-dismissed";function i0(){const r=navigator.userAgent;return/iP(hone|od|ad)/.test(r)&&/WebKit/.test(r)&&!/(CriOS|FxiOS|OPiOS|mercury)/.test(r)}function r0(){return navigator.standalone===!0||window.matchMedia("(display-mode: standalone)").matches}function u0(){const{t:r}=Vt(),[u,s]=g.useState("hidden"),[o,f]=g.useState(!1),h=g.useRef(null),_=g.useRef(void 0);g.useEffect(()=>{if(r0()||localStorage.getItem(jh)||window.innerWidth>=768)return;const p=k=>{k.preventDefault(),h.current=k};window.addEventListener("beforeinstallprompt",p);const w=setTimeout(()=>s("visible"),1e3);return()=>{window.removeEventListener("beforeinstallprompt",p),clearTimeout(w),clearTimeout(_.current)}},[]);function b(){localStorage.setItem(jh,"1"),s("dismissing"),_.current=setTimeout(()=>s("hidden"),200)}async function y(){if(h.current){await h.current.prompt();const{outcome:p}=await h.current.userChoice;p==="accepted"&&b(),h.current=null}else i0()&&f(!0)}return u==="hidden"?null:m.jsx("div",{className:`fixed bottom-4 left-4 right-4 z-40 md:hidden ${u==="dismissing"?"animate-slide-down":"animate-slide-up"}`,role:"dialog","aria-label":r("pwa_install.title"),children:m.jsxs("div",{className:"overflow-hidden rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--accent)]/20 bg-[var(--accent)]/[0.06] px-3 py-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-[var(--accent)]"}),m.jsx("span",{className:"text-[9px] font-medium text-[var(--accent)]",children:r("pwa_install.title")})]}),m.jsx("button",{onClick:b,className:"p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:m.jsx(lp,{size:14})})]}),m.jsx("div",{className:"px-3.5 py-3",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.ios_command")]}),m.jsx("div",{className:"mt-2.5 flex flex-col gap-2.5",children:[r("pwa_install.ios_step_1"),r("pwa_install.ios_step_2"),r("pwa_install.ios_step_3")].map((p,w)=>m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] bg-[var(--accent)]/[0.08]",children:m.jsx("span",{className:"text-xs font-semibold text-[var(--accent)]",children:w+1})}),m.jsxs("span",{className:"text-[10px] leading-snug text-[var(--text-secondary)]",children:[w===0&&m.jsx(cb,{size:12,className:"mr-1 inline-block align-text-bottom text-[var(--text-muted)]"}),p]})]},w))})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-[10px] text-[var(--text-muted)]",children:[m.jsx("span",{className:"text-[var(--accent)]",children:"$"})," ",r("pwa_install.command")]}),m.jsxs("div",{className:"mt-1.5 text-[10px] leading-relaxed text-[var(--text-secondary)]",children:["→ ",r("pwa_install.desc_1"),m.jsx("br",{}),"→ ",r("pwa_install.desc_2")]}),m.jsxs("div",{className:"mt-2.5 flex gap-2",children:[m.jsx("button",{onClick:y,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_install.install")}),m.jsx("button",{onClick:b,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[10px] text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:r("pwa_install.skip")})]})]})})]})})}function o0(){const{t:r}=Vt(),[u,s]=g.useState(!1);return g.useEffect(()=>{if(!("serviceWorker"in navigator))return;let o=!1,f=null,h=null,_=null,b=null;function y(){o||s(!0)}navigator.serviceWorker.addEventListener("controllerchange",y);function p(k){if(f=k,k.waiting){s(!0);return}_=()=>{const N=k.installing;N&&(h=N,b=()=>{N.state==="installed"&&navigator.serviceWorker.controller&&(o||s(!0))},N.addEventListener("statechange",b))},k.addEventListener("updatefound",_)}navigator.serviceWorker.getRegistration().then(k=>{k&&!o&&p(k)});const w=setInterval(()=>{navigator.serviceWorker.getRegistration().then(k=>{!k||o||(k.update().catch(()=>{}),k.waiting&&s(!0))})},3e4);return()=>{o=!0,clearInterval(w),navigator.serviceWorker.removeEventListener("controllerchange",y),f&&_&&f.removeEventListener("updatefound",_),h&&b&&h.removeEventListener("statechange",b)}},[]),u?m.jsx("div",{className:"animate-slide-up fixed bottom-20 left-4 right-4 z-50 md:bottom-4 md:left-auto md:right-4 md:w-80",children:m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] border border-[var(--accent)]/40 bg-[var(--bg-card)] px-3.5 py-3 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[m.jsx(ep,{size:14,className:"shrink-0 text-[var(--accent)]"}),m.jsx("span",{className:"flex-1 text-[10px] text-[var(--text-secondary)]",children:r("pwa_update.message")}),m.jsx("button",{onClick:()=>window.location.reload(),className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-1 text-[10px] font-semibold text-black transition-all hover:brightness-110",children:r("pwa_update.reload")})]})}):null}const Ur=64,s0=96,Rh=32;function c0({children:r,className:u}){const s=g.useRef(null),o=g.useRef(0),f=g.useRef("idle"),[h,_]=g.useState(0),[b,y]=g.useState("idle"),p=g.useCallback(U=>{f.current=U,y(U)},[]),w=g.useCallback(()=>{const U=s.current;return U?U.scrollTop<=0:!0},[]),k=g.useCallback(U=>{if(!w()){o.current=0;return}o.current=U.touches[0].clientY},[w]),N=g.useCallback(U=>{if(f.current==="refreshing"||o.current===0)return;const X=U.touches[0].clientY-o.current;if(X<=0){f.current!=="idle"&&(_(0),p("idle"));return}if(!w())return;U.preventDefault();const ue=Math.min(X*.5,s0);_(ue),p(ue>=Ur?"ready":"pulling")},[w,p]),Y=g.useCallback(()=>{f.current!=="refreshing"&&(f.current==="ready"?(p("refreshing"),_(Ur),setTimeout(()=>{window.location.reload()},300)):(_(0),p("idle")),o.current=0)},[p]);g.useEffect(()=>{const U=s.current;if(U)return U.addEventListener("touchstart",k,{passive:!0}),U.addEventListener("touchmove",N,{passive:!1}),U.addEventListener("touchend",Y,{passive:!0}),()=>{U.removeEventListener("touchstart",k),U.removeEventListener("touchmove",N),U.removeEventListener("touchend",Y)}},[k,N,Y]);const L=Math.min(h/Ur,1),H=b==="refreshing"?0:h/Ur*180,B=h>0||b==="refreshing";return m.jsxs("div",{ref:s,className:u,style:{overscrollBehaviorY:"contain"},children:[B&&m.jsx("div",{className:"pointer-events-none flex items-center justify-center md:hidden",style:{height:h,transition:b==="idle"?"height 200ms ease-out":void 0},children:m.jsx("div",{className:"flex items-center justify-center rounded-full bg-[var(--bg-card)] border border-[var(--border)]",style:{width:Rh,height:Rh,opacity:L,transition:b==="idle"?"opacity 200ms ease-out":void 0},children:b==="refreshing"?m.jsxs("svg",{width:16,height:16,viewBox:"0 0 16 16",className:"animate-spin",style:{color:"var(--accent)"},children:[m.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),m.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}):m.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16",style:{color:b==="ready"?"var(--accent)":"var(--text-muted)",transform:`rotate(${H}deg)`,transition:"color 150ms"},children:m.jsx("path",{d:"M8 3v8M5 8l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),r]})}const Ep=g.createContext({setActions:()=>{}});function B1(r){const{setActions:u}=g.useContext(Ep);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const wp=g.createContext({setSubtitle:()=>{}});function Y1(r){const{setSubtitle:u}=g.useContext(wp);g.useEffect(()=>(u(r),()=>u(null)),[r,u])}const f0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih},{to:"/workers",label:"workers",icon:ap},{to:"/projects",label:"projects",icon:ab},{to:"/access-tokens",label:"tokens",icon:lb}],d0=[{to:"/docs/cli",label:"cli",icon:$s},{to:"/docs/api",label:"api",icon:eb},{to:"/docs/bot",label:"bot",icon:ob},{to:"/docs/skill",label:"skill",icon:db},{to:"/docs/all",label:"all",icon:ib}],m0=[{to:"/admin",label:"admin",icon:fb}],h0=[{to:"/home",label:"terminal",icon:$s},{to:"/tasks",label:"tasks",icon:Ph},{to:"/dashboard",label:"dashboard",icon:Ih}],qr={"/home":{title:"common.breadcrumb_terminal",subtitle:"common.breadcrumb_terminal_sub"},"/dashboard":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/workers":{title:"common.breadcrumb_workers",subtitle:"common.breadcrumb_workers_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_tokens",subtitle:"common.breadcrumb_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"},"/docs/bot":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_bot_sub"},"/docs/all":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_all_sub"}};function p0(r){const{t:u}=Vt();if(qr[r]){const o=qr[r];return{title:u(o.title),subtitle:u(o.subtitle)}}const s="/"+r.split("/").filter(Boolean)[0];if(qr[s]){const o=qr[s],f=r.split("/").filter(Boolean).slice(1).join(" / ");return{title:u(o.title),subtitle:f||u(o.subtitle)}}return{title:r.slice(1).replace(/\//g," // ")||"home"}}function _0(r,u){return r==="/home"?u==="/home":r==="/dashboard"?u==="/dashboard":u.startsWith(r)}function g0(){const r=gt(),{t:u}=Vt(),s={terminal:u("terminal_home.title"),dashboard:u("dashboard.title"),tasks:u("tasks.title"),workers:u("workers.title")};return m.jsxs("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)]",style:{height:48,paddingTop:4},children:[h0.map(({to:o,label:f,icon:h})=>{const _=_0(o,r.pathname);return m.jsxs(Js,{to:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(h,{size:18,className:_?"text-[var(--accent)]":"text-[var(--text-muted)]"}),m.jsx("span",{className:`text-[11px] lowercase ${_?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:s[f]??f})]},o)}),m.jsx(kp,{renderTrigger:o=>m.jsxs("button",{type:"button",onClick:o,className:"flex flex-1 flex-col items-center gap-1",children:[m.jsx(tp,{size:18,className:"text-[var(--text-muted)]"}),m.jsx("span",{className:"text-[11px] lowercase text-[var(--text-muted)]",children:u("common.search_placeholder")})]})})]})}function y0(){const r=Fa(),{t:u}=Vt();return m.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:"calc(56px + env(safe-area-inset-top, 0px))",minHeight:"calc(56px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)"},children:[m.jsxs("button",{onClick:()=>r("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",children:m.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),m.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",children:u("common.overlord")})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{onClick:()=>r("/profile"),className:"p-2 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]","aria-label":u("common.profile"),children:m.jsx(pb,{size:18})}),m.jsx(Sp,{}),m.jsx(cp,{})]})]})}function zs({label:r,items:u,collapsed:s}){return m.jsxs("div",{className:"mt-4 first:mt-0",children:[!s&&m.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:r}),u.map(({to:o,label:f,icon:h})=>m.jsx(Js,{to:o,className:({isActive:_})=>`flex items-center text-sm lowercase transition-colors ${s?"justify-center py-3":"gap-2.5 px-3 py-1.5"} ${_?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:({isActive:_})=>m.jsxs(m.Fragment,{children:[m.jsx(h,{size:14,style:{flexShrink:0}}),!s&&m.jsx("span",{children:_?`> ${f}`:` ${f}`})]})},o))]})}function v0(){const{user:r,logout:u}=xa(),s=Fa(),[o,f]=g.useState(!1),h=vb(),{t:_}=Vt(),{sidebarCollapsed:b,toggleSidebar:y}=xb();function p(){u(),s("/login")}return m.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] transition-[width,min-width] duration-300 overflow-hidden",style:{width:b?56:240,minWidth:b?56:240,backgroundColor:"var(--bg-card)"},children:[m.jsx("div",{className:"flex items-center px-5",style:{height:48},children:m.jsxs("button",{onClick:()=>s("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[m.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{flexShrink:0},children:m.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),!b&&m.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)"},children:_("common.overlord")})]})}),m.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[m.jsx(zs,{label:_("common.navigation"),items:f0,collapsed:b}),m.jsx(zs,{label:_("common.docs_section"),items:d0,collapsed:b}),h&&m.jsx(zs,{label:_("common.admin_section"),items:m0,collapsed:b})]}),m.jsx("div",{className:`px-3 py-1 ${b?"flex justify-center":""}`,children:m.jsx("button",{onClick:y,className:"flex items-center justify-center w-full py-1.5 rounded-[4px] text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)] hover:bg-[var(--accent)]/5","aria-label":b?"expand sidebar":"collapse sidebar",children:b?m.jsx(Fv,{size:14}):m.jsx(Wv,{size:14})})}),m.jsx("div",{className:"border-t border-[var(--border)] p-3",children:m.jsxs("div",{className:`flex items-center py-2 ${b?"justify-center":"gap-3 px-3"}`,children:[m.jsx("button",{onClick:()=>s("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:_("common.profile"),children:((r==null?void 0:r.username)??"u")[0].toUpperCase()}),!b&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{onClick:()=>s("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:_("common.profile"),children:[m.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.username)??"user"}),m.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(r==null?void 0:r.role)??"user"})]}),m.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":_("common.log_out"),children:m.jsx(ub,{size:14})})]})]})}),m.jsx(l0,{isOpen:o,onClose:()=>f(!1),onConfirm:p,title:_("common.logout_title"),message:_("common.logout_message"),confirmLabel:_("common.logout"),confirmVariant:"warning"})]})}function b0({headerActions:r,subtitleOverride:u}){const s=gt(),{title:o,subtitle:f}=p0(s.pathname),h=u??f;return m.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[m.jsxs("div",{className:"text-sm lowercase",children:[m.jsx("span",{style:{color:"var(--text-primary)"},children:o}),h&&m.jsxs("span",{style:{color:"var(--text-muted)"},title:h,children:[" ","// ",Wh(h,40)]})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[r,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(kp,{}),m.jsx(Sp,{}),m.jsx(cp,{})]})]})]})}function x0(){const[r,u]=g.useState(null),[s,o]=g.useState(null),f=gt(),h=f.pathname==="/home",_=/^\/tasks\/\d+$/.test(f.pathname),b=f.pathname.startsWith("/docs");return g.useEffect(()=>up.getState().init(),[]),m.jsxs("div",{className:"fixed inset-x-0 top-0 flex w-full overflow-hidden font-mono md:flex-row",style:{height:"var(--app-height, 100dvh)",minHeight:"var(--app-height, 100dvh)"},children:[m.jsx(v0,{}),m.jsxs("div",{"data-testid":"app-main-column",className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-[calc(48px+var(--safe-area-bottom,0px))] md:pb-0",children:[m.jsx(y0,{}),!b&&m.jsx(b0,{headerActions:r,subtitleOverride:s}),m.jsx(c0,{className:h||_?"min-h-0 flex-1 overflow-hidden bg-[var(--bg-primary)]":"min-h-0 flex-1 overflow-auto bg-[var(--bg-primary)] p-4 pb-6 md:p-6 md:pb-6",children:m.jsx(Ep.Provider,{value:{setActions:u},children:m.jsx(wp.Provider,{value:{setSubtitle:o},children:m.jsx(ov,{})})})}),m.jsx(u0,{}),m.jsx(o0,{}),m.jsx("div",{className:"safe-area-bottom-fill fixed inset-x-0 bottom-0 z-30 bg-[var(--bg-card)] md:hidden",children:m.jsx(g0,{})})]})]})}function Ah(r){var s;const u=(s=r.state)==null?void 0:s.from;return u?{from:u}:{from:{pathname:r.pathname,search:r.search}}}function li({children:r,requireAdmin:u=!1}){const{accessToken:s,user:o,requireTotpSetup:f,initializing:h}=xa(),_=gt();if(h)return m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})});if(!s)return m.jsx(ll,{to:"/login",state:Ah(_),replace:!0});if(f){const b=Ah(_);return _.pathname!=="/totp-setup"&&_.pathname!=="/bind"?m.jsx(ll,{to:"/totp-setup",state:b,replace:!0}):_.pathname==="/bind"?(sessionStorage.setItem("overlord_bind_redirect",JSON.stringify(b.from)),m.jsx(ll,{to:"/totp-setup",state:b,replace:!0})):m.jsx(m.Fragment,{children:r})}return u&&(o==null?void 0:o.role)!==ip.ADMIN?m.jsx(ll,{to:"/home",replace:!0}):m.jsx(m.Fragment,{children:r})}function S0({children:r}){const{theme:u,resolved:s,setResolved:o}=sp();return g.useEffect(()=>{if(u!=="system"){o(u);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const h=_=>o(_.matches?"dark":"light");return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[u,o]),g.useEffect(()=>{document.documentElement.classList.toggle("dark",s==="dark")},[s]),m.jsx(m.Fragment,{children:r})}class k0 extends g.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}render(){var u;return this.state.hasError?m.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8 font-mono",children:[m.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Br("common.runtime_error")}),m.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((u=this.state.error)==null?void 0:u.message)||Br("common.an_unexpected_error_occurred")}),m.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[m.jsx(ep,{className:"h-3.5 w-3.5"}),Br("common.reload")]})]}):this.props.children}}function E0({isOpen:r}){const u=Fa(),{logout:s,setSessionExpired:o}=xa(),{t:f}=Vt();function h(){s(),o(!1),u("/login")}return r?m.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[m.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),m.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:m.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[m.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:m.jsx(rb,{className:"h-7 w-7 text-[var(--warning)]"})}),m.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),m.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),m.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:h,children:f("auth.go_to_login")})]})})]}):null}const zh=5;let ba=[];const Bs=new Set;function Tp(){Bs.forEach(r=>r())}function w0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(r,u,s=4e3){const o=w0();return ba=[...ba,{id:o,variant:r,message:u,duration:s}],ba.length>zh&&(ba=ba.slice(ba.length-zh)),Tp(),o}Wa.success=(r,u)=>Wa("success",r,u);Wa.error=(r,u)=>Wa("error",r,u);Wa.warning=(r,u)=>Wa("warning",r,u);Wa.info=(r,u)=>Wa("info",r,u);function T0(r){ba=ba.filter(u=>u.id!==r),Tp()}function j0(){const[,r]=g.useState(0);return g.useEffect(()=>{const u=()=>r(s=>s+1);return Bs.add(u),()=>{Bs.delete(u)}},[]),ba}const R0={success:{icon:Iv,borderColor:"var(--accent)"},error:{icon:Pv,borderColor:"var(--destructive)"},warning:{icon:np,borderColor:"var(--warning)"},info:{icon:nb,borderColor:"var(--info)"}};function A0({item:r}){const u=R0[r.variant],s=u.icon,{t:o}=Vt(),f=g.useCallback(()=>T0(r.id),[r.id]);return g.useEffect(()=>{if(!r.duration)return;const h=setTimeout(f,r.duration);return()=>clearTimeout(h)},[r.duration,f]),m.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${u.borderColor}`},role:"alert",children:[m.jsx(s,{className:"h-4 w-4 shrink-0",style:{color:u.borderColor}}),m.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:r.message}),m.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:m.jsx(lp,{className:"h-3.5 w-3.5"})})]})}function z0(){const r=j0();return r.length===0?null:m.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:r.map(u=>m.jsx("div",{className:"pointer-events-auto",children:m.jsx(A0,{item:u})},u.id))})}const O0=g.lazy(()=>ne(()=>import("./LandingPage-3ulS5Cqn.js"),__vite__mapDeps([0,1,2,3,4,5]))),C0=g.lazy(()=>ne(()=>import("./LoginPage-Ct_jVDj4.js"),[])),D0=g.lazy(()=>ne(()=>import("./TotpSetupPage-Cj5ywlij.js"),[])),N0=g.lazy(()=>ne(()=>import("./NotFoundPage-DveirmMy.js"),[])),M0=g.lazy(()=>ne(()=>import("./HomePage-B2acOwjz.js"),__vite__mapDeps([6,7,8,9,10,11,12,13,14,1]))),U0=g.lazy(()=>ne(()=>import("./TerminalHomePage-BEYHtMw1.js"),__vite__mapDeps([15,16,17,18,10,11,19,8,12,13,20,21,22]))),q0=g.lazy(()=>ne(()=>import("./TaskListPage-2YolzAUA.js"),__vite__mapDeps([23,16,7,8,12,14,24,19,5,25,9,20]))),L0=g.lazy(()=>ne(()=>import("./TaskDetailPage-CW2ETn6a.js"),__vite__mapDeps([26,16,17,18,12,19,8,14,27,21,24,28,29]))),H0=g.lazy(()=>ne(()=>import("./WorkerListPage-xz1kYnO8.js"),__vite__mapDeps([30,8,31,32,33,34,35,22,5,29,19,25,9,13,20]))),B0=g.lazy(()=>ne(()=>import("./WorkerDetailPage-Bu2t2eiz.js"),__vite__mapDeps([36,12,8,37,31,13,14,38,27]))),Y0=g.lazy(()=>ne(()=>import("./WorkerSetupGuidePage-CQD-nP4Z.js"),__vite__mapDeps([32,33,34,35,22]))),G0=g.lazy(()=>ne(()=>import("./ProjectListPage-COMMwrrs.js"),__vite__mapDeps([39,19,25,9,12,13,20]))),V0=g.lazy(()=>ne(()=>import("./ProjectDetailPage-NnvPZi7k.js"),__vite__mapDeps([40,41,19,14,12,8,37,13,42,38,20]))),X0=g.lazy(()=>ne(()=>import("./EditProjectPage-BImjnYmT.js"),__vite__mapDeps([43,19,41,20]))),Q0=g.lazy(()=>ne(()=>import("./PipelineEditorPage-DAZfSuYk.js"),__vite__mapDeps([44,19]))),Z0=g.lazy(()=>ne(()=>import("./ProfilePage-CZQ3htfG.js"),__vite__mapDeps([45,46,37,13]))),K0=g.lazy(()=>ne(()=>import("./BindPlatformPage-edTTq_uY.js"),[])),J0=g.lazy(()=>ne(()=>import("./AccessTokensPage-DjD5LZsA.js"),__vite__mapDeps([47,19,25,9,12,13,20,5,38]))),$0=g.lazy(()=>ne(()=>import("./CliReferencePage-BAzf89yH.js"),__vite__mapDeps([48,49,5,20]))),W0=g.lazy(()=>ne(()=>import("./ApiReferencePage-C8Bx02qj.js"),__vite__mapDeps([50,49,5,20]))),F0=g.lazy(()=>ne(()=>import("./SkillPage-C082Rzgs.js"),__vite__mapDeps([51,52,5,28]))),I0=g.lazy(()=>ne(()=>import("./DocsLayout-D2Mu8hlA.js"),__vite__mapDeps([53,27]))),P0=g.lazy(()=>ne(()=>import("./InstallationPage-DN_QajMd.js"),__vite__mapDeps([54,52,5]))),e1=g.lazy(()=>ne(()=>import("./DeveloperSetupPage-CBeh_qVr.js"),__vite__mapDeps([55,52,5]))),t1=g.lazy(()=>ne(()=>import("./WorkerSetupPage-ODbWtI01.js"),__vite__mapDeps([56,52,5]))),a1=g.lazy(()=>ne(()=>import("./BotSetupPage-D4935h0w.js"),__vite__mapDeps([57,52,5]))),n1=g.lazy(()=>ne(()=>import("./LocalDevelopmentPage-lBHHYq61.js"),__vite__mapDeps([58,52,5]))),l1=g.lazy(()=>ne(()=>import("./WorkerOperationsPage-biq5EcKg.js"),[])),i1=g.lazy(()=>ne(()=>import("./DeploymentPage-21M33DaS.js"),__vite__mapDeps([59,52,5]))),Oh=g.lazy(()=>ne(()=>import("./BotIntegrationPage-ONWvd1eX.js"),[])),r1=g.lazy(()=>ne(()=>import("./PipelineConfigPage-Dk6AjEpj.js"),__vite__mapDeps([60,52,5]))),u1=g.lazy(()=>ne(()=>import("./DevWorkflowPage-DKDSiELE.js"),__vite__mapDeps([61,52,5]))),o1=g.lazy(()=>ne(()=>import("./PermissionsPage-BuR4Kbo5.js"),[])),s1=g.lazy(()=>ne(()=>import("./EnvVariablesPage-6QIcLih_.js"),__vite__mapDeps([62,52,5]))),c1=g.lazy(()=>ne(()=>import("./ArchitecturePage-CfNRUT_y.js"),__vite__mapDeps([63,52,5]))),f1=g.lazy(()=>ne(()=>import("./ChangelogPage-BcVgepLQ.js"),[])),d1=g.lazy(()=>ne(()=>import("./AgentCliPage-BlASsz-A.js"),__vite__mapDeps([64,52,5]))),m1=g.lazy(()=>ne(()=>import("./DocsIndexPage-IQGwIaxX.js"),__vite__mapDeps([65,34,2,3,35]))),h1=g.lazy(()=>ne(()=>import("./AdminPage-BUC4Y85a.js"),__vite__mapDeps([66,4,2,67,35]))),p1=g.lazy(()=>ne(()=>import("./DeveloperManage-BmdITcZP.js"),__vite__mapDeps([68,19,46,25,9,13,8,20,4,42,21]))),_1=g.lazy(()=>ne(()=>import("./BotManage-BB1hDnX_.js"),__vite__mapDeps([69,19,52,5,38,20,25,9,13,8,2,42]))),g1=g.lazy(()=>ne(()=>import("./TokenManage-iqPhAikO.js"),__vite__mapDeps([70,33,5,28,25,9,13,8,20]))),y1=g.lazy(()=>ne(()=>import("./AuditLogPage-PWgPA80y.js"),__vite__mapDeps([71,19,25,9,67,11]))),v1=g.lazy(()=>ne(()=>import("./SettingsPage-NfHYjZBQ.js"),[]));function b1(){return m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function x1(){const r=xa(u=>u.sessionExpired);return m.jsxs(S0,{children:[m.jsx(z0,{}),m.jsx(k0,{children:m.jsxs(Mv,{children:[m.jsx(E0,{isOpen:r}),m.jsx(g.Suspense,{fallback:m.jsx(b1,{}),children:m.jsxs(cv,{children:[m.jsx(ee,{path:"/",element:m.jsx(O0,{})}),m.jsx(ee,{path:"/login",element:m.jsx(C0,{})}),m.jsx(ee,{path:"/totp-setup",element:m.jsx(li,{children:m.jsx(D0,{})})}),m.jsx(ee,{path:"/bind",element:m.jsx(li,{children:m.jsx(K0,{})})}),m.jsxs(ee,{element:m.jsx(li,{children:m.jsx(x0,{})}),children:[m.jsx(ee,{path:"/home",element:m.jsx(U0,{})}),m.jsx(ee,{path:"/dashboard",element:m.jsx(M0,{})}),m.jsx(ee,{path:"/tasks",element:m.jsx(q0,{})}),m.jsx(ee,{path:"/tasks/:id",element:m.jsx(L0,{})}),m.jsx(ee,{path:"/workers",element:m.jsx(H0,{})}),m.jsx(ee,{path:"/workers/setup",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(Y0,{})})}),m.jsx(ee,{path:"/workers/:id",element:m.jsx(B0,{})}),m.jsx(ee,{path:"/projects",element:m.jsx(G0,{})}),m.jsx(ee,{path:"/projects/:key",element:m.jsx(V0,{})}),m.jsx(ee,{path:"/projects/:key/edit",element:m.jsx(X0,{})}),m.jsx(ee,{path:"/projects/:key/pipeline",element:m.jsx(Q0,{})}),m.jsx(ee,{path:"/profile",element:m.jsx(Z0,{})}),m.jsx(ee,{path:"/access-tokens",element:m.jsx(J0,{})}),m.jsxs(ee,{path:"/docs",element:m.jsx(I0,{}),children:[m.jsx(ee,{index:!0,element:m.jsx(ll,{to:"cli",replace:!0})}),m.jsx(ee,{path:"cli",element:m.jsx($0,{})}),m.jsx(ee,{path:"api",element:m.jsx(W0,{})}),m.jsx(ee,{path:"bot",element:m.jsx(Oh,{})}),m.jsx(ee,{path:"all",element:m.jsx(m1,{})}),m.jsx(ee,{path:"skill",element:m.jsx(F0,{})}),m.jsx(ee,{path:"installation",element:m.jsx(P0,{})}),m.jsx(ee,{path:"developer-setup",element:m.jsx(e1,{})}),m.jsx(ee,{path:"worker-setup",element:m.jsx(t1,{})}),m.jsx(ee,{path:"bot-setup",element:m.jsx(a1,{})}),m.jsx(ee,{path:"local-development",element:m.jsx(n1,{})}),m.jsx(ee,{path:"worker-operations",element:m.jsx(l1,{})}),m.jsx(ee,{path:"deployment",element:m.jsx(i1,{})}),m.jsx(ee,{path:"bot-integration",element:m.jsx(Oh,{})}),m.jsx(ee,{path:"pipeline-config",element:m.jsx(r1,{})}),m.jsx(ee,{path:"dev-workflow",element:m.jsx(u1,{})}),m.jsx(ee,{path:"permissions",element:m.jsx(o1,{})}),m.jsx(ee,{path:"env-variables",element:m.jsx(s1,{})}),m.jsx(ee,{path:"architecture",element:m.jsx(c1,{})}),m.jsx(ee,{path:"agent-cli",element:m.jsx(d1,{})}),m.jsx(ee,{path:"changelog",element:m.jsx(f1,{})})]}),m.jsxs(ee,{path:"/admin",element:m.jsx(li,{requireAdmin:!0,children:m.jsx(h1,{})}),children:[m.jsx(ee,{index:!0,element:m.jsx(ll,{to:"developers",replace:!0})}),m.jsx(ee,{path:"developers",element:m.jsx(p1,{})}),m.jsx(ee,{path:"bots",element:m.jsx(_1,{})}),m.jsx(ee,{path:"tokens",element:m.jsx(g1,{})}),m.jsx(ee,{path:"audit-logs",element:m.jsx(y1,{})}),m.jsx(ee,{path:"settings",element:m.jsx(v1,{})})]})]}),m.jsx(ee,{path:"*",element:m.jsx(N0,{})})]})})]})})]})}function S1(r){var u,s;return((u=r.matchMedia)==null?void 0:u.call(r,"(display-mode: standalone)").matches)===!0||((s=r.navigator)==null?void 0:s.standalone)===!0}function k1(r){var s,o;const u=((s=r.navigator)==null?void 0:s.userAgent)??"";return/iPhone|iPad|iPod/i.test(u)||/Macintosh/i.test(u)&&(((o=r.navigator)==null?void 0:o.maxTouchPoints)??0)>1}function E1(r){const u=r.activeElement;if(!(u instanceof HTMLElement))return!1;const s=u.tagName;return u.isContentEditable||s==="INPUT"||s==="TEXTAREA"||s==="SELECT"}function w1(r){const u=r.screen;if(!u)return null;const s=Math.round(u.width),o=Math.round(u.height);return r.innerHeight>=r.innerWidth?Math.max(s,o):Math.min(s,o)}function T1(r=window,u=document){const s=u.documentElement,o=r.visualViewport??null,f=()=>{const h=Math.round((o==null?void 0:o.height)??0),_=Math.round(r.innerHeight);let b=h>0?h:_;if(S1(r)&&k1(r)&&!E1(u)){const y=w1(r);y!==null&&(b=Math.max(b,_,y))}s.style.setProperty("--app-height",`${b}px`)};return f(),r.addEventListener("resize",f),r.addEventListener("orientationchange",f),o==null||o.addEventListener("resize",f),o==null||o.addEventListener("scroll",f),()=>{r.removeEventListener("resize",f),r.removeEventListener("orientationchange",f),o==null||o.removeEventListener("resize",f),o==null||o.removeEventListener("scroll",f)}}xa.getState().initialize();T1(window,document);const j1=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(j1){document.documentElement.classList.add("pwa-standalone");const r=window.matchMedia("(prefers-color-scheme: dark)").matches,u=localStorage.getItem("overlord-theme"),s=u==="dark"||u!=="light"&&r;document.body.style.backgroundColor=s?"#171717":"#FFFFFF",new MutationObserver(()=>{const o=document.documentElement.classList.contains("dark");document.body.style.backgroundColor=o?"#171717":"#FFFFFF"}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})}oy.createRoot(document.getElementById("root")).render(m.jsx(g.StrictMode,{children:m.jsx(x1,{})}));export{L1 as $,N1 as A,np as B,$v as C,ip as D,D1 as E,ep as F,U1 as G,Ns as H,iy as I,Wh as J,lb as K,Jh as L,ob as M,ll as N,ub as O,u0 as P,M1 as Q,Rr as R,ap as S,cp as T,eb as U,db as V,C1 as W,lp as X,Js as Y,ov as Z,q1 as _,Vt as a,Pv as a0,$s as b,xe as c,fb as d,ib as e,Fa as f,gt as g,Xr as h,vb as i,m as j,up as k,Pb as l,Fr as m,O1 as n,Y1 as o,l0 as p,B1 as q,g as r,tp as s,Wa as t,xa as u,Ph as v,H1 as w,A1 as x,z1 as y,Iv as z};