@overlordai/server 1.0.143 → 1.0.145
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.
- package/database/migrations/014-automations.sql +67 -0
- package/dist/adapters/command-parser.utils.d.ts +1 -0
- package/dist/adapters/command-parser.utils.d.ts.map +1 -1
- package/dist/adapters/command-parser.utils.js +14 -1
- package/dist/adapters/command-parser.utils.js.map +1 -1
- package/dist/adapters/help-text.d.ts.map +1 -1
- package/dist/adapters/help-text.js +2 -1
- package/dist/adapters/help-text.js.map +1 -1
- package/dist/adapters/nlu.service.d.ts.map +1 -1
- package/dist/adapters/nlu.service.js +4 -1
- package/dist/adapters/nlu.service.js.map +1 -1
- package/dist/app.module.d.ts.map +1 -1
- package/dist/app.module.js +2 -0
- package/dist/app.module.js.map +1 -1
- package/dist/automation/automation-executor.d.ts +23 -0
- package/dist/automation/automation-executor.d.ts.map +1 -0
- package/dist/automation/automation-executor.js +365 -0
- package/dist/automation/automation-executor.js.map +1 -0
- package/dist/automation/automation-scheduler.d.ts +21 -0
- package/dist/automation/automation-scheduler.d.ts.map +1 -0
- package/dist/automation/automation-scheduler.js +124 -0
- package/dist/automation/automation-scheduler.js.map +1 -0
- package/dist/automation/automation-template.service.d.ts +30 -0
- package/dist/automation/automation-template.service.d.ts.map +1 -0
- package/dist/automation/automation-template.service.js +66 -0
- package/dist/automation/automation-template.service.js.map +1 -0
- package/dist/automation/automation-trigger.d.ts +13 -0
- package/dist/automation/automation-trigger.d.ts.map +1 -0
- package/dist/automation/automation-trigger.js +96 -0
- package/dist/automation/automation-trigger.js.map +1 -0
- package/dist/automation/automation-validation.d.ts +14 -0
- package/dist/automation/automation-validation.d.ts.map +1 -0
- package/dist/automation/automation-validation.js +66 -0
- package/dist/automation/automation-validation.js.map +1 -0
- package/dist/automation/automation.module.d.ts +3 -0
- package/dist/automation/automation.module.d.ts.map +1 -0
- package/dist/automation/automation.module.js +33 -0
- package/dist/automation/automation.module.js.map +1 -0
- package/dist/automation/automation.service.d.ts +22 -0
- package/dist/automation/automation.service.d.ts.map +1 -0
- package/dist/automation/automation.service.js +232 -0
- package/dist/automation/automation.service.js.map +1 -0
- package/dist/database/repositories/automation.repository.d.ts +87 -0
- package/dist/database/repositories/automation.repository.d.ts.map +1 -0
- package/dist/database/repositories/automation.repository.js +531 -0
- package/dist/database/repositories/automation.repository.js.map +1 -0
- package/dist/database/repositories/task.repository.d.ts +1 -0
- package/dist/database/repositories/task.repository.d.ts.map +1 -1
- package/dist/database/repositories/task.repository.js +4 -2
- package/dist/database/repositories/task.repository.js.map +1 -1
- package/dist/database/repository.module.d.ts.map +1 -1
- package/dist/database/repository.module.js +2 -0
- package/dist/database/repository.module.js.map +1 -1
- package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
- package/dist/dispatcher/dispatcher.service.js +1 -0
- package/dist/dispatcher/dispatcher.service.js.map +1 -1
- package/dist/dispatcher/task-creation.service.d.ts +3 -3
- package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
- package/dist/dispatcher/task-creation.service.js +14 -5
- package/dist/dispatcher/task-creation.service.js.map +1 -1
- package/dist/events/event-types.d.ts +31 -0
- package/dist/events/event-types.d.ts.map +1 -1
- package/dist/events/event-types.js +4 -0
- package/dist/events/event-types.js.map +1 -1
- package/dist/notifier/notification-consumer.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.js +65 -1
- package/dist/notifier/notification-consumer.js.map +1 -1
- package/dist/notifier/notification-event-listener.d.ts +7 -2
- package/dist/notifier/notification-event-listener.d.ts.map +1 -1
- package/dist/notifier/notification-event-listener.js +56 -2
- package/dist/notifier/notification-event-listener.js.map +1 -1
- package/dist/notifier/notifier.service.d.ts +4 -1
- package/dist/notifier/notifier.service.d.ts.map +1 -1
- package/dist/notifier/notifier.service.js +23 -2
- package/dist/notifier/notifier.service.js.map +1 -1
- package/dist/notifier/template.service.d.ts +1 -1
- package/dist/notifier/template.service.d.ts.map +1 -1
- package/dist/notifier/template.service.js +14 -4
- package/dist/notifier/template.service.js.map +1 -1
- package/dist/web/automation.controller.d.ts +74 -0
- package/dist/web/automation.controller.d.ts.map +1 -0
- package/dist/web/automation.controller.js +539 -0
- package/dist/web/automation.controller.js.map +1 -0
- package/dist/web/frame-handlers/automation-report.handler.d.ts +10 -0
- package/dist/web/frame-handlers/automation-report.handler.d.ts.map +1 -0
- package/dist/web/frame-handlers/automation-report.handler.js +15 -0
- package/dist/web/frame-handlers/automation-report.handler.js.map +1 -0
- package/dist/web/frame-handlers/index.d.ts +1 -0
- package/dist/web/frame-handlers/index.d.ts.map +1 -1
- package/dist/web/frame-handlers/index.js +3 -1
- package/dist/web/frame-handlers/index.js.map +1 -1
- package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
- package/dist/web/frame-handlers/stage-confirm.handler.js +1 -1
- package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
- package/dist/web/task.controller.d.ts +3 -0
- package/dist/web/task.controller.d.ts.map +1 -1
- package/dist/web/web-event.service.d.ts +20 -1
- package/dist/web/web-event.service.d.ts.map +1 -1
- package/dist/web/web-event.service.js +66 -2
- package/dist/web/web-event.service.js.map +1 -1
- package/dist/web/web.module.d.ts.map +1 -1
- package/dist/web/web.module.js +4 -1
- package/dist/web/web.module.js.map +1 -1
- package/dist/web/worker-channel.gateway.d.ts +2 -1
- package/dist/web/worker-channel.gateway.d.ts.map +1 -1
- package/dist/web/worker-channel.gateway.js +5 -2
- package/dist/web/worker-channel.gateway.js.map +1 -1
- package/package.json +5 -4
- package/public/assets/AccessTokensPage-BYuGmkhG.js +1 -0
- package/public/assets/{AdminPage-CxHMuTgJ.js → AdminPage-BResRWph.js} +1 -1
- package/public/assets/{AgentCliPage-DxZUrhjz.js → AgentCliPage-BcDXV12E.js} +1 -1
- package/public/assets/{ApiReferencePage-Cc_-lPFn.js → ApiReferencePage-NaJYMeTA.js} +1 -1
- package/public/assets/{ArchitecturePage-CpXl4jb3.js → ArchitecturePage-D-0d-kgA.js} +1 -1
- package/public/assets/{AuditLogPage-CvG7Kmpn.js → AuditLogPage-BuiWgzsv.js} +1 -1
- package/public/assets/AutomationCreatePage-CbGNlXYx.js +1 -0
- package/public/assets/AutomationDetailPage-C8GfVtsX.js +16 -0
- package/public/assets/AutomationEditPage-C7hl6YxI.js +1 -0
- package/public/assets/AutomationListPage-sjxnTqLB.js +16 -0
- package/public/assets/AutomationRunDetailPage-DYpv-WBg.js +6 -0
- package/public/assets/{BindPlatformPage-DQEP-N9z.js → BindPlatformPage-DS1eO2Me.js} +1 -1
- package/public/assets/BotIntegrationPage-DW13UERh.js +1 -0
- package/public/assets/{BotManage-B1lkaWlW.js → BotManage-CW08edmX.js} +2 -2
- package/public/assets/{BotSetupPage-kJHd4z6w.js → BotSetupPage-B2TIppqV.js} +2 -2
- package/public/assets/{ChangelogPage-QheUxtEJ.js → ChangelogPage-BpJdCfIe.js} +1 -1
- package/public/assets/{CliReferencePage-Dy78S9h1.js → CliReferencePage-wbYT0YSP.js} +1 -1
- package/public/assets/ConfirmStageDialog-Bke18NAb.js +7 -0
- package/public/assets/{DeploymentPage-CaIslw2W.js → DeploymentPage-DqYVYlM2.js} +1 -1
- package/public/assets/{DevWorkflowPage-DjmFkvCo.js → DevWorkflowPage-B1T1aB-L.js} +1 -1
- package/public/assets/DeveloperManage-CwH2nj3C.js +16 -0
- package/public/assets/{DeveloperSetupPage-D3RvWqx0.js → DeveloperSetupPage-B099stPW.js} +1 -1
- package/public/assets/{DocsIndexPage-BHnvOEn8.js → DocsIndexPage-BQJNEB0T.js} +1 -1
- package/public/assets/{DocsLayout-BdWlFJ_G.js → DocsLayout-VgiIORoW.js} +1 -1
- package/public/assets/{DocsPrimitives-BRoBpWHe.js → DocsPrimitives-DStFX1T8.js} +1 -1
- package/public/assets/{EditProjectPage-CepF7mnT.js → EditProjectPage-CSv1LQ0c.js} +2 -2
- package/public/assets/{EmptyState-BIXXLer_.js → EmptyState-CM34MS8q.js} +1 -1
- package/public/assets/{EnvVariablesPage-DxRT4ql6.js → EnvVariablesPage-By_n8jC_.js} +2 -2
- package/public/assets/{HomePage-CkiXfp2H.js → HomePage-BA8S5QIk.js} +1 -1
- package/public/assets/{InfoRow-DXCzjoGj.js → InfoRow-BkLVrW3X.js} +1 -1
- package/public/assets/{InstallationPage-CF8j4Y-C.js → InstallationPage-5aHtmv3w.js} +1 -1
- package/public/assets/{LandingPage-CaYr_-RD.js → LandingPage-XfW3mTgR.js} +7 -12
- package/public/assets/{LocalDevelopmentPage-HIFhYvHJ.js → LocalDevelopmentPage-CEhJ10RY.js} +1 -1
- package/public/assets/{LoginPage-D17Mq8Qe.js → LoginPage-hEkjuwQp.js} +1 -1
- package/public/assets/{MetricBar-DDJWywkw.js → MetricBar-CuVoQPXf.js} +1 -1
- package/public/assets/{NotFoundPage-BTlUFX7F.js → NotFoundPage-CDaJI7W_.js} +1 -1
- package/public/assets/{OnboardingGuide-CTJYul4_.js → OnboardingGuide-xLqRqP0t.js} +1 -1
- package/public/assets/{PermissionsPage-Dj27JR_m.js → PermissionsPage-BGlc6yU2.js} +1 -1
- package/public/assets/{PipelineConfigPage-BTy8cOFI.js → PipelineConfigPage-Bzm1MeK0.js} +1 -1
- package/public/assets/{PipelineEditorPage-CuSW0B-0.js → PipelineEditorPage-DhS-VBVt.js} +2 -2
- package/public/assets/{PlanPage-CMQs2Hiz.js → PlanPage-Mu6msPek.js} +1 -1
- package/public/assets/{ProfilePage-BRxrQCQd.js → ProfilePage-Dk-XPfIf.js} +1 -1
- package/public/assets/{ProjectDetailPage-CRHNrgPt.js → ProjectDetailPage-C8v5ztXD.js} +3 -3
- package/public/assets/ProjectListPage-Ccrl3DtV.js +6 -0
- package/public/assets/PtyTerminal-DCbNmuIT.js +38 -0
- package/public/assets/{QuickAuth-Dx-LoUjm.js → QuickAuth-DAPeXfQS.js} +1 -1
- package/public/assets/RemoveMemberConfirmDialog-gr2WUWrR.js +6 -0
- package/public/assets/ReviewAggregatePage-B1SB4rXq.js +6 -0
- package/public/assets/{ReviewPage-DzNkeQXP.js → ReviewPage-Bde6YvIA.js} +1 -1
- package/public/assets/{Select-DYnPuPlP.js → Select-Bxil-UGQ.js} +1 -1
- package/public/assets/{SettingsPage-YpqaOT8x.js → SettingsPage-nA4hlLlN.js} +1 -1
- package/public/assets/{Skeleton-tFvClhRo.js → Skeleton-DMVGjH__.js} +1 -1
- package/public/assets/{SkillPage-BQto2TJm.js → SkillPage-BqTTImpe.js} +1 -1
- package/public/assets/{TaskDetailPage-BAnCb9zv.js → TaskDetailPage-DPdD57PF.js} +2 -2
- package/public/assets/{TaskGuidePage-Bs-Unzck.js → TaskGuidePage-CQAlhXHL.js} +1 -1
- package/public/assets/TaskListPage-C5tAOuSG.js +1 -0
- package/public/assets/{TaskStatusBadge-BUczBM5S.js → TaskStatusBadge-D5lVjwey.js} +1 -1
- package/public/assets/TerminalHomePage-BX-sHKXF.js +6 -0
- package/public/assets/TokenManage-95LL4o8y.js +1 -0
- package/public/assets/{Tooltip-BTMAbLUj.js → Tooltip-3_9w-Oet.js} +1 -1
- package/public/assets/{TotpSetupPage-B9IghCSA.js → TotpSetupPage-BzyS9OrP.js} +1 -1
- package/public/assets/{WorkerDetailPage-D0Vz2Z_J.js → WorkerDetailPage-BaVeVMvg.js} +1 -1
- package/public/assets/WorkerListPage-zOEHoOtr.js +6 -0
- package/public/assets/{WorkerOperationsPage-Du5dUuwe.js → WorkerOperationsPage-B9A7kFhI.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-Chgd3lOw.js → WorkerSetupGuidePage-DzTffG6n.js} +1 -1
- package/public/assets/{WorkerSetupPage-DOy5dzpL.js → WorkerSetupPage-B28GH43r.js} +1 -1
- package/public/assets/{agent-type-options-DYVQzNPE.js → agent-type-options-BBcV6_LY.js} +1 -1
- package/public/assets/{arrow-left-BmJhqQxJ.js → arrow-left-BDjYIP3Y.js} +1 -1
- package/public/assets/{arrow-right-za11FMwb.js → arrow-right-DITZLrUG.js} +1 -1
- package/public/assets/{bot-BREu_dZH.js → bot-CJ6g-CgU.js} +1 -1
- package/public/assets/{chevron-down-pInOI1Sz.js → chevron-down-D9VkxIPs.js} +1 -1
- package/public/assets/{chevron-left-9sE-mZhp.js → chevron-left-CWC7W_zG.js} +1 -1
- package/public/assets/{chevron-right-BTVDsZF2.js → chevron-right-BDlNEjPF.js} +1 -1
- package/public/assets/{chevron-up-7pQBLB6e.js → chevron-up-B2_M0Aou.js} +1 -1
- package/public/assets/circle-alert-Cb6RgYCQ.js +6 -0
- package/public/assets/clock-CPiGRQpX.js +6 -0
- package/public/assets/{copy-Ciibu4ij.js → copy-Dz9BK4cr.js} +1 -1
- package/public/assets/{download-C5M-xVQE.js → download-qgK3DePm.js} +1 -1
- package/public/assets/{external-link-DXCE8f-2.js → external-link-kSTql_zg.js} +1 -1
- package/public/assets/{file-text-FxjQforC.js → file-text-moi4pXOm.js} +1 -1
- package/public/assets/{git-fork-BnUjRz81.js → git-fork-FS4LqWZJ.js} +1 -1
- package/public/assets/index-CdJk2QGi.css +1 -0
- package/public/assets/index-DEBRwDiX.js +257 -0
- package/public/assets/{key-DORG2Bvk.js → key-CHc_t6rY.js} +1 -1
- package/public/assets/{loader-circle-Ce741dwH.js → loader-circle-BEHOzbAc.js} +1 -1
- package/public/assets/{pencil-C4ejRMe1.js → pencil-COk9Cf4n.js} +1 -1
- package/public/assets/{play-w6NUT3Ge.js → play-B8L-TpIA.js} +1 -1
- package/public/assets/{plus-CgnoWo2P.js → plus-Bh23dSc7.js} +1 -1
- package/public/assets/{rotate-ccw-DE82XdM1.js → rotate-ccw-CumxDFOW.js} +1 -1
- package/public/assets/{scroll-text-DAbRTvTk.js → scroll-text-yKGiDEH2.js} +1 -1
- package/public/assets/{settings-B6CvfGJs.js → settings-BZ99cVpB.js} +1 -1
- package/public/assets/{skip-forward-kX5fzSWO.js → skip-forward-YMw2gv4i.js} +1 -1
- package/public/assets/{status-colors-DTc6Ynln.js → status-colors-CpxhEwhO.js} +1 -1
- package/public/assets/{task-constants-DFxPkPUs.js → task-constants-BOIiRs7J.js} +1 -1
- package/public/assets/{task.store-VJg4-Qif.js → task.store-B7v0IyXP.js} +1 -1
- package/public/assets/timer--KEJmHJk.js +6 -0
- package/public/assets/{trash-2-BTUlSSX7.js → trash-2-CGFhXY_R.js} +1 -1
- package/public/assets/{useFetch-DLQT-fqN.js → useFetch-_325GIxD.js} +1 -1
- package/public/assets/{users-B6ZPxGEF.js → users-0IqI-VRX.js} +1 -1
- package/public/assets/{wifi-RZmzDeRm.js → wifi-DveQJnOv.js} +1 -1
- package/public/assets/{workflow-C1oJzdp3.js → workflow-BUUDFa4R.js} +1 -1
- package/public/assets/zap-D2T18qt7.js +6 -0
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AccessTokensPage-BSxprw7x.js +0 -1
- package/public/assets/BotIntegrationPage-DP1ipK65.js +0 -1
- package/public/assets/ConfirmStageDialog-rt45LR8Q.js +0 -12
- package/public/assets/DeveloperManage-Ab6SdQEz.js +0 -16
- package/public/assets/ProjectListPage-QM4505IY.js +0 -6
- package/public/assets/PtyTerminal-BxD1WFmu.js +0 -38
- package/public/assets/RemoveMemberConfirmDialog-pg5SnIU8.js +0 -6
- package/public/assets/ReviewAggregatePage-DHUyVVeT.js +0 -11
- package/public/assets/TaskListPage-CL98Ev5l.js +0 -1
- package/public/assets/TerminalHomePage-CgZYHN7Y.js +0 -6
- package/public/assets/TokenManage-BU8KbNvZ.js +0 -1
- package/public/assets/WorkerListPage-B4aOYXSX.js +0 -6
- package/public/assets/index-CTVNJXL0.js +0 -252
- package/public/assets/index-kJfGgL_V.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as r,o as e,
|
|
1
|
+
import{W as r,o as e,ab as s,ac as u,a7 as a}from"./index-DEBRwDiX.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as a,
|
|
1
|
+
import{o as a,Q as t}from"./index-DEBRwDiX.js";import{a as l}from"./agent-type-options-BBcV6_LY.js";const r=[a.COMPLETED,a.FAILED,a.CANCELLED],E=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],o=l(e=>e);[...o];function c(e){return(e??t.CLAUDE).toLowerCase()}export{r as T,E as a,c as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as i,h as c}from"./index-
|
|
1
|
+
import{n as i,h as c}from"./index-DEBRwDiX.js";const k=i((a,o)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async s=>{const t=o()._fetchTasksAbort;t&&t.abort();const e=new AbortController,n=o()._fetchTasksRequestId+1;a({loading:!0,error:null,_fetchTasksAbort:e,_fetchTasksRequestId:n});try{const r={};s!=null&&s.status&&(r.status=s.status),s!=null&&s.projectKey&&(r.projectKey=s.projectKey),s!=null&&s.developerId&&(r.developerId=s.developerId),s!=null&&s.cursor&&(r.cursor=s.cursor),s!=null&&s.limit&&(r.limit=String(s.limit));const l=await c.get("web/tasks",{searchParams:r,signal:e.signal}).json();if(o()._fetchTasksRequestId!==n)return;a({tasks:l.data,nextCursor:l.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;o()._fetchTasksRequestId===n&&a({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{o()._fetchTasksRequestId===n&&a({loading:!1,_fetchTasksAbort:null})}},fetchTask:async s=>{a({loading:!0,error:null});try{const t=await c.get(`web/tasks/${s}`).json();a({currentTask:t})}catch(t){a({error:t instanceof Error?t.message:"Failed to fetch task"})}finally{a({loading:!1})}},createTask:async s=>{a({error:null});try{const t=await c.post("web/tasks",{json:s}).json();return a(e=>({tasks:[t,...e.tasks]})),t}catch(t){throw a({error:t instanceof Error?t.message:"Failed to create task"}),t}},cancelTask:async s=>{a({error:null});try{await c.post(`web/tasks/${s}/cancel`);const{currentTask:t}=o();(t==null?void 0:t.id)===s&&await o().fetchTask(s)}catch(t){throw a({error:t instanceof Error?t.message:"Failed to cancel task"}),t}},reset:()=>{a({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}}));export{k as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as e}from"./index-DEBRwDiX.js";/**
|
|
2
|
+
* @license lucide-react v0.469.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const i=e("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);export{i as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-DEBRwDiX.js";function p(s,l){const[i,d]=e.useState(null),[R,a]=e.useState(!0),[m,o]=e.useState(null),f=e.useRef(s);f.current=s;const r=e.useRef(0),t=e.useRef(!0),u=e.useCallback(async()=>{const c=++r.current;a(!0),o(null);try{const n=await f.current();t.current&&c===r.current&&d(n)}catch(n){if(t.current&&c===r.current){const E=n instanceof Error?n.message:"An unexpected error occurred";o(E)}}finally{t.current&&c===r.current&&a(!1)}},l);return e.useEffect(()=>{u()},[u]),e.useEffect(()=>()=>{t.current=!1,r.current+=1},[]),{data:i,loading:R,error:m,refetch:u}}export{p as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as a}from"./index-DEBRwDiX.js";/**
|
|
2
|
+
* @license lucide-react v0.469.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const e=a("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);export{e as Z};
|
package/public/index.html
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
|
|
29
29
|
rel="stylesheet"
|
|
30
30
|
/>
|
|
31
|
-
<script type="module" crossorigin src="/assets/index-
|
|
32
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
31
|
+
<script type="module" crossorigin src="/assets/index-DEBRwDiX.js"></script>
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CdJk2QGi.css">
|
|
33
33
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
34
34
|
<body>
|
|
35
35
|
<div id="root"></div>
|
package/public/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const l=(l,
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const a=s=>l(s,r),o={module:{uri:r},exports:u,require:a};e[r]=Promise.all(i.map(s=>o[s]||a(s))).then(s=>(n(...s),u))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"85106b3e7b5ceba2a530eb884f646abc"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-D2T18qt7.js",revision:null},{url:"assets/workflow-BUUDFa4R.js",revision:null},{url:"assets/wifi-DveQJnOv.js",revision:null},{url:"assets/users-0IqI-VRX.js",revision:null},{url:"assets/useFetch-_325GIxD.js",revision:null},{url:"assets/trash-2-CGFhXY_R.js",revision:null},{url:"assets/timer--KEJmHJk.js",revision:null},{url:"assets/task.store-B7v0IyXP.js",revision:null},{url:"assets/task-constants-BOIiRs7J.js",revision:null},{url:"assets/status-colors-CpxhEwhO.js",revision:null},{url:"assets/skip-forward-YMw2gv4i.js",revision:null},{url:"assets/settings-BZ99cVpB.js",revision:null},{url:"assets/scroll-text-yKGiDEH2.js",revision:null},{url:"assets/rotate-ccw-CumxDFOW.js",revision:null},{url:"assets/plus-Bh23dSc7.js",revision:null},{url:"assets/play-B8L-TpIA.js",revision:null},{url:"assets/pencil-COk9Cf4n.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-BEHOzbAc.js",revision:null},{url:"assets/key-CHc_t6rY.js",revision:null},{url:"assets/index-DEBRwDiX.js",revision:null},{url:"assets/index-CdJk2QGi.css",revision:null},{url:"assets/git-fork-FS4LqWZJ.js",revision:null},{url:"assets/file-text-moi4pXOm.js",revision:null},{url:"assets/external-link-kSTql_zg.js",revision:null},{url:"assets/download-qgK3DePm.js",revision:null},{url:"assets/date-RFA7-ZGs.js",revision:null},{url:"assets/copy-Dz9BK4cr.js",revision:null},{url:"assets/clock-CPiGRQpX.js",revision:null},{url:"assets/circle-alert-Cb6RgYCQ.js",revision:null},{url:"assets/chevron-up-B2_M0Aou.js",revision:null},{url:"assets/chevron-right-BDlNEjPF.js",revision:null},{url:"assets/chevron-left-CWC7W_zG.js",revision:null},{url:"assets/chevron-down-D9VkxIPs.js",revision:null},{url:"assets/bot-CJ6g-CgU.js",revision:null},{url:"assets/arrow-right-DITZLrUG.js",revision:null},{url:"assets/arrow-left-BDjYIP3Y.js",revision:null},{url:"assets/agent-type-options-BBcV6_LY.js",revision:null},{url:"assets/WorkerSetupPage-B28GH43r.js",revision:null},{url:"assets/WorkerSetupGuidePage-DzTffG6n.js",revision:null},{url:"assets/WorkerOperationsPage-B9A7kFhI.js",revision:null},{url:"assets/WorkerListPage-zOEHoOtr.js",revision:null},{url:"assets/WorkerDetailPage-BaVeVMvg.js",revision:null},{url:"assets/TotpSetupPage-BzyS9OrP.js",revision:null},{url:"assets/Tooltip-3_9w-Oet.js",revision:null},{url:"assets/TokenManage-95LL4o8y.js",revision:null},{url:"assets/TerminalHomePage-BX-sHKXF.js",revision:null},{url:"assets/TaskStatusBadge-D5lVjwey.js",revision:null},{url:"assets/TaskListPage-C5tAOuSG.js",revision:null},{url:"assets/TaskGuidePage-CQAlhXHL.js",revision:null},{url:"assets/TaskDetailPage-DPdD57PF.js",revision:null},{url:"assets/SkillPage-BqTTImpe.js",revision:null},{url:"assets/Skeleton-DMVGjH__.js",revision:null},{url:"assets/SettingsPage-nA4hlLlN.js",revision:null},{url:"assets/Select-Bxil-UGQ.js",revision:null},{url:"assets/ReviewPage-Bde6YvIA.js",revision:null},{url:"assets/ReviewAggregatePage-B1SB4rXq.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-gr2WUWrR.js",revision:null},{url:"assets/QuickAuth-DAPeXfQS.js",revision:null},{url:"assets/PtyTerminal-DCbNmuIT.js",revision:null},{url:"assets/PtyTerminal-6GBZ9nXN.css",revision:null},{url:"assets/ProjectListPage-Ccrl3DtV.js",revision:null},{url:"assets/ProjectDetailPage-C8v5ztXD.js",revision:null},{url:"assets/ProfilePage-Dk-XPfIf.js",revision:null},{url:"assets/PlanPage-Mu6msPek.js",revision:null},{url:"assets/PipelineEditorPage-DhS-VBVt.js",revision:null},{url:"assets/PipelineConfigPage-Bzm1MeK0.js",revision:null},{url:"assets/PermissionsPage-BGlc6yU2.js",revision:null},{url:"assets/OnboardingGuide-xLqRqP0t.js",revision:null},{url:"assets/NotFoundPage-CDaJI7W_.js",revision:null},{url:"assets/MetricBar-CuVoQPXf.js",revision:null},{url:"assets/LoginPage-hEkjuwQp.js",revision:null},{url:"assets/LocalDevelopmentPage-CEhJ10RY.js",revision:null},{url:"assets/LandingPage-XfW3mTgR.js",revision:null},{url:"assets/InstallationPage-5aHtmv3w.js",revision:null},{url:"assets/InfoRow-BkLVrW3X.js",revision:null},{url:"assets/HomePage-BA8S5QIk.js",revision:null},{url:"assets/EnvVariablesPage-By_n8jC_.js",revision:null},{url:"assets/EmptyState-CM34MS8q.js",revision:null},{url:"assets/EditProjectPage-CSv1LQ0c.js",revision:null},{url:"assets/DocsPrimitives-DStFX1T8.js",revision:null},{url:"assets/DocsLayout-VgiIORoW.js",revision:null},{url:"assets/DocsIndexPage-BQJNEB0T.js",revision:null},{url:"assets/DeveloperSetupPage-B099stPW.js",revision:null},{url:"assets/DeveloperManage-CwH2nj3C.js",revision:null},{url:"assets/DevWorkflowPage-B1T1aB-L.js",revision:null},{url:"assets/DeploymentPage-DqYVYlM2.js",revision:null},{url:"assets/ConfirmStageDialog-Bke18NAb.js",revision:null},{url:"assets/CliReferencePage-wbYT0YSP.js",revision:null},{url:"assets/ChangelogPage-BpJdCfIe.js",revision:null},{url:"assets/BotSetupPage-B2TIppqV.js",revision:null},{url:"assets/BotManage-CW08edmX.js",revision:null},{url:"assets/BotIntegrationPage-DW13UERh.js",revision:null},{url:"assets/BindPlatformPage-DS1eO2Me.js",revision:null},{url:"assets/AutomationRunDetailPage-DYpv-WBg.js",revision:null},{url:"assets/AutomationListPage-sjxnTqLB.js",revision:null},{url:"assets/AutomationEditPage-C7hl6YxI.js",revision:null},{url:"assets/AutomationDetailPage-C8GfVtsX.js",revision:null},{url:"assets/AutomationCreatePage-CbGNlXYx.js",revision:null},{url:"assets/AuditLogPage-BuiWgzsv.js",revision:null},{url:"assets/ArchitecturePage-D-0d-kgA.js",revision:null},{url:"assets/ApiReferencePage-NaJYMeTA.js",revision:null},{url:"assets/AgentCliPage-BcDXV12E.js",revision:null},{url:"assets/AdminPage-BResRWph.js",revision:null},{url:"assets/AccessTokensPage-BYuGmkhG.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"e3100788a89f54481dbd663d57df57a6"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as _,r as c,j as e,h as k,s as C,v as T,B as S,a0 as A,a2 as f,t as g}from"./index-CTVNJXL0.js";import{S as D}from"./Select-DYnPuPlP.js";import{E}from"./EmptyState-BIXXLer_.js";import{T as L}from"./Skeleton-tFvClhRo.js";import{t as N}from"./date-RFA7-ZGs.js";import{u as I}from"./useFetch-DLQT-fqN.js";import{P as R}from"./plus-CgnoWo2P.js";import{C as O}from"./copy-Ciibu4ij.js";import{T as w}from"./trash-2-BTUlSSX7.js";import"./chevron-down-pInOI1Sz.js";function P({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_(),[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function h(){o(""),n("never"),l(""),u()}async function b(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:h}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&b()},className:"w-full 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)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(D,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:b,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function V({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(C,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function J(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:h}=I(()=>k.get("web/profile/tokens").json(),[]);T(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function b(t){i(!1),d(t.token),x(!1),h()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),h()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(S,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:3})}):!l||l.length===0?e.jsx(E,{icon:A,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[100px] md:max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(P,{isOpen:u,onClose:()=>i(!1),onCreated:b}),e.jsx(V,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./index-CTVNJXL0.js";function t(){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:"// bot integration"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"advanced bot integration topics — interactive cards, troubleshooting, and the adapter pattern. for initial bot setup (lark, slack), see the bot setup guide."})]}),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-4",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> interactive cards"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a pipeline reaches a stage that requires user input, the bot sends an interactive card. there are three card modes:"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"confirm mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when a stage needs explicit approval before proceeding. the card shows a summary of what will happen and two buttons:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] pl-4",children:[e.jsxs("li",{children:["- ",e.jsx("span",{className:"text-[var(--accent)]",children:"confirm"})," — advance the pipeline to the next stage"]}),e.jsxs("li",{children:["- ",e.jsx("span",{className:"text-[var(--accent)]",children:"cancel"})," — abort the pipeline"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: a deploy stage waiting for human sign-off before pushing to production. the bot updates the card in-place after the user responds, replacing the buttons with the outcome."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"choice mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when the pipeline branches and the user must pick one of several options. each option is rendered as a button. the selected option determines which branch the pipeline follows."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: choosing a deploy target (staging / production / canary) mid-pipeline."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"input mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when the pipeline needs free-form text input from the user. the bot sends a card with a link to the web dashboard where the user submits their input. the submitted value is injected into the pipeline context as a variable."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: providing a hotfix version number or a rollback reason."})]})]}),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:"> card lifecycle"}),e.jsxs("div",{className:"space-y-2 text-xs text-[var(--text-secondary)]",children:[e.jsx("p",{children:"1. bot sends the card when the stage starts"}),e.jsx("p",{children:"2. card remains active until a user responds or the stage times out (default: 10 minutes)"}),e.jsx("p",{children:"3. on response, the bot updates the card to show the result and the pipeline continues"}),e.jsx("p",{children:"4. if the stage times out, the card is updated with a timeout message and the pipeline follows the timeout path (fail or fallback)"})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"only users with the appropriate project role can interact with cards. unauthorized clicks return an ephemeral error."})]}),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:"> notification routing"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a task progresses through its lifecycle, the bot sends notifications to relevant parties. routing depends on who created the task and who is assigned to execute it."}),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:"event"}),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:"executor"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"creator (if ≠)"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"project chats"})]})}),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:"assigned"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"running"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"stage_changed"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"completed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"}),e.jsx("td",{className:"py-2",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"failed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"cancelled"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"suspended"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"resumed"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"stage_confirm_required"}),e.jsx("td",{className:"py-2 pr-4",children:"new dm"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm only)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]})]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"creator = executor"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"intermediate updates (assigned, running, stage changes) update the original task card in-place. important events (completed, failed, cancelled, suspended) send a new message. stage confirmation requests are always sent as a dm."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"creator ≠ executor"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a task is assigned to another developer via @mention, the executor receives all notifications via dm. the creator only receives completed and failed notifications in the source chat. stage confirmations go exclusively to the executor."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"stage confirmation timeout"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"if the executor does not respond to a stage confirmation within 10 minutes, the task is automatically marked as failed with a timeout error."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"web-created tasks"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"tasks created via the web dashboard also receive DM notifications if the developer has linked their Lark or Slack account. both in-app (bell icon) and platform DM notifications are delivered."})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"if the target developer has not linked their platform account, notifications fall back to the web dashboard's in-app notification system."})]}),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:"> plan and review commands"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["in addition to ",e.jsx("span",{className:"text-[var(--accent)]",children:"develop"})," and ",e.jsx("span",{className:"text-[var(--accent)]",children:"fork"}),", the bot supports two higher-level commands:"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"plan"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["starts an interactive planning session where an ai agent reads the project codebase, discusses requirements with you, and produces a spec document saved to the project repository. use ",e.jsx("span",{className:"text-[var(--accent)]",children:"--project KEY"})," to specify the target project."]}),e.jsx("code",{className:"block text-xs text-[var(--text-secondary)] bg-[var(--bg-primary)] rounded-[4px] px-3 py-2",children:'@bot plan "implement user authentication system" --project WEB'})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"review"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"triggers cross-model code review on a completed develop task. each specified agent runs a parallel review task and produces a structured report. only completed develop tasks can be reviewed."}),e.jsx("code",{className:"block text-xs text-[var(--text-secondary)] bg-[var(--bg-primary)] rounded-[4px] px-3 py-2",children:"@bot review #42 --agent codex,cursor"})]})]})]}),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:"> troubleshooting"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"common issues when running bots in production:"}),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:"symptom"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"cause"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"fix"})]})}),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:"bot doesn't respond to mentions"}),e.jsx("td",{className:"py-2 pr-4",children:"webhook url not reachable"}),e.jsx("td",{className:"py-2",children:"verify the url is publicly accessible and returns 200 to the platform's verification challenge"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"401 on webhook"}),e.jsx("td",{className:"py-2 pr-4",children:"wrong verification token / signing secret"}),e.jsx("td",{className:"py-2",children:"check webhooktoken matches the platform's verification token (lark) or signing secret (slack)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"commands work but no cards"}),e.jsx("td",{className:"py-2 pr-4",children:"missing card event subscription"}),e.jsx("td",{className:"py-2",children:"lark: set callback configuration request url to your webhook url. slack: enable interactivity and set the interact url"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"user not found error"}),e.jsx("td",{className:"py-2 pr-4",children:"developer account not linked"}),e.jsx("td",{className:"py-2",children:"set platform_uid on the developer record to their platform user id"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"bot responds in wrong project"}),e.jsx("td",{className:"py-2 pr-4",children:"chat group bound to wrong project"}),e.jsx("td",{className:"py-2",children:"update the binding via admin - bot management or the bindings api"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"duplicate messages"}),e.jsx("td",{className:"py-2 pr-4",children:"multiple bot instances handling same event"}),e.jsx("td",{className:"py-2",children:"ensure only one overlord instance processes webhooks, or use the built-in dedup"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"card buttons do nothing"}),e.jsx("td",{className:"py-2 pr-4",children:"interact url misconfigured"}),e.jsx("td",{className:"py-2",children:"slack: check interactivity request url. lark: check card action callback url"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"/overlord slash command 404"}),e.jsx("td",{className:"py-2 pr-4",children:"command url wrong"}),e.jsx("td",{className:"py-2",children:"verify the slash command request url matches your-server/webhook/slack/commands"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"bot stops responding after deploy"}),e.jsx("td",{className:"py-2 pr-4",children:"webhook url changed"}),e.jsx("td",{className:"py-2",children:"update the request url in the platform's app settings to match the new server address"})]})]})]})})]}),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:"> adapter pattern"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the bot system uses an adapter pattern internally. each platform (lark, slack, discord) implements an adapter interface:"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"handleWebhook(req)"}),e.jsx("span",{children:"— receive platform events, verify signatures, parse into commands"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"sendMessage(chatId, content)"}),e.jsx("span",{children:"— send messages (text or cards)"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"updateMessage(msgId, content)"}),e.jsx("span",{children:"— update existing messages (progress updates)"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"resolveUser(platformUid)"}),e.jsx("span",{children:"— map platform user id to overlord developer"})]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"to add a custom platform adapter, implement the interface and register it in the bot service config. see the lark and slack adapters in the codebase for reference."})]}),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:"> multi-bot architecture"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"overlord supports multiple bot instances across different platforms simultaneously. each project or group can have its own bot. all bots share the same overlord backend."}),e.jsxs("div",{className:"space-y-2 text-xs text-[var(--text-secondary)]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"lark"})," — single webhook url (/webhook/lark), bot identified by app_id in the request payload"]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"slack"})," — separate endpoints for events, interactivity, and commands (/webhook/slack/events, /webhook/slack/interact, /webhook/slack/commands), bot identified by app_id in the request headers"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"you can run multiple bots on the same platform (e.g., one slack bot per team) by registering each with a unique app id. a discord adapter is planned for a future release."})]})]})]})}export{t as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{c as O,r as c,a as P,j as s,F as Q,I as Z,n as I,u as $,h as H,J as ee,M as te}from"./index-CTVNJXL0.js";import{L as ne}from"./loader-circle-Ce741dwH.js";import{R as re}from"./rotate-ccw-DE82XdM1.js";import{a as se,P as G}from"./PtyTerminal-BxD1WFmu.js";import{a as ae}from"./date-RFA7-ZGs.js";import{F as oe}from"./file-text-FxjQforC.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ce=O("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
7
|
-
* @license lucide-react v0.469.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const V=O("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]),F="claude";function Ne(t){if(t.agentType)return t.agentType;if(!t.configSnapshot)return F;try{const n=JSON.parse(t.configSnapshot);return typeof n.agentType=="string"&&n.agentType?n.agentType:F}catch{return F}}const ie=768,X=`(max-width: ${ie-1}px)`;function U(){const[t,n]=c.useState(()=>typeof window>"u"?!1:window.matchMedia(X).matches);return c.useEffect(()=>{const e=window.matchMedia(X);n(e.matches);const r=a=>n(a.matches);return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),t}function le({state:t,onRelease:n,onRequestTakeover:e,denialReason:r,retryAttempt:a=1,maxRetries:o=3}){const{t:l}=P(),[i,u]=c.useState(!0);return c.useEffect(()=>{u(!0)},[t]),i?s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[t==="auto"&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{className:"h-3 w-3 text-[var(--accent)]"}),s.jsx("span",{className:"text-[11px] font-medium text-[var(--accent)]",children:l("tasks.auto_pipeline")})]}),t==="requesting"&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{className:"h-3 w-3 animate-spin text-amber-500"}),s.jsx("span",{className:"text-[11px] font-medium text-amber-500",children:l("tasks.requesting_takeover")})]}),t==="manual"&&s.jsxs(s.Fragment,{children:[s.jsx(V,{className:"h-3 w-3 text-amber-500"}),s.jsx("span",{className:"text-[11px] font-medium text-amber-500",children:l("tasks.manual_takeover")})]}),t==="denied"&&s.jsxs("div",{className:"flex items-center gap-1.5 rounded-[4px] border border-red-900 bg-red-950 px-2.5 py-1",children:[s.jsx(Z,{className:"h-3 w-3 text-red-500"}),s.jsxs("span",{className:"text-[11px] font-medium text-red-500",children:[l("tasks.takeover_denied"),r?`: ${r}`:""]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[(t==="auto"||t==="denied")&&e&&s.jsx("button",{type:"button",onClick:e,className:"inline-flex items-center rounded-[4px] border border-[var(--border)] p-1.5 text-amber-500 hover:bg-white/5","aria-label":l("tasks.take_over"),children:s.jsx(V,{className:"h-3.5 w-3.5"})}),t==="manual"&&n&&s.jsx("button",{type:"button",onClick:n,className:"inline-flex items-center rounded-[4px] bg-[var(--accent)] p-1.5","aria-label":l("tasks.restore_auto"),children:s.jsx(re,{className:"h-3.5 w-3.5 text-black"})})]})]}):null}function ue({value:t,onChange:n,onSubmit:e,isMobile:r=!1,inputDisabled:a=!1,sendDisabled:o=!1}){function l(i){i.preventDefault(),!o&&e()}return s.jsxs("form",{onSubmit:l,className:"flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-2",children:[s.jsx("textarea",{value:t,onChange:i=>n(i.target.value),rows:r?3:4,spellCheck:!1,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",placeholder:"type a command...",disabled:a,className:"min-h-20 resize-none rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-2 font-mono text-xs text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:opacity-60"}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsx("button",{type:"submit",disabled:o,className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black disabled:cursor-not-allowed disabled:opacity-60",children:"send"})})]})}const z=new Map;function W(t){const n=(z.get(t)??0)+1;return z.set(t,n),n}function de(){for(const[t,n]of z.entries())z.set(t,n+1)}function Y(t,n){return z.get(t)===n}const A=I((t,n)=>({connections:new Map,statuses:new Map,connect:async(e,r,a)=>{const o=W(e),l=n().connections.get(e);l&&(l.dispose(),t(v=>{const d=new Map(v.connections);d.delete(e);const h=new Map(v.statuses);return h.delete(e),{connections:d,statuses:h}}));const i=$.getState().accessToken;if(!i)throw new Error("Not authenticated");const{channelToken:u}=await H.post(`web/tasks/${e}/pty-token`).json(),x=async()=>(await H.post(`web/tasks/${e}/pty-token`).json()).channelToken,b=new se({taskId:e,accessToken:i,channelToken:u,getChannelToken:x,getAccessToken:()=>$.getState().accessToken,onData:r,onMessage:a,onStatus:v=>{Y(e,o)&&t(d=>{if(d.statuses.get(e)===v)return d;const h=new Map(d.statuses);return h.set(e,v),{statuses:h}})}});if(!Y(e,o)){b.dispose();return}t(v=>{const d=new Map(v.connections);return d.set(e,b),{connections:d}}),b.connect()},disconnect:e=>{W(e);const r=n().connections.get(e);r&&(r.dispose(),t(a=>{const o=new Map(a.connections);o.delete(e);const l=new Map(a.statuses);return l.delete(e),{connections:o,statuses:l}}))},write:(e,r)=>{var a;(a=n().connections.get(e))==null||a.sendData(r)},resize:(e,r,a)=>{var o;(o=n().connections.get(e))==null||o.sendResize(r,a)},requestTakeover:(e,r)=>{var a;(a=n().connections.get(e))==null||a.requestTakeover(r)},releaseTakeover:e=>{var r;(r=n().connections.get(e))==null||r.releaseTakeover()},forceTakeover:e=>{var r;(r=n().connections.get(e))==null||r.send({type:"force_takeover"})},disconnectAll:()=>{de();for(const e of n().connections.values())e.dispose();t({connections:new Map,statuses:new Map})}})),K="\x1B",fe=new Set(["h","l"]),xe=new Set(["1049","1047","47"]);function J(){return{visibleText:"",inAlternateScreen:!1,fullscreenTuiDetected:!1,pendingControlSequence:""}}function pe(t,n){const e=me(t.pendingControlSequence+n),r=(t.visibleText+e.visibleText).slice(-12e4);let a=t.inAlternateScreen,o=t.fullscreenTuiDetected;for(const l of e.alternateScreenTransitions)a=l==="enter",l==="enter"&&(o=!0);return{visibleText:r,inAlternateScreen:a,fullscreenTuiDetected:o,pendingControlSequence:e.pendingControlSequence}}function me(t){let n="";const e=[];let r="";for(let a=0;a<t.length;){const o=t[a];if(o!==K){o!=="\r"&&o!=="\x07"&&(n+=o),a+=1;continue}if(a===t.length-1){r=t.slice(a);break}const l=t[a+1];if(l==="["){const u=be(t,a+2);if(u===-1){r=t.slice(a);break}const x=t.slice(a,u+1),b=we(x);b&&e.push(b),a=u+1;continue}if(l==="]"){const u=ve(t,a+2);if(u===-1){r=t.slice(a);break}a=u+1;continue}const i=he(t,a+1);if(i===-1){r=t.slice(a);break}a=i+1}return{visibleText:n,alternateScreenTransitions:e,pendingControlSequence:r}}function be(t,n){let e=n;for(;e<t.length;){const r=t.charCodeAt(e);if(r>=64&&r<=126)return e;if(r>=48&&r<=63||r>=32&&r<=47){e+=1;continue}return-1}return-1}function ve(t,n){for(let e=n;e<t.length;e+=1){if(t[e]==="\x07")return e;if(t[e]===K&&t[e+1]==="\\")return e+1}return-1}function he(t,n){let e=n;for(;e<t.length;){const r=t.charCodeAt(e);if(r>=48&&r<=126)return e;if(r>=32&&r<=47){e+=1;continue}return-1}return-1}function we(t){if(!t.startsWith("\x1B[?"))return null;const n=t.at(-1);if(!n||!fe.has(n))return null;const e=t.slice(3,-1);return xe.has(e)?n==="h"?"enter":"exit":null}const ge=c.forwardRef(function({taskId:n,taskFinished:e=!1,onOpenFullTerminal:r,onStatusChange:a,onTakeoverChange:o},l){const i=U(),{t:u}=P(),x=A(p=>p.connect),b=A(p=>p.disconnect),v=A(p=>p.write),d=A(p=>p.forceTakeover),h=A(p=>p.releaseTakeover),y=A(p=>p.statuses.get(n)),[k,S]=c.useState(""),[N,C]=c.useState(J()),[j,w]=c.useState("auto"),[g,f]=c.useState();c.useEffect(()=>{S(""),C(J()),w("auto"),f(void 0)},[n]),c.useEffect(()=>{e&&(w("auto"),f(void 0))},[e]),c.useEffect(()=>{a==null||a(y??"disconnected")},[a,y]),c.useEffect(()=>{o==null||o(j)},[o,j]),c.useEffect(()=>{if(e)return;let p=!0,q,m=0;const T=5,B=()=>{x(n,D=>{p&&C(L=>pe(L,D))},D=>{if(!p)return;const L=D;switch(L.type){case"takeover_granted":w("manual"),f(void 0);break;case"takeover_denied":w("denied"),f(L.reason??L.message);break;case"writer_revoked":w("auto"),f(void 0);break}}).catch(()=>{if(p&&m<T){const D=Math.min(3e3*2**m,3e4);m++,q=setTimeout(B,D)}})};return B(),()=>{p=!1,q&&clearTimeout(q),b(n)}},[x,b,e,n]);const _=y==="connected"&&j==="manual",E=c.useCallback(()=>{_&&(v(n,`${k}
|
|
12
|
-
`),S(""))},[k,_,n,v]),M=c.useCallback(()=>{w("requesting"),f(void 0),d(n)},[d,n]),R=c.useCallback(()=>{h(n),w("auto"),f(void 0)},[h,n]);return c.useImperativeHandle(l,()=>({requestTakeover:M,releaseTakeover:R}),[R,M]),s.jsxs("div",{"data-testid":"companion-terminal",className:"flex h-full min-h-0 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono text-xs text-[var(--text-primary)]",children:[s.jsx(le,{state:j,onRequestTakeover:e?void 0:M,onRelease:e?void 0:R,denialReason:g}),s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:[r&&s.jsx("div",{className:"mb-3 flex justify-end",children:s.jsx("button",{type:"button",onClick:r,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-primary)] hover:bg-white/5",children:u("tasks.full_terminal")})}),N.fullscreenTuiDetected&&s.jsx("div",{className:"mb-3 rounded-[4px] border border-amber-900 bg-amber-950/40 px-3 py-2 text-[11px] text-amber-300",children:u("tasks.complex_terminal_hint")}),s.jsx("pre",{"data-testid":"companion-terminal-output","aria-label":"terminal output",className:"min-h-[120px] overflow-auto whitespace-pre-wrap break-words rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 text-[12px] leading-5 text-[var(--text-primary)]",children:N.visibleText||u("tasks.no_output")})]}),s.jsx("div",{className:"shrink-0 border-t border-[var(--border)] p-3",children:s.jsx(ue,{value:k,onChange:S,onSubmit:E,isMobile:i,inputDisabled:e,sendDisabled:e||!_})})]})}),Ee=c.forwardRef(function({taskId:n,sessionId:e,taskFinished:r,onStatusChange:a,onTakeoverChange:o},l){const i=U(),{t:u}=P(),[x,b]=c.useState("companion"),[v,d]=c.useState(!1),[h,y]=c.useState("disconnected"),[k,S]=c.useState("auto"),[N,C]=c.useState("disconnected"),[j,w]=c.useState("auto"),[g,f]=c.useState(null),_=c.useRef(null),E=c.useRef(null);c.useEffect(()=>{b("companion"),d(!1),y("disconnected"),S("auto"),C("disconnected"),w("auto"),f(null)},[n]);const M=x==="full"?N:h,R=x==="full"?j:k;c.useEffect(()=>{i&&(a==null||a(M))},[M,i,a]),c.useEffect(()=>{i&&(o==null||o(R))},[R,i,o]),c.useEffect(()=>{var m,T;if(!(!i||!g)){if(g==="full"){if(N!=="connected")return;(m=E.current)==null||m.requestTakeover(),f(null);return}h==="connected"&&((T=_.current)==null||T.requestTakeover(),f(null))}},[h,N,i,g]);const p=c.useCallback(()=>{var m;k==="manual"&&((m=_.current)==null||m.releaseTakeover(),f("full")),d(!0),b("full")},[k]),q=c.useCallback(()=>{var m;j==="manual"&&((m=E.current)==null||m.releaseTakeover(),f("companion")),b("companion")},[j]);return c.useImperativeHandle(l,()=>({requestTakeover(){var m,T;if(!i||x==="full"){(m=E.current)==null||m.requestTakeover();return}(T=_.current)==null||T.requestTakeover()},releaseTakeover(){var m,T;if(!i||x==="full"){(m=E.current)==null||m.releaseTakeover();return}(T=_.current)==null||T.releaseTakeover()}}),[i,x]),i?s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2 overflow-hidden",children:[x==="full"&&s.jsx("button",{type:"button",onClick:q,className:"self-start rounded-[4px] border border-[var(--border)] px-3 py-2 text-[11px] text-[var(--text-primary)]",children:u("tasks.return_to_companion")}),s.jsx("div",{className:x==="companion"?"min-h-0 flex-1 overflow-hidden":"hidden",children:s.jsx(ge,{ref:_,taskId:n,taskFinished:r,onOpenFullTerminal:p,onStatusChange:y,onTakeoverChange:S})}),v&&s.jsx("div",{className:x==="full"?"min-h-0 flex-1 overflow-hidden":"hidden",children:s.jsx(G,{ref:E,taskId:n,sessionId:e,taskFinished:r,onStatusChange:C,onTakeoverChange:w})})]}):s.jsx(G,{ref:E,taskId:n,sessionId:e,taskFinished:r,onStatusChange:a,onTakeoverChange:o})});function Ce({isOpen:t,onClose:n,taskId:e,stageName:r,timeoutSeconds:a,confirmType:o="confirm",onSubmitted:l}){const{t:i}=P(),[u,x]=c.useState(a),[b,v]=c.useState(!1),[d,h]=c.useState(""),y=o==="plan_review"||o==="code_review",k=o==="plan_decompose";c.useEffect(()=>{if(!t)return;x(a),h("");const g=setInterval(()=>{x(f=>f<=1?(clearInterval(g),0):f-1)},1e3);return()=>clearInterval(g)},[t,a]),c.useEffect(()=>{u===0&&t&&n()},[u,t,n]);const S=c.useCallback(async g=>{v(!0);try{const f={stageName:r,approved:g};y&&!k&&d.trim()&&(f.feedback=d.trim()),await H.post(`web/tasks/${e}/confirm-stage`,{json:f}),l==null||l(),n()}catch{}finally{v(!1)}},[e,r,d,y,k,n,l]);if(!t)return null;const N=o==="plan_review"||o==="plan_decompose"?oe:o==="code_review"?ee:te,C=o==="plan_review"?i("tasks.plan_review_message",{name:r}):o==="plan_decompose"?i("tasks.plan_decompose_message"):o==="code_review"?i("tasks.code_review_message",{name:r}):i("tasks.confirm_stage_message",{name:r}),j=i(o==="plan_review"?"tasks.approve_plan":o==="plan_decompose"?"tasks.approve_plan_decompose":o==="code_review"?"tasks.approve_review":"tasks.confirm_and_proceed"),w=i(o==="plan_decompose"?"tasks.reject_plan_decompose":y?"tasks.request_changes":"tasks.reject");return s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[s.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),s.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N,{className:"h-4 w-4 text-[var(--accent)]"}),s.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// stage: ",r]})]}),a>0&&s.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--text-muted)]",children:[s.jsx(ce,{className:"h-3.5 w-3.5"}),ae(u)]})]}),s.jsxs("div",{className:"space-y-4 px-5 py-5",children:[s.jsx("p",{className:"whitespace-pre-wrap text-xs text-[var(--text-primary)]",children:C}),y&&!k&&s.jsx("textarea",{className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none resize-y",rows:4,placeholder:i("tasks.feedback_placeholder"),value:d,onChange:g=>h(g.target.value)})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[s.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:b,onClick:()=>S(!1),children:w}),s.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:b,onClick:()=>S(!0),children:b?i("tasks.stage_submitting"):j})]})]})]})}export{ce as C,V as H,Ee as M,Ce as a,Ne as g,U as u};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as X,D as S,a as E,r as o,j as e,X as L,h as C,u as F,w as H,a6 as k}from"./index-CTVNJXL0.js";import{S as V}from"./Select-DYnPuPlP.js";import{v as B}from"./password-CHk45-jw.js";import{E as J}from"./EmptyState-BIXXLer_.js";import{T as K}from"./Skeleton-tFvClhRo.js";import{u as Q}from"./useFetch-DLQT-fqN.js";import{c as O}from"./status-colors-DTc6Ynln.js";import{P as W}from"./plus-CgnoWo2P.js";import{U as Y}from"./users-B6ZPxGEF.js";import{P as Z}from"./pencil-C4ejRMe1.js";import{R as ee}from"./rotate-ccw-DE82XdM1.js";import"./chevron-down-pInOI1Sz.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const te=X("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
7
|
-
* @license lucide-react v0.469.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const ae=X("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
|
|
12
|
-
* @license lucide-react v0.469.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const re=X("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]),q=Object.values(S).map(a=>({value:a,label:a}));function se({isOpen:a,onClose:r,onCreated:n}){const{t:l}=E(),[s,i]=o.useState(""),[m,u]=o.useState(""),[p,b]=o.useState(""),[c,v]=o.useState(""),[h,y]=o.useState("developer"),[f,t]=o.useState(!1),[j,g]=o.useState("");function D(){i(""),u(""),b(""),v(""),y("developer"),g("")}function N(){D(),r()}async function U(){if(g(""),!s.trim()||!m.trim()||!p.trim()||!c.trim()){g(l("admin.all_fields_required"));return}const x=B(c);if(x){g(l(x));return}try{t(!0),await C.post("admin/developers",{json:{name:s.trim(),gitName:m.trim(),gitEmail:p.trim(),password:c,role:h}}).json(),N(),n()}catch(T){const A=T instanceof Error?T.message:l("admin.failed_to_create_developer");g(A)}finally{t(!1)}}return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:N}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// ",l("admin.create_developer_title")]}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:N,children:e.jsx(L,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[j&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:j}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:l("admin.username")}),e.jsx("input",{type:"text",placeholder:"e.g. jdoe",value:s,onChange:x=>i(x.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:l("profile.git_name")}),e.jsx("input",{type:"text",placeholder:"e.g. John Doe",value:m,onChange:x=>u(x.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:l("profile.git_email")}),e.jsx("input",{type:"email",placeholder:"e.g. john@example.com",value:p,onChange:x=>b(x.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:l("auth.password")}),e.jsx("input",{type:"password",placeholder:"10-20 chars, letters + digits + special",value:c,onChange:x=>v(x.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:l("admin.password_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:l("common.role")}),e.jsx(V,{value:h,onChange:y,options:q})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:N,children:l("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:f,onClick:U,children:l(f?"common.creating":"common.create")})]})]})]}):null}function ne({isOpen:a,developer:r,onClose:n,onUpdated:l}){var M,z;const{t:s}=E(),i=F(d=>d.user),[m,u]=o.useState(r.name),[p,b]=o.useState(r.gitName),[c,v]=o.useState(r.gitEmail),[h,y]=o.useState(r.role),[f,t]=o.useState(((M=r.platformUids)==null?void 0:M.lark)??""),[j,g]=o.useState(((z=r.platformUids)==null?void 0:z.slack)??""),[D,N]=o.useState(!1),[U,x]=o.useState(""),A=r.id===(i==null?void 0:i.id)&&r.role===S.ADMIN&&h!==S.ADMIN;o.useEffect(()=>{var d,w;u(r.name),b(r.gitName),v(r.gitEmail),y(r.role),t(((d=r.platformUids)==null?void 0:d.lark)??""),g(((w=r.platformUids)==null?void 0:w.slack)??""),x("")},[r]);async function G(){var d,w;if(x(""),!m.trim()||!p.trim()||!c.trim()){x(s("admin.all_fields_required"));return}A&&x(s("admin.demote_self_warning"));try{N(!0);const _={name:m.trim(),gitName:p.trim(),gitEmail:c.trim(),role:h},I=((d=r.platformUids)==null?void 0:d.lark)??"",$=((w=r.platformUids)==null?void 0:w.slack)??"";if(f.trim()!==I||j.trim()!==$){const R={};R.lark=f.trim(),R.slack=j.trim(),_.platformUids=R}await C.put(`admin/developers/${r.id}`,{json:_}).json(),n(),l()}catch(_){const I=_ instanceof Error?_.message:s("admin.failed_to_update_developer");x(I)}finally{N(!1)}}return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:n}),e.jsxs("div",{className:"relative z-10 mx-2 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// ",s("admin.edit_developer_title")]}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:n,children:e.jsx(L,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[U&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:U}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.username")}),e.jsx("input",{type:"text",value:m,onChange:d=>u(d.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("profile.git_name")}),e.jsx("input",{type:"text",value:p,onChange:d=>b(d.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("profile.git_email")}),e.jsx("input",{type:"email",value:c,onChange:d=>v(d.target.value),className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("common.role")}),e.jsx(V,{value:h,onChange:y,options:q}),A&&e.jsx("div",{className:"mt-2 rounded-[4px] border border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2 text-xs text-[var(--warning)]",children:s("admin.demote_self_inline_warning")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.platform_accounts")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-muted)]",children:s("admin.lark_uid")}),e.jsx("input",{type:"text",value:f,onChange:d=>t(d.target.value),placeholder:"ou_xxxxxxxxxx",className:"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)] focus:outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-muted)]",children:s("admin.slack_uid")}),e.jsx("input",{type:"text",value:j,onChange:d=>g(d.target.value),placeholder:"U0XXXXXXXXX",className:"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)] focus:outline-none focus:border-[var(--accent)]"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:n,children:s("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:D,onClick:G,children:s(D?"common.saving":"common.save_changes")})]})]})]}):null}function oe({isOpen:a,developer:r,onClose:n,onConfirmed:l}){const{t:s}=E(),[i,m]=o.useState(!1),[u,p]=o.useState("");async function b(){p("");try{m(!0),await C.put(`admin/developers/${r.id}/reset-totp`),n(),l()}catch(c){const v=c instanceof Error?c.message:s("admin.failed_to_reset_2fa");p(v)}finally{m(!1)}}return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:n}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4 text-yellow-400"}),e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// ",s("admin.reset_2fa")]})]}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:n,children:e.jsx(L,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-3 px-5 py-5",children:[u&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:u}),e.jsxs("p",{className:"text-xs text-[var(--text-primary)]",children:[s("admin.reset_2fa_confirm_message")," ",e.jsx("span",{className:"text-[var(--accent)]",children:r.name}),"?"]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.reset_2fa_audit_note")})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:n,children:s("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-yellow-600 px-3 py-1.5 text-xs text-white hover:opacity-90 transition-opacity disabled:opacity-50",disabled:i,onClick:b,children:s(i?"admin.resetting":"admin.reset_2fa")})]})]})]}):null}function P({dev:a,currentUserId:r,onEdit:n,onReset2fa:l,onToggleStatus:s}){const{t:i}=E();return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:i("common.edit"),onClick:()=>n(a),children:e.jsx(Z,{className:"h-3.5 w-3.5"})}),a.id!==r&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:i("admin.reset_2fa"),onClick:()=>l(a),children:e.jsx(ee,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:`rounded-[4px] p-2.5 md:p-1.5 transition-colors hover:bg-white/[0.05] ${a.status===k.ACTIVE?"text-red-400 hover:text-red-300":"text-green-400 hover:text-green-300"}`,title:a.status===k.ACTIVE?i("admin.deactivate"):i("admin.activate"),onClick:()=>s(a),children:a.status===k.ACTIVE?e.jsx(re,{className:"h-3.5 w-3.5"}):e.jsx(ae,{className:"h-3.5 w-3.5"})})]})]})}function ye(){const{t:a}=E(),r=F(t=>t.user),[n,l]=o.useState(""),[s,i]=o.useState(!1),[m,u]=o.useState(null),[p,b]=o.useState(null),{data:c,loading:v,refetch:h}=Q(()=>{const t={};return n&&(t.q=n),C.get("admin/developers",{searchParams:t}).json()},[n]);async function y(t){const j=t.status===k.ACTIVE?k.DISABLED:k.ACTIVE;try{await C.put(`admin/developers/${t.id}`,{json:{status:j}}),h()}catch{}}function f(t){switch(t){case S.ADMIN:return"text-yellow-400";case S.DEVELOPER:return"text-blue-400";default:return"text-[var(--text-secondary)]"}}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.developers_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.developers_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>i(!0),children:[e.jsx(W,{className:"h-3.5 w-3.5"}),a("admin.create_developer")]})]}),e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(H,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.search_developers"),value:n,onChange:t=>l(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})}),v?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(K,{rows:4})}):!c||c.length===0?e.jsx(J,{icon:Y,title:a(n?"admin.no_matching_developers":"admin.no_developers_found"),description:a(n?"admin.try_adjusting_search":"admin.create_first_developer"),actionLabel:n?void 0:a("admin.create_developer"),onAction:n?void 0:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block 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)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.username")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("profile.git_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.role")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.totp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:t.name}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.gitName}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:f(t.role),children:t.role})}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:O(t.status),children:t.status})}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:t.totpEnabled?"text-green-400":"text-[var(--text-muted)]",children:t.totpEnabled?a("common.enabled"):a("common.disabled")})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5",children:e.jsx(P,{dev:t,currentUserId:r==null?void 0:r.id,onEdit:u,onReset2fa:b,onToggleStatus:y})})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:c.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium",children:t.name}),e.jsx(P,{dev:t,currentUserId:r==null?void 0:r.id,onEdit:u,onReset2fa:b,onToggleStatus:y})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] mb-1",children:t.gitName}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[e.jsx("span",{className:f(t.role),children:t.role}),e.jsx("span",{className:O(t.status),children:t.status}),e.jsx("span",{className:t.totpEnabled?"text-green-400":"text-[var(--text-muted)]",children:t.totpEnabled?a("common.enabled"):a("common.disabled")})]})]},t.id))})]}),e.jsx(se,{isOpen:s,onClose:()=>i(!1),onCreated:h}),m&&e.jsx(ne,{isOpen:!!m,developer:m,onClose:()=>u(null),onUpdated:h}),p&&e.jsx(oe,{isOpen:!!p,developer:p,onClose:()=>b(null),onConfirmed:h})]})}export{ye as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as I,a as E,r as o,G as x,O as z,j as e,h as P,f as H,v as M}from"./index-CTVNJXL0.js";import{S as U}from"./Select-DYnPuPlP.js";import{a as R}from"./agent-type-options-DYVQzNPE.js";import{E as O}from"./EmptyState-BIXXLer_.js";import{T as D}from"./Skeleton-tFvClhRo.js";import{t as J}from"./date-RFA7-ZGs.js";import{u as q}from"./useFetch-DLQT-fqN.js";import{P as W}from"./plus-CgnoWo2P.js";import{A as $}from"./arrow-left-BmJhqQxJ.js";import"./chevron-down-pInOI1Sz.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const K=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 V({isOpen:l,onClose:a,onCreated:j}){const{t}=E(),d=R(r=>r),[c,u]=o.useState(""),[s,b]=o.useState(""),[n,y]=o.useState(""),[f,C]=o.useState(""),[_,k]=o.useState("main"),[N,S]=o.useState(x.GITHUB),[B,T]=o.useState(z.CLAUDE),[p,w]=o.useState(!1),[F,v]=o.useState("");o.useEffect(()=>{l&&A()},[l]);function A(){u(""),b(""),y(""),C(""),k("main"),S(x.GITHUB),T(z.CLAUDE),v("")}function g(){A(),a()}async function L(r){r.preventDefault(),v(""),w(!0);try{const h=await P.post("admin/projects",{json:{name:c,key:s,repoUrl:n,sshUrl:f||void 0,defaultBranch:_,gitPlatform:N,agentType:B}}).json();j(h),g()}catch(h){const G=h instanceof Error?h.message:t("projects.failed_to_create_project");v(G)}finally{w(!1)}}return l?e.jsx("div",{onClick:g,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")})]}),F&&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:F}),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=>y(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:f,onChange:r=>C(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:_,onChange:r=>k(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:N,onChange:r=>S(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:B,onChange:r=>T(r),options:d})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:g,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 ne(){const l=H(),{t:a}=E(),[j,t]=o.useState(!1),{data:d,loading:c,refetch:u}=q(()=>P.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(W,{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($,{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(D,{rows:4})}):!d||d.length===0?e.jsx(O,{icon:K,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:J(s.lastActivity??null)})]},s.key))]})]}),e.jsx(V,{isOpen:j,onClose:()=>t(!1),onCreated:u})]})]})}export{ne as default};
|