@overlordai/server 1.0.157 → 1.0.159

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 (144) hide show
  1. package/database/migrations/018-source-chat-type.sql +1 -0
  2. package/dist/adapters/command-parser.utils.d.ts.map +1 -1
  3. package/dist/adapters/command-parser.utils.js +6 -7
  4. package/dist/adapters/command-parser.utils.js.map +1 -1
  5. package/dist/adapters/lark/lark.adapter.d.ts +6 -0
  6. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  7. package/dist/adapters/lark/lark.adapter.js +57 -5
  8. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  9. package/dist/adapters/nlu-fallback.utils.d.ts +6 -1
  10. package/dist/adapters/nlu-fallback.utils.d.ts.map +1 -1
  11. package/dist/adapters/nlu-fallback.utils.js +28 -1
  12. package/dist/adapters/nlu-fallback.utils.js.map +1 -1
  13. package/dist/adapters/nlu.service.js +2 -2
  14. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  15. package/dist/adapters/slack/slack.adapter.js +20 -2
  16. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  17. package/dist/database/repositories/task.repository.d.ts +1 -0
  18. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  19. package/dist/database/repositories/task.repository.js +4 -2
  20. package/dist/database/repositories/task.repository.js.map +1 -1
  21. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  22. package/dist/dispatcher/dispatcher.service.js +5 -3
  23. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  24. package/dist/dispatcher/dispatcher.types.d.ts +1 -0
  25. package/dist/dispatcher/dispatcher.types.d.ts.map +1 -1
  26. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  27. package/dist/dispatcher/task-creation.service.js +1 -0
  28. package/dist/dispatcher/task-creation.service.js.map +1 -1
  29. package/dist/notifier/notification-consumer.d.ts +1 -0
  30. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  31. package/dist/notifier/notification-consumer.js +10 -1
  32. package/dist/notifier/notification-consumer.js.map +1 -1
  33. package/dist/web/task.controller.d.ts +3 -0
  34. package/dist/web/task.controller.d.ts.map +1 -1
  35. package/package.json +4 -4
  36. package/public/assets/{AccessTokensPage-DjD0y3Wy.js → AccessTokensPage-DJa6imEC.js} +1 -1
  37. package/public/assets/{AdminPage-HzAbA69P.js → AdminPage-Dg8T3e2A.js} +1 -1
  38. package/public/assets/{AgentCliPage-Bh0J93z7.js → AgentCliPage-CbOOO3x8.js} +1 -1
  39. package/public/assets/{ApiReferencePage-Byzf5pf8.js → ApiReferencePage-gLJQIfFs.js} +1 -1
  40. package/public/assets/{ArchitecturePage-BIjfqByG.js → ArchitecturePage-CznVuU5n.js} +1 -1
  41. package/public/assets/{AuditLogPage-ClVtZ-sy.js → AuditLogPage-CUrXuW9T.js} +1 -1
  42. package/public/assets/{AutomationCreatePage-BE13E9gR.js → AutomationCreatePage-Cb1l0-wZ.js} +1 -1
  43. package/public/assets/{AutomationDetailPage-B8xZmC-l.js → AutomationDetailPage-upMMgI6g.js} +3 -3
  44. package/public/assets/{AutomationEditPage-CEt_oXIR.js → AutomationEditPage-CUKZxnpo.js} +1 -1
  45. package/public/assets/{AutomationListPage-D5CjLqcN.js → AutomationListPage-D0uIwr0z.js} +2 -2
  46. package/public/assets/{AutomationRunDetailPage-D0E_0VeU.js → AutomationRunDetailPage-BYqfc7Ld.js} +2 -2
  47. package/public/assets/{BindPlatformPage-DB1QVWgX.js → BindPlatformPage-CbHYiY2Z.js} +1 -1
  48. package/public/assets/{BotIntegrationPage-CzHAeEuV.js → BotIntegrationPage-B9jKTeh6.js} +1 -1
  49. package/public/assets/{BotManage-S125k7rw.js → BotManage-OSxhQ78T.js} +1 -1
  50. package/public/assets/{BotSetupPage-Dnm6DF4F.js → BotSetupPage-NEQkb_aJ.js} +1 -1
  51. package/public/assets/ChangelogPage-CGQHZHmO.js +1 -0
  52. package/public/assets/{CliReferencePage-25GPOr4l.js → CliReferencePage-V-_oDaRg.js} +1 -1
  53. package/public/assets/{ConfirmStageDialog-tQoVqBUn.js → ConfirmStageDialog-B7JvCse7.js} +2 -2
  54. package/public/assets/{DeploymentPage-BlJKhtpn.js → DeploymentPage-CwbD1HEF.js} +1 -1
  55. package/public/assets/{DevWorkflowPage-aEtLVTU8.js → DevWorkflowPage-Bl6nXzEb.js} +1 -1
  56. package/public/assets/{DeveloperManage-BnqshBpG.js → DeveloperManage-TPOpF30z.js} +1 -1
  57. package/public/assets/{DeveloperSetupPage-B1zy4XVc.js → DeveloperSetupPage-B4s49n8U.js} +1 -1
  58. package/public/assets/{DocsIndexPage-nv_fodEi.js → DocsIndexPage-tT9tgN-V.js} +1 -1
  59. package/public/assets/{DocsLayout-B7jFA598.js → DocsLayout-CzPavn6q.js} +1 -1
  60. package/public/assets/{DocsPrimitives-AcZO1JrK.js → DocsPrimitives-909IF-Hp.js} +1 -1
  61. package/public/assets/{EditProjectPage-DiEZlhg4.js → EditProjectPage-DmlAPrhm.js} +2 -2
  62. package/public/assets/{EmptyState-LTKgHYcv.js → EmptyState-Dg8UN1Uo.js} +1 -1
  63. package/public/assets/{EnvVariablesPage-e6GuwB1R.js → EnvVariablesPage-EgX4ZE4x.js} +1 -1
  64. package/public/assets/{HomePage-Cd2_zDHz.js → HomePage-D_YSq-WI.js} +1 -1
  65. package/public/assets/{InfoRow-lnXeWgNk.js → InfoRow-D5N9gMw3.js} +1 -1
  66. package/public/assets/{InstallationPage-DD1pdslX.js → InstallationPage-BQIokEvz.js} +1 -1
  67. package/public/assets/{LandingPage-DIkupOBz.js → LandingPage-CbjzE9Hp.js} +1 -1
  68. package/public/assets/{LocalDevelopmentPage-CK8RJXvS.js → LocalDevelopmentPage-Bt3_QwQi.js} +1 -1
  69. package/public/assets/{LoginPage-CJu_By_F.js → LoginPage-BocCCnhE.js} +1 -1
  70. package/public/assets/{MetricBar-67CkWYmq.js → MetricBar-CtqnZJov.js} +1 -1
  71. package/public/assets/{MultiSelect-BhLPEo_K.js → MultiSelect-D0uOKezV.js} +1 -1
  72. package/public/assets/{NotFoundPage-CpbBgA_n.js → NotFoundPage-t8FksA7t.js} +1 -1
  73. package/public/assets/{OnboardingGuide-HdfZWDmp.js → OnboardingGuide-Bi-g-Iw9.js} +1 -1
  74. package/public/assets/{PermissionsPage-C6EhLmoR.js → PermissionsPage-CCCmXGJ2.js} +1 -1
  75. package/public/assets/{PipelineConfigPage-DsfoW7BV.js → PipelineConfigPage-DLxiRezs.js} +1 -1
  76. package/public/assets/PipelineEditorPage-BqjN6Z6_.js +3 -0
  77. package/public/assets/{PlanPage-CPv3FaK5.js → PlanPage-BKJWTsJH.js} +1 -1
  78. package/public/assets/{ProfilePage-B9eZhx0g.js → ProfilePage-DArQZVmd.js} +1 -1
  79. package/public/assets/{ProjectDetailPage-BsuAmV1J.js → ProjectDetailPage-BiLgLtap.js} +3 -3
  80. package/public/assets/{ProjectListPage-1QvxxlXK.js → ProjectListPage-rKmXQZfN.js} +2 -2
  81. package/public/assets/{PtyTerminal-huC-c2oe.js → PtyTerminal-Dyd6hZ66.js} +1 -1
  82. package/public/assets/{QuickAuth-CCtyO4Ck.js → QuickAuth-DzPlVKux.js} +1 -1
  83. package/public/assets/{RemoveMemberConfirmDialog-Oqecz4vr.js → RemoveMemberConfirmDialog-DkPO6agB.js} +1 -1
  84. package/public/assets/{ReviewAggregatePage-BzKd2sFY.js → ReviewAggregatePage-Cwqw537t.js} +2 -2
  85. package/public/assets/ReviewPage-HUY6XIBP.js +1 -0
  86. package/public/assets/{Select-CNYCHeZX.js → Select-BdUjuVPU.js} +1 -1
  87. package/public/assets/{SettingsPage-BvTyYAXJ.js → SettingsPage-BayKRVfO.js} +1 -1
  88. package/public/assets/{Skeleton-BrVgXQ4x.js → Skeleton-DZltBScg.js} +1 -1
  89. package/public/assets/{SkillPage-CKerSBp8.js → SkillPage-tEl_scrn.js} +1 -1
  90. package/public/assets/{TaskDetailPage-BPfdUhIA.js → TaskDetailPage-Mgt_DDft.js} +2 -2
  91. package/public/assets/{TaskGuidePage-BceANeUe.js → TaskGuidePage-AzKu3Oth.js} +1 -1
  92. package/public/assets/TaskListPage-DFu3jl-d.js +1 -0
  93. package/public/assets/{TaskStatusBadge-DTlL90XL.js → TaskStatusBadge-DN9LRx7Z.js} +1 -1
  94. package/public/assets/{TerminalHomePage-Bxt9wTDO.js → TerminalHomePage-0dhFntcB.js} +1 -1
  95. package/public/assets/{TokenManage-CbYNSi7e.js → TokenManage-CK-P3WO8.js} +1 -1
  96. package/public/assets/{Tooltip-C3hg00C8.js → Tooltip-BHebqiCF.js} +1 -1
  97. package/public/assets/{TotpSetupPage-BqZ_rQ89.js → TotpSetupPage-Bd9tAUkq.js} +1 -1
  98. package/public/assets/{WorkerDetailPage-mJymc0c9.js → WorkerDetailPage-BAWSgsX7.js} +1 -1
  99. package/public/assets/{WorkerListPage-BvvaEpSh.js → WorkerListPage-Bxi_XBHn.js} +2 -2
  100. package/public/assets/{WorkerOperationsPage-BtRfYi8T.js → WorkerOperationsPage-7kpkz1U9.js} +1 -1
  101. package/public/assets/{WorkerSetupGuidePage-C7uzs-1r.js → WorkerSetupGuidePage-BwCr32j3.js} +1 -1
  102. package/public/assets/{WorkerSetupPage-BLveOM_y.js → WorkerSetupPage-BZ71fFGZ.js} +1 -1
  103. package/public/assets/{agent-type-options-BAQ9fpbk.js → agent-type-options-D09p3GHf.js} +1 -1
  104. package/public/assets/{arrow-left-B6sCoNMg.js → arrow-left-Bx4nR3Vh.js} +1 -1
  105. package/public/assets/{arrow-right-DucIlJgu.js → arrow-right-ByYi4vIr.js} +1 -1
  106. package/public/assets/{bot-C0ZB09x2.js → bot-ChcNlI1h.js} +1 -1
  107. package/public/assets/{chevron-down-Bd-GeLYL.js → chevron-down-CMJNvCkO.js} +1 -1
  108. package/public/assets/{chevron-left-BkCX7Jfp.js → chevron-left-D32li7kz.js} +1 -1
  109. package/public/assets/{chevron-right-j7uSeS3a.js → chevron-right-CJoGvgTt.js} +1 -1
  110. package/public/assets/{chevron-up-Da8klXGP.js → chevron-up-Ouv2r2Jr.js} +1 -1
  111. package/public/assets/{circle-alert-VOv95Apc.js → circle-alert-B88-HLYp.js} +1 -1
  112. package/public/assets/{clock-CMu6MgNQ.js → clock-tNaDNX3I.js} +1 -1
  113. package/public/assets/{copy-BpJGDcH8.js → copy-tvtyH4eP.js} +1 -1
  114. package/public/assets/{download-Cn3E19jC.js → download-CRX_DJkZ.js} +1 -1
  115. package/public/assets/{external-link-CTvv0bQF.js → external-link-DP3KNa_2.js} +1 -1
  116. package/public/assets/{git-fork-DCl86SOH.js → git-fork--Nr0I7x8.js} +1 -1
  117. package/public/assets/{index-Dg26ocqa.css → index-CULr4DFs.css} +1 -1
  118. package/public/assets/{index-cjnaCqIk.js → index-Cnjcx5EP.js} +3 -3
  119. package/public/assets/{key-Dorg0_uB.js → key-CkD-0NnX.js} +1 -1
  120. package/public/assets/{loader-circle-CMUEKgE-.js → loader-circle-CoOnqP8V.js} +1 -1
  121. package/public/assets/{pencil-DEF_BTYZ.js → pencil-CmamgXMb.js} +1 -1
  122. package/public/assets/{play-BLPg52oN.js → play-CmZnnLuv.js} +1 -1
  123. package/public/assets/{plus-8-agJFRJ.js → plus-T50zBWvm.js} +1 -1
  124. package/public/assets/{rotate-ccw-wLonVM_U.js → rotate-ccw-I6j0q_Iy.js} +1 -1
  125. package/public/assets/{scroll-text-CKwOpWMh.js → scroll-text-ZBeRRo74.js} +1 -1
  126. package/public/assets/{settings-D1YRvTDO.js → settings-B1b_6onY.js} +1 -1
  127. package/public/assets/{skip-forward-DNcoNfv9.js → skip-forward-B7WDk647.js} +1 -1
  128. package/public/assets/{status-colors-CR_ojibY.js → status-colors-BMdWkS1a.js} +1 -1
  129. package/public/assets/{task-constants-F1gBygz6.js → task-constants-Bjfrzjfy.js} +1 -1
  130. package/public/assets/task.store-Bq6C3_Ny.js +1 -0
  131. package/public/assets/{timer-BX0T2rB2.js → timer-GGOn9LAl.js} +1 -1
  132. package/public/assets/{trash-2-2HWSKe9Q.js → trash-2-DlnQ4ddN.js} +1 -1
  133. package/public/assets/{useFetch-DAyPN0QS.js → useFetch-BGgm-RKN.js} +1 -1
  134. package/public/assets/{users-DPvIMDWv.js → users-DgMm52jh.js} +1 -1
  135. package/public/assets/{wifi-z3u1A7iV.js → wifi-B-LLQjvB.js} +1 -1
  136. package/public/assets/{workflow-DZ8vNArC.js → workflow-CCSkA4u6.js} +1 -1
  137. package/public/assets/{zap-CdiPtBsB.js → zap-CeHncDxq.js} +1 -1
  138. package/public/index.html +2 -2
  139. package/public/sw.js +1 -1
  140. package/public/assets/ChangelogPage-Da-oDqd1.js +0 -1
  141. package/public/assets/PipelineEditorPage-DW-KXDsp.js +0 -3
  142. package/public/assets/ReviewPage-BnaopkqX.js +0 -1
  143. package/public/assets/TaskListPage-CwnqvCTD.js +0 -1
  144. package/public/assets/task.store-Da_v76Ve.js +0 -1
@@ -1 +1 @@
1
- import{j as e}from"./index-cjnaCqIk.js";function r(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permissions & roles"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"overlord uses role-based access control (rbac) with two layers: system roles that govern global permissions, and project roles that scope access within individual projects. roles are hierarchical — higher roles inherit all permissions from lower ones."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> system roles"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"system roles are assigned to developer accounts and determine what actions they can perform across the entire overlord instance."}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"role"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"inherits"}),e.jsx("th",{className:"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:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"developer"})}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"base role for all users"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"lead"})}),e.jsx("td",{className:"py-2 pr-4",children:"developer"}),e.jsx("td",{className:"py-2",children:"team lead with worker management capabilities"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"admin"})}),e.jsx("td",{className:"py-2 pr-4",children:"all"}),e.jsx("td",{className:"py-2",children:"full system access"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> permissions matrix"}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"permission"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"developer"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"lead"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"admin"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"create & view tasks"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"attach to terminals"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage own profile"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view assigned projects"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view all workers"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"drain / undrain workers"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage developers"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage projects"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage bots"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage worker tokens"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view audit logs"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"system settings"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> project roles"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project roles control what a developer can do within a specific project. these are assigned per project and are independent of system roles."}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"role"}),e.jsx("th",{className:"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:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"member"})}),e.jsx("td",{className:"py-2",children:"read access to project, can create tasks"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maintainer"})}),e.jsx("td",{className:"py-2",children:"full project management"})]})]})]})}),e.jsx("p",{className:"mt-3 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:"project permissions"}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"permission"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"member"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"maintainer"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view project"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"create tasks in project"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"update project config"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage project members"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"manage git tokens"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]})]})]})}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"admins can access all projects without explicit membership. the project role check is bypassed entirely for admin system role."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> authentication"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"overlord supports three authentication methods:"}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"method"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"lifetime"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"use case"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"jwt"})}),e.jsx("td",{className:"py-2 pr-4",children:"access: 15 min, refresh: 7 days"}),e.jsx("td",{className:"py-2",children:"web dashboard, api sessions"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pat"})}),e.jsx("td",{className:"py-2 pr-4",children:"no expiry (until revoked)"}),e.jsx("td",{className:"py-2",children:"cli tools, scripts, integrations"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"totp 2fa"})}),e.jsx("td",{className:"py-2 pr-4",children:"30s codes"}),e.jsx("td",{className:"py-2",children:"optional second factor on login"})]})]})]})}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"jwt authentication uses a rotating refresh token — each refresh request issues a new access token and a new refresh token, invalidating the previous refresh token. pats authenticate with the same authorization: bearer header format as jwts."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"totp 2fa is optional per account. once enabled, the totpcode field is required on login. use any standard authenticator app to generate codes."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> audit logging"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"all privileged actions (developer management, project changes, worker operations, system settings) are recorded in the audit log. audit entries include the actor, action, target resource, and timestamp. only admins can view audit logs via the web dashboard or api."})]})]})]})}export{r as default};
1
+ import{j as e}from"./index-Cnjcx5EP.js";function r(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permissions & roles"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"overlord uses role-based access control (rbac) with two layers: system roles that govern global permissions, and project roles that scope access within individual projects. roles are hierarchical — higher roles inherit all permissions from lower ones."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> system roles"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"system roles are assigned to developer accounts and determine what actions they can perform across the entire overlord instance."}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"role"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"inherits"}),e.jsx("th",{className:"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:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"developer"})}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"base role for all users"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"lead"})}),e.jsx("td",{className:"py-2 pr-4",children:"developer"}),e.jsx("td",{className:"py-2",children:"team lead with worker management capabilities"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"admin"})}),e.jsx("td",{className:"py-2 pr-4",children:"all"}),e.jsx("td",{className:"py-2",children:"full system access"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> permissions matrix"}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"permission"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"developer"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"lead"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"admin"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"create & view tasks"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"attach to terminals"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage own profile"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view assigned projects"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view all workers"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"drain / undrain workers"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage developers"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage projects"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage bots"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage worker tokens"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view audit logs"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"system settings"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> project roles"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project roles control what a developer can do within a specific project. these are assigned per project and are independent of system roles."}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"role"}),e.jsx("th",{className:"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:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"member"})}),e.jsx("td",{className:"py-2",children:"read access to project, can create tasks"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maintainer"})}),e.jsx("td",{className:"py-2",children:"full project management"})]})]})]})}),e.jsx("p",{className:"mt-3 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:"project permissions"}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"permission"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"member"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"maintainer"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"view project"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"create tasks in project"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--accent)]",children:"yes"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"update project config"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"manage project members"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"manage git tokens"}),e.jsx("td",{className:"py-2 pr-4 text-[var(--text-muted)]",children:"—"}),e.jsx("td",{className:"py-2 text-[var(--accent)]",children:"yes"})]})]})]})}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"admins can access all projects without explicit membership. the project role check is bypassed entirely for admin system role."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> authentication"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"overlord supports three authentication methods:"}),e.jsx("div",{className:"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)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"method"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"lifetime"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"use case"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"jwt"})}),e.jsx("td",{className:"py-2 pr-4",children:"access: 15 min, refresh: 7 days"}),e.jsx("td",{className:"py-2",children:"web dashboard, api sessions"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pat"})}),e.jsx("td",{className:"py-2 pr-4",children:"no expiry (until revoked)"}),e.jsx("td",{className:"py-2",children:"cli tools, scripts, integrations"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"totp 2fa"})}),e.jsx("td",{className:"py-2 pr-4",children:"30s codes"}),e.jsx("td",{className:"py-2",children:"optional second factor on login"})]})]})]})}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"jwt authentication uses a rotating refresh token — each refresh request issues a new access token and a new refresh token, invalidating the previous refresh token. pats authenticate with the same authorization: bearer header format as jwts."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"totp 2fa is optional per account. once enabled, the totpcode field is required on login. use any standard authenticator app to generate codes."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> audit logging"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"all privileged actions (developer management, project changes, worker operations, system settings) are recorded in the audit log. audit entries include the actor, action, target resource, and timestamp. only admins can view audit logs via the web dashboard or api."})]})]})]})}export{r as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-cjnaCqIk.js";import{a}from"./DocsPrimitives-AcZO1JrK.js";import"./copy-BpJGDcH8.js";const c=`[
1
+ import{j as e}from"./index-Cnjcx5EP.js";import{a}from"./DocsPrimitives-909IF-Hp.js";import"./copy-tvtyH4eP.js";const c=`[
2
2
  {
3
3
  "name": "develop",
4
4
  "command": "/develop {description}",
@@ -0,0 +1,3 @@
1
+ import{a as g,r as p,j as e,a0 as $,B as I,f as M,h as S,t as y}from"./index-Cnjcx5EP.js";import{S as C}from"./Select-BdUjuVPU.js";import"./chevron-down-CMJNvCkO.js";const O={stages:[]};function q(){return{name:"",prompt:""}}function b({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function j({value:t,onChange:o,placeholder:a,type:r="text",className:c=""}){return e.jsx("input",{type:r,value:t,onChange:s=>o(s.target.value),placeholder:a,className:`w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none ${c}`})}function J({checked:t,onChange:o}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>o(!t),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-[var(--border)] transition-colors ${t?"bg-[var(--accent)]":"bg-[var(--bg-primary)]"}`,children:e.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${t?"translate-x-[18px]":"translate-x-[2px]"}`})})}function N({value:t,onChange:o,placeholder:a,rows:r=4}){return e.jsx("textarea",{value:t,onChange:c=>o(c.target.value),placeholder:a,rows:r,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs leading-relaxed text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})}function T({stage:t,index:o,selected:a,onSelect:r,onDelete:c}){const{t:s}=g(),i=t.prompt?$(t.prompt,60):"";return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${a?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:"var(--accent)"},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-[var(--text-muted)]",children:String(o+1).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs font-bold text-[var(--text-primary)]",children:t.name||"unnamed"}),t.label&&e.jsx("span",{className:"truncate font-mono text-[11px] text-[var(--text-muted)]",children:t.label})]}),i&&e.jsxs("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]",children:["// ",i]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[11px] text-[var(--text-muted)]",children:[t.gate&&e.jsx("span",{children:"gate"}),t.requireConfirm&&e.jsx("span",{children:"confirm"}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"mt-0.5 shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":s("pipeline.delete_stage"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function _({stage:t,onChange:o,allStageNames:a}){const{t:r}=g(),c=p.useMemo(()=>{const s=[{value:"",label:"-- select --"}];for(const i of a)i&&i!==t.name&&s.push({value:i,label:i});return s},[a,t.name]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:r("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.editing",{name:t.name||r("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsxs(b,{children:[r("pipeline.name")," *"]}),e.jsx(j,{value:t.name,onChange:s=>o({name:s}),placeholder:r("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(b,{children:"label"}),e.jsx(j,{value:t.label??"",onChange:s=>o({label:s||void 0}),placeholder:"optional display label"})]}),e.jsxs("div",{children:[e.jsx(b,{children:"prompt *"}),e.jsx(N,{value:t.prompt,onChange:s=>o({prompt:s}),placeholder:"instructions for the agent...",rows:8})]}),e.jsxs("div",{children:[e.jsx(b,{children:"gate"}),e.jsx(j,{value:t.gate??"",onChange:s=>o({gate:s||void 0}),placeholder:"Pass condition, e.g.: no P1-P3 issues"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:r("pipeline.confirm_required")}),e.jsx(J,{checked:t.requireConfirm??!1,onChange:s=>o({requireConfirm:s})})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.timeout")}),e.jsx(j,{type:"number",value:String(t.timeout??""),onChange:s=>o({timeout:s?parseInt(s,10):void 0}),placeholder:"600"})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("p",{className:"mb-3 font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(b,{children:r("pipeline.on_failure")}),e.jsx(C,{value:t.onFailure?"goto":"stop",onChange:s=>{o(s==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:r("pipeline.stop")},{value:"goto",label:r("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.goto")}),e.jsx(C,{value:t.onFailure.goto,onChange:s=>{var i;return o({onFailure:{goto:s,maxLoops:((i=t.onFailure)==null?void 0:i.maxLoops)??3}})},options:c})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.max_loops")}),e.jsx(j,{type:"number",value:String(t.onFailure.maxLoops),onChange:s=>{var i;return o({onFailure:{goto:((i=t.onFailure)==null?void 0:i.goto)??"",maxLoops:s?parseInt(s,10):3}})},placeholder:"3"})]})]})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold text-[var(--accent)]",children:"params"}),e.jsx(N,{value:t.params?Object.entries(t.params).map(([s,i])=>`${s}=${i}`).join(`
2
+ `):"",onChange:s=>{if(!s.trim()){o({params:void 0});return}const i={};s.split(`
3
+ `).forEach(d=>{const l=d.indexOf("=");l>0&&(i[d.slice(0,l).trim()]=d.slice(l+1).trim())}),o({params:i})},placeholder:"KEY=value (one per line)",rows:3})]})]})}function B({value:t,onChange:o}){const[a,r]=p.useState(t.trim().length>0);return p.useEffect(()=>{!a&&t.trim().length>0&&r(!0)},[t,a]),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:"flex w-full items-center justify-between px-4 py-3 text-left font-mono text-xs font-semibold text-[var(--accent)]",children:[e.jsx("span",{children:"preamble"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a?"[-]":"[+]"})]}),a&&e.jsx("div",{className:"border-t border-[var(--border)] px-4 py-3",children:e.jsx(N,{value:t,onChange:o,placeholder:"Global pre-prompt injected before all stages",rows:4})})]})}function D({value:t,onChange:o}){const{t:a}=g(),[r,c]=p.useState(null),[s,i]=p.useState(!1),d=p.useMemo(()=>t??O,[t]),l=d.stages,h=r!=null?l[r]??null:null,f=p.useMemo(()=>l.map(n=>n.name),[l]),v=p.useCallback(n=>{o({...d,stages:n})},[o,d]),F=p.useCallback(()=>{const n=[...l,q()];v(n),c(n.length-1)},[l,v]),E=p.useCallback(n=>{const x=l.filter((m,u)=>u!==n);v(x),r===n?c(x.length>0?Math.min(n,x.length-1):null):r!=null&&r>n&&c(r-1)},[l,r,v]),w=p.useCallback((n,x)=>{const m=l.map((u,P)=>P===n?{...u,...x}:u);v(m)},[l,v]),k=p.useCallback((n,x)=>{const m=x==="up"?n-1:n+1;if(m<0||m>=l.length)return;const u=[...l];[u[n],u[m]]=[u[m],u[n]],v(u),r===n?c(m):r===m&&c(n)},[l,r,v]),L=p.useMemo(()=>JSON.stringify(d,null,2),[d]);return e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>i(n=>!n),className:`rounded-[4px] border px-2 py-1 font-mono text-[11px] transition-colors ${s?"border-[var(--accent)] text-[var(--accent)]":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:[a("pipeline.json_toggle")," ⇅"]})}),s&&e.jsx("pre",{className:"mb-4 max-h-[400px] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 font-mono text-[11px] leading-relaxed text-[var(--text-primary)]",children:L}),e.jsx("div",{className:"mb-4",children:e.jsx(B,{value:d.preamble??"",onChange:n=>o({...d,preamble:n||void 0})})}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.map((n,x)=>{var m;return e.jsxs("div",{children:[e.jsx(T,{stage:n,index:x,selected:r===x,onSelect:()=>c(x),onDelete:()=>E(x)}),x<l.length-1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"▼"}),e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"})]}),((m=n.onFailure)==null?void 0:m.goto)&&e.jsx("div",{className:"flex items-center justify-center gap-1.5 py-1",children:e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["↺ loop → ",n.onFailure.goto," (max ",n.onFailure.maxLoops,")"]})})]},`${x}-${n.name}`)}),r!=null&&l.length>1&&e.jsxs("div",{className:"flex items-center gap-1 pl-7 pt-2",children:[e.jsxs("button",{type:"button",disabled:r===0,onClick:()=>k(r,"up"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▲ ",a("pipeline.up")]}),e.jsxs("button",{type:"button",disabled:r===l.length-1,onClick:()=>k(r,"down"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▼ ",a("pipeline.down")]})]}),e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsxs("button",{type:"button",onClick:F,className:"flex items-center gap-1.5 rounded-[4px] border border-dashed border-[var(--border)] px-4 py-2 font-mono text-xs text-[var(--accent)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--bg-secondary)]",children:[e.jsx("span",{className:"text-sm leading-none",children:"+"})," ",a("pipeline.add_stage")]})}),h&&e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs font-semibold text-[var(--accent)]",children:a("pipeline.stage_properties")}),e.jsx("button",{type:"button",onClick:()=>c(null),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 font-mono text-[11px] text-[var(--text-muted)]",children:"x"})]}),e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f})]})]}),e.jsx("div",{className:"hidden w-[360px] shrink-0 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 lg:block",style:{alignSelf:"flex-start",position:"sticky",top:0},children:h?e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f}):e.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:e.jsx("p",{className:"font-mono text-xs text-[var(--text-muted)]",children:a("pipeline.select_stage")})})})]})]})}function W(){const{key:t}=I(),o=M(),{t:a}=g(),[r,c]=p.useState(null),[s,i]=p.useState(!0),[d,l]=p.useState(!1);p.useEffect(()=>{t&&S.get(`web/projects/${t}`).json().then(f=>{if(f.pipeline)try{c(JSON.parse(f.pipeline))}catch{c(null)}}).catch(()=>y.error(a("pipeline.failed_to_load_project"))).finally(()=>i(!1))},[t,a]);const h=p.useCallback(async()=>{if(t){l(!0);try{await S.put(`web/projects/${t}`,{json:{pipeline:r?JSON.stringify(r):null}}),y.success(a("pipeline.saved"))}catch{y.error(a("pipeline.failed_to_save"))}finally{l(!1)}}},[t,r,a]);return s?e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("pipeline.loading_pipeline")})}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-[var(--border)] px-4 md:px-8 py-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-base font-medium text-[var(--text-primary)] shrink-0",children:a("pipeline.title")}),e.jsx("span",{className:"text-sm text-[var(--text-muted)] truncate",children:a("pipeline.subtitle",{key:t??""})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:h,disabled:d,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:a(d?"common.saving":"pipeline.save")}),e.jsx("button",{type:"button",onClick:()=>o(`/projects/${t}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("pipeline.cancel")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 md:p-8",children:e.jsx(D,{value:r,onChange:c})})]})}export{W as default};
@@ -1 +1 @@
1
- import{f as Q,a as H,k as J,r,h as j,o as s,t as M,w as V,j as t,K as Z,l as z,G as W}from"./index-cjnaCqIk.js";import{E as X}from"./EmptyState-LTKgHYcv.js";import{T as Y}from"./Skeleton-BrVgXQ4x.js";import{f as ee}from"./date-CmcdoD87.js";import{S as te}from"./Select-CNYCHeZX.js";import{P as re}from"./plus-8-agJFRJ.js";import{E as se}from"./external-link-CTvv0bQF.js";import{C as ae}from"./chevron-left-BkCX7Jfp.js";import{C as oe}from"./chevron-right-j7uSeS3a.js";import"./chevron-down-Bd-GeLYL.js";const ne=[s.QUEUED,s.ASSIGNED,s.RUNNING,s.SUSPENDED],ce=20;function ie(n,a){if(!n)return null;const v=n.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),c=a.split("/").map(encodeURIComponent).join("/");return n.gitPlatform===W.GITLAB?`${v}/-/tree/${c}/docs/specs`:`${v}/tree/${c}/docs/specs`}function le(n){switch(n){case s.RUNNING:return"bg-[var(--accent)]";case s.QUEUED:return"bg-[var(--warning)]";case s.ASSIGNED:return"bg-[var(--info)]";case s.SUSPENDED:return"bg-[var(--warning)]";case s.COMPLETED:return"bg-[var(--accent)]";case s.FAILED:return"bg-[var(--destructive)]";case s.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function je(){const n=Q(),{t:a}=H(),v=J(e=>e.taskSeq),[c,G]=r.useState("in_progress"),[y,w]=r.useState([]),[k,D]=r.useState(!0),[u,P]=r.useState(void 0),[g,N]=r.useState(void 0),[p,E]=r.useState([]),[h,T]=r.useState({}),[i,R]=r.useState([]),[x,L]=r.useState(""),[m,U]=r.useState(""),[S,_]=r.useState(!1),O=r.useMemo(()=>{const e={};for(const o of i)e[o.key]=o;return e},[i]);r.useEffect(()=>{let e=!1;return j.get("web/projects").json().then(o=>{e||R(o)}).catch(()=>{}),()=>{e=!0}},[]),r.useEffect(()=>{i.length>0&&!x&&L(i[0].key)},[i]);const A=r.useCallback(async e=>{D(!0);try{const o=new URLSearchParams({taskMode:"plan",limit:String(ce)});c==="in_progress"?o.set("status",ne.join(",")):o.set("status",s.COMPLETED+","+s.FAILED+","+s.CANCELLED),e&&o.set("cursor",e);const b=await j.get(`web/tasks?${o}`).json(),f=b.data??[];w(f),P(b.nextCursor);const l=f.filter(d=>d.status===s.COMPLETED).map(d=>d.id);if(l.length>0){const d={};await Promise.all(l.map(async C=>{try{const F=await j.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(C),limit:"100"})}`).json();d[C]=(F.data??[]).length}catch{d[C]=0}})),T(d)}else T({})}catch{w([]),P(void 0)}finally{D(!1)}},[c]);r.useEffect(()=>{A(g)},[A,g,v]),r.useEffect(()=>{N(void 0),E([])},[c]);const K=r.useCallback(()=>{u&&(E(e=>[...e,g??""]),N(u))},[u,g]),B=r.useCallback(()=>{p.length!==0&&(N(p.at(-1)||void 0),E(e=>e.slice(0,-1)))},[p]),q=p.length+1,$=r.useCallback(async()=>{if(!x||!m.trim()){M.error("project and description are required.");return}_(!0);try{const e=await j.post("web/tasks",{json:{projectKey:x,description:m.trim(),taskMode:"plan"}}).json();U(""),n(`/tasks/${e.task.id}`)}catch(e){const o=e instanceof Error?e.message:String(e);M.error(o)}finally{_(!1)}},[x,m,n]),I=r.useMemo(()=>i.map(e=>({value:e.key,label:e.name})),[i]);return V(null),t.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsx("h1",{className:"sr-only",children:a("plan.title")}),t.jsxs("div",{className:"mb-6 flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:flex-row md:items-center md:gap-3",children:[t.jsx(te,{value:x,onChange:L,options:I.length>0?I:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:a("plan.description_placeholder"),value:m,onChange:e=>U(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!S&&$()},className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),t.jsxs("button",{onClick:$,disabled:S||!x||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-mono text-black transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:[t.jsx(re,{className:"h-3.5 w-3.5"}),a(S?"common.creating":"plan.create")]})]}),t.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:["in_progress","completed"].map(e=>t.jsx("button",{onClick:()=>G(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${c===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:a(e==="in_progress"?"review.in_progress":"tasks.tab_completed")},e))}),t.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[k&&y.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(Y,{rows:4})}),!k&&y.length===0&&t.jsx(X,{icon:Z,title:a("plan.no_plans"),description:a("plan.description_placeholder")}),y.map(e=>t.jsxs("div",{onClick:()=>n(`/tasks/${e.id}`),className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[t.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${le(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)] preserve-case",children:["#",e.id," ",z(e)]}),e.status===s.COMPLETED&&h[e.id]!=null&&h[e.id]>0&&t.jsxs("span",{className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold",style:{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"},title:`${h[e.id]} downstream task(s)`,children:[h[e.id]," tasks"]}),e.status===s.COMPLETED&&(()=>{const o=O[e.projectKey];if(!o)return null;let b="main";if(e.configSnapshot)try{const l=JSON.parse(e.configSnapshot);l.defaultBranch&&(b=l.defaultBranch)}catch{}const f=ie(o,b);return f?t.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.stopPropagation(),className:"shrink-0 flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--info)] hover:border-[var(--info)] transition-colors",title:a("plan.view_spec"),children:[t.jsx(se,{className:"h-2.5 w-2.5"}),a("plan.view_spec")]}):null})(),t.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:e.projectKey}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:e.status.toLowerCase()}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:ee(e.createdAt)})]},e.id))]}),(p.length>0||u)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",q]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:B,disabled:p.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[t.jsx(ae,{className:"h-3.5 w-3.5"}),a("tasks.prev")]}),t.jsxs("button",{onClick:K,disabled:!u,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[a("common.next"),t.jsx(oe,{className:"h-3.5 w-3.5"})]})]})]})]})}export{je as default};
1
+ import{f as Q,a as H,k as J,r,h as j,o as s,t as M,x as V,j as t,O as Z,l as z,I as W}from"./index-Cnjcx5EP.js";import{E as X}from"./EmptyState-Dg8UN1Uo.js";import{T as Y}from"./Skeleton-DZltBScg.js";import{f as ee}from"./date-CmcdoD87.js";import{S as te}from"./Select-BdUjuVPU.js";import{P as re}from"./plus-T50zBWvm.js";import{E as se}from"./external-link-DP3KNa_2.js";import{C as ae}from"./chevron-left-D32li7kz.js";import{C as oe}from"./chevron-right-CJoGvgTt.js";import"./chevron-down-CMJNvCkO.js";const ne=[s.QUEUED,s.ASSIGNED,s.RUNNING,s.SUSPENDED],ce=20;function ie(n,a){if(!n)return null;const v=n.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),c=a.split("/").map(encodeURIComponent).join("/");return n.gitPlatform===W.GITLAB?`${v}/-/tree/${c}/docs/specs`:`${v}/tree/${c}/docs/specs`}function le(n){switch(n){case s.RUNNING:return"bg-[var(--accent)]";case s.QUEUED:return"bg-[var(--warning)]";case s.ASSIGNED:return"bg-[var(--info)]";case s.SUSPENDED:return"bg-[var(--warning)]";case s.COMPLETED:return"bg-[var(--accent)]";case s.FAILED:return"bg-[var(--destructive)]";case s.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function je(){const n=Q(),{t:a}=H(),v=J(e=>e.taskSeq),[c,O]=r.useState("in_progress"),[y,w]=r.useState([]),[k,D]=r.useState(!0),[u,P]=r.useState(void 0),[g,N]=r.useState(void 0),[p,E]=r.useState([]),[h,T]=r.useState({}),[i,R]=r.useState([]),[x,L]=r.useState(""),[m,U]=r.useState(""),[S,_]=r.useState(!1),G=r.useMemo(()=>{const e={};for(const o of i)e[o.key]=o;return e},[i]);r.useEffect(()=>{let e=!1;return j.get("web/projects").json().then(o=>{e||R(o)}).catch(()=>{}),()=>{e=!0}},[]),r.useEffect(()=>{i.length>0&&!x&&L(i[0].key)},[i]);const A=r.useCallback(async e=>{D(!0);try{const o=new URLSearchParams({taskMode:"plan",limit:String(ce)});c==="in_progress"?o.set("status",ne.join(",")):o.set("status",s.COMPLETED+","+s.FAILED+","+s.CANCELLED),e&&o.set("cursor",e);const b=await j.get(`web/tasks?${o}`).json(),f=b.data??[];w(f),P(b.nextCursor);const l=f.filter(d=>d.status===s.COMPLETED).map(d=>d.id);if(l.length>0){const d={};await Promise.all(l.map(async C=>{try{const F=await j.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(C),limit:"100"})}`).json();d[C]=(F.data??[]).length}catch{d[C]=0}})),T(d)}else T({})}catch{w([]),P(void 0)}finally{D(!1)}},[c]);r.useEffect(()=>{A(g)},[A,g,v]),r.useEffect(()=>{N(void 0),E([])},[c]);const B=r.useCallback(()=>{u&&(E(e=>[...e,g??""]),N(u))},[u,g]),K=r.useCallback(()=>{p.length!==0&&(N(p.at(-1)||void 0),E(e=>e.slice(0,-1)))},[p]),q=p.length+1,I=r.useCallback(async()=>{if(!x||!m.trim()){M.error("project and description are required.");return}_(!0);try{const e=await j.post("web/tasks",{json:{projectKey:x,description:m.trim(),taskMode:"plan"}}).json();U(""),n(`/tasks/${e.task.id}`)}catch(e){const o=e instanceof Error?e.message:String(e);M.error(o)}finally{_(!1)}},[x,m,n]),$=r.useMemo(()=>i.map(e=>({value:e.key,label:e.name})),[i]);return V(null),t.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsx("h1",{className:"sr-only",children:a("plan.title")}),t.jsxs("div",{className:"mb-6 flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:flex-row md:items-center md:gap-3",children:[t.jsx(te,{value:x,onChange:L,options:$.length>0?$:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:a("plan.description_placeholder"),value:m,onChange:e=>U(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!S&&I()},className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),t.jsxs("button",{onClick:I,disabled:S||!x||!m.trim(),className:"flex shrink-0 items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-mono text-black transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:[t.jsx(re,{className:"h-3.5 w-3.5"}),a(S?"common.creating":"plan.create")]})]}),t.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:["in_progress","completed"].map(e=>t.jsx("button",{onClick:()=>O(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${c===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:a(e==="in_progress"?"review.in_progress":"tasks.tab_completed")},e))}),t.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[k&&y.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(Y,{rows:4})}),!k&&y.length===0&&t.jsx(X,{icon:Z,title:a("plan.no_plans"),description:a("plan.description_placeholder")}),y.map(e=>t.jsxs("div",{onClick:()=>n(`/tasks/${e.id}`),className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[t.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${le(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)] preserve-case",children:["#",e.id," ",z(e)]}),e.status===s.COMPLETED&&h[e.id]!=null&&h[e.id]>0&&t.jsxs("span",{className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold",style:{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"},title:`${h[e.id]} downstream task(s)`,children:[h[e.id]," tasks"]}),e.status===s.COMPLETED&&(()=>{const o=G[e.projectKey];if(!o)return null;let b="main";if(e.configSnapshot)try{const l=JSON.parse(e.configSnapshot);l.defaultBranch&&(b=l.defaultBranch)}catch{}const f=ie(o,b);return f?t.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.stopPropagation(),className:"shrink-0 flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--info)] hover:border-[var(--info)] transition-colors",title:a("plan.view_spec"),children:[t.jsx(se,{className:"h-2.5 w-2.5"}),a("plan.view_spec")]}):null})(),t.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:e.projectKey}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:e.status.toLowerCase()}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:ee(e.createdAt)})]},e.id))]}),(p.length>0||u)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",q]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:K,disabled:p.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[t.jsx(ae,{className:"h-3.5 w-3.5"}),a("tasks.prev")]}),t.jsxs("button",{onClick:B,disabled:!u,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[a("common.next"),t.jsx(oe,{className:"h-3.5 w-3.5"})]})]})]})]})}export{je as default};
@@ -1 +1 @@
1
- import{a as A,u as F,f as T,r as s,j as e,L as z,a5 as I,a6 as $,s as K,h as p,t as c}from"./index-cjnaCqIk.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-lnXeWgNk.js";import{u as V}from"./useFetch-DAyPN0QS.js";function Q(){var y,k,C,P;const{t:r}=A(),{logout:L}=F(),E=T(),[S,m]=s.useState(!1),{data:t,loading:U,refetch:D}=V(()=>p.get("web/profile").json(),[]),[x,u]=s.useState(""),[d,b]=s.useState(""),[f,v]=s.useState(""),[g,h]=s.useState(!1),[j,n]=s.useState(""),[i,_]=s.useState(""),[w,N]=s.useState(!1);async function O(){if(n(""),!x){n(r("profile.current_password_required"));return}if(!d){n(r("profile.new_password_required"));return}const a=M(d);if(a){n(r(a));return}if(d!==f){n(r("profile.passwords_do_not_match"));return}try{h(!0),await p.put("web/profile/password",{json:{currentPassword:x,newPassword:d}}),c.success(r("profile.password_changed")),u(""),b(""),v("")}catch(l){const q=l instanceof Error?l.message:r("profile.failed_to_change_password");n(q)}finally{h(!1)}}async function R(){if(!i||i.length!==6){c.error(r("profile.totp_code_required"));return}try{N(!0),await p.post("web/profile/totp/regenerate",{json:{code:i}}),c.success(r("profile.two_fa_regenerated")),_(""),D()}catch(a){const l=a instanceof Error?a.message:r("profile.totp_code_invalid");c.error(l)}finally{N(!1)}}return U?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):e.jsxs("div",{className:"mx-auto max-w-xl space-y-8 px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("h1",{className:"text-lg text-[var(--text-primary)]",children:[r("profile.title")," ",e.jsx("span",{className:"text-[var(--text-muted)]",children:r("profile.personal_settings")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.profile_info")}),t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:r("profile.username"),value:t.name}),e.jsx(o,{variant:"fixed-label",label:r("common.role"),value:t.role}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.status"),value:t.status}),e.jsx(o,{variant:"fixed-label",label:r("profile.created_at"),value:new Date(t.createdAt).toLocaleDateString()})]}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("profile.unable_to_load_profile")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.platform_accounts")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:"lark",value:(y=t==null?void 0:t.platformUids)!=null&&y.lark?`${t.platformUids.lark.slice(0,12)}... ✓`:r("profile.not_linked")}),e.jsx(o,{variant:"fixed-label",label:"slack",value:(k=t==null?void 0:t.platformUids)!=null&&k.slack?`${t.platformUids.slack.slice(0,12)}... ✓`:r("profile.not_linked")})]}),(!((C=t==null?void 0:t.platformUids)!=null&&C.lark)||!((P=t==null?void 0:t.platformUids)!=null&&P.slack))&&e.jsx("p",{className:"mt-3 text-xs text-[var(--text-muted)]",children:r("profile.bind_hint")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.change_password")}),e.jsxs("div",{className:"space-y-4",children:[j&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:j}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_password")}),e.jsx("input",{type:"password",value:x,onChange:a=>u(a.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.new_password")}),e.jsx("input",{type:"password",value:d,onChange:a=>b(a.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r("profile.password_hint_10_20")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.confirm_password")}),e.jsx("input",{type:"password",value:f,onChange:a=>v(a.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:O,disabled:g,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(g?"common.updating":"profile.update_password")})})]})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.two_factor_auth")}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm",children:t!=null&&t.totpEnabled?e.jsxs("span",{className:"text-[var(--accent)]",children:["● ",r("profile.two_fa_enabled")]}):e.jsxs("span",{className:"text-[var(--text-muted)]",children:["● ",r("profile.two_fa_not_setup")]})}),(t==null?void 0:t.totpEnabled)&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.regenerate_2fa_warning")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_totp_code")}),e.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,placeholder:r("profile.totp_code_placeholder"),value:i,onChange:a=>{const l=a.target.value.replace(/\D/g,"").slice(0,6);_(l)},className:"w-full max-w-xs rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)] font-mono tracking-widest"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:R,disabled:w||i.length!==6,className:"rounded-[4px] border border-[var(--warning)] bg-transparent px-4 py-2 text-xs font-medium text-[var(--warning)] hover:bg-[var(--warning)] hover:text-black disabled:opacity-50 transition-colors",children:r(w?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(z,{to:"/access-tokens",className:"flex items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]",children:[e.jsx(I,{size:16,className:"text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[var(--text-primary)]",children:r("profile.access_tokens")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.access_tokens_desc")})]})]}),e.jsxs("button",{onClick:()=>m(!0),className:"flex w-full items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--destructive)] text-left",children:[e.jsx($,{size:16,className:"text-[var(--destructive)]"}),e.jsx("span",{className:"text-sm text-[var(--destructive)]",children:r("common.log_out")})]}),e.jsxs("div",{className:"pt-2 pb-4 text-center text-xs text-[var(--text-muted)]",children:["overlord v","1.0.157"]}),e.jsx(K,{isOpen:S,onClose:()=>m(!1),onConfirm:()=>{L(),E("/login")},title:r("common.logout_title"),message:r("common.logout_message"),confirmLabel:r("common.logout"),confirmVariant:"warning"})]})}export{Q as default};
1
+ import{a as A,u as F,f as T,r as s,j as e,L as z,a6 as I,a7 as $,s as K,h as p,t as c}from"./index-Cnjcx5EP.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-D5N9gMw3.js";import{u as V}from"./useFetch-BGgm-RKN.js";function Q(){var y,k,C,P;const{t:r}=A(),{logout:L}=F(),E=T(),[S,m]=s.useState(!1),{data:t,loading:U,refetch:D}=V(()=>p.get("web/profile").json(),[]),[x,u]=s.useState(""),[d,b]=s.useState(""),[f,v]=s.useState(""),[g,h]=s.useState(!1),[j,n]=s.useState(""),[i,_]=s.useState(""),[w,N]=s.useState(!1);async function O(){if(n(""),!x){n(r("profile.current_password_required"));return}if(!d){n(r("profile.new_password_required"));return}const a=M(d);if(a){n(r(a));return}if(d!==f){n(r("profile.passwords_do_not_match"));return}try{h(!0),await p.put("web/profile/password",{json:{currentPassword:x,newPassword:d}}),c.success(r("profile.password_changed")),u(""),b(""),v("")}catch(l){const q=l instanceof Error?l.message:r("profile.failed_to_change_password");n(q)}finally{h(!1)}}async function R(){if(!i||i.length!==6){c.error(r("profile.totp_code_required"));return}try{N(!0),await p.post("web/profile/totp/regenerate",{json:{code:i}}),c.success(r("profile.two_fa_regenerated")),_(""),D()}catch(a){const l=a instanceof Error?a.message:r("profile.totp_code_invalid");c.error(l)}finally{N(!1)}}return U?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):e.jsxs("div",{className:"mx-auto max-w-xl space-y-8 px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("h1",{className:"text-lg text-[var(--text-primary)]",children:[r("profile.title")," ",e.jsx("span",{className:"text-[var(--text-muted)]",children:r("profile.personal_settings")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.profile_info")}),t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:r("profile.username"),value:t.name}),e.jsx(o,{variant:"fixed-label",label:r("common.role"),value:t.role}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.status"),value:t.status}),e.jsx(o,{variant:"fixed-label",label:r("profile.created_at"),value:new Date(t.createdAt).toLocaleDateString()})]}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("profile.unable_to_load_profile")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.platform_accounts")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:"lark",value:(y=t==null?void 0:t.platformUids)!=null&&y.lark?`${t.platformUids.lark.slice(0,12)}... ✓`:r("profile.not_linked")}),e.jsx(o,{variant:"fixed-label",label:"slack",value:(k=t==null?void 0:t.platformUids)!=null&&k.slack?`${t.platformUids.slack.slice(0,12)}... ✓`:r("profile.not_linked")})]}),(!((C=t==null?void 0:t.platformUids)!=null&&C.lark)||!((P=t==null?void 0:t.platformUids)!=null&&P.slack))&&e.jsx("p",{className:"mt-3 text-xs text-[var(--text-muted)]",children:r("profile.bind_hint")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.change_password")}),e.jsxs("div",{className:"space-y-4",children:[j&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:j}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_password")}),e.jsx("input",{type:"password",value:x,onChange:a=>u(a.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.new_password")}),e.jsx("input",{type:"password",value:d,onChange:a=>b(a.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r("profile.password_hint_10_20")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.confirm_password")}),e.jsx("input",{type:"password",value:f,onChange:a=>v(a.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:O,disabled:g,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(g?"common.updating":"profile.update_password")})})]})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.two_factor_auth")}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm",children:t!=null&&t.totpEnabled?e.jsxs("span",{className:"text-[var(--accent)]",children:["● ",r("profile.two_fa_enabled")]}):e.jsxs("span",{className:"text-[var(--text-muted)]",children:["● ",r("profile.two_fa_not_setup")]})}),(t==null?void 0:t.totpEnabled)&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.regenerate_2fa_warning")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_totp_code")}),e.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,placeholder:r("profile.totp_code_placeholder"),value:i,onChange:a=>{const l=a.target.value.replace(/\D/g,"").slice(0,6);_(l)},className:"w-full max-w-xs rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)] font-mono tracking-widest"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:R,disabled:w||i.length!==6,className:"rounded-[4px] border border-[var(--warning)] bg-transparent px-4 py-2 text-xs font-medium text-[var(--warning)] hover:bg-[var(--warning)] hover:text-black disabled:opacity-50 transition-colors",children:r(w?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(z,{to:"/access-tokens",className:"flex items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]",children:[e.jsx(I,{size:16,className:"text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[var(--text-primary)]",children:r("profile.access_tokens")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.access_tokens_desc")})]})]}),e.jsxs("button",{onClick:()=>m(!0),className:"flex w-full items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--destructive)] text-left",children:[e.jsx($,{size:16,className:"text-[var(--destructive)]"}),e.jsx("span",{className:"text-sm text-[var(--destructive)]",children:r("common.log_out")})]}),e.jsxs("div",{className:"pt-2 pb-4 text-center text-xs text-[var(--text-muted)]",children:["overlord v","1.0.159"]}),e.jsx(K,{isOpen:S,onClose:()=>m(!1),onConfirm:()=>{L(),E("/login")},title:r("common.logout_title"),message:r("common.logout_message"),confirmLabel:r("common.logout"),confirmVariant:"warning"})]})}export{Q as default};
@@ -1,7 +1,7 @@
1
- import{c as R,a as $,j as e,s as q,A as K,f as B,u as H,i as J,r as x,Y as k,w as V,l as D,Z as Y,h}from"./index-cjnaCqIk.js";import{U as P,A as Z,R as z}from"./RemoveMemberConfirmDialog-Oqecz4vr.js";import{T as G}from"./Tooltip-C3hg00C8.js";import{c as _}from"./date-CmcdoD87.js";import{t as T}from"./status-colors-CR_ojibY.js";import{I as o}from"./InfoRow-lnXeWgNk.js";import{u as Q}from"./useFetch-DAyPN0QS.js";import{P as X}from"./pencil-DEF_BTYZ.js";import{T as ee}from"./trash-2-2HWSKe9Q.js";import{A as te}from"./arrow-left-B6sCoNMg.js";import{P as re}from"./plus-8-agJFRJ.js";import"./Select-CNYCHeZX.js";import"./chevron-down-Bd-GeLYL.js";/**
1
+ import{c as R,a as $,j as e,s as q,B,f as K,u as H,i as J,r as x,Z as k,x as V,l as D,_ as Z,h}from"./index-Cnjcx5EP.js";import{U as P,A as z,R as G}from"./RemoveMemberConfirmDialog-DkPO6agB.js";import{T as Q}from"./Tooltip-BHebqiCF.js";import{c as _}from"./date-CmcdoD87.js";import{t as T}from"./status-colors-BMdWkS1a.js";import{I as o}from"./InfoRow-D5N9gMw3.js";import{u as X}from"./useFetch-BGgm-RKN.js";import{P as Y}from"./pencil-CmamgXMb.js";import{T as ee}from"./trash-2-DlnQ4ddN.js";import{A as te}from"./arrow-left-Bx4nR3Vh.js";import{P as re}from"./plus-T50zBWvm.js";import"./Select-BdUjuVPU.js";import"./chevron-down-CMJNvCkO.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const se=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ae({isOpen:n,onClose:a,onConfirm:r,projectName:m,loading:p}){const{t:j}=$();return e.jsx(q,{isOpen:n,onClose:a,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function ue(){const{key:n}=K(),a=B(),{t:r}=$(),m=H(t=>t.user),p=J(),[j,N]=x.useState(!1),[L,C]=x.useState(!1),[S,A]=x.useState(!1),[d,u]=x.useState(null),[W,I]=x.useState(!1),{data:l,loading:F,error:M,refetch:y}=Q(async()=>{if(!n)throw new Error("Missing project key");const[t,w,f]=await Promise.all([h.get(`web/projects/${n}`).json(),h.get(`web/projects/${n}/members`).json().catch(()=>[]),h.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(U=>U.data).catch(()=>[])]);let v=null;if(t.pipeline)try{v=JSON.parse(t.pipeline)}catch{}return{project:t,members:w,tasks:f,pipelineConfig:v}},[n]),s=(l==null?void 0:l.project)??null,b=(l==null?void 0:l.members)??[],g=(l==null?void 0:l.tasks)??[],i=(l==null?void 0:l.pipelineConfig)??null,c=p||b.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===k.MAINTAINER);V(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[c&&e.jsxs("button",{onClick:()=>a(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(X,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,c,p,a,r]));async function O(){if(s){C(!0);try{await h.delete(`admin/projects/${s.key}`),a("/projects")}catch{}finally{C(!1),N(!1)}}}async function E(){if(!(!s||!d)){I(!0);try{await h.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(d.developerId)}}),await y()}catch{}finally{I(!1),u(null)}}}return F?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):M?e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:M}),e.jsx("button",{onClick:()=>y(),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>a("/projects"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(te,{className:"h-4 w-4"})}),e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:[s.key," — ",s.name]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 hidden md:block text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),c&&e.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(re,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] p-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"block text-[11px] mt-0.5",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-muted)"},children:t.role})]}),c&&e.jsx("button",{onClick:()=>u(t),className:"shrink-0 text-[var(--destructive)] hover:underline ml-2","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})]},t.developerId))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),c&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)}),c&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>u(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),g.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_tasks_for_project")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:g.map(t=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] p-3 transition-colors active:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2 preserve-case",title:t.description,children:["#",t.id," ",D(t)]}),e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:T[t.status]},children:t.status})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(t.createdAt)})]},t.id))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)] preserve-case",children:e.jsx(G,{content:t.description,children:D(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:T[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)})]},t.id))})]})})]})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((t,w)=>{var f,v;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
7
- `)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((f=t.onFailure)==null?void 0:f.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(Y,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["onFailure.goto: ",t.onFailure.goto,", maxLoops: ",t.onFailure.maxLoops]})]}),w<i.stages.length-1&&!((v=t.onFailure)!=null&&v.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(se,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},t.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:r("projects.no_pipeline_configured")}),c&&e.jsx("button",{onClick:()=>a(`/projects/${s.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:r("projects.add_stage")})]})})]}),e.jsx(ae,{isOpen:j,onClose:()=>N(!1),onConfirm:O,projectName:s.name,loading:L}),e.jsx(Z,{isOpen:S,onClose:()=>A(!1),projectKey:s.key,existingMemberIds:b.map(t=>t.developerId),onAdded:y}),e.jsx(z,{isOpen:!!d,onClose:()=>u(null),onConfirm:E,memberName:d?d.developerName??`#${d.developerId}`:"",loading:W})]})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}export{ue as default};
6
+ */const se=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ae({isOpen:n,onClose:a,onConfirm:r,projectName:m,loading:p}){const{t:j}=$();return e.jsx(q,{isOpen:n,onClose:a,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function ue(){const{key:n}=B(),a=K(),{t:r}=$(),m=H(t=>t.user),p=J(),[j,N]=x.useState(!1),[L,C]=x.useState(!1),[S,A]=x.useState(!1),[d,u]=x.useState(null),[W,I]=x.useState(!1),{data:l,loading:F,error:M,refetch:y}=X(async()=>{if(!n)throw new Error("Missing project key");const[t,w,f]=await Promise.all([h.get(`web/projects/${n}`).json(),h.get(`web/projects/${n}/members`).json().catch(()=>[]),h.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(U=>U.data).catch(()=>[])]);let v=null;if(t.pipeline)try{v=JSON.parse(t.pipeline)}catch{}return{project:t,members:w,tasks:f,pipelineConfig:v}},[n]),s=(l==null?void 0:l.project)??null,b=(l==null?void 0:l.members)??[],g=(l==null?void 0:l.tasks)??[],i=(l==null?void 0:l.pipelineConfig)??null,c=p||b.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===k.MAINTAINER);V(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[c&&e.jsxs("button",{onClick:()=>a(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(Y,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,c,p,a,r]));async function O(){if(s){C(!0);try{await h.delete(`admin/projects/${s.key}`),a("/projects")}catch{}finally{C(!1),N(!1)}}}async function E(){if(!(!s||!d)){I(!0);try{await h.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(d.developerId)}}),await y()}catch{}finally{I(!1),u(null)}}}return F?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):M?e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:M}),e.jsx("button",{onClick:()=>y(),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>a("/projects"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(te,{className:"h-4 w-4"})}),e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:[s.key," — ",s.name]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 hidden md:block text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),c&&e.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(re,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] p-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"block text-[11px] mt-0.5",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-muted)"},children:t.role})]}),c&&e.jsx("button",{onClick:()=>u(t),className:"shrink-0 text-[var(--destructive)] hover:underline ml-2","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})]},t.developerId))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),c&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)}),c&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>u(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),g.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_tasks_for_project")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:g.map(t=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] p-3 transition-colors active:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2 preserve-case",title:t.description,children:["#",t.id," ",D(t)]}),e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:T[t.status]},children:t.status})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(t.createdAt)})]},t.id))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)] preserve-case",children:e.jsx(Q,{content:t.description,children:D(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:T[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)})]},t.id))})]})})]})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((t,w)=>{var f,v;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
7
+ `)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((f=t.onFailure)==null?void 0:f.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(Z,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["onFailure.goto: ",t.onFailure.goto,", maxLoops: ",t.onFailure.maxLoops]})]}),w<i.stages.length-1&&!((v=t.onFailure)!=null&&v.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(se,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},t.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:r("projects.no_pipeline_configured")}),c&&e.jsx("button",{onClick:()=>a(`/projects/${s.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:r("projects.add_stage")})]})})]}),e.jsx(ae,{isOpen:j,onClose:()=>N(!1),onConfirm:O,projectName:s.name,loading:L}),e.jsx(z,{isOpen:S,onClose:()=>A(!1),projectKey:s.key,existingMemberIds:b.map(t=>t.developerId),onAdded:y}),e.jsx(G,{isOpen:!!d,onClose:()=>u(null),onConfirm:E,memberName:d?d.developerName??`#${d.developerId}`:"",loading:W})]})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}export{ue as default};
@@ -1,6 +1,6 @@
1
- import{c as I,a as P,v as R,r as o,G as x,O as z,j as e,h as E,f as H,w as M}from"./index-cjnaCqIk.js";import{S as U}from"./Select-CNYCHeZX.js";import{a as D}from"./agent-type-options-BAQ9fpbk.js";import{E as J}from"./EmptyState-LTKgHYcv.js";import{T as O}from"./Skeleton-BrVgXQ4x.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-DAyPN0QS.js";import{P as $}from"./plus-8-agJFRJ.js";import{A as K}from"./arrow-left-B6sCoNMg.js";import"./chevron-down-Bd-GeLYL.js";/**
1
+ import{c as R,a as P,v as G,r as o,I as x,Q as z,j as e,h as E,f as H,x as M}from"./index-Cnjcx5EP.js";import{S as U}from"./Select-BdUjuVPU.js";import{a as D}from"./agent-type-options-D09p3GHf.js";import{E as J}from"./EmptyState-Dg8UN1Uo.js";import{T as O}from"./Skeleton-DZltBScg.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-BGgm-RKN.js";import{P as $}from"./plus-T50zBWvm.js";import{A as K}from"./arrow-left-Bx4nR3Vh.js";import"./chevron-down-CMJNvCkO.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const V=I("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),m={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},i={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function Q({isOpen:l,onClose:a,onCreated:j}){const{t}=P();R(l);const d=D(r=>r),[c,u]=o.useState(""),[s,b]=o.useState(""),[n,g]=o.useState(""),[y,f]=o.useState(""),[C,_]=o.useState("main"),[k,N]=o.useState(x.GITHUB),[S,B]=o.useState(z.CLAUDE),[p,T]=o.useState(!1),[w,v]=o.useState("");o.useEffect(()=>{l&&F()},[l]);function F(){u(""),b(""),g(""),f(""),_("main"),N(x.GITHUB),B(z.CLAUDE),v("")}function A(){F(),a()}async function L(r){r.preventDefault(),v(""),T(!0);try{const h=await E.post("admin/projects",{json:{name:c,key:s,repoUrl:n,sshUrl:y||void 0,defaultBranch:C,gitPlatform:k,agentType:S}}).json();j(h),A()}catch(h){const G=h instanceof Error?h.message:t("projects.failed_to_create_project");v(G)}finally{T(!1)}}return l?e.jsx("div",{style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))",padding:"1rem"},children:e.jsxs("div",{onClick:r=>r.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",t("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:t("projects.add_project_desc")})]}),w&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:w}),e.jsxs("form",{onSubmit:L,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_name")}),e.jsx("input",{type:"text",value:c,onChange:r=>u(r.target.value),placeholder:t("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_key")}),e.jsx("input",{type:"text",value:s,onChange:r=>b(r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:t("projects.project_key_placeholder"),required:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.repo_url")}),e.jsx("input",{type:"text",value:n,onChange:r=>g(r.target.value),placeholder:t("projects.repo_url_placeholder"),required:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.ssh_url")}),e.jsx("input",{type:"text",value:y,onChange:r=>f(r.target.value),placeholder:t("projects.ssh_url_placeholder"),style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.ssh_url_hint")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.default_branch")}),e.jsx("input",{type:"text",value:C,onChange:r=>_(r.target.value),placeholder:t("projects.main"),style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.git_platform")}),e.jsx(U,{value:k,onChange:r=>N(r),options:[{value:x.GITHUB,label:t("projects.github")},{value:x.GITLAB,label:t("projects.gitlab")},{value:x.GITEA,label:t("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.agent_type")}),e.jsx(U,{value:S,onChange:r=>B(r),options:d})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:A,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:t("common.cancel")}),e.jsx("button",{type:"submit",disabled:p||!c||!s||!n,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p||!c||!s||!n?"not-allowed":"pointer",opacity:p||!c||!s||!n?.7:1},children:t(p?"common.creating":"common.create")})]})]})]})}):null}function le(){const l=H(),{t:a}=P(),[j,t]=o.useState(!1),{data:d,loading:c,refetch:u}=W(()=>E.get("web/projects").json(),[]);return M(o.useMemo(()=>e.jsxs("button",{onClick:()=>t(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx($,{className:"h-3.5 w-3.5"}),a("projects.create_project")]}),[a])),e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>l("/dashboard"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(K,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:a("projects.title")})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[c?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(O,{rows:4})}):!d||d.length===0?e.jsx(J,{icon:V,title:a("projects.no_projects_yet"),description:a("projects.create_first_project"),actionLabel:a("projects.create_project"),onAction:()=>t(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:d.map(s=>e.jsxs("div",{onClick:()=>l(`/projects/${s.key}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--accent)]",children:s.key}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.taskCount??0," tasks"]})]}),e.jsx("span",{className:"mt-1 block text-[11px] text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"mt-0.5 block text-[11px] text-[var(--text-muted)]",children:s.agentType})]},s.key))}),e.jsxs("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:a("projects.key")}),e.jsx("span",{children:a("projects.name")}),e.jsx("span",{children:a("projects.members")}),e.jsx("span",{children:a("projects.tasks_count")}),e.jsx("span",{children:a("projects.last_activity")})]}),d.map((s,b)=>e.jsxs("div",{onClick:()=>l(`/projects/${s.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:b+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:s.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsxs("span",{className:"block truncate text-[11px] text-[var(--text-muted)]",children:[s.agentType," · ",s.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(s.members??[]).map(n=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[11px] font-bold text-[var(--accent)]",title:n.name,children:n.name.charAt(0).toUpperCase()},n.id)),(s.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[11px] text-[var(--text-muted)]",children:["+",s.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.taskCount??0}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:q(s.lastActivity??null)})]},s.key))]})]}),e.jsx(Q,{isOpen:j,onClose:()=>t(!1),onCreated:u})]})]})}export{le as default};
6
+ */const Q=R("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),m={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},i={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function V({isOpen:l,onClose:a,onCreated:j}){const{t}=P();G(l);const d=D(r=>r),[c,u]=o.useState(""),[s,b]=o.useState(""),[n,g]=o.useState(""),[y,f]=o.useState(""),[C,_]=o.useState("main"),[k,N]=o.useState(x.GITHUB),[S,B]=o.useState(z.CLAUDE),[p,T]=o.useState(!1),[w,v]=o.useState("");o.useEffect(()=>{l&&F()},[l]);function F(){u(""),b(""),g(""),f(""),_("main"),N(x.GITHUB),B(z.CLAUDE),v("")}function A(){F(),a()}async function I(r){r.preventDefault(),v(""),T(!0);try{const h=await E.post("admin/projects",{json:{name:c,key:s,repoUrl:n,sshUrl:y||void 0,defaultBranch:C,gitPlatform:k,agentType:S}}).json();j(h),A()}catch(h){const L=h instanceof Error?h.message:t("projects.failed_to_create_project");v(L)}finally{T(!1)}}return l?e.jsx("div",{style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))",padding:"1rem"},children:e.jsxs("div",{onClick:r=>r.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",t("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:t("projects.add_project_desc")})]}),w&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:w}),e.jsxs("form",{onSubmit:I,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_name")}),e.jsx("input",{type:"text",value:c,onChange:r=>u(r.target.value),placeholder:t("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_key")}),e.jsx("input",{type:"text",value:s,onChange:r=>b(r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:t("projects.project_key_placeholder"),required:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.repo_url")}),e.jsx("input",{type:"text",value:n,onChange:r=>g(r.target.value),placeholder:t("projects.repo_url_placeholder"),required:!0,style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.ssh_url")}),e.jsx("input",{type:"text",value:y,onChange:r=>f(r.target.value),placeholder:t("projects.ssh_url_placeholder"),style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.ssh_url_hint")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.default_branch")}),e.jsx("input",{type:"text",value:C,onChange:r=>_(r.target.value),placeholder:t("projects.main"),style:m,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.git_platform")}),e.jsx(U,{value:k,onChange:r=>N(r),options:[{value:x.GITHUB,label:t("projects.github")},{value:x.GITLAB,label:t("projects.gitlab")},{value:x.GITEA,label:t("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.agent_type")}),e.jsx(U,{value:S,onChange:r=>B(r),options:d})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:A,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:t("common.cancel")}),e.jsx("button",{type:"submit",disabled:p||!c||!s||!n,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p||!c||!s||!n?"not-allowed":"pointer",opacity:p||!c||!s||!n?.7:1},children:t(p?"common.creating":"common.create")})]})]})]})}):null}function le(){const l=H(),{t:a}=P(),[j,t]=o.useState(!1),{data:d,loading:c,refetch:u}=W(()=>E.get("web/projects").json(),[]);return M(o.useMemo(()=>e.jsxs("button",{onClick:()=>t(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx($,{className:"h-3.5 w-3.5"}),a("projects.create_project")]}),[a])),e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>l("/dashboard"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(K,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:a("projects.title")})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[c?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(O,{rows:4})}):!d||d.length===0?e.jsx(J,{icon:Q,title:a("projects.no_projects_yet"),description:a("projects.create_first_project"),actionLabel:a("projects.create_project"),onAction:()=>t(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:d.map(s=>e.jsxs("div",{onClick:()=>l(`/projects/${s.key}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--accent)]",children:s.key}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.taskCount??0," tasks"]})]}),e.jsx("span",{className:"mt-1 block text-[11px] text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"mt-0.5 block text-[11px] text-[var(--text-muted)]",children:s.agentType})]},s.key))}),e.jsxs("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:a("projects.key")}),e.jsx("span",{children:a("projects.name")}),e.jsx("span",{children:a("projects.members")}),e.jsx("span",{children:a("projects.tasks_count")}),e.jsx("span",{children:a("projects.last_activity")})]}),d.map((s,b)=>e.jsxs("div",{onClick:()=>l(`/projects/${s.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:b+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:s.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsxs("span",{className:"block truncate text-[11px] text-[var(--text-muted)]",children:[s.agentType," · ",s.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(s.members??[]).map(n=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[11px] font-bold text-[var(--accent)]",title:n.name,children:n.name.charAt(0).toUpperCase()},n.id)),(s.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[11px] text-[var(--text-muted)]",children:["+",s.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.taskCount??0}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:q(s.lastActivity??null)})]},s.key))]})]}),e.jsx(V,{isOpen:j,onClose:()=>t(!1),onCreated:u})]})]})}export{le as default};
@@ -1,4 +1,4 @@
1
- var Xr=Object.defineProperty;var jr=(e,t,i)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Oe=(e,t,i)=>jr(e,typeof t!="symbol"?t+"":t,i);import{r as Z,u as Gr,h as Jr,j as Mt}from"./index-cjnaCqIk.js";/**
1
+ var Xr=Object.defineProperty;var jr=(e,t,i)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Oe=(e,t,i)=>jr(e,typeof t!="symbol"?t+"":t,i);import{r as Z,u as Gr,h as Jr,j as Mt}from"./index-Cnjcx5EP.js";/**
2
2
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
3
  * @license MIT
4
4
  *
@@ -1 +1 @@
1
- import{a as h,r as s,h as b,a7 as v,j as e,C as j}from"./index-cjnaCqIk.js";import{C as f}from"./copy-BpJGDcH8.js";function y({mode:l}){const{t:o}=h(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{b.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status===v.ACTIVE);d(r),r.length>0&&c(r[0].id)}).catch(()=>{})},[]);const a=l==="cli"?"ov login --token <your-token>":'curl -H "authorization: bearer <your-token>" http://localhost:9000/api/web/tasks',p=s.useCallback(()=>{navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},[a]);return n.length===0?null:e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--accent)]/20 bg-[var(--bg-card)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:o("docs.quick_start_with_token")}),e.jsx("select",{value:x??"",onChange:t=>c(Number(t.target.value)),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2 py-1 text-xs text-[var(--text-primary)]",children:n.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] break-all",children:a}),e.jsx("button",{onClick:p,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:u?e.jsx(j,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{y as Q};
1
+ import{a as h,r as s,h as b,a8 as v,j as e,C as j}from"./index-Cnjcx5EP.js";import{C as f}from"./copy-tvtyH4eP.js";function y({mode:l}){const{t:o}=h(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{b.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status===v.ACTIVE);d(r),r.length>0&&c(r[0].id)}).catch(()=>{})},[]);const a=l==="cli"?"ov login --token <your-token>":'curl -H "authorization: bearer <your-token>" http://localhost:9000/api/web/tasks',p=s.useCallback(()=>{navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},[a]);return n.length===0?null:e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--accent)]/20 bg-[var(--bg-card)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:o("docs.quick_start_with_token")}),e.jsx("select",{value:x??"",onChange:t=>c(Number(t.target.value)),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2 py-1 text-xs text-[var(--text-primary)]",children:n.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] break-all",children:a}),e.jsx("button",{onClick:p,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:u?e.jsx(j,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{y as Q};
@@ -1,4 +1,4 @@
1
- import{c as R,a as _,v as w,r as a,Y as c,j as e,X as C,h as g,s as D}from"./index-cjnaCqIk.js";import{S as N}from"./Select-CNYCHeZX.js";/**
1
+ import{c as R,a as _,v as w,r as a,Z as c,j as e,X as C,h as g,s as D}from"./index-Cnjcx5EP.js";import{S as N}from"./Select-BdUjuVPU.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
- import{c as de,A as xe,f as me,a as B,k as pe,r as n,h as L,j as e,L as ue,Q as H,V as ve,t as f,o as v,b as be,O as ge,X as he}from"./index-cjnaCqIk.js";import{P as fe}from"./PtyTerminal-huC-c2oe.js";import{T as je}from"./Skeleton-BrVgXQ4x.js";import{f as Ne,b as we}from"./date-CmcdoD87.js";import{a as ye}from"./agent-type-options-BAQ9fpbk.js";import{T as G,g as Q}from"./task-constants-F1gBygz6.js";import{A as ke}from"./arrow-left-B6sCoNMg.js";import{L as Se}from"./loader-circle-CMUEKgE-.js";import{P as z}from"./play-BLPg52oN.js";import{S as Ce}from"./skip-forward-DNcoNfv9.js";import{R as Te}from"./rotate-ccw-wLonVM_U.js";import{C as Ae}from"./chevron-up-Da8klXGP.js";import{C as Ee}from"./chevron-down-Bd-GeLYL.js";import{C as Re}from"./circle-alert-VOv95Apc.js";/**
1
+ import{c as de,B as xe,f as me,a as X,k as pe,r as n,h as L,j as e,L as ue,V as H,Y as ve,t as f,o as v,b as be,Q as ge,X as he}from"./index-Cnjcx5EP.js";import{P as fe}from"./PtyTerminal-Dyd6hZ66.js";import{T as je}from"./Skeleton-DZltBScg.js";import{f as Ne,b as we}from"./date-CmcdoD87.js";import{a as ye}from"./agent-type-options-D09p3GHf.js";import{T as G,g as Q}from"./task-constants-Bjfrzjfy.js";import{A as ke}from"./arrow-left-Bx4nR3Vh.js";import{L as Se}from"./loader-circle-CoOnqP8V.js";import{P as z}from"./play-CmZnnLuv.js";import{S as Ce}from"./skip-forward-B7WDk647.js";import{R as Te}from"./rotate-ccw-I6j0q_Iy.js";import{C as Ae}from"./chevron-up-Ouv2r2Jr.js";import{C as Ee}from"./chevron-down-CMJNvCkO.js";import{C as Re}from"./circle-alert-B88-HLYp.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const De=de("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),Y={critical:0,warning:1,suggestion:2};function Ie(s){switch(s){case"critical":return{text:"text-[var(--destructive)]",bg:"rgba(239,68,68,0.12)",border:"rgba(239,68,68,0.27)"};case"warning":return{text:"text-[var(--warning)]",bg:"rgba(245,158,11,0.12)",border:"rgba(245,158,11,0.27)"};default:return{text:"text-[var(--info)]",bg:"rgba(59,130,246,0.10)",border:"rgba(59,130,246,0.27)"}}}function Le({severity:s}){return s==="critical"?e.jsx(Re,{className:"h-3.5 w-3.5 text-[var(--destructive)]"}):s==="warning"?e.jsx(H,{className:"h-3.5 w-3.5 text-[var(--warning)]"}):e.jsx(De,{className:"h-3.5 w-3.5 text-[var(--info)]"})}function _e(s){switch(s){case v.RUNNING:return"bg-[var(--accent)]";case v.QUEUED:case v.ASSIGNED:case v.SUSPENDED:return"bg-[var(--warning)]";case v.COMPLETED:return"bg-[var(--accent)]";case v.FAILED:return"bg-[var(--destructive)]";default:return"bg-[#525252]"}}function W(s){return s===v.RUNNING||s===v.QUEUED||s===v.ASSIGNED}function O(s){return s===v.SUSPENDED}const $e=ye(Q);function Pe({task:s,expanded:l,onToggleExpand:r}){const b=Q(s.agentType),d=_e(s.status),o=we(s.startedAt,s.completedAt??void 0),j=W(s.status),g=G.includes(s.status),w=n.useRef(null);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",onClick:r,children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${d} ${j?"animate-pulse":""}`}),e.jsx("span",{className:"flex-1 text-xs font-medium text-[var(--text-primary)]",children:b}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[j?`${s.status.toLowerCase()}...`:s.status.toLowerCase(),o&&` · ${o}`]}),e.jsxs("a",{href:`/tasks/${s.id}`,target:"_blank",rel:"noopener noreferrer",onClick:y=>y.stopPropagation(),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-muted)] hover:text-[var(--accent)] hover:border-[var(--accent)] transition-colors flex items-center gap-1",children:[e.jsx(be,{className:"h-3 w-3"}),"↗"]}),l?e.jsx(Ae,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}):e.jsx(Ee,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})]}),l&&e.jsx("div",{className:"border-t border-[var(--border)]",style:{height:"300px"},children:e.jsx(fe,{ref:w,taskId:s.id,sessionId:s.currentSessionId??void 0,taskFinished:g})})]})}function Fe({issue:s}){const l=Ie(s.severity);return e.jsxs("div",{className:`rounded-[4px] p-3 text-xs ${s.isDuplicate?"opacity-60":""}`,style:{backgroundColor:l.bg,border:`1px solid ${l.border}`},children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx(Le,{severity:s.severity}),e.jsx("span",{className:`font-bold ${l.text}`,children:s.severity}),s.agentType&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:s.agentType}),e.jsxs("span",{className:"text-[var(--text-muted)]",children:[s.file,s.line!=null?`:${s.line}`:""]}),s.isDuplicate&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"duplicate"})]}),e.jsx("p",{className:"mb-1 text-[var(--text-secondary)]",children:s.description}),s.suggestion&&e.jsxs("p",{className:"text-[var(--text-muted)]",children:[e.jsx("span",{className:"font-medium",children:"suggestion:"})," ",s.suggestion]})]})}function Ue({sourceTaskId:s,defaultReviewers:l,onClose:r,onLaunched:b}){const{t:d}=B(),o=l.length>0?l:[ge.CLAUDE],j=l.length>0,[g,w]=n.useState(o),[y,_]=n.useState(""),[N,$]=n.useState(!1),[C,T]=n.useState(!1);function R(c){w(u=>u.includes(c)?u.filter(P=>P!==c):[...u,c])}async function D(){if(g.length===0){f.error("select at least one review agent.");return}T(!0);try{await L.post(`web/tasks/${s}/review`,{json:{agentTypes:g,description:y.trim()||void 0,skipFix:N||void 0}}),f.success("review launched"),b(),r()}catch(c){const u=c instanceof Error?c.message:String(c);f.error(u)}finally{T(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:d("review.review_again")}),e.jsx("button",{onClick:r,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(he,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:d("review.select_agents")}),j&&e.jsx("span",{className:"rounded-[4px] border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-500",children:"using project defaults"})]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:$e.map(c=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:g.includes(c.value),onChange:()=>R(c.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:c.label})]},c.value))}),e.jsx("textarea",{value:y,onChange:c=>_(c.target.value),placeholder:d("review.description_placeholder"),rows:3,className:"mb-3 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"mb-4 flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:N,onChange:c=>$(c.target.checked),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-muted)]",children:d("review.skip_fix_label")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:D,disabled:C||g.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(z,{className:"h-3 w-3"}),d(C?"common.processing":"review.launch")]}),e.jsx("button",{onClick:r,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:d("common.cancel")})]})]})})}function Ze(){var K;const{sourceTaskId:s}=xe(),l=me(),{t:r}=B(),b=Number(s),d=pe(t=>t.eventSeq),[o,j]=n.useState(null),[g,w]=n.useState(!0),[y,_]=n.useState(new Set),[N,$]=n.useState(""),[C,T]=n.useState(!1),[R,D]=n.useState(!1),[c,u]=n.useState(!1),[P,V]=n.useState(null),k=n.useCallback(async()=>{try{const t=await L.get(`web/tasks/${b}/reviews`).json();j(t),t.rounds&&t.rounds.length>0&&V(a=>a??t.rounds[t.rounds.length-1].round)}catch{j(null)}finally{w(!1)}},[b]);n.useEffect(()=>{w(!0),k()},[k]),n.useEffect(()=>{d>0&&k()},[d,k]);const Z=n.useCallback(t=>{_(a=>{const x=new Set(a);return x.has(t)?x.delete(t):x.add(t),x})},[]),S=(o==null?void 0:o.rounds)??[],F=S.length>0?S[S.length-1].round:null,h=P??F,U=S.find(t=>t.round===h),i=(U==null?void 0:U.reviewTasks)??(o==null?void 0:o.reviewTasks)??[];i.some(t=>W(t.status));const I=i.some(t=>O(t.status)),M=i.length>0&&i.every(t=>G.includes(t.status)),ee=i.some(t=>t.report!=null),te=i.length>0&&i.every(t=>t.report!=null),q=h===F,se=I||M,A=n.useMemo(()=>{var x;const t=[];for(const p of i)if((x=p.report)!=null&&x.issues)for(const E of p.report.issues)t.push({...E,agentType:p.agentType??"claude"});t.sort((p,E)=>(Y[p.severity]??9)-(Y[E.severity]??9));const a=new Set;return t.map(p=>{const E=p.description.slice(0,20),X=`${p.file}:${p.line??""}:${E}`;return a.has(X)?{...p,isDuplicate:!0}:(a.add(X),p)})},[i]),re=A.filter(t=>t.severity==="critical").length,ae=A.filter(t=>t.severity==="warning").length,ne=A.filter(t=>t.severity==="suggestion").length,J=i.filter(t=>O(t.status)),oe=n.useMemo(()=>[{value:"",label:"select agent..."},...J.map(t=>({value:String(t.id),label:Q(t.agentType)}))],[J]);async function ce(){if(!N){f.error("select a review agent to perform the fix.");return}T(!0);try{await L.post(`web/tasks/${b}/approve-fix`,{json:{reviewTaskId:Number(N)}}),f.success("fix started"),k()}catch(t){const a=t instanceof Error?t.message:String(t);f.error(a)}finally{T(!1)}}async function ie(){D(!0);try{await L.post(`web/tasks/${b}/skip-fix`,{json:h!=null?{round:h}:{}}),f.success("review completed — no fix needed"),l("/review")}catch(t){const a=t instanceof Error?t.message:String(t);f.error(a)}finally{D(!1)}}const le=n.useMemo(()=>{var a;const t=(a=o==null?void 0:o.sourceTask)==null?void 0:a.configSnapshot;if(!t)return[];try{const x=JSON.parse(t);return Array.isArray(x.defaultReviewers)?x.defaultReviewers:[]}catch{return[]}},[(K=o==null?void 0:o.sourceTask)==null?void 0:K.configSnapshot]);if(g)return e.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(je,{rows:5})});if(!o)return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"// reviews not found"}),e.jsx("button",{onClick:()=>l("/review"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"< back to review"})]});const{sourceTask:m}=o;return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>l("/review"),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),r("common.back")]})}),e.jsx("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:"source task"}),e.jsxs(ue,{to:`/tasks/${m.id}`,className:"text-xs text-[var(--info)] hover:underline",children:["#",m.id]}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:m.projectKey})]}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:m.description}),(m.branch||m.sourceCommitSha)&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["reviewing branch"," ",m.branch&&e.jsx("span",{className:"text-[var(--text-secondary)]",children:m.branch}),m.sourceCommitSha&&e.jsxs(e.Fragment,{children:[" ","at commit"," ",e.jsx("span",{className:"font-mono text-[var(--accent)]",children:m.sourceCommitSha.slice(0,7)})]})]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:Ne(m.createdAt)})]})}),S.length>1&&e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"round:"}),e.jsx("div",{className:"flex gap-1",children:S.map(t=>e.jsxs("button",{onClick:()=>V(t.round),className:`rounded-[4px] border px-3 py-1 text-xs transition-colors ${h===t.round?"border-[var(--accent)] bg-[var(--accent)] text-black font-bold":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:["#",t.round]},t.round))}),h!==F&&e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// historical"})]}),i.length>0&&e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:[r("review.round"),h?` #${h}`:""]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[i.filter(t=>G.includes(t.status)||O(t.status)).length," / ",i.length," done"]})]}),e.jsx("div",{className:"flex flex-col gap-2",children:i.map(t=>e.jsx(Pe,{task:t,expanded:y.has(t.id),onToggleExpand:()=>Z(t.id)},t.id))})]}),se&&ee&&(i.filter(a=>a.report!=null).every(a=>!a.report.summary&&a.report.issues.length===0)?e.jsx("div",{className:"mb-5 rounded-[4px] border border-amber-500/40 bg-amber-500/10 p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(H,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5"}),e.jsx("p",{className:"text-xs text-amber-500",children:r("review.empty_report_warning")})]})}):e.jsxs("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"mb-3 flex items-center gap-3",children:e.jsxs("span",{className:"text-xs font-bold text-[var(--accent)]",children:[r("review.round")," — ",r("review.issues_summary",{critical:String(re),warning:String(ae),suggestion:String(ne)})]})}),A.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:A.map((a,x)=>e.jsx(Fe,{issue:a},x))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// no issues reported"})]})),q&&te&&!I&&!M&&e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx(Se,{className:"h-3.5 w-3.5 animate-spin text-[var(--text-muted)]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("review.waiting_agents")})]}),q&&(I||M)&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("span",{className:"mb-3 block text-xs font-bold text-[var(--text-muted)]",children:"actions"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[I&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[e.jsx("select",{value:N,onChange:t=>$(t.target.value),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)] md:w-48",children:oe.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsxs("button",{onClick:ce,disabled:C||!N,className:"flex items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(z,{className:"h-3 w-3"}),r(C?"common.processing":"review.approve_fix")]}),e.jsxs("button",{onClick:ie,disabled:R,className:"flex items-center justify-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)] hover:bg-[var(--bg-input)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Ce,{className:"h-3 w-3"}),r(R?"common.processing":"review.skip_fix")]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",children:[e.jsx(ve,{className:"h-3 w-3 shrink-0"}),r("review.fix_push_info")]})]}),e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),r("review.review_again")]})]})]}),i.length===0&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("review.no_reviews")}),e.jsxs("button",{onClick:()=>u(!0),className:"mt-3 flex items-center gap-1.5 mx-auto rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black",children:[e.jsx(z,{className:"h-3 w-3"}),r("review.launch")]})]}),c&&e.jsx(Ue,{sourceTaskId:b,defaultReviewers:le,onClose:()=>u(!1),onLaunched:()=>{u(!1),k()}})]})}export{Ze as default};
6
+ */const De=de("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),K={critical:0,warning:1,suggestion:2};function Ie(s){switch(s){case"critical":return{text:"text-[var(--destructive)]",bg:"rgba(239,68,68,0.12)",border:"rgba(239,68,68,0.27)"};case"warning":return{text:"text-[var(--warning)]",bg:"rgba(245,158,11,0.12)",border:"rgba(245,158,11,0.27)"};default:return{text:"text-[var(--info)]",bg:"rgba(59,130,246,0.10)",border:"rgba(59,130,246,0.27)"}}}function Le({severity:s}){return s==="critical"?e.jsx(Re,{className:"h-3.5 w-3.5 text-[var(--destructive)]"}):s==="warning"?e.jsx(H,{className:"h-3.5 w-3.5 text-[var(--warning)]"}):e.jsx(De,{className:"h-3.5 w-3.5 text-[var(--info)]"})}function _e(s){switch(s){case v.RUNNING:return"bg-[var(--accent)]";case v.QUEUED:case v.ASSIGNED:case v.SUSPENDED:return"bg-[var(--warning)]";case v.COMPLETED:return"bg-[var(--accent)]";case v.FAILED:return"bg-[var(--destructive)]";default:return"bg-[#525252]"}}function W(s){return s===v.RUNNING||s===v.QUEUED||s===v.ASSIGNED}function O(s){return s===v.SUSPENDED}const $e=ye(Q);function Pe({task:s,expanded:l,onToggleExpand:r}){const b=Q(s.agentType),d=_e(s.status),o=we(s.startedAt,s.completedAt??void 0),j=W(s.status),g=G.includes(s.status),w=n.useRef(null);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",onClick:r,children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${d} ${j?"animate-pulse":""}`}),e.jsx("span",{className:"flex-1 text-xs font-medium text-[var(--text-primary)]",children:b}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[j?`${s.status.toLowerCase()}...`:s.status.toLowerCase(),o&&` · ${o}`]}),e.jsxs("a",{href:`/tasks/${s.id}`,target:"_blank",rel:"noopener noreferrer",onClick:y=>y.stopPropagation(),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-muted)] hover:text-[var(--accent)] hover:border-[var(--accent)] transition-colors flex items-center gap-1",children:[e.jsx(be,{className:"h-3 w-3"}),"↗"]}),l?e.jsx(Ae,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}):e.jsx(Ee,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})]}),l&&e.jsx("div",{className:"border-t border-[var(--border)]",style:{height:"300px"},children:e.jsx(fe,{ref:w,taskId:s.id,sessionId:s.currentSessionId??void 0,taskFinished:g})})]})}function Fe({issue:s}){const l=Ie(s.severity);return e.jsxs("div",{className:`rounded-[4px] p-3 text-xs ${s.isDuplicate?"opacity-60":""}`,style:{backgroundColor:l.bg,border:`1px solid ${l.border}`},children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx(Le,{severity:s.severity}),e.jsx("span",{className:`font-bold ${l.text}`,children:s.severity}),s.agentType&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:s.agentType}),e.jsxs("span",{className:"text-[var(--text-muted)]",children:[s.file,s.line!=null?`:${s.line}`:""]}),s.isDuplicate&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"duplicate"})]}),e.jsx("p",{className:"mb-1 text-[var(--text-secondary)]",children:s.description}),s.suggestion&&e.jsxs("p",{className:"text-[var(--text-muted)]",children:[e.jsx("span",{className:"font-medium",children:"suggestion:"})," ",s.suggestion]})]})}function Ue({sourceTaskId:s,defaultReviewers:l,onClose:r,onLaunched:b}){const{t:d}=X(),o=l.length>0?l:[ge.CLAUDE],j=l.length>0,[g,w]=n.useState(o),[y,_]=n.useState(""),[N,$]=n.useState(!1),[C,T]=n.useState(!1);function R(c){w(u=>u.includes(c)?u.filter(P=>P!==c):[...u,c])}async function D(){if(g.length===0){f.error("select at least one review agent.");return}T(!0);try{await L.post(`web/tasks/${s}/review`,{json:{agentTypes:g,description:y.trim()||void 0,skipFix:N||void 0}}),f.success("review launched"),b(),r()}catch(c){const u=c instanceof Error?c.message:String(c);f.error(u)}finally{T(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:d("review.review_again")}),e.jsx("button",{onClick:r,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(he,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:d("review.select_agents")}),j&&e.jsx("span",{className:"rounded-[4px] border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-500",children:"using project defaults"})]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:$e.map(c=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:g.includes(c.value),onChange:()=>R(c.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:c.label})]},c.value))}),e.jsx("textarea",{value:y,onChange:c=>_(c.target.value),placeholder:d("review.description_placeholder"),rows:3,className:"mb-3 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"mb-4 flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:N,onChange:c=>$(c.target.checked),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-muted)]",children:d("review.skip_fix_label")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:D,disabled:C||g.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(z,{className:"h-3 w-3"}),d(C?"common.processing":"review.launch")]}),e.jsx("button",{onClick:r,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:d("common.cancel")})]})]})})}function Ze(){var B;const{sourceTaskId:s}=xe(),l=me(),{t:r}=X(),b=Number(s),d=pe(t=>t.eventSeq),[o,j]=n.useState(null),[g,w]=n.useState(!0),[y,_]=n.useState(new Set),[N,$]=n.useState(""),[C,T]=n.useState(!1),[R,D]=n.useState(!1),[c,u]=n.useState(!1),[P,V]=n.useState(null),k=n.useCallback(async()=>{try{const t=await L.get(`web/tasks/${b}/reviews`).json();j(t),t.rounds&&t.rounds.length>0&&V(a=>a??t.rounds[t.rounds.length-1].round)}catch{j(null)}finally{w(!1)}},[b]);n.useEffect(()=>{w(!0),k()},[k]),n.useEffect(()=>{d>0&&k()},[d,k]);const Z=n.useCallback(t=>{_(a=>{const x=new Set(a);return x.has(t)?x.delete(t):x.add(t),x})},[]),S=(o==null?void 0:o.rounds)??[],F=S.length>0?S[S.length-1].round:null,h=P??F,U=S.find(t=>t.round===h),i=(U==null?void 0:U.reviewTasks)??(o==null?void 0:o.reviewTasks)??[];i.some(t=>W(t.status));const I=i.some(t=>O(t.status)),M=i.length>0&&i.every(t=>G.includes(t.status)),ee=i.some(t=>t.report!=null),te=i.length>0&&i.every(t=>t.report!=null),q=h===F,se=I||M,A=n.useMemo(()=>{var x;const t=[];for(const p of i)if((x=p.report)!=null&&x.issues)for(const E of p.report.issues)t.push({...E,agentType:p.agentType??"claude"});t.sort((p,E)=>(K[p.severity]??9)-(K[E.severity]??9));const a=new Set;return t.map(p=>{const E=p.description.slice(0,20),J=`${p.file}:${p.line??""}:${E}`;return a.has(J)?{...p,isDuplicate:!0}:(a.add(J),p)})},[i]),re=A.filter(t=>t.severity==="critical").length,ae=A.filter(t=>t.severity==="warning").length,ne=A.filter(t=>t.severity==="suggestion").length,Y=i.filter(t=>O(t.status)),oe=n.useMemo(()=>[{value:"",label:"select agent..."},...Y.map(t=>({value:String(t.id),label:Q(t.agentType)}))],[Y]);async function ce(){if(!N){f.error("select a review agent to perform the fix.");return}T(!0);try{await L.post(`web/tasks/${b}/approve-fix`,{json:{reviewTaskId:Number(N)}}),f.success("fix started"),k()}catch(t){const a=t instanceof Error?t.message:String(t);f.error(a)}finally{T(!1)}}async function ie(){D(!0);try{await L.post(`web/tasks/${b}/skip-fix`,{json:h!=null?{round:h}:{}}),f.success("review completed — no fix needed"),l("/review")}catch(t){const a=t instanceof Error?t.message:String(t);f.error(a)}finally{D(!1)}}const le=n.useMemo(()=>{var a;const t=(a=o==null?void 0:o.sourceTask)==null?void 0:a.configSnapshot;if(!t)return[];try{const x=JSON.parse(t);return Array.isArray(x.defaultReviewers)?x.defaultReviewers:[]}catch{return[]}},[(B=o==null?void 0:o.sourceTask)==null?void 0:B.configSnapshot]);if(g)return e.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(je,{rows:5})});if(!o)return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"// reviews not found"}),e.jsx("button",{onClick:()=>l("/review"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"< back to review"})]});const{sourceTask:m}=o;return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>l("/review"),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),r("common.back")]})}),e.jsx("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:"source task"}),e.jsxs(ue,{to:`/tasks/${m.id}`,className:"text-xs text-[var(--info)] hover:underline",children:["#",m.id]}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:m.projectKey})]}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:m.description}),(m.branch||m.sourceCommitSha)&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["reviewing branch"," ",m.branch&&e.jsx("span",{className:"text-[var(--text-secondary)]",children:m.branch}),m.sourceCommitSha&&e.jsxs(e.Fragment,{children:[" ","at commit"," ",e.jsx("span",{className:"font-mono text-[var(--accent)]",children:m.sourceCommitSha.slice(0,7)})]})]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:Ne(m.createdAt)})]})}),S.length>1&&e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"round:"}),e.jsx("div",{className:"flex gap-1",children:S.map(t=>e.jsxs("button",{onClick:()=>V(t.round),className:`rounded-[4px] border px-3 py-1 text-xs transition-colors ${h===t.round?"border-[var(--accent)] bg-[var(--accent)] text-black font-bold":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:["#",t.round]},t.round))}),h!==F&&e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// historical"})]}),i.length>0&&e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:[r("review.round"),h?` #${h}`:""]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[i.filter(t=>G.includes(t.status)||O(t.status)).length," / ",i.length," done"]})]}),e.jsx("div",{className:"flex flex-col gap-2",children:i.map(t=>e.jsx(Pe,{task:t,expanded:y.has(t.id),onToggleExpand:()=>Z(t.id)},t.id))})]}),se&&ee&&(i.filter(a=>a.report!=null).every(a=>!a.report.summary&&a.report.issues.length===0)?e.jsx("div",{className:"mb-5 rounded-[4px] border border-amber-500/40 bg-amber-500/10 p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(H,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5"}),e.jsx("p",{className:"text-xs text-amber-500",children:r("review.empty_report_warning")})]})}):e.jsxs("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"mb-3 flex items-center gap-3",children:e.jsxs("span",{className:"text-xs font-bold text-[var(--accent)]",children:[r("review.round")," — ",r("review.issues_summary",{critical:String(re),warning:String(ae),suggestion:String(ne)})]})}),A.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:A.map((a,x)=>e.jsx(Fe,{issue:a},x))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// no issues reported"})]})),q&&te&&!I&&!M&&e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx(Se,{className:"h-3.5 w-3.5 animate-spin text-[var(--text-muted)]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("review.waiting_agents")})]}),q&&(I||M)&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("span",{className:"mb-3 block text-xs font-bold text-[var(--text-muted)]",children:"actions"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[I&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[e.jsx("select",{value:N,onChange:t=>$(t.target.value),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)] md:w-48",children:oe.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsxs("button",{onClick:ce,disabled:C||!N,className:"flex items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(z,{className:"h-3 w-3"}),r(C?"common.processing":"review.approve_fix")]}),e.jsxs("button",{onClick:ie,disabled:R,className:"flex items-center justify-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)] hover:bg-[var(--bg-input)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Ce,{className:"h-3 w-3"}),r(R?"common.processing":"review.skip_fix")]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",children:[e.jsx(ve,{className:"h-3 w-3 shrink-0"}),r("review.fix_push_info")]})]}),e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),r("review.review_again")]})]})]}),i.length===0&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("review.no_reviews")}),e.jsxs("button",{onClick:()=>u(!0),className:"mt-3 flex items-center gap-1.5 mx-auto rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black",children:[e.jsx(z,{className:"h-3 w-3"}),r("review.launch")]})]}),c&&e.jsx(Ue,{sourceTaskId:b,defaultReviewers:le,onClose:()=>u(!1),onLaunched:()=>{u(!1),k()}})]})}export{Ze as default};
@@ -0,0 +1 @@
1
+ import{a as w,f as k,k as K,r,x as F,j as e,h as N,o as m,E,l as B,X as T,H,t as y,Q}from"./index-Cnjcx5EP.js";import{E as D}from"./EmptyState-Dg8UN1Uo.js";import{T as L}from"./Skeleton-DZltBScg.js";import{S as C}from"./Select-BdUjuVPU.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-BHebqiCF.js";import{a as q}from"./agent-type-options-D09p3GHf.js";import{g as z}from"./task-constants-Bjfrzjfy.js";import{P as X}from"./plus-T50zBWvm.js";import{P as R}from"./play-CmZnnLuv.js";import{C as Z}from"./chevron-left-D32li7kz.js";import{C as J}from"./chevron-right-CJoGvgTt.js";import"./chevron-down-CMJNvCkO.js";function $(){const[s,i]=r.useState(void 0),[t,o]=r.useState(void 0),[p,c]=r.useState([]),h=r.useRef(void 0),u=r.useRef(void 0);h.current=s,u.current=t;const g=r.useCallback(x=>{i(x)},[]),l=r.useCallback(()=>{const x=h.current;x&&(c(j=>[...j,u.current??""]),o(x))},[]),b=r.useRef([]);b.current=p;const d=r.useCallback(()=>{const x=b.current;x.length!==0&&(o(x.at(-1)||void 0),c(x.slice(0,-1)))},[]),a=p.length+1,n=p.length>0;return{cursor:t,setNextCursor:g,goNext:l,goPrev:d,pageNumber:a,hasPrev:n,hasNext:!!s}}const I=20;function V(s){switch(s){case m.RUNNING:return"bg-[var(--accent)]";case m.QUEUED:return"bg-[var(--warning)]";case m.ASSIGNED:return"bg-[var(--info)]";case m.SUSPENDED:return"bg-[var(--warning)]";case m.COMPLETED:return"bg-[var(--accent)]";case m.FAILED:return"bg-[var(--destructive)]";case m.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const W=q(z);function Y({taskId:s,onClose:i,onLaunched:t}){const{t:o}=w(),[p,c]=r.useState([Q.CLAUDE]),[h,u]=r.useState(""),[g,l]=r.useState(!1);function b(a){c(n=>n.includes(a)?n.filter(f=>f!==a):[...n,a])}async function d(){if(p.length===0){y.error("select at least one review agent.");return}l(!0);try{await N.post(`web/tasks/${s}/review`,{json:{agentTypes:p,description:h.trim()||void 0}}),y.success("review launched"),t(),i()}catch(a){const n=a instanceof Error?a.message:String(a);y.error(n)}finally{l(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:o("review.launch")}),e.jsx("button",{onClick:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(T,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:["task #",s," — ",o("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:W.map(a=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:p.includes(a.value),onChange:()=>b(a.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:a.label})]},a.value))}),e.jsx("textarea",{value:h,onChange:a=>u(a.target.value),placeholder:o("review.description_placeholder"),rows:3,className:"mb-4 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:d,disabled:g||p.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(R,{className:"h-3 w-3"}),o(g?"common.processing":"review.launch")]}),e.jsx("button",{onClick:i,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:o("common.cancel")})]})]})})}function _({pag:s}){const{t:i}=w();return!s.hasPrev&&!s.hasNext?null:e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",s.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:s.goPrev,disabled:!s.hasPrev,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(Z,{className:"h-3.5 w-3.5"}),i("tasks.prev")]}),e.jsxs("button",{onClick:s.goNext,disabled:!s.hasNext,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[i("common.next"),e.jsx(J,{className:"h-3.5 w-3.5"})]})]})]})}function ee({onRefresh:s,projectFilter:i,developerFilter:t}){const{t:o}=w(),p=k(),[c,h]=r.useState([]),[u,g]=r.useState(!0),[l,b]=r.useState(null),d=$(),a=r.useCallback(async n=>{g(!0);try{const f=new Date(Date.now()-6048e5).toISOString(),x=new URLSearchParams({status:m.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:f,limit:String(I)});i&&x.set("projectKey",i),t&&x.set("developerId",t),n&&x.set("cursor",n);const j=await N.get(`web/tasks?${x}`).json();h(j.data??[]),d.setNextCursor(j.nextCursor)}catch{h([]),d.setNextCursor(void 0)}finally{g(!1)}},[i,t]);return r.useEffect(()=>{a(d.cursor)},[a,d.cursor]),u&&c.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&c.length===0&&!d.hasPrev?e.jsx(D,{icon:E,title:o("review.no_reviews"),description:o("review.pending")}):e.jsxs(e.Fragment,{children:[c.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:c.map(n=>e.jsxs("div",{className:"flex flex-col gap-1 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:n.description,className:"flex-1 min-w-0",children:e.jsxs("span",{className:"cursor-pointer truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors block preserve-case",onClick:()=>p(`/tasks/${n.id}`),children:["#",n.id," ",B(n)]})}),e.jsx("button",{onClick:async()=>{try{await N.post(`web/tasks/${n.id}/review-status`,{json:{reviewStatus:"dismissed"}}),a(d.cursor)}catch(f){let x="Failed to dismiss";try{if(f instanceof H){const j=await f.response.json();x=(j==null?void 0:j.message)??x}else f instanceof Error&&(x=f.message)}catch{}y.error(x)}},className:"shrink-0 flex items-center rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":"dismiss",children:e.jsx(T,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{onClick:()=>b(n.id),className:"shrink-0 flex items-center gap-1.5 rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(R,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:o("review.launch_short")})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5 text-[11px] text-[var(--text-muted)] min-w-0",children:[e.jsx("span",{className:"shrink-0",children:P(n.completedAt??n.createdAt)}),e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"shrink-0",children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:n.workerName})]})]})]},n.id))}),e.jsx(_,{pag:d}),l!==null&&e.jsx(Y,{taskId:l,onClose:()=>b(null),onLaunched:()=>{s(),a(d.cursor)}})]})}function se(s){const i=new Map;for(const t of s){const o=t.sourceTaskId??t.id;i.has(o)||i.set(o,[]),i.get(o).push(t)}return Array.from(i.entries()).map(([t,o])=>({sourceTaskId:t,tasks:o}))}function te({group:s,onClick:i}){const t=s.tasks[0],o=s.tasks.every(c=>c.status===m.COMPLETED||c.status===m.FAILED||c.status===m.CANCELLED),p=t==null?void 0:t.sourceCommitSha;return e.jsxs("div",{onClick:i,className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${o?"bg-[var(--accent)]":"bg-[var(--warning)]"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(A,{content:(t==null?void 0:t.sourceTaskDescription)??(t==null?void 0:t.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",s.sourceTaskId]})}),p&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",p.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.tasks.length," ",s.tasks.length===1?"agent":"agents"," · ",s.tasks.map(c=>(c.agentType??"claude").toLowerCase()).join(", ")]})]}),t&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(t.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.tasks.map(c=>e.jsx("span",{className:`h-2 w-2 rounded-full ${V(c.status)}`,title:c.status.toLowerCase()},c.id))})]})}function S({mode:s,projectFilter:i,developerFilter:t}){const{t:o}=w(),p=k(),[c,h]=r.useState([]),[u,g]=r.useState(!0),l=$(),b=r.useCallback(async d=>{g(!0);try{const a=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});s==="in_progress"?a.set("status",[m.QUEUED,m.ASSIGNED,m.RUNNING,m.SUSPENDED].join(",")):a.set("status",[m.COMPLETED,m.FAILED,m.CANCELLED].join(",")),i&&a.set("projectKey",i),t&&a.set("sourceDeveloperId",t),d&&a.set("cursor",d);const n=await N.get(`web/tasks?${a}`).json();h(se(n.data??[])),l.setNextCursor(n.nextCursor??void 0)}catch{h([]),l.setNextCursor(void 0)}finally{g(!1)}},[s,i,t]);return r.useEffect(()=>{b(l.cursor)},[b,l.cursor]),u&&c.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&c.length===0&&!l.hasPrev?e.jsx(D,{icon:E,title:o("review.no_reviews")}):e.jsxs(e.Fragment,{children:[c.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:c.map(d=>e.jsx(te,{group:d,onClick:()=>p(`/review/${d.sourceTaskId}`)},d.sourceTaskId))}),e.jsx(_,{pag:l})]})}function ge(){const{t:s}=w(),i=k(),t=K(v=>v.taskSeq),[o,p]=r.useState("pending"),[c,h]=r.useState(0),[u,g]=r.useState(""),[l,b]=r.useState(""),[d,a]=r.useState([]),[n,f]=r.useState([]);F(null);const x=r.useCallback(()=>h(v=>v+1),[]);r.useEffect(()=>{let v=!1;return(async()=>{try{const[M,G]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(v)return;a(M),f(G)}catch{}})(),()=>{v=!0}},[]);const j=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...d.map(v=>({value:v.key,label:v.name}))],[d,s]),O=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...n.map(v=>({value:String(v.id),label:v.name}))],[n,s]),U=[{key:"pending",label:s("review.pending")},{key:"in_progress",label:s("review.in_progress")},{key:"history",label:s("review.history")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:s("review.title")}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:[U.map(v=>e.jsx("button",{onClick:()=>p(v.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${o===v.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:v.label},v.key)),e.jsxs("button",{onClick:()=>i("/plan"),className:"shrink-0 flex items-center gap-1 rounded-[4px] px-3 py-2 h-8 text-xs text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(X,{className:"h-3 w-3"}),s("plan.title")]})]}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(C,{value:u,onChange:g,options:j,className:"md:w-40"}),e.jsx(C,{value:l,onChange:b,options:O,className:"md:w-40"})]})]}),o==="pending"&&e.jsx(ee,{onRefresh:x,projectFilter:u,developerFilter:l},`pending-${c}-${t}-${u}-${l}`),o==="in_progress"&&e.jsx(S,{mode:"in_progress",projectFilter:u,developerFilter:l},`inprogress-${c}-${t}-${u}-${l}`),o==="history"&&e.jsx(S,{mode:"history",projectFilter:u,developerFilter:l},`history-${c}-${t}-${u}-${l}`)]})}export{ge as default};
@@ -1 +1 @@
1
- import{r as l,j as t}from"./index-cjnaCqIk.js";import{C as f}from"./chevron-down-Bd-GeLYL.js";function h({value:r,onChange:x,options:c,placeholder:u,disabled:n=!1,className:m=""}){var i;const[a,o]=l.useState(!1),s=l.useRef(null),d=((i=c.find(e=>e.value===r))==null?void 0:i.label)??u??"";return l.useEffect(()=>{function e(v){s.current&&!s.current.contains(v.target)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:s,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&o(!a),"aria-expanded":a,"aria-haspopup":"listbox",className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${a?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${n?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:d}),t.jsx(f,{size:12,className:`ml-2 shrink-0 text-[var(--text-muted)] transition-transform ${a?"rotate-180":""}`})]}),a&&t.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-1 max-h-48 min-w-full w-max max-w-[calc(100vw-2rem)] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] py-1 shadow-lg",children:c.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),o(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{h as S};
1
+ import{r as l,j as t}from"./index-Cnjcx5EP.js";import{C as f}from"./chevron-down-CMJNvCkO.js";function h({value:r,onChange:x,options:c,placeholder:u,disabled:n=!1,className:m=""}){var i;const[a,o]=l.useState(!1),s=l.useRef(null),d=((i=c.find(e=>e.value===r))==null?void 0:i.label)??u??"";return l.useEffect(()=>{function e(v){s.current&&!s.current.contains(v.target)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:s,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&o(!a),"aria-expanded":a,"aria-haspopup":"listbox",className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${a?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${n?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:d}),t.jsx(f,{size:12,className:`ml-2 shrink-0 text-[var(--text-muted)] transition-transform ${a?"rotate-180":""}`})]}),a&&t.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-1 max-h-48 min-w-full w-max max-w-[calc(100vw-2rem)] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] py-1 shadow-lg",children:c.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),o(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{h as S};