@kafca/agentdock 0.1.57 → 0.1.58
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/dist/renderer/assets/{Badge-CDTbmw1h.js → Badge-BfY1VaHS.js} +1 -1
- package/dist/renderer/assets/{Card-DayUo35w.js → Card-DWA_Tww_.js} +1 -1
- package/dist/renderer/assets/{Config-ByGMQuzR.js → Config-nHj3g1U5.js} +1 -1
- package/dist/renderer/assets/{CronList-XqHdVlgu.js → CronList-BwkA_I7v.js} +1 -1
- package/dist/renderer/assets/{Dashboard-CZj-oANw.js → Dashboard-D0_A7k02.js} +2 -2
- package/dist/renderer/assets/{EmptyState-EFMkOjZO.js → EmptyState-zatDjLj_.js} +1 -1
- package/dist/renderer/assets/{HighlightedMarkdown-DyvF3DHK.js → HighlightedMarkdown-CsM5n70d.js} +1 -1
- package/dist/renderer/assets/{Input-DxoWVc9d.js → Input-R1XdFK1K.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-CbUb2tG7.js → KnowledgeDetail-Co5sxeGd.js} +1 -1
- package/dist/renderer/assets/{KnowledgeHome-BWV1gz4f.js → KnowledgeHome-DwziPw5m.js} +1 -1
- package/dist/renderer/assets/{Logs-DqnanQTc.js → Logs-NwZUtR_G.js} +1 -1
- package/dist/renderer/assets/{Modal-yY7TzR0x.js → Modal-CrcIwIFL.js} +1 -1
- package/dist/renderer/assets/{MonitorList-CIjGQkFs.js → MonitorList-CS1uLS5A.js} +1 -1
- package/dist/renderer/assets/{Page-vwHNUdoj.js → Page-Dp0obeSw.js} +1 -1
- package/dist/renderer/assets/{Select-CmbK36pN.js → Select-6mVQaf84.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-4OceMgM4.js → ThreadChat-BFzbn3L6.js} +3 -3
- package/dist/renderer/assets/{Workspace-DplPJOjJ.js → Workspace-DCmo8BMm.js} +1 -1
- package/dist/renderer/assets/{arrow-left-C8HfBt2K.js → arrow-left-9rjg_Hp4.js} +1 -1
- package/dist/renderer/assets/{book-open-BCdZWncQ.js → book-open-Bu8GCHnG.js} +1 -1
- package/dist/renderer/assets/{channels-hgO3cAIx.js → channels-BxVbG-6j.js} +1 -1
- package/dist/renderer/assets/{chevron-down-BPk77tqY.js → chevron-down-BE8uQmWM.js} +1 -1
- package/dist/renderer/assets/{index-BlA4xPdd.js → index-B7TeF6Es.js} +1 -1
- package/dist/renderer/assets/{index-wYpjqVqC.js → index-BkI9POxj.js} +2 -2
- package/dist/renderer/assets/{knowledge-7pl06KuH.js → knowledge-Kl19SqGS.js} +1 -1
- package/dist/renderer/assets/{pencil-CB1SWZ9A.js → pencil-CPB7SK1m.js} +1 -1
- package/dist/renderer/assets/{play-BvsoXUrM.js → play-DGAO4OCu.js} +1 -1
- package/dist/renderer/assets/{plus-CokBDnaL.js → plus-Bt26z-4q.js} +1 -1
- package/dist/renderer/assets/{save-D-w4kATO.js → save-Une7GMxT.js} +1 -1
- package/dist/renderer/assets/{search-Cnsn6i4Q.js → search-DE0agJjJ.js} +1 -1
- package/dist/renderer/assets/{shield-check-Cjja2Gh6.js → shield-check-De7xaXZh.js} +1 -1
- package/dist/renderer/assets/{threads-BCm6j4eI.js → threads-BnsNL5ei.js} +1 -1
- package/dist/renderer/assets/{trash-2-CIxz9qYY.js → trash-2-6iGF59Ac.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/services/local-ai-core/src/automation/automation-conversation-executor.js +6 -47
- package/dist-electron/services/local-ai-core/src/automation/automation-monitor-service.js +2 -5
- package/dist-electron/services/local-ai-core/src/channel/lark/local-core-lark-gateway.js +6 -53
- package/dist-electron/services/local-ai-core/src/channel/lark/outbound-transport.js +25 -37
- package/dist-electron/services/local-ai-core/src/channel/lark/runtime-state.js +5 -20
- package/dist-electron/services/local-ai-core/src/channel/shared/base-channel-gateway.js +37 -0
- package/dist-electron/services/local-ai-core/src/channel/shared/bridge-event-helpers.js +23 -0
- package/dist-electron/services/local-ai-core/src/channel/shared/channel-keys.js +6 -0
- package/dist-electron/services/local-ai-core/src/channel/weixin/inbound-poller.js +2 -2
- package/dist-electron/services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js +6 -44
- package/dist-electron/services/local-ai-core/src/channel/weixin/runtime-state.js +4 -11
- package/dist-electron/services/local-ai-core/src/channel/weixin/text-utils.js +0 -8
- package/dist-electron/services/local-ai-core/src/cli/lac.js +3 -5
- package/dist-electron/services/local-ai-core/src/kernel/local-core-errors.js +8 -0
- package/dist-electron/services/local-ai-core/src/sandbox/opensandbox-client.js +3 -2
- package/dist-electron/services/local-ai-core/src/scheduler/base-channel-schedule-adapter.js +77 -0
- package/dist-electron/services/local-ai-core/src/scheduler/lark-schedule-adapter.js +13 -79
- package/dist-electron/services/local-ai-core/src/scheduler/local-schedule-adapter.js +2 -10
- package/dist-electron/services/local-ai-core/src/scheduler/run-polling.js +19 -0
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-conversation-executor.js +3 -37
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-job-route.js +20 -0
- package/dist-electron/services/local-ai-core/src/scheduler/scheduler-service.js +15 -28
- package/dist-electron/services/local-ai-core/src/scheduler/thread-resolution.js +12 -0
- package/dist-electron/services/local-ai-core/src/scheduler/weixin-schedule-adapter.js +13 -79
- package/dist-electron/tests/integration/local-core-refactor.test.js +15 -8
- package/package.json +1 -1
- package/dist-electron/services/local-ai-core/src/scheduler/lark-execution-policies.js +0 -13
- package/dist-electron/services/local-ai-core/src/scheduler/weixin-execution-policies.js +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,g as a}from"./index-
|
|
1
|
+
import{j as t,g as a}from"./index-BkI9POxj.js";const n={default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",success:"border-transparent bg-primary/10 text-primary dark:bg-primary/15 dark:text-primary",warning:"border-transparent bg-amber-100 text-amber-700 dark:bg-amber-500/15 dark:text-amber-200",danger:"border-transparent bg-destructive/10 text-destructive dark:bg-destructive/20 dark:text-red-200",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",info:"border-transparent bg-blue-100 text-blue-700 dark:bg-blue-500/15 dark:text-blue-200"};function s({children:r,variant:e="default"}){return t.jsx("span",{className:a("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n[e]),children:r})}export{s as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,g as d}from"./index-
|
|
1
|
+
import{j as a,g as d}from"./index-BkI9POxj.js";function n({children:r,className:o,hover:e}){return a.jsx("div",{className:d("rounded-lg p-5 text-card-foreground transition-colors duration-200 animate-float-in","border border-black/[0.08] bg-white/62 shadow-[0_1px_1px_rgba(0,0,0,0.04)] backdrop-blur-2xl","dark:border-white/[0.07] dark:bg-white/[0.06] dark:shadow-none",e&&"cursor-pointer hover:border-black/[0.12] hover:bg-white/76 hover:shadow-[0_10px_26px_rgba(0,0,0,0.07)] dark:hover:border-white/[0.10] dark:hover:bg-white/[0.09] dark:hover:shadow-none",o),children:r})}export{n as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as g,u as H,r as n,k as $,H as T,I as C,j as e,B as c,R as q,L as V,T as F,J as R,K as J,N as Q}from"./index-
|
|
1
|
+
import{c as g,u as H,r as n,k as $,H as T,I as C,j as e,B as c,R as q,L as V,T as F,J as R,K as J,N as Q}from"./index-BkI9POxj.js";import{B as x}from"./Badge-BfY1VaHS.js";import{I as X}from"./Input-R1XdFK1K.js";import{P as G,S as l,a as I}from"./Page-Dp0obeSw.js";import{S as O}from"./shield-check-De7xaXZh.js";import{S as W,P as Y}from"./save-Une7GMxT.js";import"./Card-DWA_Tww_.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as D,z as u,u as J,r as n,j as t,s as z,B as o,D as O,E as w}from"./index-
|
|
1
|
+
import{A as D,z as u,u as J,r as n,j as t,s as z,B as o,D as O,E as w}from"./index-BkI9POxj.js";import{l as U}from"./threads-BnsNL5ei.js";import{C as W}from"./Card-DWA_Tww_.js";import{B as x}from"./Badge-BfY1VaHS.js";import{M as $}from"./Modal-CrcIwIFL.js";import{I as y,T as B}from"./Input-R1XdFK1K.js";import{S as I}from"./Select-6mVQaf84.js";import{E as F}from"./EmptyState-zatDjLj_.js";import{P as L}from"./Page-Dp0obeSw.js";import{P as H}from"./plus-Bt26z-4q.js";import{P as _}from"./play-DGAO4OCu.js";import{P as q}from"./pencil-CPB7SK1m.js";import{T as G}from"./trash-2-6iGF59Ac.js";import"./index-B7TeF6Es.js";import"./chevron-down-BE8uQmWM.js";function Q(a){const i=D({workspace_id:a});return u("GET",`/scheduler/jobs${i}`)}function K(a){return u("POST","/scheduler/jobs",a)}function V(a,i){return u("PATCH",`/scheduler/jobs/${encodeURIComponent(a)}`,i)}function X(a){return u("DELETE",`/scheduler/jobs/${encodeURIComponent(a)}`)}function Y(a){return u("POST",`/scheduler/jobs/${encodeURIComponent(a)}/run`)}const h={workspaceId:"",executionMode:"same-thread",triggerType:"cron",cronExpr:"0 9 * * *",runAt:"",promptTemplate:"",description:"",chatId:"",platformUserId:"",threadId:"",enabled:!0};function Z(a){return a?{workspaceId:a.workspaceId,executionMode:a.executionMode,triggerType:a.triggerType,cronExpr:a.cronExpr||"0 9 * * *",runAt:a.runAt?String(a.runAt).slice(0,16):"",promptTemplate:a.promptTemplate,description:a.description,chatId:a.route.channelId,platformUserId:a.route.participantId||"",threadId:a.route.threadId||"",enabled:a.enabled}:h}function ee(a){return{workspaceId:a.workspaceId,platform:"local",route:{type:"local.thread",channelId:a.workspaceId||"local",...a.threadId?{threadId:a.threadId}:{}},executionMode:a.executionMode||"same-thread",triggerType:a.triggerType,...a.triggerType==="cron"?{cronExpr:a.cronExpr,runAt:void 0}:{runAt:new Date(a.runAt).toISOString(),cronExpr:void 0},promptTemplate:a.promptTemplate,description:a.description,enabled:a.enabled}}function ge(){const{t:a}=J(),[i,j]=n.useState([]),[g,T]=n.useState([]),[E,v]=n.useState(!0),[S,d]=n.useState(!1),[C,k]=n.useState(!1),[m,f]=n.useState(null),[s,r]=n.useState(h),b=n.useMemo(()=>g.map(e=>t.jsx("option",{value:e.id,children:e.name},e.id)),[g]),c=n.useCallback(async()=>{v(!0);try{const[e,l]=await Promise.all([Q(),U().then(p=>p.workspaces)]);j(e.jobs||[]),T(l),r(p=>p.workspaceId||l.length===0?p:{...p,workspaceId:l[0].id})}finally{v(!1)}},[]);n.useEffect(()=>{c();const e=z(l=>{(l.type==="scheduler.job.updated"||l.type==="scheduler.run.updated")&&c()});return()=>e()},[c]);const N=()=>{var e;f(null),r({...h,workspaceId:((e=g[0])==null?void 0:e.id)||""}),d(!0)},A=e=>{f(e),r(Z(e)),d(!0)},R=async()=>{if(!(!s.workspaceId||!s.promptTemplate.trim())&&!(s.triggerType==="once"&&!s.runAt)){k(!0);try{const e=ee(s);m?await V(m.id,e):await K(e),d(!1),f(null),r(h),await c()}finally{k(!1)}}},M=async e=>{confirm(a("common.confirmDelete"))&&(await X(e),await c())},P=async e=>{await Y(e),await c()};return E&&i.length===0?t.jsx("div",{className:"flex items-center justify-center h-64 text-gray-400 animate-pulse",children:a("common.loading")}):t.jsxs("div",{className:"space-y-4 animate-fade-in",children:[t.jsx(L,{title:a("cron.title"),description:"Create simple scheduled prompts for a workspace.",actions:t.jsxs(o,{onClick:N,children:[t.jsx(H,{size:16})," ",a("cron.add")]})}),i.length===0?t.jsx(F,{message:a("cron.noJobs"),icon:O}):t.jsx("div",{className:"space-y-3",children:i.map(e=>t.jsx(W,{className:"app-panel",children:t.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-white text-sm",children:e.description||e.id}),t.jsx(x,{variant:e.enabled?"success":"default",children:e.enabled?a("cron.enabled"):"disabled"}),t.jsx(x,{variant:"default",children:e.triggerType}),t.jsx(x,{variant:"default",children:e.platform}),e.lastStatus&&t.jsx(x,{variant:e.lastStatus==="failed"?"danger":"default",children:e.lastStatus})]}),t.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-500 dark:text-gray-400 mt-2",children:[t.jsxs("span",{children:[t.jsx("strong",{children:"Workspace:"})," ",e.workspaceId]}),t.jsxs("span",{children:[t.jsx("strong",{children:"Execution:"})," ",e.executionMode]}),t.jsxs("span",{children:[t.jsx("strong",{children:"Route:"})," ",e.route.channelId," / ",e.route.participantId]}),t.jsxs("span",{children:[t.jsxs("strong",{children:[e.triggerType==="cron"?a("cron.expression"):"Run at",":"]})," ",e.triggerType==="cron"?e.cronExpr:w(e.runAt||"")]}),e.route.threadId&&t.jsxs("span",{children:[t.jsx("strong",{children:"Thread:"})," ",e.route.threadId]}),e.lastRunAt&&t.jsxs("span",{children:[t.jsxs("strong",{children:[a("cron.lastRun"),":"]})," ",w(e.lastRunAt)]})]}),t.jsx("p",{className:"mt-3 line-clamp-3 rounded-[16px] bg-black/[0.035] px-3 py-2 text-sm leading-6 text-gray-700 dark:bg-white/[0.05] dark:text-gray-300",children:e.promptTemplate}),e.lastError&&t.jsx("p",{className:"text-xs text-red-500 mt-2",children:e.lastError})]}),t.jsxs("div",{className:"flex shrink-0 gap-2 lg:pt-0",children:[t.jsx(o,{size:"sm",variant:"secondary",className:"app-icon-button",onClick:()=>void P(e.id),"aria-label":"Run now",children:t.jsx(_,{size:14})}),t.jsx(o,{size:"sm",variant:"secondary",className:"app-icon-button",onClick:()=>A(e),"aria-label":"Edit job",children:t.jsx(q,{size:14})}),t.jsx(o,{size:"sm",variant:"danger",className:"app-icon-button",onClick:()=>void M(e.id),"aria-label":"Delete job",children:t.jsx(G,{size:14})})]})]})},e.id))}),t.jsx($,{open:S,onClose:()=>d(!1),title:m?"Edit scheduler job":a("cron.add"),children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(I,{label:"Workspace",value:s.workspaceId,onChange:e=>r({...s,workspaceId:e.target.value}),children:[t.jsx("option",{value:"",children:"Select workspace"}),b]}),t.jsxs(I,{label:"Schedule type",value:s.triggerType,onChange:e=>r({...s,triggerType:e.target.value}),children:[t.jsx("option",{value:"cron",children:"Repeating"}),t.jsx("option",{value:"once",children:"One time"})]}),s.triggerType==="cron"?t.jsxs("div",{className:"space-y-2",children:[t.jsx(y,{label:a("cron.expression"),value:s.cronExpr,onChange:e=>r({...s,cronExpr:e.target.value}),placeholder:"0 9 * * *"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:[["0 9 * * *","Daily 09:00"],["0 9 * * 1","Weekly Mon"],["*/30 * * * *","Every 30m"]].map(([e,l])=>t.jsx("button",{type:"button",onClick:()=>r({...s,cronExpr:e}),className:`app-segment text-xs ${s.cronExpr===e?"app-segment-active":"app-segment-idle"}`,children:l},e))})]}):t.jsx(y,{label:"Run at",type:"datetime-local",value:s.runAt,onChange:e=>r({...s,runAt:e.target.value})}),t.jsx(y,{label:a("cron.description"),value:s.description,onChange:e=>r({...s,description:e.target.value})}),t.jsx(B,{label:a("cron.prompt"),value:s.promptTemplate,onChange:e=>r({...s,promptTemplate:e.target.value}),rows:4,placeholder:"Summarize today's blockers and post a status update."}),t.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("input",{type:"checkbox",checked:s.enabled,onChange:e=>r({...s,enabled:e.target.checked})}),a("cron.enabled")]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[t.jsx(o,{variant:"secondary",onClick:()=>d(!1),children:a("common.cancel")}),t.jsx(o,{onClick:()=>void R(),disabled:C,children:a(m?"common.save":"cron.add")})]})]})})]})}export{ge as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as u,u as ee,r,a as se,l as te,b as M,d as ae,e as re,f as ie,o as ne,s as de,j as e,M as le,W as ce,B as oe,R as me,L as E,F as xe,S as ue,g as he}from"./index-
|
|
1
|
+
import{c as u,u as ee,r,a as se,l as te,b as M,d as ae,e as re,f as ie,o as ne,s as de,j as e,M as le,W as ce,B as oe,R as me,L as E,F as xe,S as ue,g as he}from"./index-BkI9POxj.js";import{C as f}from"./Card-DWA_Tww_.js";import{B as n}from"./Badge-BfY1VaHS.js";import{E as j}from"./EmptyState-zatDjLj_.js";import{P as ge}from"./Page-Dp0obeSw.js";import{l as pe}from"./threads-BnsNL5ei.js";import{B as fe}from"./book-open-Bu8GCHnG.js";import{S as $}from"./shield-check-De7xaXZh.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -38,4 +38,4 @@ import{c as u,u as ee,r,a as se,l as te,b as M,d as ae,e as re,f as ie,o as ne,s
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const Ee=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ze=u("server",Ee);function Ce({title:a,description:t,to:l,icon:c,primary:m}){return e.jsxs(E,{to:l,className:["group flex min-h-[112px] flex-col justify-between rounded-[18px] border p-5 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-ring",m?"border-primary/20 bg-primary/5 text-foreground hover:bg-primary/10 dark:bg-primary/10 dark:hover:bg-primary/15":"border-black/[0.08] bg-white text-foreground hover:bg-[#fcfcfd] dark:border-white/[0.07] dark:bg-white/[0.04] dark:hover:bg-white/[0.07]"].join(" "),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary dark:bg-primary/15",children:e.jsx(c,{size:20})}),e.jsx(B,{size:17,className:"mt-1 text-muted-foreground/45 transition-colors group-hover:text-foreground"})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:a}),e.jsx("p",{className:"mt-2 max-w-sm text-sm leading-5 text-muted-foreground",children:t})]})]})}function v({label:a,value:t,detail:l,tone:c="neutral"}){return e.jsxs("div",{className:"app-surface p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e.jsx("p",{className:he("mt-2 text-2xl font-semibold",c==="primary"?"text-primary":c==="warning"?"text-amber-600 dark:text-amber-300":"text-foreground"),children:t}),e.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:l})]})}function _e(a){return a.readiness==="ready"?"success":a.readiness==="failed"?"danger":a.readiness==="degraded"?"warning":a.status==="installed"?"success":a.status==="error"?"danger":"warning"}function De(a){return a.readiness||(a.status==="installed"?"ready":"unknown")}function L({title:a,description:t,tasks:l,empty:c,urgent:m}){return e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsx("div",{className:"border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:a}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),e.jsx(n,{variant:m&&l.length>0?"warning":"secondary",children:l.length})]})}),l.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:c,icon:Le})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:l.map(d=>e.jsxs("div",{className:"px-5 py-4 transition-colors hover:bg-black/[0.025] dark:hover:bg-white/[0.035]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),e.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[d.workspaceId," · ",d.runtimeId]})]}),e.jsx(n,{variant:d.status==="failed"?"danger":d.status==="completed"?"success":"info",children:d.status})]}),e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Updated ",new Date(d.updatedAt).toLocaleString()]})]},d.taskId))})]})}function Te({approvals:a}){return e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsx("div",{className:"border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"待审批"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"高风险操作会在这里等待确认或拒绝。"})]}),e.jsx(n,{variant:a.length>0?"warning":"secondary",children:a.length})]})}),a.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:"暂无待审批操作",icon:$})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:a.map(t=>e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[t.workspaceId," · ",t.kind]})]}),e.jsx(n,{variant:t.riskLevel==="high"?"danger":"warning",children:t.riskLevel})]}),e.jsx("p",{className:"mt-2 line-clamp-2 text-xs leading-5 text-muted-foreground",children:t.description})]},t.approvalId))})]})}function Pe({events:a}){return e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsxs("div",{className:"border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"审计记录"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"最近的任务、审批和权限事件。"})]}),a.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:"暂无审计记录",icon:$})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:a.map(t=>e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t.summary}),e.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[t.type," · ",t.actor||"system"]})]}),t.riskLevel?e.jsx(n,{variant:t.riskLevel==="high"?"danger":"secondary",children:t.riskLevel}):null]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:new Date(t.createdAt).toLocaleString()})]},t.auditId))})]})}function Ke(){const{t:a}=ee(),[t,l]=r.useState([]),[c,m]=r.useState([]),[d,W]=r.useState([]),[N,F]=r.useState([]),[H,U]=r.useState([]),[w,V]=r.useState([]),[K,O]=r.useState([]),[Q,z]=r.useState(!0),[G,C]=r.useState(!1),[J,g]=r.useState(!1),[_,D]=r.useState(""),[T,p]=r.useState(""),{desktopRuntime:h,desktopWorkspace:qe,knowledgeModule:P,schedulerModule:q}=se(),R=c.filter(s=>s.installed),y=[{title:"继续聊天",description:"打开本地对话,继续当前项目里的 agent 线程。",to:"/chat",icon:le,primary:!0},{title:"工作区",description:"管理项目、平台、模型和本地运行配置。",to:"/workspace",icon:ce}];P&&y.push({title:"知识库",description:"上传文档,维护可被检索的项目资料。",to:"/knowledge",icon:fe}),q&&y.push({title:"定时任务",description:"查看和管理自动执行的计划任务。",to:"/cron",icon:ve}),(!P||!q)&&y.push({title:"系统设置",description:"查看配置、日志和桌面应用偏好。",to:"/system",icon:ue});const k=r.useCallback(async()=>{var s;z(!0),D(""),p("");try{if(h){const[i,x]=await Promise.all([pe(),te().then(S=>({status:"fulfilled",runtimes:S.runtimes}),S=>({status:"rejected",error:S}))]),[o,A,b]=await Promise.all([M({status:["created","queued","running"],limit:6}),M({status:"waiting_for_user",limit:6}),M({status:["completed","failed","cancelled"],limit:6})]),[Y,Z]=await Promise.all([ae({status:"pending",limit:6}),re({limit:6})]);W(o.tasks||[]),F(A.tasks||[]),U(b.tasks||[]),V(Y.approvals||[]),O(Z.events||[]),l(i.workspaces||[]),x.status==="fulfilled"?m(x.runtimes):(m([]),p(((s=x.error)==null?void 0:s.message)||String(x.error)));return}}catch(i){D(i.message||String(i))}finally{z(!1)}},[h]),X=r.useCallback(async()=>{C(!0),g(!0),p("");try{m((await ie()).runtimes)}catch(s){p(s.message||String(s))}finally{C(!1),g(!1)}},[]);return r.useEffect(()=>{k();const s=()=>k();window.addEventListener("cc:refresh",s);const i=ne(()=>{k()}),x=de(o=>{if(o.type==="runtime.detect.started"){g(!0);return}if(o.type==="runtime.detect.completed"){g(!1),m(o.runtimes);return}if(o.type==="runtime.detect.failed"){g(!1),p(o.error);return}o.type==="runtime.status.changed"&&m(A=>A.map(b=>b.runtimeId===o.runtime.runtimeId?o.runtime:b))});return()=>{window.removeEventListener("cc:refresh",s),i(),x()}},[h,k]),Q&&t.length===0?e.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:e.jsx(ye,{className:"animate-pulse",size:24})}):e.jsxs("div",{className:"animate-fade-in space-y-8",children:[e.jsx(ge,{title:"概览",description:"继续最近的工作,或进入项目、知识和自动化配置。当前版本 v0.1.57"}),e.jsxs("section",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(v,{label:"Projects",value:t.length,detail:"configured workspaces",tone:"primary"}),e.jsx(v,{label:"Running",value:d.length,detail:"active agent tasks"}),e.jsx(v,{label:"Waiting",value:N.length+w.length,detail:"needs attention",tone:N.length+w.length>0?"warning":"neutral"}),e.jsx(v,{label:"Runtimes",value:R.length,detail:"installed locally"})]}),_?e.jsx("div",{role:"alert",className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",children:_}):null,e.jsxs("section",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-end justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground",children:"快速开始"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"常用入口会保留在最前面。"})]})}),e.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:y.map(s=>e.jsx(Ce,{...s},s.to))})]}),h?e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07] sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"本机 Agent Runtime"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"显示本机 runtime 安装检测状态,不执行安装或登录检查。"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(n,{variant:R.length>0?"success":"default",children:[R.length," installed"]}),J?e.jsx(n,{variant:"info",children:"checking"}):null,e.jsxs(oe,{variant:"outline",size:"sm",loading:G,onClick:X,title:"刷新 runtime 检测",children:[e.jsx(me,{size:15}),"刷新"]})]})]}),T?e.jsxs("div",{className:"px-5 py-4 text-sm text-amber-700 dark:text-amber-200",children:["检测失败:",T]}):c.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:"还没有 runtime 检测结果",icon:I})}):e.jsx("div",{className:"grid grid-cols-1 gap-3 p-5 md:grid-cols-2 xl:grid-cols-3",children:c.map(s=>{var i,x;return e.jsxs("div",{className:"app-list-row",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:["flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",s.status==="installed"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-300":s.status==="error"?"bg-red-500/10 text-red-600 dark:text-red-200":"bg-amber-500/10 text-amber-700 dark:text-amber-200"].join(" "),children:e.jsx(I,{size:19})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-semibold text-foreground",children:s.displayName}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:s.agentType})]})]}),s.status==="installed"?e.jsx(Ae,{size:18,className:"mt-0.5 shrink-0 text-emerald-500"}):e.jsx(we,{size:18,className:"mt-0.5 shrink-0 text-amber-500"})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(n,{variant:s.status==="installed"?"success":s.status==="error"?"danger":"warning",children:s.status}),e.jsx(n,{variant:_e(s),children:De(s)}),e.jsx(n,{children:s.source}),s.version?e.jsxs(n,{variant:"secondary",children:["v",s.version]}):null]}),e.jsx("p",{className:"mt-3 text-sm leading-5 text-muted-foreground",children:s.summary}),s.lastLaunchError?e.jsx("p",{className:"mt-2 text-xs leading-5 text-red-600 dark:text-red-200",children:s.lastLaunchError.userMessage}):s.issues[0]?e.jsx("p",{className:"mt-2 text-xs leading-5 text-amber-700 dark:text-amber-200",children:s.issues[0].message}):null,(i=s.lastLaunchError)!=null&&i.suggestedAction?e.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s.lastLaunchError.suggestedAction}):null,s.binaryPath||s.command?e.jsx("p",{className:"mt-3 truncate rounded-lg bg-black/[0.045] px-2.5 py-2 font-mono text-xs text-muted-foreground dark:bg-white/[0.06]",children:s.binaryPath||s.command}):null,s.recommendedActions[0]&&!((x=s.lastLaunchError)!=null&&x.suggestedAction)?e.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:s.recommendedActions[0].description}):null,e.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:["Last checked ",new Date(s.lastCheckedAt||s.detectedAt).toLocaleString()]})]},s.agentType)})})]}):null,h?e.jsxs("section",{className:"grid grid-cols-1 gap-4 xl:grid-cols-3",children:[e.jsx(L,{title:"运行中任务",description:"正在排队或执行的 agent 工作。",tasks:d,empty:"暂无运行中的任务"}),e.jsx(L,{title:"等待处理",description:"需要用户输入或审批的任务。",tasks:N,empty:"暂无等待处理的任务",urgent:!0}),e.jsx(L,{title:"最近完成",description:"最近结束、失败或取消的任务。",tasks:H,empty:"暂无最近任务"})]}):null,h?e.jsxs("section",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:[e.jsx(Te,{approvals:w}),e.jsx(Pe,{events:K})]}):null,e.jsxs(f,{className:"app-panel p-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:a("nav.projects")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"最近配置和会话概览。"})]}),e.jsx(E,{to:"/workspace",className:"text-sm font-medium text-primary transition-colors hover:text-primary/80",children:a("common.viewAll")})]}),t.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:a("projects.noProjects"),icon:xe})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:t.slice(0,6).map(s=>{var i;return e.jsxs(E,{to:`/workspace?project=${encodeURIComponent(s.name)}`,className:"group flex items-center justify-between gap-3 px-5 py-4 transition-colors duration-200 hover:bg-black/[0.04] dark:hover:bg-white/[0.06]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:e.jsx(ze,{size:17})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:s.name}),e.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[s.agentType," · ",((i=s.platforms)==null?void 0:i.join(", "))||"no platform"," · ",s.sessionsCount," sessions"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.heartbeatEnabled?e.jsx(n,{variant:"success",children:"heartbeat"}):null,e.jsx(B,{size:16,className:"text-muted-foreground/45 transition-colors group-hover:text-foreground"})]})]},s.name)})})]})]})}export{Ke as default};
|
|
41
|
+
*/const Ee=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ze=u("server",Ee);function Ce({title:a,description:t,to:l,icon:c,primary:m}){return e.jsxs(E,{to:l,className:["group flex min-h-[112px] flex-col justify-between rounded-[18px] border p-5 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-ring",m?"border-primary/20 bg-primary/5 text-foreground hover:bg-primary/10 dark:bg-primary/10 dark:hover:bg-primary/15":"border-black/[0.08] bg-white text-foreground hover:bg-[#fcfcfd] dark:border-white/[0.07] dark:bg-white/[0.04] dark:hover:bg-white/[0.07]"].join(" "),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary dark:bg-primary/15",children:e.jsx(c,{size:20})}),e.jsx(B,{size:17,className:"mt-1 text-muted-foreground/45 transition-colors group-hover:text-foreground"})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:a}),e.jsx("p",{className:"mt-2 max-w-sm text-sm leading-5 text-muted-foreground",children:t})]})]})}function v({label:a,value:t,detail:l,tone:c="neutral"}){return e.jsxs("div",{className:"app-surface p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e.jsx("p",{className:he("mt-2 text-2xl font-semibold",c==="primary"?"text-primary":c==="warning"?"text-amber-600 dark:text-amber-300":"text-foreground"),children:t}),e.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:l})]})}function _e(a){return a.readiness==="ready"?"success":a.readiness==="failed"?"danger":a.readiness==="degraded"?"warning":a.status==="installed"?"success":a.status==="error"?"danger":"warning"}function De(a){return a.readiness||(a.status==="installed"?"ready":"unknown")}function L({title:a,description:t,tasks:l,empty:c,urgent:m}){return e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsx("div",{className:"border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:a}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t})]}),e.jsx(n,{variant:m&&l.length>0?"warning":"secondary",children:l.length})]})}),l.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:c,icon:Le})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:l.map(d=>e.jsxs("div",{className:"px-5 py-4 transition-colors hover:bg-black/[0.025] dark:hover:bg-white/[0.035]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),e.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[d.workspaceId," · ",d.runtimeId]})]}),e.jsx(n,{variant:d.status==="failed"?"danger":d.status==="completed"?"success":"info",children:d.status})]}),e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Updated ",new Date(d.updatedAt).toLocaleString()]})]},d.taskId))})]})}function Te({approvals:a}){return e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsx("div",{className:"border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"待审批"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"高风险操作会在这里等待确认或拒绝。"})]}),e.jsx(n,{variant:a.length>0?"warning":"secondary",children:a.length})]})}),a.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:"暂无待审批操作",icon:$})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:a.map(t=>e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[t.workspaceId," · ",t.kind]})]}),e.jsx(n,{variant:t.riskLevel==="high"?"danger":"warning",children:t.riskLevel})]}),e.jsx("p",{className:"mt-2 line-clamp-2 text-xs leading-5 text-muted-foreground",children:t.description})]},t.approvalId))})]})}function Pe({events:a}){return e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsxs("div",{className:"border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"审计记录"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"最近的任务、审批和权限事件。"})]}),a.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:"暂无审计记录",icon:$})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:a.map(t=>e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t.summary}),e.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[t.type," · ",t.actor||"system"]})]}),t.riskLevel?e.jsx(n,{variant:t.riskLevel==="high"?"danger":"secondary",children:t.riskLevel}):null]}),e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:new Date(t.createdAt).toLocaleString()})]},t.auditId))})]})}function Ke(){const{t:a}=ee(),[t,l]=r.useState([]),[c,m]=r.useState([]),[d,W]=r.useState([]),[N,F]=r.useState([]),[H,U]=r.useState([]),[w,V]=r.useState([]),[K,O]=r.useState([]),[Q,z]=r.useState(!0),[G,C]=r.useState(!1),[J,g]=r.useState(!1),[_,D]=r.useState(""),[T,p]=r.useState(""),{desktopRuntime:h,desktopWorkspace:qe,knowledgeModule:P,schedulerModule:q}=se(),R=c.filter(s=>s.installed),y=[{title:"继续聊天",description:"打开本地对话,继续当前项目里的 agent 线程。",to:"/chat",icon:le,primary:!0},{title:"工作区",description:"管理项目、平台、模型和本地运行配置。",to:"/workspace",icon:ce}];P&&y.push({title:"知识库",description:"上传文档,维护可被检索的项目资料。",to:"/knowledge",icon:fe}),q&&y.push({title:"定时任务",description:"查看和管理自动执行的计划任务。",to:"/cron",icon:ve}),(!P||!q)&&y.push({title:"系统设置",description:"查看配置、日志和桌面应用偏好。",to:"/system",icon:ue});const k=r.useCallback(async()=>{var s;z(!0),D(""),p("");try{if(h){const[i,x]=await Promise.all([pe(),te().then(S=>({status:"fulfilled",runtimes:S.runtimes}),S=>({status:"rejected",error:S}))]),[o,A,b]=await Promise.all([M({status:["created","queued","running"],limit:6}),M({status:"waiting_for_user",limit:6}),M({status:["completed","failed","cancelled"],limit:6})]),[Y,Z]=await Promise.all([ae({status:"pending",limit:6}),re({limit:6})]);W(o.tasks||[]),F(A.tasks||[]),U(b.tasks||[]),V(Y.approvals||[]),O(Z.events||[]),l(i.workspaces||[]),x.status==="fulfilled"?m(x.runtimes):(m([]),p(((s=x.error)==null?void 0:s.message)||String(x.error)));return}}catch(i){D(i.message||String(i))}finally{z(!1)}},[h]),X=r.useCallback(async()=>{C(!0),g(!0),p("");try{m((await ie()).runtimes)}catch(s){p(s.message||String(s))}finally{C(!1),g(!1)}},[]);return r.useEffect(()=>{k();const s=()=>k();window.addEventListener("cc:refresh",s);const i=ne(()=>{k()}),x=de(o=>{if(o.type==="runtime.detect.started"){g(!0);return}if(o.type==="runtime.detect.completed"){g(!1),m(o.runtimes);return}if(o.type==="runtime.detect.failed"){g(!1),p(o.error);return}o.type==="runtime.status.changed"&&m(A=>A.map(b=>b.runtimeId===o.runtime.runtimeId?o.runtime:b))});return()=>{window.removeEventListener("cc:refresh",s),i(),x()}},[h,k]),Q&&t.length===0?e.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:e.jsx(ye,{className:"animate-pulse",size:24})}):e.jsxs("div",{className:"animate-fade-in space-y-8",children:[e.jsx(ge,{title:"概览",description:"继续最近的工作,或进入项目、知识和自动化配置。当前版本 v0.1.58"}),e.jsxs("section",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(v,{label:"Projects",value:t.length,detail:"configured workspaces",tone:"primary"}),e.jsx(v,{label:"Running",value:d.length,detail:"active agent tasks"}),e.jsx(v,{label:"Waiting",value:N.length+w.length,detail:"needs attention",tone:N.length+w.length>0?"warning":"neutral"}),e.jsx(v,{label:"Runtimes",value:R.length,detail:"installed locally"})]}),_?e.jsx("div",{role:"alert",className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",children:_}):null,e.jsxs("section",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-end justify-between gap-4",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground",children:"快速开始"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"常用入口会保留在最前面。"})]})}),e.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:y.map(s=>e.jsx(Ce,{...s},s.to))})]}),h?e.jsxs(f,{className:"app-panel overflow-hidden p-0",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07] sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:"本机 Agent Runtime"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"显示本机 runtime 安装检测状态,不执行安装或登录检查。"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(n,{variant:R.length>0?"success":"default",children:[R.length," installed"]}),J?e.jsx(n,{variant:"info",children:"checking"}):null,e.jsxs(oe,{variant:"outline",size:"sm",loading:G,onClick:X,title:"刷新 runtime 检测",children:[e.jsx(me,{size:15}),"刷新"]})]})]}),T?e.jsxs("div",{className:"px-5 py-4 text-sm text-amber-700 dark:text-amber-200",children:["检测失败:",T]}):c.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:"还没有 runtime 检测结果",icon:I})}):e.jsx("div",{className:"grid grid-cols-1 gap-3 p-5 md:grid-cols-2 xl:grid-cols-3",children:c.map(s=>{var i,x;return e.jsxs("div",{className:"app-list-row",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:["flex h-10 w-10 shrink-0 items-center justify-center rounded-xl",s.status==="installed"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-300":s.status==="error"?"bg-red-500/10 text-red-600 dark:text-red-200":"bg-amber-500/10 text-amber-700 dark:text-amber-200"].join(" "),children:e.jsx(I,{size:19})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-semibold text-foreground",children:s.displayName}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:s.agentType})]})]}),s.status==="installed"?e.jsx(Ae,{size:18,className:"mt-0.5 shrink-0 text-emerald-500"}):e.jsx(we,{size:18,className:"mt-0.5 shrink-0 text-amber-500"})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(n,{variant:s.status==="installed"?"success":s.status==="error"?"danger":"warning",children:s.status}),e.jsx(n,{variant:_e(s),children:De(s)}),e.jsx(n,{children:s.source}),s.version?e.jsxs(n,{variant:"secondary",children:["v",s.version]}):null]}),e.jsx("p",{className:"mt-3 text-sm leading-5 text-muted-foreground",children:s.summary}),s.lastLaunchError?e.jsx("p",{className:"mt-2 text-xs leading-5 text-red-600 dark:text-red-200",children:s.lastLaunchError.userMessage}):s.issues[0]?e.jsx("p",{className:"mt-2 text-xs leading-5 text-amber-700 dark:text-amber-200",children:s.issues[0].message}):null,(i=s.lastLaunchError)!=null&&i.suggestedAction?e.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:s.lastLaunchError.suggestedAction}):null,s.binaryPath||s.command?e.jsx("p",{className:"mt-3 truncate rounded-lg bg-black/[0.045] px-2.5 py-2 font-mono text-xs text-muted-foreground dark:bg-white/[0.06]",children:s.binaryPath||s.command}):null,s.recommendedActions[0]&&!((x=s.lastLaunchError)!=null&&x.suggestedAction)?e.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:s.recommendedActions[0].description}):null,e.jsxs("p",{className:"mt-3 text-xs text-muted-foreground",children:["Last checked ",new Date(s.lastCheckedAt||s.detectedAt).toLocaleString()]})]},s.agentType)})})]}):null,h?e.jsxs("section",{className:"grid grid-cols-1 gap-4 xl:grid-cols-3",children:[e.jsx(L,{title:"运行中任务",description:"正在排队或执行的 agent 工作。",tasks:d,empty:"暂无运行中的任务"}),e.jsx(L,{title:"等待处理",description:"需要用户输入或审批的任务。",tasks:N,empty:"暂无等待处理的任务",urgent:!0}),e.jsx(L,{title:"最近完成",description:"最近结束、失败或取消的任务。",tasks:H,empty:"暂无最近任务"})]}):null,h?e.jsxs("section",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:[e.jsx(Te,{approvals:w}),e.jsx(Pe,{events:K})]}):null,e.jsxs(f,{className:"app-panel p-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-black/[0.08] px-5 py-4 dark:border-white/[0.07]",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-foreground",children:a("nav.projects")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"最近配置和会话概览。"})]}),e.jsx(E,{to:"/workspace",className:"text-sm font-medium text-primary transition-colors hover:text-primary/80",children:a("common.viewAll")})]}),t.length===0?e.jsx("div",{className:"p-5",children:e.jsx(j,{message:a("projects.noProjects"),icon:xe})}):e.jsx("div",{className:"divide-y divide-black/[0.08] dark:divide-white/[0.07]",children:t.slice(0,6).map(s=>{var i;return e.jsxs(E,{to:`/workspace?project=${encodeURIComponent(s.name)}`,className:"group flex items-center justify-between gap-3 px-5 py-4 transition-colors duration-200 hover:bg-black/[0.04] dark:hover:bg-white/[0.06]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:e.jsx(ze,{size:17})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:s.name}),e.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[s.agentType," · ",((i=s.platforms)==null?void 0:i.join(", "))||"no platform"," · ",s.sessionsCount," sessions"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.heartbeatEnabled?e.jsx(n,{variant:"success",children:"heartbeat"}):null,e.jsx(B,{size:16,className:"text-muted-foreground/45 transition-colors group-hover:text-foreground"})]})]},s.name)})})]})]})}export{Ke as default};
|
package/dist/renderer/assets/{HighlightedMarkdown-DyvF3DHK.js → HighlightedMarkdown-CsM5n70d.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Jn,h as jn,j as fe,r as ei}from"./index-
|
|
1
|
+
import{c as Jn,h as jn,j as fe,r as ei}from"./index-BkI9POxj.js";import{C as ti}from"./chevron-down-BE8uQmWM.js";import{c as ni,v as ii,M as ai,r as ri}from"./ThreadChat-BFzbn3L6.js";import"./channels-BxVbG-6j.js";import"./shield-check-De7xaXZh.js";import"./Input-R1XdFK1K.js";import"./Modal-CrcIwIFL.js";import"./index-B7TeF6Es.js";import"./search-DE0agJjJ.js";import"./pencil-CPB7SK1m.js";import"./trash-2-6iGF59Ac.js";import"./knowledge-Kl19SqGS.js";import"./threads-BnsNL5ei.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,g as i}from"./index-
|
|
1
|
+
import{j as e,g as i}from"./index-BkI9POxj.js";function t({label:s,className:o,...r}){return e.jsxs("div",{className:"space-y-1.5",children:[s&&e.jsx("label",{className:"block text-sm font-medium text-foreground",children:s}),e.jsx("input",{className:i("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",o),...r})]})}function l({label:s,className:o,...r}){return e.jsxs("div",{className:"space-y-1.5",children:[s&&e.jsx("label",{className:"block text-sm font-medium text-foreground",children:s}),e.jsx("textarea",{className:i("flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors resize-none","placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",o),...r})]})}export{t as I,l as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as y,Y as q,r as t,j as e,L as C,B as p,S as H,g as P,E as _}from"./index-
|
|
1
|
+
import{c as y,Y as q,r as t,j as e,L as C,B as p,S as H,g as P,E as _}from"./index-BkI9POxj.js";import{C as x}from"./Card-DWA_Tww_.js";import{I as U}from"./Input-R1XdFK1K.js";import{E as F}from"./EmptyState-zatDjLj_.js";import{g as E,h as O,a as V,i as Z,j as G,k as Q,s as Y}from"./knowledge-Kl19SqGS.js";import{A as J}from"./arrow-left-9rjg_Hp4.js";import{S as W}from"./search-DE0agJjJ.js";import{T as X}from"./trash-2-6iGF59Ac.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as T,r as t,j as e,L as D,B as d,S as se,g as I,C as ae,Q as te,E as re}from"./index-
|
|
1
|
+
import{c as T,r as t,j as e,L as D,B as d,S as se,g as I,C as ae,Q as te,E as re}from"./index-BkI9POxj.js";import{C as x}from"./Card-DWA_Tww_.js";import{M as L}from"./Modal-CrcIwIFL.js";import{I as C,T as ne}from"./Input-R1XdFK1K.js";import{E as R}from"./EmptyState-zatDjLj_.js";import{g as ie,a as le,l as oe,c as de,b as ce,u as me,d as xe,e as ge,f as pe}from"./knowledge-Kl19SqGS.js";import{P}from"./pencil-CPB7SK1m.js";import{T as O}from"./trash-2-6iGF59Ac.js";import{S as he}from"./search-DE0agJjJ.js";import{P as ue}from"./plus-Bt26z-4q.js";import{B as fe}from"./book-open-Bu8GCHnG.js";import"./index-B7TeF6Es.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as b,u as N,r as t,O as L,j as e,L as S,B as m}from"./index-
|
|
1
|
+
import{c as b,u as N,r as t,O as L,j as e,L as S,B as m}from"./index-BkI9POxj.js";import{C}from"./Card-DWA_Tww_.js";import{B as E}from"./Badge-BfY1VaHS.js";import{I as k}from"./Input-R1XdFK1K.js";import{S as f}from"./Select-6mVQaf84.js";import{P as z}from"./Page-Dp0obeSw.js";import{A}from"./arrow-left-9rjg_Hp4.js";import{S as I}from"./search-DE0agJjJ.js";import"./index-B7TeF6Es.js";import"./chevron-down-BE8uQmWM.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as K,r as s,P as C,j as i,g as M}from"./index-
|
|
1
|
+
import{c as K,r as s,P as C,j as i,g as M}from"./index-BkI9POxj.js";import{u as I,d as X,e as O,g as Y,P as x,f as N,R as Z,h as J,c as Q,a as ee,i as te,F as ne,D as oe,j as re}from"./index-B7TeF6Es.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as R,z as x,u as q,r,j as s,s as D,B as u,G as B,E as F}from"./index-
|
|
1
|
+
import{A as R,z as x,u as q,r,j as s,s as D,B as u,G as B,E as F}from"./index-BkI9POxj.js";import{l as L}from"./threads-BnsNL5ei.js";import{C as O}from"./Card-DWA_Tww_.js";import{B as g}from"./Badge-BfY1VaHS.js";import{M as U}from"./Modal-CrcIwIFL.js";import{I as f,T as W}from"./Input-R1XdFK1K.js";import{S as v}from"./Select-6mVQaf84.js";import{E as G}from"./EmptyState-zatDjLj_.js";import{P as H}from"./Page-Dp0obeSw.js";import{P as V}from"./plus-Bt26z-4q.js";import{P as Q}from"./play-DGAO4OCu.js";import{P as Z}from"./pencil-CPB7SK1m.js";import{T as J}from"./trash-2-6iGF59Ac.js";import"./index-B7TeF6Es.js";import"./chevron-down-BE8uQmWM.js";function K(t){const n=R({workspace_id:t});return x("GET",`/automation/monitors${n}`)}function X(t){return x("POST","/automation/monitors",t)}function Y(t,n){return x("PATCH",`/automation/monitors/${encodeURIComponent(t)}`,n)}function ee(t){return x("DELETE",`/automation/monitors/${encodeURIComponent(t)}`)}function te(t){return x("POST",`/automation/monitors/${encodeURIComponent(t)}/run`)}const b={workspaceId:"",title:"",sourceType:"stock.quote",symbol:"",condition:"abs_change_percent >= 3",promptTemplate:"",cooldownMinutes:"15",executionMode:"side-thread",enabled:!0};function k(t){const n=t.trim();if(n.includes("&&")||n.includes("||"))return{metric:"expression",operator:"==",value:!0,expression:n};const c=n.match(/^([a-zA-Z0-9_.-]+)\s*(>=|<=|==|!=|>|<)\s*(.+)$/);if(!c)return null;const l=String(c[3]||"").trim(),h=Number(l);return{metric:String(c[1]||"").trim(),operator:c[2],value:Number.isFinite(h)&&l!==""?h:l}}function T(t){return t.condition.expression?t.condition.expression:`${t.condition.metric} ${t.condition.operator} ${t.condition.value}`}function se(t){return t?{workspaceId:t.workspaceId,title:t.title,sourceType:"stock.quote",symbol:String(t.sourceConfig.symbol||""),condition:T(t),promptTemplate:t.promptTemplate,cooldownMinutes:String(Math.round(t.cooldownMs/6e4)),executionMode:t.executionMode,enabled:t.enabled}:b}function ae(t){const n=k(t.condition);if(!n)throw new Error("Invalid condition");return{workspaceId:t.workspaceId,title:t.title,sourceType:t.sourceType,sourceConfig:w[t.sourceType].buildConfig(t),condition:n,promptTemplate:t.promptTemplate,executionMode:t.executionMode,cooldownMs:Math.max(0,Number(t.cooldownMinutes||"0")*6e4),enabled:t.enabled}}const w={"stock.quote":{label:"Stock quote",buildConfig:t=>({symbol:t.symbol.toUpperCase()}),renderSummary:t=>String(t.sourceConfig.symbol||"")}};function je(){const{t}=q(),[n,c]=r.useState([]),[l,h]=r.useState([]),[S,C]=r.useState(!0),[N,p]=r.useState(!1),[E,M]=r.useState(!1),[j,y]=r.useState(null),[a,o]=r.useState(b),I=r.useMemo(()=>l.map(e=>s.jsx("option",{value:e.id,children:e.name},e.id)),[l]),d=r.useCallback(async()=>{C(!0);try{const[e,i]=await Promise.all([K(),L().then(m=>m.workspaces)]);c(e.monitors||[]),h(i),o(m=>m.workspaceId||i.length===0?m:{...m,workspaceId:i[0].id})}finally{C(!1)}},[]);r.useEffect(()=>{d();const e=D(i=>{(i.type==="automation.monitor.updated"||i.type==="automation.monitor.run.updated")&&d()});return()=>e()},[d]);const P=()=>{var e;y(null),o({...b,workspaceId:((e=l[0])==null?void 0:e.id)||""}),p(!0)},A=e=>{y(e),o(se(e)),p(!0)},_=async()=>{if(!(!a.workspaceId||!a.title.trim()||!a.symbol.trim()||!a.promptTemplate.trim()||!k(a.condition))){M(!0);try{const e=ae(a);j?await Y(j.id,e):await X(e),p(!1),y(null),o(b),await d()}finally{M(!1)}}},z=async e=>{confirm(t("common.confirmDelete"))&&(await ee(e),await d())},$=async e=>{await te(e),await d()};return S&&n.length===0?s.jsx("div",{className:"flex h-64 items-center justify-center text-gray-400 animate-pulse",children:t("common.loading")}):s.jsxs("div",{className:"space-y-4 animate-fade-in",children:[s.jsx(H,{title:t("monitors.title"),description:"Create event monitors that trigger agent analysis and stream results back to channels.",actions:s.jsxs(u,{onClick:P,children:[s.jsx(V,{size:16})," ",t("monitors.add")]})}),n.length===0?s.jsx(G,{message:t("monitors.noMonitors"),icon:B}):s.jsx("div",{className:"space-y-3",children:n.map(e=>s.jsx(O,{className:"app-panel",children:s.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:e.title}),s.jsx(g,{variant:e.enabled?"success":"default",children:e.enabled?t("monitors.enabled"):"disabled"}),s.jsx(g,{variant:"default",children:e.sourceType}),s.jsx(g,{variant:"default",children:e.platform}),e.lastStatus&&s.jsx(g,{variant:e.lastStatus==="failed"?"danger":"default",children:e.lastStatus})]}),s.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-gray-500 dark:text-gray-400",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Workspace:"})," ",e.workspaceId]}),s.jsxs("span",{children:[s.jsx("strong",{children:"Subject:"})," ",w["stock.quote"].renderSummary(e)]}),s.jsxs("span",{children:[s.jsx("strong",{children:"Condition:"})," ",T(e)]}),s.jsxs("span",{children:[s.jsx("strong",{children:"Execution:"})," ",e.executionMode]}),s.jsxs("span",{children:[s.jsx("strong",{children:"Cooldown:"})," ",Math.round(e.cooldownMs/6e4),"m"]}),e.lastTriggeredAt&&s.jsxs("span",{children:[s.jsxs("strong",{children:[t("monitors.lastRun"),":"]})," ",F(e.lastTriggeredAt)]})]}),s.jsx("p",{className:"mt-3 line-clamp-3 rounded-[16px] bg-black/[0.035] px-3 py-2 text-sm leading-6 text-gray-700 dark:bg-white/[0.05] dark:text-gray-300",children:e.promptTemplate}),e.lastError&&s.jsx("p",{className:"mt-2 text-xs text-red-500",children:e.lastError})]}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(u,{variant:"secondary",size:"sm",className:"app-icon-button",onClick:()=>$(e.id),title:t("monitors.run"),"aria-label":t("monitors.run"),children:s.jsx(Q,{size:14})}),s.jsx(u,{variant:"secondary",size:"sm",className:"app-icon-button",onClick:()=>A(e),title:t("common.save"),"aria-label":t("common.save"),children:s.jsx(Z,{size:14})}),s.jsx(u,{variant:"danger",size:"sm",className:"app-icon-button",onClick:()=>z(e.id),title:t("common.delete"),"aria-label":t("common.delete"),children:s.jsx(J,{size:14})})]})]})},e.id))}),s.jsx(U,{open:N,title:t(j?"monitors.edit":"monitors.add"),onClose:()=>p(!1),children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(v,{label:"Workspace",value:a.workspaceId,onChange:e=>o({...a,workspaceId:e.target.value}),children:I}),s.jsx(f,{label:t("monitors.monitorTitle"),value:a.title,onChange:e=>o({...a,title:e.target.value})}),s.jsx(v,{label:"Source",value:a.sourceType,onChange:e=>o({...a,sourceType:e.target.value}),children:Object.entries(w).map(([e,i])=>s.jsx("option",{value:e,children:i.label},e))}),a.sourceType==="stock.quote"&&s.jsx(f,{label:"Symbol",value:a.symbol,onChange:e=>o({...a,symbol:e.target.value}),placeholder:"AAPL"}),s.jsx(f,{label:t("monitors.condition"),value:a.condition,onChange:e=>o({...a,condition:e.target.value}),placeholder:"abs_change_percent >= 3"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:[["abs_change_percent >= 3","+/- 3%"],["price >= 500","Price >= 500"],["volume_ratio >= 2","Volume spike"]].map(([e,i])=>s.jsx("button",{type:"button",onClick:()=>o({...a,condition:e}),className:`app-segment text-xs ${a.condition===e?"app-segment-active":"app-segment-idle"}`,children:i},e))}),k(a.condition)?null:s.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-200",children:"Condition should look like metric >= value or a boolean expression."}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(f,{label:t("monitors.cooldown"),value:a.cooldownMinutes,onChange:e=>o({...a,cooldownMinutes:e.target.value})}),s.jsxs(v,{label:"Execution",value:a.executionMode,onChange:e=>o({...a,executionMode:e.target.value}),children:[s.jsx("option",{value:"side-thread",children:"side-thread"}),s.jsx("option",{value:"same-thread",children:"same-thread"})]})]}),s.jsx(W,{label:t("monitors.prompt"),rows:6,value:a.promptTemplate,onChange:e=>o({...a,promptTemplate:e.target.value})}),s.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[s.jsx("input",{type:"checkbox",checked:a.enabled,onChange:e=>o({...a,enabled:e.target.checked})}),t("monitors.enabled")]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(u,{variant:"secondary",onClick:()=>p(!1),children:t("common.cancel")}),s.jsx(u,{onClick:_,disabled:E,children:t("common.save")})]})]})})]})}export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,g as a}from"./index-
|
|
1
|
+
import{j as e,g as a}from"./index-BkI9POxj.js";import{C as n}from"./Card-DWA_Tww_.js";function o({title:s,description:r,actions:t}){return e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:s}),r?e.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-muted-foreground",children:r}):null]}),t?e.jsx("div",{className:"flex shrink-0 flex-wrap gap-2",children:t}):null]})}function b({title:s,description:r,actions:t,children:l,className:d,bodyClassName:m}){return e.jsxs(n,{className:a("p-0",d),children:[(s||r||t)&&e.jsxs("div",{className:"flex flex-col gap-3 border-b px-5 py-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[s?e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s}):null,r?e.jsx("p",{className:"mt-1 text-sm leading-5 text-muted-foreground",children:r}):null]}),t?e.jsx("div",{className:"flex shrink-0 flex-wrap gap-2",children:t}):null]}),e.jsx("div",{className:a("p-5",m),children:l})]})}const x={neutral:"border-border bg-muted text-muted-foreground",success:"border-primary/20 bg-primary/10 text-primary",warning:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",danger:"border-destructive/20 bg-destructive/10 text-destructive dark:text-red-200",info:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-400/20 dark:bg-blue-500/10 dark:text-blue-200"};function c({children:s,tone:r="neutral"}){return e.jsx("span",{className:a("inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium",x[r]),children:s})}export{o as P,b as S,c as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as jn,n as he,P as Y,j as S,r as p,g as vt}from"./index-
|
|
1
|
+
import{c as jn,n as he,P as Y,j as S,r as p,g as vt}from"./index-BkI9POxj.js";import{c as ct,a as Je,r as lt,P as z,u as J,b as kt,d as yt,e as at,f as $,g as kn,h as Hn,i as Vn,R as Bn,F as Wn,D as Fn}from"./index-B7TeF6Es.js";import{a as St,C as $n}from"./chevron-down-BE8uQmWM.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|