@overlordai/server 1.0.152 → 1.0.154
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/016-automation-notify-project-chats.sql +2 -0
- package/database/migrations/017-automation-multi-project.sql +21 -0
- package/dist/automation/automation-executor.d.ts +1 -1
- package/dist/automation/automation-executor.d.ts.map +1 -1
- package/dist/automation/automation-executor.js +18 -13
- package/dist/automation/automation-executor.js.map +1 -1
- package/dist/automation/automation-scheduler.d.ts.map +1 -1
- package/dist/automation/automation-scheduler.js +9 -1
- package/dist/automation/automation-scheduler.js.map +1 -1
- package/dist/automation/automation-trigger.js +3 -3
- package/dist/automation/automation-trigger.js.map +1 -1
- package/dist/automation/automation.service.d.ts +4 -0
- package/dist/automation/automation.service.d.ts.map +1 -1
- package/dist/automation/automation.service.js +66 -7
- package/dist/automation/automation.service.js.map +1 -1
- package/dist/automation/builtin-templates.js +3 -3
- package/dist/automation/builtin-templates.js.map +1 -1
- package/dist/database/repositories/automation.repository.d.ts +9 -2
- package/dist/database/repositories/automation.repository.d.ts.map +1 -1
- package/dist/database/repositories/automation.repository.js +75 -23
- package/dist/database/repositories/automation.repository.js.map +1 -1
- package/dist/notifier/notification-consumer.d.ts +4 -1
- package/dist/notifier/notification-consumer.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.js +32 -8
- package/dist/notifier/notification-consumer.js.map +1 -1
- package/dist/notifier/notification-event-listener.d.ts.map +1 -1
- package/dist/notifier/notification-event-listener.js +3 -2
- package/dist/notifier/notification-event-listener.js.map +1 -1
- package/dist/notifier/notifier.service.d.ts +4 -2
- package/dist/notifier/notifier.service.d.ts.map +1 -1
- package/dist/notifier/notifier.service.js +57 -2
- package/dist/notifier/notifier.service.js.map +1 -1
- package/dist/web/automation.controller.d.ts +4 -0
- package/dist/web/automation.controller.d.ts.map +1 -1
- package/dist/web/automation.controller.js +60 -21
- package/dist/web/automation.controller.js.map +1 -1
- package/dist/web/worker-web.controller.d.ts +1 -1
- package/dist/web/worker-web.controller.d.ts.map +1 -1
- package/dist/web/worker-web.controller.js +15 -5
- package/dist/web/worker-web.controller.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-DOQYcLSs.js → AccessTokensPage-CYec9jzJ.js} +1 -1
- package/public/assets/{AdminPage-vaAs4nmP.js → AdminPage-t2Q3HGBC.js} +1 -1
- package/public/assets/{AgentCliPage-BXGIfvSo.js → AgentCliPage-S06CR41h.js} +1 -1
- package/public/assets/{ApiReferencePage-ChGlKtFZ.js → ApiReferencePage-CsXGBGDf.js} +1 -1
- package/public/assets/{ArchitecturePage-BDo0Sz0V.js → ArchitecturePage-1w9WC-ns.js} +1 -1
- package/public/assets/{AuditLogPage-CDonhWBh.js → AuditLogPage-BtTTQrI0.js} +1 -1
- package/public/assets/AutomationCreatePage-B-fTvSAy.js +1 -0
- package/public/assets/AutomationDetailPage-vsniJu06.js +16 -0
- package/public/assets/AutomationEditPage-Bl_WVim4.js +1 -0
- package/public/assets/AutomationListPage-2K5vRQk2.js +26 -0
- package/public/assets/{AutomationRunDetailPage-BWRONm49.js → AutomationRunDetailPage-41_RxWmD.js} +2 -2
- package/public/assets/{BindPlatformPage-B-jO83qZ.js → BindPlatformPage-BElmbysw.js} +1 -1
- package/public/assets/{BotIntegrationPage-CfWOXPnJ.js → BotIntegrationPage-Dl2aGKqO.js} +1 -1
- package/public/assets/{BotManage-Dt4gvWW6.js → BotManage-bSKcAFsV.js} +1 -1
- package/public/assets/{BotSetupPage-BAtr0Wem.js → BotSetupPage-DNlfGROu.js} +1 -1
- package/public/assets/{ChangelogPage-CbYmEPo0.js → ChangelogPage-zcA8kPFS.js} +1 -1
- package/public/assets/{CliReferencePage-DzBrPSnn.js → CliReferencePage-M1h0rDfy.js} +1 -1
- package/public/assets/{ConfirmStageDialog-CJ8pWink.js → ConfirmStageDialog-DR4NtMbp.js} +1 -1
- package/public/assets/{DeploymentPage-DngrSHQT.js → DeploymentPage-C7TLn2zL.js} +1 -1
- package/public/assets/{DevWorkflowPage-BQfJaZyg.js → DevWorkflowPage-wv-IqCn3.js} +1 -1
- package/public/assets/{DeveloperManage-whlVH116.js → DeveloperManage-BSh3_MTP.js} +1 -1
- package/public/assets/{DeveloperSetupPage-LrbpgJ2C.js → DeveloperSetupPage-CxcWXk1l.js} +1 -1
- package/public/assets/{DocsIndexPage-vE4yr9Si.js → DocsIndexPage-BaAVze9J.js} +1 -1
- package/public/assets/DocsLayout-T_cPcAIl.js +1 -0
- package/public/assets/{DocsPrimitives-DCBNKtsW.js → DocsPrimitives-BCcIgi-N.js} +1 -1
- package/public/assets/{EditProjectPage-CjJMof0e.js → EditProjectPage-BNzVUbWF.js} +1 -1
- package/public/assets/{EmptyState-BfgwLg0u.js → EmptyState-Dtc0ZNRp.js} +1 -1
- package/public/assets/{EnvVariablesPage-D5h_sa-J.js → EnvVariablesPage-Bac6hRjE.js} +1 -1
- package/public/assets/{HomePage-BfETjlYe.js → HomePage-BNiekw7A.js} +1 -1
- package/public/assets/{InfoRow-CIwHf1Un.js → InfoRow-CzMBBOwd.js} +1 -1
- package/public/assets/{InstallationPage-2uTV3WlY.js → InstallationPage-ZVK1CxNV.js} +1 -1
- package/public/assets/{LandingPage-DMFC0PF_.js → LandingPage-ChvKFNcy.js} +1 -1
- package/public/assets/{LocalDevelopmentPage-9g3s63GP.js → LocalDevelopmentPage-DO_Je_rS.js} +1 -1
- package/public/assets/{LoginPage-CXwygPZl.js → LoginPage-q5n1oi6c.js} +1 -1
- package/public/assets/{MetricBar-BWuqiydF.js → MetricBar-8Mx9cJBP.js} +1 -1
- package/public/assets/MultiSelect-Bn_OBCgB.js +1 -0
- package/public/assets/{NotFoundPage-Cs7ae_Mz.js → NotFoundPage-CUbVM9QK.js} +1 -1
- package/public/assets/{OnboardingGuide-uCrXzgnL.js → OnboardingGuide-CV4tINbf.js} +1 -1
- package/public/assets/{PermissionsPage-CVrdX2r2.js → PermissionsPage-Cu20mTMb.js} +1 -1
- package/public/assets/{PipelineConfigPage-BxkXW1la.js → PipelineConfigPage-DadkE0Vl.js} +1 -1
- package/public/assets/{PipelineEditorPage-DiyMvTIg.js → PipelineEditorPage-CmGr3emr.js} +2 -2
- package/public/assets/{PlanPage-B-NSg434.js → PlanPage-C9BaQHlG.js} +1 -1
- package/public/assets/{ProfilePage-CRMCbMyc.js → ProfilePage-V2QDDDT5.js} +1 -1
- package/public/assets/{ProjectDetailPage-Bx1DUkpw.js → ProjectDetailPage-BIM5wNdd.js} +1 -1
- package/public/assets/{ProjectListPage-D1LzmIVf.js → ProjectListPage-BqJ3sa75.js} +1 -1
- package/public/assets/{PtyTerminal-CxBKQBbF.js → PtyTerminal-CDGp4pLP.js} +1 -1
- package/public/assets/{QuickAuth-BMY6Nw6u.js → QuickAuth-YzGZf86P.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-Da3XlOxO.js → RemoveMemberConfirmDialog-3Zg6POcw.js} +1 -1
- package/public/assets/{ReviewAggregatePage-mnnW-Nli.js → ReviewAggregatePage-DZ7vq0na.js} +1 -1
- package/public/assets/{ReviewPage-_pd3mJC1.js → ReviewPage-CuIGtr5J.js} +1 -1
- package/public/assets/{Select-CaAVBHmI.js → Select-67FOknim.js} +1 -1
- package/public/assets/{SettingsPage-CsDJ7FS9.js → SettingsPage-DxQyuz8P.js} +1 -1
- package/public/assets/{Skeleton-CNV0Dyd8.js → Skeleton-_rq02txk.js} +1 -1
- package/public/assets/{SkillPage-CQyxaNa5.js → SkillPage-BZiHfn-H.js} +1 -1
- package/public/assets/{TaskDetailPage-Dn7Vl2tI.js → TaskDetailPage-CUBpkfyo.js} +1 -1
- package/public/assets/{TaskGuidePage-Ch465zVv.js → TaskGuidePage-hvqiwQod.js} +1 -1
- package/public/assets/{TaskListPage-DbQbJMDj.js → TaskListPage-Bhose57w.js} +1 -1
- package/public/assets/{TaskStatusBadge-Dzloj2eJ.js → TaskStatusBadge-D4ZTaewH.js} +1 -1
- package/public/assets/{TerminalHomePage-C2bwGFkH.js → TerminalHomePage-BG0HvMTN.js} +1 -1
- package/public/assets/{TokenManage-mToToJ_g.js → TokenManage-XCYWH63A.js} +1 -1
- package/public/assets/Tooltip-BeXBpXMQ.js +1 -0
- package/public/assets/{TotpSetupPage-Dk00_OYo.js → TotpSetupPage-DchjCTiK.js} +1 -1
- package/public/assets/WorkerDetailPage-DIa8H0Cq.js +1 -0
- package/public/assets/{WorkerListPage-kKUioe-i.js → WorkerListPage-C8Or4H2-.js} +1 -1
- package/public/assets/{WorkerOperationsPage-CBzwbV8I.js → WorkerOperationsPage-BSoKQXAz.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-DvaP5u6N.js → WorkerSetupGuidePage-BfVQ3Ua8.js} +1 -1
- package/public/assets/{WorkerSetupPage-BD-EAPKM.js → WorkerSetupPage-BndankoD.js} +1 -1
- package/public/assets/{agent-type-options-BiwwFXJv.js → agent-type-options-ChuePYjM.js} +1 -1
- package/public/assets/{arrow-left-BnN4eZhK.js → arrow-left-DqjVoydc.js} +1 -1
- package/public/assets/{arrow-right-BDaYPEVr.js → arrow-right-CTYUOR48.js} +1 -1
- package/public/assets/{bot-jsWsZ197.js → bot-DIgcjp1L.js} +1 -1
- package/public/assets/{chevron-down-DyqUpmgf.js → chevron-down-USdSAtLM.js} +1 -1
- package/public/assets/{chevron-left-D5fJVFiB.js → chevron-left-DeBK5qpt.js} +1 -1
- package/public/assets/{chevron-right-Bz-j2WmS.js → chevron-right-c3y2M4GO.js} +1 -1
- package/public/assets/{chevron-up-DEXIEMJO.js → chevron-up-DCDYf3Az.js} +1 -1
- package/public/assets/{circle-alert-DE06tNOV.js → circle-alert-l_FFcF-_.js} +1 -1
- package/public/assets/{clock-DyV22whY.js → clock-ey7I11g5.js} +1 -1
- package/public/assets/{copy-Dtpgo9EK.js → copy-BvsnHVjA.js} +1 -1
- package/public/assets/date-CmcdoD87.js +1 -0
- package/public/assets/{download-DVCPTZuD.js → download-BzwPSzep.js} +1 -1
- package/public/assets/{external-link-Bbo-dc9z.js → external-link-ChvrB9MU.js} +1 -1
- package/public/assets/{git-fork-A1WGp9ha.js → git-fork-DS0EMsEA.js} +1 -1
- package/public/assets/index-Azh1KhiX.css +1 -0
- package/public/assets/{index-PZwTchr_.js → index-Dc7l0IT6.js} +3 -3
- package/public/assets/{key-BDx4jfUG.js → key-D7b87-i1.js} +1 -1
- package/public/assets/{loader-circle-nKG9e8iK.js → loader-circle-CA2KGzXp.js} +1 -1
- package/public/assets/{pencil-Dgj4md4-.js → pencil-CfrtWF-J.js} +1 -1
- package/public/assets/{play-DFj8BMl8.js → play-C_ZVU9H5.js} +1 -1
- package/public/assets/{plus-CCF-PMRF.js → plus-g2yZrAF7.js} +1 -1
- package/public/assets/{rotate-ccw-CyltG4Qx.js → rotate-ccw-C1EaXve8.js} +1 -1
- package/public/assets/{scroll-text-IFQgBRlh.js → scroll-text-CwMw-SJf.js} +1 -1
- package/public/assets/{settings-CYtYYzCu.js → settings-CpJIpeUV.js} +1 -1
- package/public/assets/{skip-forward-Ck7tY58a.js → skip-forward-BQCBn5yW.js} +1 -1
- package/public/assets/{status-colors-DDycfcf7.js → status-colors-PFYg7zX9.js} +1 -1
- package/public/assets/{task-constants-CSVY_jfk.js → task-constants-BtTS5GQt.js} +1 -1
- package/public/assets/{task.store-BTXbcXgO.js → task.store-2YMrViYj.js} +1 -1
- package/public/assets/{timer-CXsWiTNP.js → timer-B7JsdQPs.js} +1 -1
- package/public/assets/{trash-2-DXJqRCdo.js → trash-2-CgnGXyNP.js} +1 -1
- package/public/assets/{useFetch-6R6P2rOm.js → useFetch-CM-iw_s7.js} +1 -1
- package/public/assets/{users-BZPY-p6E.js → users-Bpg-Dicv.js} +1 -1
- package/public/assets/{wifi-Bgq95lS8.js → wifi-2G9hdLVN.js} +1 -1
- package/public/assets/{workflow-RqNfx4vc.js → workflow-o40bANXK.js} +1 -1
- package/public/assets/{zap-BIwamY7L.js → zap-YCwvQMOv.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AutomationCreatePage-C1_2qnf5.js +0 -1
- package/public/assets/AutomationDetailPage-BruGQNkV.js +0 -16
- package/public/assets/AutomationEditPage-BVlx-7AI.js +0 -1
- package/public/assets/AutomationListPage-BprhRKdu.js +0 -26
- package/public/assets/DocsLayout-ByGEAOqk.js +0 -1
- package/public/assets/Tooltip-DzkVglKi.js +0 -1
- package/public/assets/WorkerDetailPage-C8_zfmSR.js +0 -1
- package/public/assets/date-RFA7-ZGs.js +0 -1
- package/public/assets/index-Du11Fv9c.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as r,o as e,aa as s,ab as u,a7 as a}from"./index-
|
|
1
|
+
import{W as r,o as e,aa as s,ab as u,a7 as a}from"./index-Dc7l0IT6.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,O as t}from"./index-
|
|
1
|
+
import{o as a,O as t}from"./index-Dc7l0IT6.js";import{a as l}from"./agent-type-options-ChuePYjM.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-Dc7l0IT6.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-Dc7l0IT6.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};
|
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-Dc7l0IT6.js"></script>
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Azh1KhiX.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,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 a={};const u=s=>l(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(i.map(s=>o[s]||u(s))).then(s=>(n(...s),a))}}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:"
|
|
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 a={};const u=s=>l(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(i.map(s=>o[s]||u(s))).then(s=>(n(...s),a))}}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:"5232b7cd6f110e1d76b044627f9b923e"},{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-YCwvQMOv.js",revision:null},{url:"assets/workflow-o40bANXK.js",revision:null},{url:"assets/wifi-2G9hdLVN.js",revision:null},{url:"assets/users-Bpg-Dicv.js",revision:null},{url:"assets/useFetch-CM-iw_s7.js",revision:null},{url:"assets/trash-2-CgnGXyNP.js",revision:null},{url:"assets/timer-B7JsdQPs.js",revision:null},{url:"assets/task.store-2YMrViYj.js",revision:null},{url:"assets/task-constants-BtTS5GQt.js",revision:null},{url:"assets/status-colors-PFYg7zX9.js",revision:null},{url:"assets/skip-forward-BQCBn5yW.js",revision:null},{url:"assets/settings-CpJIpeUV.js",revision:null},{url:"assets/scroll-text-CwMw-SJf.js",revision:null},{url:"assets/rotate-ccw-C1EaXve8.js",revision:null},{url:"assets/plus-g2yZrAF7.js",revision:null},{url:"assets/play-C_ZVU9H5.js",revision:null},{url:"assets/pencil-CfrtWF-J.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-CA2KGzXp.js",revision:null},{url:"assets/key-D7b87-i1.js",revision:null},{url:"assets/index-Dc7l0IT6.js",revision:null},{url:"assets/index-Azh1KhiX.css",revision:null},{url:"assets/git-fork-DS0EMsEA.js",revision:null},{url:"assets/external-link-ChvrB9MU.js",revision:null},{url:"assets/download-BzwPSzep.js",revision:null},{url:"assets/date-CmcdoD87.js",revision:null},{url:"assets/copy-BvsnHVjA.js",revision:null},{url:"assets/clock-ey7I11g5.js",revision:null},{url:"assets/circle-alert-l_FFcF-_.js",revision:null},{url:"assets/chevron-up-DCDYf3Az.js",revision:null},{url:"assets/chevron-right-c3y2M4GO.js",revision:null},{url:"assets/chevron-left-DeBK5qpt.js",revision:null},{url:"assets/chevron-down-USdSAtLM.js",revision:null},{url:"assets/bot-DIgcjp1L.js",revision:null},{url:"assets/arrow-right-CTYUOR48.js",revision:null},{url:"assets/arrow-left-DqjVoydc.js",revision:null},{url:"assets/agent-type-options-ChuePYjM.js",revision:null},{url:"assets/WorkerSetupPage-BndankoD.js",revision:null},{url:"assets/WorkerSetupGuidePage-BfVQ3Ua8.js",revision:null},{url:"assets/WorkerOperationsPage-BSoKQXAz.js",revision:null},{url:"assets/WorkerListPage-C8Or4H2-.js",revision:null},{url:"assets/WorkerDetailPage-DIa8H0Cq.js",revision:null},{url:"assets/TotpSetupPage-DchjCTiK.js",revision:null},{url:"assets/Tooltip-BeXBpXMQ.js",revision:null},{url:"assets/TokenManage-XCYWH63A.js",revision:null},{url:"assets/TerminalHomePage-BG0HvMTN.js",revision:null},{url:"assets/TaskStatusBadge-D4ZTaewH.js",revision:null},{url:"assets/TaskListPage-Bhose57w.js",revision:null},{url:"assets/TaskGuidePage-hvqiwQod.js",revision:null},{url:"assets/TaskDetailPage-CUBpkfyo.js",revision:null},{url:"assets/SkillPage-BZiHfn-H.js",revision:null},{url:"assets/Skeleton-_rq02txk.js",revision:null},{url:"assets/SettingsPage-DxQyuz8P.js",revision:null},{url:"assets/Select-67FOknim.js",revision:null},{url:"assets/ReviewPage-CuIGtr5J.js",revision:null},{url:"assets/ReviewAggregatePage-DZ7vq0na.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-3Zg6POcw.js",revision:null},{url:"assets/QuickAuth-YzGZf86P.js",revision:null},{url:"assets/PtyTerminal-CDGp4pLP.js",revision:null},{url:"assets/PtyTerminal-6GBZ9nXN.css",revision:null},{url:"assets/ProjectListPage-BqJ3sa75.js",revision:null},{url:"assets/ProjectDetailPage-BIM5wNdd.js",revision:null},{url:"assets/ProfilePage-V2QDDDT5.js",revision:null},{url:"assets/PlanPage-C9BaQHlG.js",revision:null},{url:"assets/PipelineEditorPage-CmGr3emr.js",revision:null},{url:"assets/PipelineConfigPage-DadkE0Vl.js",revision:null},{url:"assets/PermissionsPage-Cu20mTMb.js",revision:null},{url:"assets/OnboardingGuide-CV4tINbf.js",revision:null},{url:"assets/NotFoundPage-CUbVM9QK.js",revision:null},{url:"assets/MultiSelect-Bn_OBCgB.js",revision:null},{url:"assets/MetricBar-8Mx9cJBP.js",revision:null},{url:"assets/LoginPage-q5n1oi6c.js",revision:null},{url:"assets/LocalDevelopmentPage-DO_Je_rS.js",revision:null},{url:"assets/LandingPage-ChvKFNcy.js",revision:null},{url:"assets/InstallationPage-ZVK1CxNV.js",revision:null},{url:"assets/InfoRow-CzMBBOwd.js",revision:null},{url:"assets/HomePage-BNiekw7A.js",revision:null},{url:"assets/EnvVariablesPage-Bac6hRjE.js",revision:null},{url:"assets/EmptyState-Dtc0ZNRp.js",revision:null},{url:"assets/EditProjectPage-BNzVUbWF.js",revision:null},{url:"assets/DocsPrimitives-BCcIgi-N.js",revision:null},{url:"assets/DocsLayout-T_cPcAIl.js",revision:null},{url:"assets/DocsIndexPage-BaAVze9J.js",revision:null},{url:"assets/DeveloperSetupPage-CxcWXk1l.js",revision:null},{url:"assets/DeveloperManage-BSh3_MTP.js",revision:null},{url:"assets/DevWorkflowPage-wv-IqCn3.js",revision:null},{url:"assets/DeploymentPage-C7TLn2zL.js",revision:null},{url:"assets/ConfirmStageDialog-DR4NtMbp.js",revision:null},{url:"assets/CliReferencePage-M1h0rDfy.js",revision:null},{url:"assets/ChangelogPage-zcA8kPFS.js",revision:null},{url:"assets/BotSetupPage-DNlfGROu.js",revision:null},{url:"assets/BotManage-bSKcAFsV.js",revision:null},{url:"assets/BotIntegrationPage-Dl2aGKqO.js",revision:null},{url:"assets/BindPlatformPage-BElmbysw.js",revision:null},{url:"assets/AutomationRunDetailPage-41_RxWmD.js",revision:null},{url:"assets/AutomationListPage-2K5vRQk2.js",revision:null},{url:"assets/AutomationEditPage-Bl_WVim4.js",revision:null},{url:"assets/AutomationDetailPage-vsniJu06.js",revision:null},{url:"assets/AutomationCreatePage-B-fTvSAy.js",revision:null},{url:"assets/AuditLogPage-BtTTQrI0.js",revision:null},{url:"assets/ArchitecturePage-1w9WC-ns.js",revision:null},{url:"assets/ApiReferencePage-CsXGBGDf.js",revision:null},{url:"assets/AgentCliPage-S06CR41h.js",revision:null},{url:"assets/AdminPage-t2Q3HGBC.js",revision:null},{url:"assets/AccessTokensPage-CYec9jzJ.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{f as Z,a as H,B as J,a0 as S,r,h as Q,t as i,j as e}from"./index-PZwTchr_.js";import{S as p}from"./Select-CaAVBHmI.js";import{A as W}from"./arrow-left-BnN4eZhK.js";import"./chevron-down-DyqUpmgf.js";const X=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],ee=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],te=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],ae=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function re(d){const a=d.trim().split(/\s+/);return a.length===5||a.length===6}function ce(){const d=Z(),{t:a}=H(),[I]=J(),x=I.get("templateId"),{createAutomation:T}=S(),[v,E]=r.useState(""),[y,w]=r.useState(""),[b,O]=r.useState(""),[l,A]=r.useState("cron"),[q,j]=r.useState("0 0 * * *"),[u,_]=r.useState("0 0 * * *"),[N,P]=r.useState("UTC"),[k,F]=r.useState("COMPLETED"),[h,M]=r.useState(""),[g,K]=r.useState(""),[f,L]=r.useState("readonly"),[C,$]=r.useState("claude"),[B,R]=r.useState({}),[Y,U]=r.useState([]),[D,z]=r.useState(!1);r.useEffect(()=>{let t=!1;return Q.get("web/projects").json().then(c=>{t||U(c)}).catch(()=>{t||i.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{if(!x)return;let t=!1;return S.getState().fetchTemplates().then(()=>{if(t)return;const o=S.getState().templates.find(n=>n.id===Number(x));if(o){E(o.name),w(o.taskDescription),A(o.triggerType),L(o.executionMode);const n=o.triggerConfig;if(o.triggerType==="cron"&&n.cron&&(_(n.cron),j(""),n.timezone&&P(n.timezone)),o.triggerType==="task_event"&&n.event){F(n.event);const s=n.filter;s!=null&&s.projectKey&&M(s.projectKey),s!=null&&s.taskMode&&K(s.taskMode)}const m=o.taskConfig;m&&R(m),m!=null&&m.agentType&&$(m.agentType)}}),()=>{t=!0}},[x]);const V=t=>{j(t),t&&_(t)},G=r.useCallback(async()=>{if(!v.trim()){i.error(a("automation.name_required"));return}if(!b){i.error(a("automation.project_required"));return}let t={};if(l==="cron"){if(!u.trim()){i.error(a("automation.cron_expression_required"));return}if(!re(u)){i.error(a("automation.cron_expression_invalid"));return}t={cron:u,timezone:N}}else l==="task_event"&&(t={event:k,filter:{...h&&{projectKey:h},...g&&{taskMode:g}}});z(!0);try{const c=await T({projectKey:b,name:v.trim(),description:y.trim(),triggerType:l,triggerConfig:t,executionMode:f,taskConfig:{...B,agentType:C},...x?{templateId:Number(x)}:{}});i.success(a("automation.automation_created")),d(`/automations/${c.id}`)}catch(c){const o=c instanceof Error?c.message:a("automation.failed_create");i.error(o)}finally{z(!1)}},[v,y,b,l,u,N,k,h,g,f,C,x,T,d,a]);return e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>d("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(W,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.create_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-project",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.project")}),e.jsx(p,{value:b,onChange:O,options:Y.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:a("automation.select_project")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"create-name",type:"text",value:v,onChange:t=>E(t.target.value),placeholder:a("automation.name_placeholder"),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)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"create-description",value:y,onChange:t=>w(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),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)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>A(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${l===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),l==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(p,{value:q,onChange:V,options:X.map(t=>({value:t.value,label:t.value?`${t.label} (${t.value})`:t.label}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"create-cron-expression",type:"text",value:u,onChange:t=>{_(t.target.value),j("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(p,{value:N,onChange:P,options:ae.map(t=>({value:t,label:t}))})]})]}),l==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(p,{value:k,onChange:F,options:ee})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx("input",{id:"create-filter-project",type:"text",value:h,onChange:t=>M(t.target.value),placeholder:a("automation.filter_project_key_placeholder"),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)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(p,{value:g,onChange:K,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>L(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${f===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(f==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:te.map(t=>e.jsx("button",{onClick:()=>$(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${C===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:G,disabled:D,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(D?"automation.creating":"automation.create_automation")}),e.jsx("button",{onClick:()=>d("/automations"),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{ce as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as g,f as M,a as $,A as I,a0 as S,r as i,a1 as D,p as L,t as c,w as O,j as t,s as F}from"./index-PZwTchr_.js";import{E as k}from"./EmptyState-BfgwLg0u.js";import{T as q}from"./Skeleton-CNV0Dyd8.js";import{f as _,c as z}from"./date-RFA7-ZGs.js";import{C as A}from"./clock-DyV22whY.js";import{A as G}from"./arrow-left-BnN4eZhK.js";import{P as C}from"./play-DFj8BMl8.js";import{T as H}from"./trash-2-DXJqRCdo.js";import{T as K}from"./timer-CXsWiTNP.js";import{Z as U}from"./zap-BIwamY7L.js";import{E as W}from"./external-link-Bbo-dc9z.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 Z=g("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
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 B=g("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
|
|
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 Q=g("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function V(n){switch(n){case"COMPLETED":return"bg-[var(--accent)]";case"RUNNING":return"bg-[var(--accent)]";case"PENDING":return"bg-[var(--warning)]";case"FAILED":return"bg-[var(--destructive)]";case"SKIPPED":return"bg-[#525252]";default:return"bg-[#525252]"}}function J(n){const e=n.split(" ");if(e.length!==5)return n;const[o,s,a,,x]=e;return o==="0"&&s==="*"?"every hour":o==="0"&&s==="0"&&a==="*"&&x==="*"?"daily at midnight":o==="0"&&s==="9"&&a==="*"&&x==="*"?"daily at 9:00am":o==="0"&&s==="9"&&x==="1"?"weekly on monday at 9:00am":s==="*"&&o==="*"?"every minute":s.startsWith("*/")?`every ${s.slice(2)} hours`:n}function lt(){const n=M(),{t:e}=$(),{id:o}=I(),s=Number(o),{currentAutomation:a,loading:x,fetchAutomation:m,enableAutomation:v,disableAutomation:b,triggerAutomation:f,deleteAutomation:j,runs:y,fetchRuns:l,clearRunQuery:N}=S(),[T,w]=i.useState(!1),u=i.useRef(!1);i.useEffect(()=>(m(s),l({automationId:s,limit:20}),()=>{N()}),[s,m,l,N]),i.useEffect(()=>{u.current=!0;const r=D.onStatus(h=>{u.current&&h==="connected"&&l({automationId:s,limit:20})});return()=>{u.current=!1,r()}},[s,l]),L((a==null?void 0:a.name)??null);const P=i.useCallback(async()=>{if(a)try{a.enabled?(await b(a.id),await m(s),c.success(e("automation.automation_disabled"))):(await v(a.id),await m(s),c.success(e("automation.automation_enabled")))}catch{c.error(e("automation.failed_toggle"))}},[a,s,v,b,m,e]),E=i.useCallback(async()=>{try{await f(s),c.success(e("automation.automation_triggered")),l({automationId:s,limit:20})}catch{c.error(e("automation.failed_trigger"))}},[s,f,l,e]),R=i.useCallback(async()=>{try{await j(s),c.success(e("automation.automation_deleted")),n("/automations")}catch{c.error(e("automation.failed_delete"))}},[s,j,n,e]);if(O(null),x&&!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(q,{rows:6})});if(!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(k,{icon:A,title:e("automation.automation_not_found")})});const d=a.triggerConfig,p=a.taskConfig;return t.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsxs("div",{className:"mb-6 flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>n("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:t.jsx(G,{className:"h-4 w-4"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a.name}),t.jsx("span",{className:`h-2 w-2 rounded-full ${a.enabled?"bg-[var(--accent)]":"bg-[var(--text-muted)]"}`}),t.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:a.enabled?e("automation.enabled"):e("automation.disabled")})]}),a.description&&t.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)]",children:a.description})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:P,className:`flex items-center gap-1 rounded-[4px] border px-3 py-1.5 text-[11px] transition-colors ${a.enabled?"border-[var(--warning)] text-[var(--warning)] hover:bg-[var(--warning)]/10":"border-[var(--accent)] text-[var(--accent)] hover:bg-[var(--accent)]/10"}`,children:a.enabled?t.jsxs(t.Fragment,{children:[t.jsx(Z,{className:"h-3 w-3"})," ",e("automation.disable")]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{className:"h-3 w-3"})," ",e("automation.enable")]})}),t.jsxs("button",{onClick:()=>n(`/automations/${a.id}/edit`),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[t.jsx(Q,{className:"h-3 w-3"})," ",e("automation.edit")]}),t.jsxs("button",{onClick:E,className:"flex items-center gap-1 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-[11px] font-bold text-black transition-opacity hover:opacity-90",children:[t.jsx(C,{className:"h-3 w-3"})," ",e("automation.trigger_now")]}),t.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)] px-3 py-1.5 text-[11px] text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[t.jsx(H,{className:"h-3 w-3"})," ",e("automation.delete")]})]})]}),t.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.configuration")}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.trigger_type")}),t.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-xs text-[var(--text-primary)]",children:[a.triggerType==="cron"&&t.jsx(K,{className:"h-3 w-3"}),a.triggerType==="task_event"&&t.jsx(U,{className:"h-3 w-3"}),a.triggerType==="manual"&&t.jsx(C,{className:"h-3 w-3"}),a.triggerType]})]}),a.triggerType==="cron"&&!!d.cron&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.schedule")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:J(d.cron)}),t.jsxs("span",{className:"block text-[10px] text-[var(--text-muted)]",children:[d.cron," (",d.timezone??"UTC",")"]})]}),a.triggerType==="task_event"&&!!d.event&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.event")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:d.event})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.agent_type")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:(p==null?void 0:p.agentType)??"claude"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.execution_mode")}),t.jsx("span",{className:`mt-0.5 block text-xs ${a.executionMode==="writable"?"text-[var(--warning)]":"text-[var(--text-primary)]"}`,children:a.executionMode})]})]}),t.jsxs("div",{className:"mt-3 flex items-center gap-4 text-[10px] text-[var(--text-muted)]",children:[t.jsxs("span",{children:[e("automation.project"),": ",a.projectKey]}),a.lastRunAt&&t.jsx("span",{children:e("automation.last_run",{time:_(a.lastRunAt)})}),a.nextRunAt&&t.jsx("span",{children:e("automation.next_run",{time:z(a.nextRunAt)})})]})]}),t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.run_history")}),y.length===0?t.jsx(k,{icon:A,title:e("automation.no_runs"),compact:!0}):t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_time")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_status")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_findings")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_task")})]})}),t.jsx("tbody",{children:y.map(r=>t.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border)] last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",onClick:()=>n(`/automations/runs/${r.id}`),children:[t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-primary)]",children:_(r.createdAt)}),t.jsx("td",{className:"px-4 py-2.5",children:t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--text-primary)]",children:[t.jsx("span",{className:`h-2 w-2 rounded-full ${V(r.status)}`}),r.status.toLowerCase()]})}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-muted)]",children:r.hasFindings&&r.findings?`${Array.isArray(r.findings)?r.findings.length:0} finding${Array.isArray(r.findings)&&r.findings.length!==1?"s":""}`:"-"}),t.jsx("td",{className:"px-4 py-2.5",children:r.taskId?t.jsxs("button",{onClick:h=>{h.stopPropagation(),n(`/tasks/${r.taskId}`)},className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:["#",r.taskId,t.jsx(W,{className:"h-2.5 w-2.5"})]}):t.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"-"})})]},r.id))})]})})]}),t.jsx(F,{isOpen:T,onClose:()=>w(!1),onConfirm:R,title:e("automation.delete_title"),message:e("automation.delete_confirm",{name:a.name}),confirmLabel:e("automation.delete"),confirmVariant:"danger"})]})}export{lt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as V,a as B,A as G,a0 as Z,r as o,t as x,j as e}from"./index-PZwTchr_.js";import{T as H}from"./Skeleton-CNV0Dyd8.js";import{E as J}from"./EmptyState-BfgwLg0u.js";import{C as Q}from"./clock-DyV22whY.js";import{A as W}from"./arrow-left-BnN4eZhK.js";const D=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],X=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],ee=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],te=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function ae(i){const a=i.trim().split(/\s+/);return a.length===5||a.length===6}function ie(){const i=V(),{t:a}=B(),{id:$}=G(),s=Number($),{currentAutomation:r,loading:K,fetchAutomation:N,updateAutomation:_}=Z(),[u,k]=o.useState(""),[b,C]=o.useState(""),[l,E]=o.useState("cron"),[O,h]=o.useState(""),[d,g]=o.useState(""),[y,T]=o.useState("UTC"),[f,S]=o.useState("COMPLETED"),[m,w]=o.useState(""),[p,A]=o.useState(""),[v,P]=o.useState("readonly"),[j,F]=o.useState("claude"),[M,L]=o.useState(!1),[z,I]=o.useState(!1);o.useEffect(()=>{N(s)},[s,N]),o.useEffect(()=>{if(!r||r.id!==s||z)return;k(r.name),C(r.description),E(r.triggerType),P(r.executionMode);const t=r.triggerConfig;if(r.triggerType==="cron"){const n=t.cron??"";g(n);const Y=D.find(q=>q.value===n);h(Y?n:""),T(t.timezone??"UTC")}if(r.triggerType==="task_event"){S(t.event??"COMPLETED");const n=t.filter;w((n==null?void 0:n.projectKey)??""),A((n==null?void 0:n.taskMode)??"")}const c=r.taskConfig;F((c==null?void 0:c.agentType)??"claude"),I(!0)},[r,s,z]);const R=t=>{h(t),t&&g(t)},U=o.useCallback(async()=>{if(!u.trim()){x.error(a("automation.name_required"));return}let t={};if(l==="cron"){if(!d.trim()){x.error(a("automation.cron_expression_required"));return}if(!ae(d)){x.error(a("automation.cron_expression_invalid"));return}t={cron:d,timezone:y}}else l==="task_event"&&(t={event:f,filter:{...m&&{projectKey:m},...p&&{taskMode:p}}});L(!0);try{await _(s,{name:u.trim(),description:b.trim(),triggerType:l,triggerConfig:t,executionMode:v,taskConfig:{...(r==null?void 0:r.taskConfig)??{},agentType:j}}),x.success(a("automation.automation_updated")),i(`/automations/${s}`)}catch(c){const n=c instanceof Error?c.message:a("automation.failed_update");x.error(n)}finally{L(!1)}},[u,b,l,d,y,f,m,p,v,j,s,_,i,a]);return K&&!r?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(H,{rows:6})}):!r||r.id!==s?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(J,{icon:Q,title:a("automation.automation_not_found")})}):e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>i(`/automations/${s}`),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(W,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.edit_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"edit-name",type:"text",value:u,onChange:t=>k(t.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)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"edit-description",value:b,onChange:t=>C(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),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)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>E(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${l===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),l==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx("select",{id:"edit-cron-preset",value:O,onChange:t=>R(t.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)] outline-none focus:border-[var(--accent)]",children:D.map(t=>e.jsxs("option",{value:t.value,children:[t.label," ",t.value?`(${t.value})`:""]},t.label))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"edit-cron-expression",type:"text",value:d,onChange:t=>{g(t.target.value),h("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx("select",{id:"edit-timezone",value:y,onChange:t=>T(t.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)] outline-none focus:border-[var(--accent)]",children:te.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx("select",{id:"edit-event-type",value:f,onChange:t=>S(t.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)] outline-none focus:border-[var(--accent)]",children:X.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx("input",{id:"edit-filter-project",type:"text",value:m,onChange:t=>w(t.target.value),placeholder:a("automation.filter_project_key_placeholder"),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)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsxs("select",{id:"edit-filter-mode",value:p,onChange:t=>A(t.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)] outline-none focus:border-[var(--accent)]",children:[e.jsx("option",{value:"",children:a("automation.all_modes")}),e.jsx("option",{value:"develop",children:"develop"}),e.jsx("option",{value:"review",children:"review"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>P(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${v===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(v==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:ee.map(t=>e.jsx("button",{onClick:()=>F(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${j===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:U,disabled:M,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(M?"automation.saving":"automation.save_changes")}),e.jsx("button",{onClick:()=>i(`/automations/${s}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{ie as default};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{c as S,f as K,a as M,r as l,a0 as T,w as G,j as e,a1 as W,a2 as R,a3 as Q,a4 as H,t as p,Q as Z,F as X,v as J,h as ee,X as te}from"./index-PZwTchr_.js";import{E as P}from"./EmptyState-BfgwLg0u.js";import{T as $}from"./Skeleton-CNV0Dyd8.js";import{f as I}from"./date-RFA7-ZGs.js";import{S as L}from"./Select-CaAVBHmI.js";import{P as ae}from"./plus-CCF-PMRF.js";import{P as re}from"./play-DFj8BMl8.js";import{Z as se}from"./zap-BIwamY7L.js";import{T as ne}from"./timer-CXsWiTNP.js";import{C as oe}from"./clock-DyV22whY.js";import{C as ie}from"./chevron-right-Bz-j2WmS.js";import"./chevron-down-DyqUpmgf.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=S("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
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 O=S("BookDashed",[["path",{d:"M12 17h1.5",key:"1gkc67"}],["path",{d:"M12 22h1.5",key:"1my7sn"}],["path",{d:"M12 2h1.5",key:"19tvb7"}],["path",{d:"M17.5 22H19a1 1 0 0 0 1-1",key:"10akbh"}],["path",{d:"M17.5 2H19a1 1 0 0 1 1 1v1.5",key:"1vrfjs"}],["path",{d:"M20 14v3h-2.5",key:"1naeju"}],["path",{d:"M20 8.5V10",key:"1ctpfu"}],["path",{d:"M4 10V8.5",key:"1o3zg5"}],["path",{d:"M4 19.5V14",key:"ob81pf"}],["path",{d:"M4 4.5A2.5 2.5 0 0 1 6.5 2H8",key:"s8vcyb"}],["path",{d:"M8 22H6.5a1 1 0 0 1 0-5H8",key:"1cu73q"}]]);/**
|
|
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 le=S("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
17
|
-
* @license lucide-react v0.469.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const de=S("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
22
|
-
* @license lucide-react v0.469.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const xe=S("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);function me({severity:a}){const t={critical:"border-[var(--destructive)] text-[var(--destructive)]",warning:"border-[var(--warning)] text-[var(--warning)]",info:"border-[var(--info)] text-[var(--info)]"};return e.jsx("span",{className:`rounded-[4px] border px-1.5 py-0.5 text-[10px] ${t[a]??"border-[var(--border)] text-[var(--text-muted)]"}`,children:a})}function z({type:a}){const i={cron:ne,task_event:se,manual:re}[a]??oe;return e.jsxs("span",{className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:[e.jsx(i,{className:"h-2.5 w-2.5"}),a]})}function q({mode:a}){const t=a==="writable";return e.jsx("span",{className:`rounded-[4px] border px-1.5 py-0.5 text-[10px] ${t?"border-[var(--warning)] text-[var(--warning)]":"border-[var(--border)] text-[var(--text-muted)]"}`,children:a})}function ue(){const a=K(),{t}=M(),{runs:i,loading:o,fetchRuns:d,updateRunStatus:g,batchUpdateRuns:x,clearRunQuery:y}=T(),[s,b]=l.useState(new Set),k=l.useRef(!1);l.useEffect(()=>(d({inboxStatus:"unread",limit:50}),()=>{y()}),[d,y]),l.useEffect(()=>{k.current=!0;const r=W.onStatus(_=>{k.current&&_==="connected"&&d({inboxStatus:"unread",limit:50})});return()=>{k.current=!1,r()}},[d]);const c=r=>{b(_=>{const f=new Set(_);return f.has(r)?f.delete(r):f.add(r),f})},u=()=>{s.size===i.length?b(new Set):b(new Set(i.map(r=>r.id)))},m=async r=>{try{await g(r,"read"),p.success(t("automation.marked_as_read"))}catch{p.error(t("automation.failed_mark_read"))}},j=async r=>{try{await g(r,"archived"),p.success(t("automation.archived"))}catch{p.error(t("automation.failed_archive"))}},w=async()=>{if(s.size!==0)try{await x(Array.from(s),"read"),b(new Set),p.success(t("automation.marked_n_read",{n:s.size}))}catch{p.error(t("automation.failed_batch_update"))}},v=r=>r.findings&&Array.isArray(r.findings)?r.findings.length:0;if(o&&i.length===0)return e.jsx("div",{className:"p-4",children:e.jsx($,{rows:4})});const A=i.filter(r=>r.inboxStatus==="unread");return A.length===0?e.jsx(P,{icon:de,title:t("automation.no_unread_findings"),description:t("automation.inbox_description")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("button",{onClick:u,className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:s.size===A.length?t("automation.deselect_all"):t("automation.select_all")}),s.size>0&&e.jsxs("button",{onClick:w,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(R,{className:"h-3 w-3"}),t("automation.mark_all_read")," (",s.size,")"]})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:A.map(r=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsx("input",{type:"checkbox",checked:s.has(r.id),onChange:()=>c(r.id),className:"h-3.5 w-3.5 shrink-0 accent-[var(--accent)]"}),e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsxs("div",{className:"flex min-w-0 flex-1 cursor-pointer flex-col gap-0.5",onClick:()=>a(`/automations/runs/${r.id}`),children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors",children:t("automation.run_label",{id:r.id,automationId:r.automationId})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(z,{type:r.triggerType}),r.findings&&Array.isArray(r.findings)&&r.findings.length>0&&e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:v(r)!==1?t("automation.findings_count",{count:v(r)}):t("automation.finding_count",{count:v(r)})}),r.findings&&Array.isArray(r.findings)&&(()=>{const _=new Set(r.findings.map(f=>f.severity));return Array.from(_).map(f=>e.jsx(me,{severity:f},f))})()]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:I(r.createdAt)}),e.jsx("button",{onClick:()=>m(r.id),className:"shrink-0 rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",title:t("automation.mark_read"),children:e.jsx(R,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>j(r.id),className:"shrink-0 rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",title:t("automation.archive"),children:e.jsx(ce,{className:"h-3.5 w-3.5"})})]},r.id))})]})}function pe(){const a=K(),{t}=M(),{automations:i,loading:o,fetchAutomations:d,enableAutomation:g,disableAutomation:x}=T();l.useEffect(()=>{d()},[d]);const y=async s=>{try{s.enabled?(await x(s.id),p.success(t("automation.automation_disabled"))):(await g(s.id),p.success(t("automation.automation_enabled")))}catch{p.error(t("automation.failed_toggle"))}};return o&&i.length===0?e.jsx("div",{className:"p-4",children:e.jsx($,{rows:4})}):i.length===0?e.jsx(P,{icon:Q,title:t("automation.no_automations"),description:t("automation.create_first_description"),actionLabel:t("automation.new_automation"),onAction:()=>a("/automations/new")}):e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:i.map(s=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]/30",onClick:()=>a(`/automations/${s.id}`),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-xs font-bold text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${s.enabled?"bg-[var(--accent)]":"bg-[var(--text-muted)]"}`})]}),s.description&&e.jsx("p",{className:"mt-1 truncate text-[11px] text-[var(--text-muted)]",children:s.description})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),y(s)},className:`relative h-5 w-9 shrink-0 rounded-full transition-colors ${s.enabled?"bg-[var(--accent)]":"bg-[var(--border)]"}`,children:e.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-white transition-transform ${s.enabled?"translate-x-4":"translate-x-0.5"}`})})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx(z,{type:s.triggerType}),e.jsx(q,{mode:s.executionMode})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] text-[var(--text-muted)]",children:[s.lastRunAt&&e.jsx("span",{children:t("automation.last_run",{time:I(s.lastRunAt)})}),s.nextRunAt&&e.jsx("span",{children:t("automation.next_run",{time:I(s.nextRunAt)})}),!s.lastRunAt&&!s.nextRunAt&&e.jsx("span",{children:t("automation.no_runs_yet")})]})]},s.id))})}const B={status_reports:{titleKey:"automation.template_category_status_reports",descriptionKey:"automation.template_category_status_reports_description",icon:X,order:0,iconClass:"border-sky-500/30 bg-sky-500/10 text-sky-300"},release_prep:{titleKey:"automation.template_category_release_prep",descriptionKey:"automation.template_category_release_prep_description",icon:R,order:1,iconClass:"border-emerald-500/30 bg-emerald-500/10 text-emerald-300"},incidents_triage:{titleKey:"automation.template_category_incidents_triage",descriptionKey:"automation.template_category_incidents_triage_description",icon:Z,order:2,iconClass:"border-rose-500/30 bg-rose-500/10 text-rose-300"},code_quality:{titleKey:"automation.template_category_code_quality",descriptionKey:"automation.template_category_code_quality_description",icon:le,order:3,iconClass:"border-amber-500/30 bg-amber-500/10 text-amber-300"},repo_maintenance:{titleKey:"automation.template_category_repo_maintenance",descriptionKey:"automation.template_category_repo_maintenance_description",icon:xe,order:4,iconClass:"border-fuchsia-500/30 bg-fuchsia-500/10 text-fuchsia-300"},growth_exploration:{titleKey:"automation.template_category_growth_exploration",descriptionKey:"automation.template_category_growth_exploration_description",icon:H,order:5,iconClass:"border-violet-500/30 bg-violet-500/10 text-violet-300"},other:{titleKey:"automation.template_category_other",descriptionKey:"automation.template_category_other_description",icon:O,order:99,iconClass:"border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]"}},he={standup_summary:0,weekly_engineering_summary:1,weekly_release_notes:2,daily_bug_scan:3},ge=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}];function C(a){return B[a??""]??B.other}function be(a){const t=C(a.category);return{Icon:t.icon,iconClass:t.iconClass}}function U(a){const t=a.builtinKey!=null?he[a.builtinKey]??50:50,i=C(a.category).order,o=a.isBuiltin?0:20,d=a.executionMode==="readonly"?0:2;return t+i*5+o+d}function D({template:a,onUse:t,emphasized:i=!1,sourceLabel:o,actionLabel:d}){const{Icon:g,iconClass:x}=be(a);return e.jsxs("article",{className:`group rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]/30 ${i?"min-h-[220px]":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-[4px] border ${x}`,children:e.jsx(g,{className:"h-4 w-4"})}),e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[10px] text-[var(--text-muted)]",children:o})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-sm font-bold text-[var(--text-primary)]",children:a.name}),e.jsx("p",{className:`mt-2 text-xs leading-5 text-[var(--text-secondary)] ${i?"line-clamp-4":"line-clamp-3"}`,children:a.description})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(z,{type:a.triggerType}),e.jsx(q,{mode:a.executionMode})]}),e.jsxs("button",{onClick:()=>t(a.id),className:"mt-5 inline-flex items-center gap-1 text-xs font-bold text-[var(--accent)] transition-colors hover:text-[var(--text-primary)]",children:[d,e.jsx(ie,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})]})}function ve(a){const t=a.trim().split(/\s+/);return t.length===5||t.length===6}function fe({template:a,onClose:t,onCreated:i}){const{t:o}=M(),{createAutomation:d}=T(),[g,x]=l.useState([]),[y,s]=l.useState(""),[b,k]=l.useState(""),[c,u]=l.useState("UTC"),[m,j]=l.useState("claude"),[w,v]=l.useState(!1),[A,r]=l.useState(!1),[_,f]=l.useState(!1);if(J(!!a),l.useEffect(()=>{if(!a)return;const n=a.triggerConfig??{},h=a.taskConfig??{};s(""),k(typeof n.cron=="string"?n.cron:""),u(typeof n.timezone=="string"?n.timezone:"UTC"),j(typeof h.agentType=="string"?h.agentType:"claude"),v(!1),r(!0);let N=!1;return ee.get("web/projects").json().then(E=>{N||(x(E),E.length===1&&(s(E[0].key),j(E[0].agentType)))}).catch(()=>{N||p.error(o("automation.failed_load_projects"))}).finally(()=>{N||r(!1)}),()=>{N=!0}},[a,o]),l.useEffect(()=>{if(!a)return;const n=h=>{h.key==="Escape"&&!_&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[a,t,_]),!a)return null;const F=n=>{if(s(n),w)return;const h=g.find(N=>N.key===n);h&&j(h.agentType)},V=n=>{j(n),v(!0)},Y=async()=>{if(!y){p.error(o("automation.project_required"));return}let n=a.triggerConfig??{};if(a.triggerType==="cron"){if(!b.trim()){p.error(o("automation.cron_expression_required"));return}if(!ve(b)){p.error(o("automation.cron_expression_invalid"));return}n={...n,cron:b.trim(),timezone:c}}else if(a.triggerType==="task_event"){const h=typeof n.filter=="object"&&n.filter!==null&&!Array.isArray(n.filter)?n.filter:{};n={...n,filter:{...h,projectKey:y}}}f(!0);try{const h=a.taskConfig??{},N=await d({projectKey:y,name:a.name,description:a.taskDescription,triggerType:a.triggerType,triggerConfig:n,executionMode:a.executionMode,taskConfig:{...h,agentType:m},templateId:a.id});p.success(o("automation.automation_created")),t(),i(N.id)}catch(h){const N=h instanceof Error?h.message:o("automation.failed_create");p.error(N)}finally{f(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/70 p-4",onClick:t,children:e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":a.name,onClick:n=>n.stopPropagation(),className:"mx-auto my-4 max-h-[calc(100vh-2rem)] w-full max-w-5xl overflow-y-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--border)] px-6 py-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--accent)]",children:o("automation.template_preview")}),e.jsx("h2",{className:"mt-2 text-2xl font-semibold text-[var(--text-primary)]",children:a.name}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-[var(--text-secondary)]",children:a.description})]}),e.jsx("button",{type:"button","aria-label":o("common.close"),onClick:t,className:"rounded-[4px] border border-[var(--border)] p-2 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(te,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"px-6 py-6",children:e.jsxs("div",{className:"max-h-[40vh] overflow-y-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] p-5",children:[e.jsx("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:o("automation.template_prompt")}),e.jsx("p",{className:"whitespace-pre-wrap text-lg leading-9 text-[var(--text-primary)]",children:a.taskDescription})]})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-[var(--border)] px-6 py-5",children:[e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_200px]",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.project")}),e.jsx(L,{value:y,onChange:F,options:g.map(n=>({value:n.key,label:`${n.name} (${n.key})`})),placeholder:o(A?"common.loading":"automation.select_project"),className:"w-full"})]}),a.triggerType==="cron"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.schedule")}),e.jsx("input",{type:"text",value:b,onChange:n=>k(n.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)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.timezone")}),e.jsx(L,{value:c,onChange:u,options:[{value:"UTC",label:"UTC"},{value:"Asia/Shanghai",label:"Asia/Shanghai"},{value:"Asia/Singapore",label:"Asia/Singapore"},{value:"America/Los_Angeles",label:"America/Los_Angeles"},{value:"America/New_York",label:"America/New_York"}],placeholder:o("automation.timezone"),className:"w-full"})]})]}):e.jsxs("div",{className:"lg:col-span-2 flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.trigger_type")}),e.jsx("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 text-xs text-[var(--text-primary)]",children:a.triggerType})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:ge.map(n=>e.jsx("button",{type:"button",onClick:()=>V(n.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${m===n.value?"border-[var(--accent)] bg-[var(--accent)]/5 text-[var(--accent)]":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:n.label},n.value))})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"text-sm text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:o("automation.cancel")}),e.jsx("button",{type:"button",onClick:Y,disabled:_,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-sm font-bold text-black transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",children:o(_?"automation.creating":"automation.create_from_template")})]})]})]})})}function ye(){const a=K(),{t}=M(),{templates:i,loading:o,fetchTemplates:d}=T(),[g,x]=l.useState(null);if(l.useEffect(()=>{d()},[d]),o&&i.length===0)return e.jsx("div",{className:"p-4",children:e.jsx($,{rows:4})});if(i.length===0)return e.jsx(P,{icon:O,title:t("automation.no_templates"),description:t("automation.templates_description")});const y=i.reduce((c,u)=>{const m=u.category||"other";return c[m]||(c[m]=[]),c[m].push(u),c},{}),s=Object.entries(y).sort(([c],[u])=>C(c).order-C(u).order),b=[...i].sort((c,u)=>U(c)-U(u)).slice(0,Math.min(4,i.length)),k=c=>{const u=i.find(m=>m.id===c)??null;x(u)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--accent)]",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t("automation.templates_suggested")})]}),e.jsx("h2",{className:"mt-2 text-sm font-bold text-[var(--text-primary)]",children:t("automation.templates_suggested_title")}),e.jsx("p",{className:"mt-1 max-w-2xl text-xs leading-5 text-[var(--text-muted)]",children:t("automation.templates_suggested_description")})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t("automation.templates_ready_count",{count:i.length})})]}),e.jsx("div",{className:"mt-4 grid gap-3 xl:grid-cols-2",children:b.map(c=>e.jsx(D,{template:c,emphasized:!0,onUse:k,sourceLabel:c.isBuiltin?t("automation.template_source_builtin"):t("automation.template_source_custom"),actionLabel:t("automation.use_template")},`suggested-${c.id}`))})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[220px_minmax(0,1fr)]",children:[e.jsxs("aside",{className:"h-fit rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 lg:sticky lg:top-4",children:[e.jsx("p",{className:"text-[11px] font-bold text-[var(--text-primary)]",children:t("automation.templates_browse")}),e.jsx("p",{className:"mt-1 text-[11px] leading-5 text-[var(--text-muted)]",children:t("automation.templates_browse_description")}),e.jsx("div",{className:"mt-3 space-y-1.5",children:s.map(([c,u])=>{const m=C(c),j=m.icon,w=`automation-template-category-${c}`;return e.jsxs("button",{type:"button","aria-label":t(m.titleKey),onClick:()=>{var v;(v=document.getElementById(w))==null||v.scrollIntoView({behavior:"smooth",block:"start"})},className:"flex w-full items-center justify-between rounded-[4px] border border-transparent bg-[var(--bg-input)] px-3 py-2 text-left transition-colors hover:border-[var(--border)] hover:text-[var(--text-primary)]",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-secondary)]",children:[e.jsx(j,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:t(m.titleKey)})]}),e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:u.length})]},`nav-${c}`)})})]}),e.jsx("div",{className:"space-y-6",children:s.map(([c,u])=>{const m=C(c),j=m.icon,w=`automation-template-category-${c}`;return e.jsxs("section",{id:w,className:"scroll-mt-4",children:[e.jsxs("div",{className:"mb-3 border-b border-[var(--border)] pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx(j,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t(m.titleKey)})]}),e.jsx("h3",{className:"mt-2 text-sm font-bold text-[var(--text-primary)]",children:t(m.titleKey)}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--text-muted)]",children:t(m.descriptionKey)})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:u.map(v=>e.jsx(D,{template:v,onUse:k,sourceLabel:v.isBuiltin?t("automation.template_source_builtin"):t("automation.template_source_custom"),actionLabel:t("automation.use_template")},v.id))})]},c)})})]}),e.jsx(fe,{template:g,onClose:()=>x(null),onCreated:c=>a(`/automations/${c}`)})]})}function Ie(){const a=K(),{t}=M(),[i,o]=l.useState("inbox"),d=T(x=>x.inboxUnreadCount);l.useEffect(()=>{T.getState().fetchInboxCount()},[]),G(l.useMemo(()=>e.jsxs("button",{onClick:()=>a("/automations/new"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(ae,{className:"h-3.5 w-3.5"}),t("automation.new_automation")]}),[a,t]));const g=[{key:"inbox",label:t("automation.tab_inbox"),count:d>0?d:void 0},{key:"automations",label:t("automation.tab_automations")},{key:"templates",label:t("automation.tab_templates")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:t("automation.title")}),e.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:g.map(x=>e.jsxs("button",{onClick:()=>o(x.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors flex items-center gap-1.5 ${i===x.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:[x.label,x.count!==void 0&&e.jsx("span",{className:"flex h-4 min-w-[16px] items-center justify-center rounded-full bg-[var(--accent)] px-1 text-[10px] font-bold text-black",children:x.count})]},x.key))}),i==="inbox"&&e.jsx(ue,{}),i==="automations"&&e.jsx(pe,{}),i==="templates"&&e.jsx(ye,{})]})}export{Ie as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as i,g as x,j as a,L as d,b as m,J as b,M as p,a4 as u,e as v,a8 as f,a9 as h}from"./index-PZwTchr_.js";import{A as j}from"./arrow-left-BnN4eZhK.js";const o=[{to:"/docs/cli",label:"cli",icon:m},{to:"/docs/api",label:"api",icon:b},{to:"/docs/bot",label:"bot",icon:p},{to:"/docs/skill",label:"skill",icon:u},{to:"/docs/all",label:"all",icon:v}],k=new Set(o.map(s=>s.to));function y(){const{t:s}=i(),r=x(),t=!k.has(r.pathname);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("nav",{className:"flex items-center border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:px-6 overflow-x-auto no-scrollbar",children:[t&&a.jsxs(d,{to:"/docs/all",className:"mr-3 shrink-0 flex items-center gap-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[a.jsx(j,{size:12}),s("docs.docs_back")]}),o.map(({to:e,label:l,icon:c})=>a.jsxs(f,{to:e,className:({isActive:n})=>`flex items-center gap-1.5 px-3 py-3 text-xs lowercase border-b-2 transition-colors shrink-0 ${n||t&&e==="/docs/all"?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[a.jsx(c,{size:14}),a.jsx("span",{children:l})]},e))]}),a.jsx("main",{className:"flex-1 overflow-auto p-4 md:p-6",children:a.jsx(h,{})})]})}export{y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as m,r as e,j as t}from"./index-PZwTchr_.js";var b=m();function g({content:n,children:a,delay:l=100,className:i}){const[p,u]=e.useState(!1),[c,f]=e.useState({top:0,left:0}),r=e.useRef(null),o=e.useRef(null),x=e.useCallback(()=>{r.current=setTimeout(()=>{if(o.current){const s=o.current.getBoundingClientRect();f({top:s.top-4,left:s.left+s.width/2})}u(!0)},l)},[l]),d=e.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),u(!1)},[]);return n?t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:o,onMouseEnter:x,onMouseLeave:d,className:i,children:a}),p&&b.createPortal(t.jsx("div",{role:"tooltip",style:{position:"fixed",top:c.top,left:c.left,transform:"translate(-50%, -100%)",zIndex:9999},className:"pointer-events-none max-w-sm rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1.5 text-xs text-[var(--text-primary)] shadow-lg border border-[var(--border-row)]",children:n}),document.body)]}):t.jsx(t.Fragment,{children:a})}export{g as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,j as e,s as T,A as se,f as te,r as x,u as ae,k as R,w as ne,W as m,D as N,L as oe,Q as F,h as g,l as ie}from"./index-PZwTchr_.js";import{t as le,c as H}from"./date-RFA7-ZGs.js";import{w as ce,b as de,t as xe}from"./status-colors-DDycfcf7.js";import{I as l}from"./InfoRow-CIwHf1Un.js";import{M as S}from"./MetricBar-BWuqiydF.js";import{u as me}from"./useFetch-6R6P2rOm.js";import{T as pe}from"./Tooltip-DzkVglKi.js";import{T as U}from"./trash-2-DXJqRCdo.js";import{A as ue}from"./arrow-left-BnN4eZhK.js";function be({isOpen:t,onClose:n,onConfirm:r,workerName:o,isDraining:i,loading:p}){const{t:c}=b();return e.jsx(T,{isOpen:t,onClose:n,onConfirm:r,title:c(i?"workers.undrain_worker_title":"workers.drain_worker_title"),message:i?c("workers.undrain_confirm",{name:o}):c("workers.drain_confirm",{name:o}),confirmLabel:c(i?"workers.undrain":"workers.drain"),confirmVariant:i?"accent":"warning",isLoading:p})}function V(t){return t==="rate_limit"?"rate limited":t}function ve(t,n){return n(t==="binary_missing"?"workers.manual_restore_required":"workers.awaiting_auto_recovery")}function Se(){var $,A;const{id:t}=se(),n=te(),{t:r}=b(),[o,i]=x.useState(!1),[p,c]=x.useState(!1),[P,w]=x.useState(!1),[z,L]=x.useState(!1),[B,j]=x.useState(!1),[Q,I]=x.useState(!1),[y,f]=x.useState(null),v=ae(a=>{var d;return(d=a.user)==null?void 0:d.role}),J=R(a=>a.workerSeq),K=R(a=>a.taskSeq),{data:u,loading:X,error:M,refetch:_}=me(async()=>{if(!t)throw new Error("Missing worker ID");const[a,d]=await Promise.all([g.get(`web/workers/${t}`).json(),g.get(`web/workers/${t}/tasks`).json().catch(()=>[])]);return{worker:a,tasks:d}},[t,J,K]),s=(u==null?void 0:u.worker)??null,C=(u==null?void 0:u.tasks)??[],O=v===N.LEAD||v===N.ADMIN;ne(x.useMemo(()=>!s||s.status===m.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===m.ONLINE&&e.jsxs("button",{onClick:()=>i(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]}),v===N.ADMIN&&e.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(U,{className:"h-3 w-3"}),r("workers.decommission")]})]}),[s,v,r]));async function Y(){if(s){c(!0);try{const a=s.status===m.DRAINING?"undrain":"drain";await g.post(`web/workers/${s.id}/${a}`),await _()}catch{}finally{c(!1),i(!1)}}}async function Z(){if(s){L(!0);try{await g.delete(`admin/workers/${s.id}`),n("/workers")}catch{}finally{L(!1),w(!1)}}}async function ee(){if(!(!s||!y)){I(!0);try{await g.post(`web/workers/${s.id}/capabilities/${encodeURIComponent(y)}/restore`),await _()}catch{}finally{I(!1),j(!1),f(null)}}}if(X)return e.jsx("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("workers.loading_worker")})});if(M)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:M}),e.jsx("button",{onClick:()=>_(),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.retry")})]});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("workers.worker_not_found")}),e.jsxs("button",{onClick:()=>n("/workers"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",r("workers.back_to_workers")]})]});const k=s.status===m.DRAINING,h=s.status!==m.DECOMMISSIONED;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>n("/workers"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(ue,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),!k&&s.status!==m.OFFLINE&&h&&e.jsxs("button",{onClick:()=>i(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[k?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(oe,{to:"/workers",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:r("workers.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[h&&e.jsxs("button",{onClick:()=>i(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",r("workers.undrain")]}),v===N.ADMIN&&h&&e.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(U,{className:"h-3 w-3"}),r("workers.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:r("workers.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(F,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:r("workers.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:r("workers.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(D,{label:r("workers.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(D,{label:r("workers.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(D,{label:r("workers.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>n("/workers"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",r("workers.back_to_workers")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:ce[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:r("workers.last_heartbeat",{time:le(s.lastHeartbeat,"never")})}),s.status===m.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this worker has been decommissioned",s.decommissionedAt?` on ${H(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(S,{label:r("workers.cpu"),value:s.cpuUsage}),e.jsx(S,{label:r("workers.mem"),value:s.memoryUsage}),e.jsx(S,{label:r("workers.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.connection_info")}),e.jsx(q,{worker:s})]})]})]}),k?e.jsxs(e.Fragment,{children:[e.jsx(G,{title:r("workers.active_tasks"),tasks:C,navigate:n}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:s.capabilities.map(a=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:a})},a))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.no_capabilities_short")}),((($=s.degradedCapabilities)==null?void 0:$.length)??0)>0&&e.jsx("div",{className:"mt-3 space-y-2",children:s.degradedCapabilities.map(a=>e.jsx(W,{agentType:a.agentType,failureType:a.failureType,failureCount:a.failureCount,showRestore:O&&h,onRestore:()=>{f(a.agentType),j(!0)}},a.agentType))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.worker_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsx(q,{worker:s,showExtended:!0})})]})]}):e.jsxs(e.Fragment,{children:[s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(a=>{var E;const d=(E=s.degradedCapabilities)==null?void 0:E.find(re=>re.agentType===a);return e.jsxs("span",{className:`rounded-[4px] border px-2.5 py-1 text-xs ${d?"border-[var(--warning)] text-[var(--warning)] bg-[var(--warning)]/5":"border-[var(--border)] text-[var(--text-secondary)]"}`,children:[a,d&&e.jsx("span",{className:"ml-1.5 text-[10px]",children:V(d.failureType)})]},a)})}),(((A=s.degradedCapabilities)==null?void 0:A.length)??0)>0&&e.jsx("div",{className:"mt-3 space-y-2",children:s.degradedCapabilities.map(a=>e.jsx(W,{agentType:a.agentType,failureType:a.failureType,failureCount:a.failureCount,showRestore:O&&h,onRestore:()=>{f(a.agentType),j(!0)}},a.agentType))})]}),e.jsx(G,{title:`${r("workers.current_tasks")} (${C.length})`,tasks:C,navigate:n})]})]})]}),e.jsx(be,{isOpen:o,onClose:()=>i(!1),onConfirm:Y,workerName:s.name,isDraining:k,loading:p}),e.jsx(T,{isOpen:P,onClose:()=>w(!1),onConfirm:Z,title:r("workers.decommission_title"),message:r("workers.decommission_confirm",{name:s.name}),confirmLabel:r("workers.decommission"),confirmVariant:"danger",isLoading:z}),e.jsx(T,{isOpen:B,onClose:()=>{j(!1),f(null)},onConfirm:ee,title:r("workers.restore_capability_title"),message:r("workers.restore_capability_confirm",{capability:y??r("workers.unknown"),name:s.name}),confirmLabel:r("workers.restore_capability"),confirmVariant:"accent",isLoading:Q})]})}function W({agentType:t,failureType:n,failureCount:r,showRestore:o,onRestore:i}){const{t:p}=b();return e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)] bg-[var(--warning)]/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium",children:t}),e.jsxs("span",{className:"text-[var(--text-muted)] ml-2 text-xs",children:[V(n)," · ",r," consecutive failure",r!==1?"s":""," · ",ve(n,p)]})]}),o&&e.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded-[4px] border border-[var(--accent)]/40 px-2.5 py-1 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:p("workers.restore_capability")})]})})}function q({worker:t,showExtended:n=!1}){const{t:r}=b();return e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(l,{label:r("workers.worker_id"),value:t.id}),e.jsx(l,{label:r("workers.host"),value:t.host}),e.jsx(l,{label:r("workers.os"),value:t.os??r("workers.unknown")}),e.jsx(l,{label:r("workers.cpu_model"),value:t.cpuModel??r("workers.n_a")}),e.jsx(l,{label:r("workers.cpu_cores"),value:t.cpuCores!=null?String(t.cpuCores):r("workers.n_a")}),e.jsx(l,{label:r("workers.memory"),value:t.memoryGb!=null?`${t.memoryGb} gb`:r("workers.n_a")}),e.jsx(l,{label:r("workers.last_heartbeat_label"),value:H(t.lastHeartbeat)}),e.jsx(l,{label:r("workers.slots"),value:`${t.activeSlots}/${t.maxSlots}`}),n&&e.jsxs(e.Fragment,{children:[e.jsx(l,{label:r("workers.status_label"),value:t.status.toLowerCase()}),e.jsx(l,{label:r("workers.worker_version"),value:t.workerVersion??r("workers.n_a")})]})]})}function G({title:t,tasks:n,navigate:r}){const{t:o}=b();return e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:t}),n.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("workers.no_active_tasks")})]}):e.jsx(he,{tasks:n,navigate:r})]})}function he({tasks:t,navigate:n}){const{t:r}=b();return 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-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:r("workers.stage")})]})}),e.jsx("tbody",{children:t.map(o=>e.jsxs("tr",{onClick:()=>n(`/tasks/${o.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",o.id]}),e.jsx("td",{className:"max-w-[120px] md:max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:e.jsx(pe,{content:o.description,children:ie(o)})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:xe[o.status]},children:["● ",o.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:o.currentStage??"-"})]},o.id))})]})})}function D({label:t,value:n,unit:r}){const o=Math.round(n*100);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[o,r]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-[2px] bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${o}%`,backgroundColor:de(n)}})})]})}export{Se as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function c(n,t="-"){if(!n)return t;const o=new Date(n).getTime();if(Number.isNaN(o))return t;const i=Date.now()-o,r=Math.floor(i/1e3);if(r<60)return`${r}s ago`;const e=Math.floor(r/60);if(e<60)return`${e}m ago`;const a=Math.floor(e/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function h(n,t){if(!n)return"-";const o=new Date(n).getTime();if(Number.isNaN(o))return"-";const i=Date.now()-o,r=Math.floor(i/6e4);if(r<1)return t?t("just_now",0):"just now";if(r<60)return t?t("m_ago",r):`${r}m ago`;const e=Math.floor(r/60);if(e<24)return t?t("h_ago",e):`${e}h ago`;const a=Math.floor(e/24);return t?t("d_ago",a):`${a}d ago`}function l(n){return n?new Date(n).toLocaleString():"n/a"}function m(n){const t=Math.floor(n/60),o=n%60;return`${t}:${o.toString().padStart(2,"0")}`}function g(n,t){if(!n)return null;const o=new Date(n).getTime(),i=t?new Date(t).getTime():Date.now();if(Number.isNaN(o)||Number.isNaN(i))return null;const r=i-o;if(r<0)return null;const e=Math.floor(r/1e3);if(e<60)return f(e,"second");const a=Math.floor(e/60);if(a<60)return f(a,"min");const u=Math.floor(a/60),s=a%60;return s===0?f(u,"hr"):`${f(u,"hr")} ${f(s,"min")}`}function f(n,t){const o=t==="hr"?"hr":`${t}s`;return`${n} ${n===1?t:o}`}export{m as a,g as b,l as c,h as f,c as t};
|