@lacneu/atrium 0.71.4 → 0.71.6
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/assets/{AccessTab-WBvcqgGb.js → AccessTab-BtmO9KE5.js} +1 -1
- package/dist/assets/{AdvancedFilter-_ukq88Xr.js → AdvancedFilter-jU8Fbwl1.js} +1 -1
- package/dist/assets/{AgentFilesTab-B3CNii1R.js → AgentFilesTab-BGKb8PdH.js} +1 -1
- package/dist/assets/AnomaliesTab-C5wgECld.js +1 -0
- package/dist/assets/{AuditTab-C-eA6aXN.js → AuditTab-BKiJ4_TF.js} +1 -1
- package/dist/assets/BridgeTab-TwfICfbD.js +1 -0
- package/dist/assets/{ChatDefaultsTab-BMko0qfD.js → ChatDefaultsTab-BPXwe9a0.js} +1 -1
- package/dist/assets/{DataTableShell-Cfa_aSH0.js → DataTableShell-CzIcsYvR.js} +1 -1
- package/dist/assets/{DetailChips-B89G7ZGY.js → DetailChips-Rp2S51Jt.js} +1 -1
- package/dist/assets/{FeedbacksTab-BUnDZOVK.js → FeedbacksTab-CVLjIvkF.js} +1 -1
- package/dist/assets/{FieldLabel-BFUi4eFy.js → FieldLabel-D4xtReLR.js} +1 -1
- package/dist/assets/{FilesTab-PvC5WpBF.js → FilesTab-MOlj7wN5.js} +1 -1
- package/dist/assets/{FilterBar-Cq7zCsPB.js → FilterBar-DZvwFu4q.js} +1 -1
- package/dist/assets/{GroupsTab-CvlA8MZR.js → GroupsTab-DLfX1phu.js} +1 -1
- package/dist/assets/{InstancesTab-DZykopmt.js → InstancesTab-B5JkkyhW.js} +1 -1
- package/dist/assets/{IntegrationsTab-BaT3OPXg.js → IntegrationsTab-DsSTvRj0.js} +1 -1
- package/dist/assets/KpiTab-BDHT_iva.js +1 -0
- package/dist/assets/{PreferencesTab-BRgonUG-.js → PreferencesTab-DbUt0619.js} +1 -1
- package/dist/assets/{ProjectPage-BKzkLoY6.js → ProjectPage-DCgYHfe9.js} +1 -1
- package/dist/assets/PromptInjectionsTab-DzPLNbBB.js +4 -0
- package/dist/assets/{RolesTab-Co9HpgoJ.js → RolesTab-D44zOC0u.js} +1 -1
- package/dist/assets/{ScheduledTab-DKUTMnxG.js → ScheduledTab-DUcav25H.js} +1 -1
- package/dist/assets/{ServiceAccountsTab-DDomx0Ie.js → ServiceAccountsTab-CpcKRaaN.js} +1 -1
- package/dist/assets/{SubAgentReportsTab-DXuwwyUm.js → SubAgentReportsTab-BvFCAZ9L.js} +1 -1
- package/dist/assets/{ThemeShowroom-cWot6Lco.js → ThemeShowroom-BbW3_UsN.js} +1 -1
- package/dist/assets/{TimeRangePicker-BicJg8jQ.js → TimeRangePicker-RpBi7Yt_.js} +1 -1
- package/dist/assets/{TimezoneCombobox-DyM6DN5I.js → TimezoneCombobox-DBgAtYNP.js} +1 -1
- package/dist/assets/TracesTab-A7CPvuRP.js +1 -0
- package/dist/assets/UsersTab-uVbHVnoK.js +1 -0
- package/dist/assets/{VoiceTab-Bho-0sIJ.js → VoiceTab-D6DkG9Za.js} +1 -1
- package/dist/assets/{api-DFyVOofy.js → api-Dr5hDHvi.js} +1 -1
- package/dist/assets/{button-DDBwZ_Mu.js → button-BI3fckfr.js} +1 -1
- package/dist/assets/{card-CAZUQg1D.js → card-D2togi2C.js} +1 -1
- package/dist/assets/check-DAI8V1Km.js +1 -0
- package/dist/assets/chevron-up-BwcZQhBy.js +1 -0
- package/dist/assets/chevrons-up-down-DBgS9XVd.js +1 -0
- package/dist/assets/{compatView-NlPlAvmy.js → compatView-Dw2Mg_up.js} +1 -1
- package/dist/assets/{dispatchErrorInfo-DfCVCZSt.js → dispatchErrorInfo-CvAG5Yps.js} +1 -1
- package/dist/assets/{dist-CdtcfM9Y.js → dist-B9J3rPRX.js} +1 -1
- package/dist/assets/{dist-gUiqdn71.js → dist-D8R6-oX1.js} +1 -1
- package/dist/assets/{dist-DLnag5PM.js → dist-nYugf5jG.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CZ5yehqj.js → highlighted-body-OFNGDK62-D5jO1eQM.js} +1 -1
- package/dist/assets/{index-CdwUN8wX.js → index-Bp13zOvd.js} +21 -21
- package/dist/assets/{list-CPeCfmaD.js → list-C4l173ZQ.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-Q3rL8rUY.js +1 -0
- package/dist/assets/{pdf-BSXkfPxt.js → pdf-joZUl_RJ.js} +1 -1
- package/dist/assets/roleDescriptions-DKViGJea.js +1 -0
- package/dist/assets/{table-BALPzgDJ.js → table-CH0obeXz.js} +1 -1
- package/dist/assets/{tabs-DGqgx6SK.js → tabs-qs6n9nsm.js} +1 -1
- package/dist/assets/x-B_mNl1Gq.js +1 -0
- package/dist/index.html +9 -9
- package/package.json +1 -1
- package/dist/assets/AnomaliesTab-CIq_ZRlZ.js +0 -1
- package/dist/assets/BridgeTab-CE2kLkwT.js +0 -1
- package/dist/assets/KpiTab-DdH9BGMB.js +0 -1
- package/dist/assets/PromptInjectionsTab-CXXeq11I.js +0 -4
- package/dist/assets/TracesTab-DC4oWXzp.js +0 -1
- package/dist/assets/UsersTab-DtHsd09F.js +0 -1
- package/dist/assets/check-BUS8MQm3.js +0 -1
- package/dist/assets/chevron-up-DQnmq9g9.js +0 -1
- package/dist/assets/chevrons-up-down-DK_8wrsF.js +0 -1
- package/dist/assets/mermaid-GHXKKRXX-LsfJaHDu.js +0 -1
- package/dist/assets/roleDescriptions-gemjs-mM.js +0 -1
- package/dist/assets/x-CZZGanJv.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CC as e,SC as t,TC as n,wC as r,xC as i}from"./api-Dr5hDHvi.js";var a={pending:n,user:r,admin:e,observer:t,agent:i};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{r as n}from"./api-
|
|
1
|
+
import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{r as n}from"./api-Dr5hDHvi.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{b as r,d as i,f as a,g as o,n as s,p as c,r as l,y as u}from"./api-
|
|
1
|
+
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{b as r,d as i,f as a,g as o,n as s,p as c,r as l,y as u}from"./api-Dr5hDHvi.js";import{t as d}from"./dist-B9J3rPRX.js";import{Gt as f,Kt as p,qt as m}from"./index-Bp13zOvd.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=o(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:o,defaultValue:s,orientation:l=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=c({prop:a,onChange:o,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:i(),value:h,onValueChange:v,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(r.div,{dir:m,"data-orientation":l,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:i=!0,...a}=e,o=S(w,n),s=b(n);return(0,g.jsx)(p,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:(0,g.jsx)(r.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,disabled:a=!1,...o}=e,s=S(E,n),c=b(n),l=A(s.baseId,i),d=j(s.baseId,i),p=i===s.value;return(0,g.jsx)(f,{asChild:!0,...c,focusable:!a,active:p,children:(0,g.jsx)(r.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":d,"data-state":p?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:t,onMouseDown:u(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:u(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:u(e.onFocus,()=>{let e=s.activationMode!==`manual`;!p&&!a&&e&&s.onValueChange(i)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:o,children:s,...c}=e,l=S(O,n),u=A(l.baseId,i),d=j(l.baseId,i),f=i===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(a,{present:o||f,children:({present:n})=>(0,g.jsx)(r.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&s})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:l(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:l(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:l(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:l(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e}from"./api-Dr5hDHvi.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
package/dist/index.html
CHANGED
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
document.documentElement.dataset.motion = "static";
|
|
63
63
|
})();
|
|
64
64
|
</script>
|
|
65
|
-
<script type="module" crossorigin src="/assets/index-
|
|
65
|
+
<script type="module" crossorigin src="/assets/index-Bp13zOvd.js"></script>
|
|
66
66
|
<link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
|
|
67
|
-
<link rel="modulepreload" crossorigin href="/assets/api-
|
|
68
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
69
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
70
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
71
|
-
<link rel="modulepreload" crossorigin href="/assets/check-
|
|
72
|
-
<link rel="modulepreload" crossorigin href="/assets/chevron-up-
|
|
73
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
74
|
-
<link rel="modulepreload" crossorigin href="/assets/button-
|
|
67
|
+
<link rel="modulepreload" crossorigin href="/assets/api-Dr5hDHvi.js">
|
|
68
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-nYugf5jG.js">
|
|
69
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-B9J3rPRX.js">
|
|
70
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-D8R6-oX1.js">
|
|
71
|
+
<link rel="modulepreload" crossorigin href="/assets/check-DAI8V1Km.js">
|
|
72
|
+
<link rel="modulepreload" crossorigin href="/assets/chevron-up-BwcZQhBy.js">
|
|
73
|
+
<link rel="modulepreload" crossorigin href="/assets/x-B_mNl1Gq.js">
|
|
74
|
+
<link rel="modulepreload" crossorigin href="/assets/button-BI3fckfr.js">
|
|
75
75
|
<link rel="stylesheet" crossorigin href="/assets/index-SBwQs_kQ.css">
|
|
76
76
|
</head>
|
|
77
77
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacneu/atrium",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.6",
|
|
4
4
|
"description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,AS as i,BS as a,CS as o,DS as ee,ES as te,FS as s,GR as c,GS as ne,HS as l,IS as re,JS as ie,KS as ae,LS as u,MS as d,NS as f,OS as p,PS as m,QS as oe,RS as se,SS as h,TS as ce,US as le,VS as ue,WR as de,WS as fe,XS as pe,YS as me,ZS as he,_S as g,aC as ge,bS as _,cC as _e,dC as v,eC as ve,gS as y,iC as ye,jS as be,kS as xe,lC as b,nC as x,oC as S,qS as C,rC as w,sC as T,t as E,tC as D,uC as O,vS as k,wS as A,xS as j,yS as M,zS as Se}from"./api-DFyVOofy.js";import{$ as N,Dt as Ce,Et as P,Fn as we,Pn as F,Q as I,U as Te,X as L,Z as R,at as z,ct as B,et as V,i as Ee,nt as H,o as De,ot as U,q as Oe,tt as W}from"./index-CdwUN8wX.js";import{n as ke}from"./TimeRangePicker-BicJg8jQ.js";import{t as Ae}from"./FilterBar-Cq7zCsPB.js";import{t as je}from"./DataTableShell-Cfa_aSH0.js";import{t as G}from"./dispatchErrorInfo-DfCVCZSt.js";var K=t(e(),1),q=n(),J=`__all__`,Me=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Ne(e){return e===`open`?v():e===`acknowledged`?O():b()}var Pe=[`info`,`warn`,`critical`],Fe=[`detector`,`agent`,`user`],Ie={kind:`relative`,from:`now-30d`,to:`now`},Le=200,Y=`all`;function X(){let e=we({from:`/settings/anomalies`}),t=F({from:`/settings/anomalies`}),n=e.q??``,o=e.status===Y?J:e.status,h=e.severity??J,g=e.kind??J,[_,v]=(0,K.useState)(J),y=Ee(e.from,e.to),{from:b,to:O}=ke(y),k=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),j=e=>void t({search:t=>({...t,status:e===J?Y:e})}),M=e=>void t({search:t=>({...t,severity:e===J?void 0:e})}),z=e=>void t({search:t=>({...t,kind:e===J?void 0:e})}),H=e=>void t({search:t=>({...t,...De(e)})}),U=Te(),W=Ce(),G=de(E.anomalies.resolveAnomaly),X=(c(E.me.getMe,{host:Oe})?.permissions??[]).includes(`admin.manage`),Z=c(E.anomalies.listAnomalies,{limit:Le,filter:{q:n||void 0,from:b,to:O,anomalyStatus:o===J?void 0:o,severity:h===J?void 0:h,source:_===J?void 0:_,kind:g===J?void 0:g}}),Q=(0,K.useMemo)(()=>{let e=new Set;for(let t of Z??[])e.add(t.kind);return[...e].sort()},[Z]),He=n!==``||o!==`open`||h!==J||_!==J||g!==J||y.kind!==`relative`||y.from!==Ie.from;function Ue(){v(J),t({search:{status:`open`},replace:!0})}async function We(e){if(await U({title:_e(),description:(0,q.jsxs)(q.Fragment,{children:[T(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,S(),` `,(0,q.jsx)(`strong`,{children:ge()}),`.`,` `,ye()]}),confirmLabel:w()}))try{await G({anomalyId:e._id,status:`resolved`}),W.success(x(),e.kind)}catch(e){W.error(D(),e)}}async function Ge(e){try{await G({anomalyId:e._id,status:`acknowledged`}),W.success(ve(),e.kind)}catch(e){W.error(r(),e)}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`oc-admin__hint`,children:[oe(),` `,(0,q.jsx)(`strong`,{children:he()}),` `,pe(),` `,(0,q.jsx)(`strong`,{children:me()}),` `,ie(),` `,(0,q.jsx)(`strong`,{children:C()}),` `,ae(),` `,(0,q.jsx)(`span`,{className:`oc-filter__window`,children:ne()})]}),(0,q.jsxs)(Ae,{q:n,onQChange:k,searchPlaceholder:fe(),timeRange:y,onTimeRangeChange:H,onReset:Ue,canReset:He,children:[(0,q.jsxs)(L,{value:o,onValueChange:j,children:[(0,q.jsx)(N,{size:`sm`,className:`w-36`,children:(0,q.jsx)(V,{})}),(0,q.jsxs)(R,{children:[(0,q.jsx)(I,{value:J,children:le()}),Me.map(e=>(0,q.jsx)(I,{value:e.value,children:Ne(e.value)},e.value))]})]}),(0,q.jsxs)(L,{value:h,onValueChange:M,children:[(0,q.jsx)(N,{size:`sm`,className:`w-36`,children:(0,q.jsx)(V,{placeholder:l()})}),(0,q.jsxs)(R,{children:[(0,q.jsx)(I,{value:J,children:se()}),Pe.map(e=>(0,q.jsx)(I,{value:e,children:e},e))]})]}),(0,q.jsxs)(L,{value:_,onValueChange:v,children:[(0,q.jsx)(N,{size:`sm`,className:`w-32`,children:(0,q.jsx)(V,{placeholder:u()})}),(0,q.jsxs)(R,{children:[(0,q.jsx)(I,{value:J,children:re()}),Fe.map(e=>(0,q.jsx)(I,{value:e,children:e},e))]})]}),(0,q.jsxs)(L,{value:g,onValueChange:z,children:[(0,q.jsx)(N,{size:`sm`,className:`w-36`,children:(0,q.jsx)(V,{placeholder:s()})}),(0,q.jsxs)(R,{children:[(0,q.jsx)(I,{value:J,children:m()}),Q.map(e=>(0,q.jsx)(I,{value:e,children:e},e))]})]})]}),(0,q.jsx)(je,{title:f(),rows:Z,emptyHint:o===`open`?d():be(),rowActions:e=>X&&e.status===`open`?[{label:i(),onSelect:()=>void We(e)},{label:xe(),onSelect:()=>void Ge(e)}]:[],columns:[{header:p(),cell:e=>(0,q.jsx)(`span`,{className:`oc-traces__time`,children:B(e.at)}),sort:e=>e.at},{header:s(),cell:e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:ue(),cell:e=>e.occurrenceCount!==null&&e.occurrenceCount>1?(0,q.jsx)(`span`,{className:`oc-traces__time`,title:e.firstAt===null?void 0:Se({when:B(e.firstAt)}),children:a({count:String(e.occurrenceCount)})}):(0,q.jsx)(`span`,{className:`oc-traces__time`,children:`—`}),sort:e=>e.occurrenceCount??0},{header:l(),cell:e=>(0,q.jsx)(ze,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:ee(),cell:e=>(0,q.jsx)(Be,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:u(),cell:e=>(0,q.jsx)(P,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:te(),cell:e=>(0,q.jsxs)(`div`,{className:`oc-anomaly__msgcell`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),(0,q.jsx)(Re,{row:e})]}),sort:e=>e.message},{header:ce(),cell:e=>(0,q.jsx)($,{row:e}),sort:e=>e.evidence??null},{header:A(),cell:e=>e.correlationId?(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:Ve(e.correlationId)}):(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Z(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Q(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function $({row:e}){let t=F();if(e.kind===`subagent.failure`){let n=Q(e);return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,o()]}):null]})}let n=Z(e);if(!n.dominantCode)return(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=G(n.dominantCode),i=n.sampleCorrelationId;return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,q.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,o()]}):null]})}function Re({row:e}){let[t,n]=(0,K.useState)(!1),r=c(E.anomalies.getAnomalyAttachments,t?{anomalyId:e._id}:`skip`);return!e.attachments||e.attachments.length===0?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>n(!0),children:[h(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,q.jsx)(W,{open:t,onOpenChange:n,children:(0,q.jsxs)(H,{className:`oc-anomaly__attachments-dialog`,children:[(0,q.jsx)(z,{children:(0,q.jsx)(U,{children:j()})}),r===void 0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:_()}):r.length===0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:M()}):(0,q.jsx)(`div`,{className:`oc-anomaly__attachments`,children:r.map(e=>(0,q.jsxs)(`section`,{className:`oc-anomaly__attachment`,children:[(0,q.jsx)(`h4`,{className:`oc-anomaly__attachment-name`,children:(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.name})}),(0,q.jsx)(`pre`,{className:`oc-anomaly__attachment-content`,children:e.content})]},e.name))})]})})]})}function ze({severity:e}){return(0,q.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Be({status:e}){return e===`open`?(0,q.jsx)(P,{variant:`destructive`,children:k()}):e===`acknowledged`?(0,q.jsx)(P,{variant:`secondary`,children:g()}):(0,q.jsx)(P,{variant:`outline`,children:y()})}function Ve(e){return e.length>8?e.slice(0,8):e}export{X as AnomaliesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,$v as i,Ay as a,Bv as o,Cy as s,D as c,Dy as l,Ey as u,Fy as d,GR as f,Gl as p,Gv as m,HR as ee,Hl as h,Hv as g,Jl as _,Jv as v,Kl as y,Kv as b,Ll as x,Lv as S,My as te,Ny as ne,Oy as re,Py as ie,Ql as ae,Qv as oe,Rv as se,Sy as ce,Ty as le,Ul as ue,Uv as de,Vl as fe,Vv as pe,WR as me,Wl as he,Wv as ge,Xl as _e,Xv as ve,Yl as ye,Yv as be,Zl as xe,Zv as C,_b as Se,_y as Ce,ay as we,by as Te,cb as Ee,cy as De,db as Oe,dr as ke,dy as Ae,ey as je,fb as Me,fr as Ne,fy as w,gb as Pe,gr as Fe,gy as Ie,hy as Le,ib as Re,iy as ze,jy as Be,k as Ve,ky as He,lb as Ue,lr as We,ly as Ge,mb as Ke,my as qe,ny as Je,oy as Ye,pb as Xe,pr as Ze,py as Qe,ql as $e,qv as et,rb as tt,ry as nt,sb as rt,sy as it,t as T,ty as at,ub as ot,ur as st,uy as ct,vy as lt,wy as ut,xy as dt,yy as ft,zv as pt}from"./api-DFyVOofy.js";import{r as E}from"./dist-CdtcfM9Y.js";import{t as mt}from"./chevron-up-DQnmq9g9.js";import{t as ht}from"./chevrons-up-down-DK_8wrsF.js";import{i as gt,n as D,o as _t,r as vt,s as yt}from"./FieldLabel-BFUi4eFy.js";import{i as bt,n as xt,r as St,t as Ct}from"./tabs-DGqgx6SK.js";import{t as wt}from"./button-DDBwZ_Mu.js";import{$ as O,An as Tt,Bt as Et,Dt,Et as k,F as Ot,Fn as kt,Pn as A,Q as j,Rt as At,X as M,Z as N,at as jt,bn as Mt,ct as Nt,et as P,jn as Pt,jt as F,lt as I,nt as Ft,on as It,ot as Lt,q as Rt,rn as L,rt as zt,tt as Bt,ut as Vt,zt as Ht}from"./index-CdwUN8wX.js";import{r as Ut}from"./locales-CPjguROj.js";import{a as Wt,i as R,n as Gt,o as z,r as B,t as V}from"./table-BALPzgDJ.js";import{t as Kt}from"./FilterBar-Cq7zCsPB.js";import{a as H,n as qt,o as U,r as Jt,s as Yt,t as Xt}from"./compatView-NlPlAvmy.js";import{t as W}from"./dispatchErrorInfo-DfCVCZSt.js";var Zt=c(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Qt=c(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),G=t(e(),1);function $t(e){return e.filter(e=>e.state===`error`)}function en(e){return e.reachable&&$t(e.targets).length===0}function tn(e){return en(e)?(e.unreachableInstances??[]).length>0?`gateways_unreachable`:`ok`:`error`}function nn(e){return e.state===`error`&&e.lastErrorCode!==null}function rn(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function an(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function on(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return an(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function q(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,Y={q:``,state:J,instance:J,version:J},X={connected:0,error:1,idle:2};function sn(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function cn(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function ln(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function un(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return U(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function dn(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=ln(t.key,e),a=ln(t.key,r);return i&&a?0:i?1:a?-1:n*un(t.key,e,r)})}function fn(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function pn(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function mn(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>U(e,t)??Z(e,t))}var Q=n();function hn({connections:e,displayByInstance:t}){let[n,r]=(0,G.useState)(Y),[i,a]=(0,G.useState)(null),s=(0,G.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount+(e.downstreamRejectCount??0),attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),c=(0,G.useMemo)(()=>fn(s),[s]),l=(0,G.useMemo)(()=>pn(s),[s]),u=(0,G.useMemo)(()=>mn(s),[s]),d=(0,G.useMemo)(()=>dn(cn(s,n),i),[s,n,i]);function f(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:at()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(Kt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:oe(),onReset:()=>r(Y),canReset:sn(n),children:[(0,Q.jsxs)(M,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(O,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(P,{placeholder:ve()})}),(0,Q.jsxs)(N,{children:[(0,Q.jsx)(j,{value:J,children:C()}),c.map(e=>(0,Q.jsx)(j,{value:e,children:_n(e)},e))]})]}),(0,Q.jsxs)(M,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(O,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(P,{placeholder:be()})}),(0,Q.jsxs)(N,{children:[(0,Q.jsx)(j,{value:J,children:C()}),l.map(e=>(0,Q.jsx)(j,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(M,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(O,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(P,{placeholder:v()})}),(0,Q.jsxs)(N,{children:[(0,Q.jsx)(j,{value:J,children:C()}),u.map(e=>(0,Q.jsx)(j,{value:e,children:e},e))]})]})]}),d.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:et()}):(0,Q.jsxs)(V,{className:`oc-conn__table`,children:[(0,Q.jsx)(Wt,{children:(0,Q.jsxs)(z,{children:[(0,Q.jsx)($,{label:b(),sortKey:`target`,sort:i,onSort:f}),(0,Q.jsx)($,{label:m(),sortKey:`state`,sort:i,onSort:f}),(0,Q.jsx)($,{label:ge(),sortKey:`instance`,sort:i,onSort:f}),(0,Q.jsx)($,{label:de(),sortKey:`host`,sort:i,onSort:f}),(0,Q.jsx)($,{label:g(),sortKey:`version`,sort:i,onSort:f}),(0,Q.jsx)(R,{children:pe()}),(0,Q.jsx)($,{label:o(),sortKey:`lastOk`,sort:i,onSort:f})]})}),(0,Q.jsx)(Gt,{children:d.map(e=>(0,Q.jsx)(gn,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(R,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(mt,{size:13,"aria-hidden":!0}):(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(ht,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function gn({r:e}){let t=nn(e)?W(e.lastErrorCode):null,n=rn(e)?W(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(G.Fragment,{children:[(0,Q.jsxs)(z,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(B,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(B,{children:(0,Q.jsx)(vn,{state:e.state})}),(0,Q.jsx)(B,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(B,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(B,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(B,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:je({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(B,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:I(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(z,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(B,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${I(e.lastErrorAt)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[i({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${I(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function _n(e){return e===`connected`?pt():e===`error`?se():S()}function vn({state:e}){return e===`connected`?(0,Q.jsx)(k,{variant:`secondary`,children:pt()}):e===`error`?(0,Q.jsx)(k,{variant:`destructive`,children:se()}):(0,Q.jsx)(k,{variant:`outline`,children:S()})}function yn(){return f(T.bridgeHealth.getBridgeHealth,{})}function bn(){let e=yn(),t=f(T.compat.getBridgeCompat,{}),n=f(T.me.getMe,{host:Rt})?.role===`admin`,r=f(T.admin.listInstances,n?{}:`skip`),i=f(T.agents.usageForInstances,n?{}:`skip`),a=A(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=on(e?e.targets:[],t?t.targets:[],r??[]),{section:c}=kt({from:`/settings/bridge`}),l=A({from:`/settings/bridge`}),u=t?.compat??null,d=t===void 0?`loading`:t===null?`nodata`:`ready`,p=u!==null&&qt(u,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(xn,{health:e,compat:t,onSeeAnomalies:o}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:dt()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:Te()}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(Wt,{children:(0,Q.jsxs)(z,{children:[(0,Q.jsx)(R,{children:Ze()}),(0,Q.jsx)(R,{children:Ne()}),(0,Q.jsx)(R,{children:ke()}),(0,Q.jsx)(R,{children:st()}),(0,Q.jsx)(R,{children:We()})]})}),(0,Q.jsx)(Gt,{children:i.flatMap(e=>{let t=Ot(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Q.jsxs)(z,{children:[(0,Q.jsx)(B,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Q.jsx)(B,{children:t.provider}),(0,Q.jsx)(B,{children:t.label}),(0,Q.jsx)(B,{children:(0,Q.jsxs)(k,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Q.jsx)(B,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,s.length>0?(0,Q.jsxs)(Ct,{value:s.some(e=>e.key===c)?c:s[0]?.key??`openclaw`,onValueChange:e=>void l({search:{section:e},replace:!0}),children:[(0,Q.jsx)(St,{className:`w-full`,children:s.map(e=>(0,Q.jsxs)(bt,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(It,{size:13,"aria-hidden":!0}),q(e.key)]},e.key))}),s.map(e=>(0,Q.jsx)(xt,{value:e.key,children:(0,Q.jsx)(Sn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:u,compatStatus:d,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,p?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):null]})}function xn({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:H(t.bridgeVersion)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:xe(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,_e({build:t.buildVersion??`?`})]}):null,` · `,ye(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?_():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Ae()});let o=$t(e.targets),s=!e.reachable,c=tn(e),l=e.unreachableInstances??[],u=c===`ok`?`ok`:c===`gateways_unreachable`?`warn`:`error`,d=Nt(e.checkedAt),f=e.startedAt==null?null:Nt(e.startedAt);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${u}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c===`ok`?(0,Q.jsx)(Tt,{size:22}):s||c===`gateways_unreachable`?(0,Q.jsx)(Qt,{size:22}):(0,Q.jsx)(L,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:c===`ok`?ct():c===`gateways_unreachable`?Ye({count:l.length}):s?Ge():De({count:o.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Zt,{size:12,"aria-hidden":!0}),` `,it({time:d})]}),f?(0,Q.jsx)(`span`,{children:ze({time:f})}):null,a]}),c===`gateways_unreachable`?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:we({names:l.join(`, `)})}):null,s?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:nt()})]})}function Sn({providerKey:e,connections:t,instances:n,manifest:i,compatStatus:a,compatReachable:o,protocol:s}){let c=i?Yt(i,e):null,l=new Map;for(let e of n)l.set(e.name,e.displayName??e.name);let u=[],d=new Set;for(let n of t){if(!n.instanceName||d.has(n.instanceName))continue;d.add(n.instanceName);let t=n.gatewayVersion??null;u.push({instanceName:n.instanceName,displayName:l.get(n.instanceName)??n.instanceName,version:t,state:Xt(t,e,i)})}let f=u.map(e=>e.state),p=f.includes(`beyond`)?`beyond`:f.length>0&&f.every(e=>e===`supported`)?`supported`:null,[m,ee]=(0,G.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(It,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:q(e)}),p?(0,Q.jsx)(k,{variant:p===`beyond`?`destructive`:`secondary`,children:Jt(p)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:r()}),(0,Q.jsx)(wn,{providerName:q(e),support:c,compatStatus:a,compatReachable:o,manifest:i,instanceRows:u}),s?(0,Q.jsx)(Cn,{protocol:s}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":m,onClick:()=>ee(e=>!e),children:[m?(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Pt,{size:13,"aria-hidden":!0}),Je({count:t.length})]}),m?(0,Q.jsx)(hn,{connections:t,displayByInstance:l}):null]})}function Cn({protocol:e}){let[t,n]=(0,G.useState)(!1),r=e.coverage,i=e.drift??[],a=(e.driftOverflow??0)+(e.driftTruncated??0);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[ft(),i.length>0?(0,Q.jsx)(k,{variant:`destructive`,children:Ce({count:i.length})}):a>0?(0,Q.jsx)(k,{variant:`destructive`,children:Ie()}):(0,Q.jsx)(k,{variant:`secondary`,children:lt()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[Le({version:e.vendoredVersion}),r?` · `+qe({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),a>0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ve({overflow:e.driftOverflow??0,truncated:e.driftTruncated??0})}):null,i.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Pt,{size:13,"aria-hidden":!0}),Qe({count:r.gapList.length})]}),t?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function wn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:a}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:$e()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Fe({provider:a})}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:p({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:_()}),e?(0,Q.jsx)(On,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:H(e.version)}),(0,Q.jsx)(k,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Jt(e.state)})]},e.instanceName))})]})}function Tn({instance:e,onClose:t}){return(0,Q.jsx)(Bt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(Ft,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(jt,{children:[(0,Q.jsx)(Lt,{children:Se({instance:e.displayName??e.name})}),(0,Q.jsx)(zt,{children:Pe()})]}),(0,Q.jsx)(Dn,{instance:e,onClose:t})]})})}function En({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(Tt,{"aria-hidden":!0}):(0,Q.jsx)(L,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?le():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ut()]}):null}function Dn({instance:e,onClose:t}){let n=me(T.admin.upsertInstanceConfig),r=ee(T.bridge.validateMediaPaths),i=Dt(),o=Ut(e.config?.contentLocale,void 0),[c,f]=(0,G.useState)(()=>gt(e.config??{},o)),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(null),y=c.inboundMediaMode===`shared-fs`,b=c.mediaMode===`shared-fs`,x=y||b;async function S(){g(!0),v(null);try{v(await r({instanceName:e.name,inboundMediaMode:c.inboundMediaMode,mediaMode:c.mediaMode}))}catch(e){i.error(He(),e)}finally{g(!1)}}async function ae(){m(!0);try{let r=e.config??{};await n({instanceId:e._id,config:vt(c,r,o)}),t()}catch(e){i.error(Ue(),e)}finally{m(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:Ke(),help:Ee()}),(0,Q.jsxs)(M,{value:c.mediaMode,onValueChange:e=>f({...c,mediaMode:e}),children:[(0,Q.jsx)(O,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(P,{})}),(0,Q.jsx)(N,{children:yt.map(e=>(0,Q.jsx)(j,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:Xe(),help:rt()}),(0,Q.jsxs)(M,{value:c.inboundMediaMode,onValueChange:e=>f({...c,inboundMediaMode:e}),children:[(0,Q.jsx)(O,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(P,{})}),(0,Q.jsx)(N,{children:_t.map(e=>(0,Q.jsx)(j,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:Me(),help:Re()}),(0,Q.jsx)(F,{type:`number`,min:1,max:4096,className:`w-full`,value:c.mediaMaxMb,onChange:e=>f({...c,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),x&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[y&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:d(),help:ie()}),(0,Q.jsx)(F,{className:`w-full`,spellCheck:!1,value:c.inboundAgentMount,onChange:e=>f({...c,inboundAgentMount:e.target.value})})]}),b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:ne(),help:te()}),(0,Q.jsx)(F,{className:`w-full`,spellCheck:!1,value:c.outboundAgentMount,onChange:e=>f({...c,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(Vt,{checked:c.rehydration,onCheckedChange:e=>f({...c,rehydration:e===!0})}),(0,Q.jsx)(D,{label:Oe(),help:tt()})]}),x&&_!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:_.reachable?!_.inbound&&!_.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),ce({reason:_.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(En,{label:l(),result:_.inbound}),(0,Q.jsx)(En,{label:u(),result:_.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:re()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(L,{"aria-hidden":!0}),s()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[x&&(0,Q.jsxs)(wt,{variant:`outline`,size:`sm`,onClick:()=>void S(),disabled:h,children:[h?(0,Q.jsx)(Mt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,h?a():Be()]}),(0,Q.jsx)(wt,{size:`sm`,onClick:()=>void ae(),disabled:p,children:ot()})]})]})})}function On({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(At,{children:[(0,Q.jsx)(Et,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?he():ue({count:e.length}),(0,Q.jsx)(E,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(Ht,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:h()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(k,{variant:`secondary`,children:e},e))})]})]})}export{bn as BridgeTab,Tn as InstanceConfigDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{CO as r,Cv as i,GR as a,MO as o,NO as s,PO as c,Sv as l,_v as u,ak as d,bv as f,dv as p,fv as m,gv as h,hv as g,jO as _,mv as v,pv as y,t as b,uv as x,vv as S,wO as C,xv as w,yv as T}from"./api-DFyVOofy.js";import{Fn as ee,Pn as te,i as ne,o as re,q as E,r as D}from"./index-CdwUN8wX.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-CAZUQg1D.js";import{n as N,t as P}from"./TimeRangePicker-BicJg8jQ.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=a(b.me.getMe,{host:E})?.permissions?.includes(`traces.read`)??!1,t=a(b.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,F.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,L).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:d()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:c()}),(0,I.jsx)(j,{children:o()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,I.jsx)(B,{series:n})})]})]})}function B({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),i=Math.max(1,...t,...n),a=t=>6+t*468/(e.length-1),o=e=>74-e*68/i,l=e=>e.map((e,t)=>`${t===0?`M`:`L`}${a(t).toFixed(1)},${o(e).toFixed(1)}`).join(` `),u=e[e.length-1];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{style:{color:`var(--primary)`},children:[r(),` p50 `,R(u.cP50),` `,s()]}),(0,I.jsxs)(`span`,{children:[C(),` p50 `,R(u.aP50),` `,s()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":c(),children:[(0,I.jsx)(`path`,{d:l(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:l(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:i(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:l(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:w(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:f(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:T(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:S(),unit:`/h`,group:`Assistant`,isError:!0}],H=V.length,U=[`API`,`OpenClaw`,`Chat`,`Assistant`],W=1e3,G=36e5;function K(e,t){let n=Math.max(1,Math.ceil((t-e)/G)),r=Math.min(n*H,W);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/H))}}function q(){let e=ee({from:`/settings/kpi`}),t=te({from:`/settings/kpi`}),n=ne(e.from,e.to,D,`now`),r=e=>void t({search:t=>({...t,...re(e)})}),{from:i,to:o}=N(n),{rowLimit:s,buckets:c}=K(i,o),l=a(b.kpi.listKpis,{limit:s,filter:{from:i,to:o}}),d=(0,F.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>c&&e.set(t,n.slice(n.length-c));return e},[l,c]),f=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[u(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:h()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return l===void 0?(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:g()})]}):l.length===0?(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:v()})]}):(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(d.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(Y,{config:e,series:d.get(e.metric)??[]},e.metric))})]},e):null})]})}function J({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(P,{value:e,onChange:t})})}function Y({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,I.jsxs)(M,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(j,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(k,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(ae,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:y({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:m()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:p({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":x({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{q as KpiTab};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,$o as i,$y as a,By as o,Cr as s,GR as c,Gy as l,Hy as u,Jy as d,Ky as f,Ly as p,Qi as m,Qo as h,Qy as g,Ry as _,Sr as v,Uy as y,Vy as b,WR as x,Wy as S,Xy as ee,Yy as C,Zi as te,Zo as ne,Zy as re,ca as ie,da as ae,ea as oe,eb as se,es as ce,la as w,lb as T,nb as E,qy as D,t as O,ta as k,tb as A,ts as j,ua as M,ub as N,xr as P,zy as F}from"./api-DFyVOofy.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as H,u as U}from"./FieldLabel-BFUi4eFy.js";import{t as W}from"./button-DDBwZ_Mu.js";import{$ as G,Dt as le,Q as K,X as q,Z as J,et as Y,q as ue,ut as de}from"./index-CdwUN8wX.js";import{r as X,t as fe}from"./locales-CPjguROj.js";import{t as pe}from"./localePickerView-C2RmOS86.js";/* empty css */var Z=t(e(),1),Q=n(),$={media_delivery:{label:re,help:ee},documentary_fetch:{label:C,help:d},inbound_files:{label:D,help:f},history_summary:{label:j,help:ce},file_curation:{label:ae,help:k},quote_reply:{label:M,help:w}},me={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
-
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
|
-
Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
|
|
4
|
-
- [Fait 1](fait-1.md) - note du projet`,excerpt:`Le classement propose trois dossiers : Clients, Fournisseurs, Interne.`},he={outboundDir:F,references:_,files:p,previous_summary:i,new_messages:h,max_chars:ne,file_name:oe,budget_chars:r,feedback:m,content:te,excerpt:ie};function ge(){let e=c(O.admin.listInstances,{}),[t,n]=(0,Z.useState)(null);if(e===void 0)return(0,Q.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,Q.jsx)(`div`,{className:`oc-injtab`,children:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:S()})});let r=e.find(e=>e._id===t)??e[0];return(0,Q.jsxs)(`div`,{className:`oc-injtab`,children:[(0,Q.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,Q.jsx)(B,{label:E(),help:A()}),(0,Q.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,Q.jsx)(`span`,{children:l()}),(0,Q.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,Q.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,Q.jsx)(Y,{})}),(0,Q.jsx)(J,{children:e.map(e=>(0,Q.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,Q.jsx)(_e,{instance:r},r._id)]})}function _e({instance:e}){let t=x(O.admin.upsertInstanceConfig),n=le(),r=c(O.me.getMe,{host:ue}),i=e.config??{},a=X(e.config?.contentLocale,r?.defaultLocale??void 0),[o,l]=(0,Z.useState)(()=>R(i,a));(0,Z.useEffect)(()=>{l(R(i,a))},[a,e._id]);let[u,d]=(0,Z.useState)(!1),f=o.promptInjections,p=(e,t)=>l({...o,promptInjections:{...f,[e]:{...f[e],...t}}});async function m(){d(!0);try{await t({instanceId:e._id,config:V(o,i,a)})}catch(e){n.error(T(),e)}finally{d(!1)}}async function h(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(T(),e)}}let g=e.config?.contentLocale??`default`,_=fe[X(void 0,r?.defaultLocale??void 0)];return(0,Q.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,Q.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,Q.jsx)(`span`,{children:s()}),(0,Q.jsxs)(q,{value:g,onValueChange:e=>void h(e),children:[(0,Q.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,Q.jsx)(Y,{})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{value:`default`,children:P({locale:_})}),pe().map(e=>(0,Q.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()})]}),U.map(e=>(0,Q.jsx)(ve,{injKey:e,def:z[e],i18n:$[e],row:f[e]??{enabled:!0,template:z[e].defaultTemplate[a]},contentLocale:a,onChange:t=>p(e,t)},e)),(0,Q.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,Q.jsx)(W,{size:`sm`,onClick:()=>void m(),disabled:u,children:N()})})]})}function ve({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:s}){let[c,l]=(0,Z.useState)(!1),d=r.template.trim()!==t.defaultTemplate[i],f=t.togglable&&!r.enabled,p=Object.fromEntries(t.placeholders.map(e=>[e,me[e]??`{${e}}`])),m=I(e,r,i),h=m?L(m,p):``;return(0,Q.jsxs)(`section`,{className:`oc-injcard`,children:[(0,Q.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(de,{checked:r.enabled,onCheckedChange:e=>s({enabled:e===!0})}),(0,Q.jsx)(B,{label:n.label(),help:n.help()})]}):(0,Q.jsx)(B,{label:n.label(),help:n.help()}),d&&(0,Q.jsx)(`span`,{className:`oc-injection__badge`,children:a()})]}),(0,Q.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:f,rows:8,spellCheck:!1,onChange:e=>s({template:e.target.value})}),(0,Q.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,Q.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,Q.jsx)(`span`,{className:`oc-injection__ph`,children:g()}),t.placeholders.map(e=>(0,Q.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,Q.jsx)(`code`,{children:`{${e}}`}),(0,Q.jsx)(H,{text:(he[e]??(()=>e))()})]},e))]}),(0,Q.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,Q.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>l(e=>!e),children:c?u():y()}),d&&(0,Q.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>s({template:t.defaultTemplate[i]}),children:se()})]})]}),c&&(0,Q.jsx)(`div`,{className:`oc-injcard__preview`,children:h?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:h}),(0,Q.jsx)(`span`,{className:`oc-injection__ph`,children:b()})]}):(0,Q.jsx)(`span`,{className:`oc-injection__ph`,children:o()})})]})}export{ge as PromptInjectionsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,AO as i,Ax as a,BO as o,Br as s,Bx as c,CO as l,Cx as u,D as d,DO as f,Dx as p,EO as m,Ex as h,FO as g,Fx as _,GO as v,GR as y,HO as b,Hx as ee,IO as x,Ix as te,JO as S,KO as C,LO as w,Lx as ne,Mx as re,Nx as ie,OO as ae,Ox as oe,Px as se,QO as ce,RO as le,Rr as ue,Rx as de,SO as fe,Sx as pe,TO as T,Tx as me,UO as E,VO as D,Vx as he,WO as O,WR as k,XO as A,YO as j,ZO as M,_O as N,_x as ge,ak as _e,ax as ve,bO as P,bx as ye,cx as be,dx as xe,ek as F,fx as Se,gO as Ce,gx as we,hx as Te,ik as Ee,ix as De,jx as Oe,kO as ke,kx as Ae,lx as je,mx as Me,nk as Ne,ox as Pe,px as Fe,qO as I,rk as Ie,sx as Le,t as L,tk as Re,ux as ze,vO as Be,vx as Ve,wO as He,wx as Ue,xO as We,xx as Ge,yO as Ke,yx as qe,zO as Je,zr as Ye,zx as Xe}from"./api-DFyVOofy.js";import{t as Ze}from"./check-BUS8MQm3.js";import{t as Qe}from"./x-CZZGanJv.js";import{i as R,n as z,r as $e,t as et}from"./tabs-DGqgx6SK.js";import{t as B}from"./button-DDBwZ_Mu.js";import{$ as V,Et as H,Fn as tt,H as nt,On as rt,Pn as it,Q as U,Tn as at,X as W,Z as G,a as ot,at as st,ct as K,et as q,i as ct,lt,nt as ut,o as dt,ot as ft,q as pt,rt as mt,s as ht,tt as gt,xn as _t}from"./index-CdwUN8wX.js";import{n as vt}from"./TimeRangePicker-BicJg8jQ.js";import{t as yt}from"./FilterBar-Cq7zCsPB.js";import{t as bt}from"./AdvancedFilter-_ukq88Xr.js";import{t as xt}from"./DataTableShell-Cfa_aSH0.js";var St=d(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=d(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?o():n===`agent`?`${Je()} - ${r}`:e}function Tt(){let e=y(L.me.getMe,{host:pt})?.role===`admin`,t=y(L.deliveryTiming.getDeliveryStatus,{}),n=k(L.deliveryTiming.startDeliveryRecord),r=k(L.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:_e()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ee()})]}),e?(0,Y.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?Ne():Ie()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(H,{variant:`secondary`,children:Re()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:F({time:lt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?M():ce()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=y(L.deliveryTiming.listDeliverySessions,{}),n=k(L.deliveryTiming.deleteDeliverySessions),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(`all`),[s,c]=(0,J.useState)(X),[l,u]=(0,J.useState)(null),{from:d,to:f}=vt(s),p=s.to===`now`?1/0:f,m=r.trim()!==``||a!==`all`||s!==X,h=()=>{i(``),o(`all`),c(X)},g=(0,J.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(a===`all`||(a===`active`?t.active:!t.active))&&t.startedAt>=d&&t.startedAt<=p).map(e=>({...e,_id:e.sessionId}))},[t,r,a,d,p]),_=e=>{let t=new Set((g??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),l!==null&&r.includes(l)&&u(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:r,onQChange:i,searchPlaceholder:j(),timeRange:s,onTimeRangeChange:c,onReset:h,canReset:m,children:(0,Y.jsxs)(W,{value:a,onValueChange:e=>o(e),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:`all`,children:S()}),(0,Y.jsx)(U,{value:`active`,children:I()}),(0,Y.jsx)(U,{value:`stopped`,children:C()})]})]})}),(0,Y.jsx)(xt,{title:A(),rows:g,emptyHint:N(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":l===e.sessionId?w():le(),onClick:()=>u(t=>t===e.sessionId?null:e.sessionId),children:l===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(at,{size:15,"aria-hidden":!0})})},{header:v(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:K(e.startedAt)})},{header:O(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:K(e.stoppedAt)})},{header:E(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:b(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:D(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(H,{variant:`secondary`,children:I()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:C()})}],rowActions:e?e=>[{label:x(),variant:`destructive`,onSelect:()=>_([e.sessionId])}]:void 0,bulkActions:e?[{label:x(),variant:`destructive`,onSelect:e=>_(e)}]:void 0,isExpanded:e=>e.sessionId===l,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=y(L.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:g()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:r()});let i=e.segments,a=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Ce()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(rt,{size:13,"aria-hidden":!0}),t?Be():Ke()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:ae()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:f()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:m()})]})}),(0,Y.jsxs)(`tbody`,{children:[a(T(),i.bridge),a(He(),i.A),a(l(),i.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:P()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:We()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:s()},{value:`principalType`,label:Ye()},{value:`direction`,label:`direction`},{value:`roleKey`,label:ue()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=tt({from:`/settings/traces`}),t=it({from:`/settings/traces`}),n=e.limit,r=e.kind,o=e.statusClass??Q,s=e.principalType??Q,l=e.direction??Q,d=e.roleKey??Q,f=e.q??``,m=ct(e.from,e.to),g=(0,J.useMemo)(()=>ht(e.adv),[e.adv]),{from:v,to:b}=vt(m),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(null),ae=e=>void t({search:t=>({...t,limit:e})}),ce=e=>void t({search:t=>({...t,kind:e})}),le=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),T=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),E=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,...dt(e)})}),O=e=>void t({search:t=>({...t,adv:ot(e)}),replace:!0}),k=y(L.observability.listEvents,{limit:n}),A=y(L.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:f||void 0,from:v,to:b,statusClass:o===Q?void 0:o,principalType:s===Q?void 0:s,direction:l===Q?void 0:l,roleKey:d===Q?void 0:d,advanced:g.length>0?g:void 0}}),j=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])e.add(t.kind);return[...e].sort()},[k]),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of k??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[k]),N=f!==``||o!==Q||s!==Q||l!==Q||d!==Q||g.length>0||m.kind!==`relative`||m.from!==Pt.from;function _e(){t({search:{limit:100,kind:`all`},replace:!0})}let ve=x?k?.filter(e=>e.correlationId===x):A,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(_t,{size:13,"aria-hidden":!0}),i()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),ke()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ee(),(0,Y.jsx)(`strong`,{children:he()}),c(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:Xe()})]}),(0,Y.jsxs)(yt,{q:f,onQChange:le,searchPlaceholder:de(),timeRange:m,onTimeRangeChange:D,onReset:_e,canReset:N,children:[(0,Y.jsxs)(W,{value:o,onValueChange:ue,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ne()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:te()}),jt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:s,onValueChange:fe,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:_()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:se()}),Mt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:l,onValueChange:T,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ie()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:re()}),Nt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:d,onValueChange:E,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{placeholder:Oe()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:Q,children:a()}),M.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:r,onValueChange:ce,children:[(0,Y.jsx)(V,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(q,{placeholder:Ae()})}),(0,Y.jsxs)(G,{children:[(0,Y.jsx)(U,{value:At,children:oe()}),j.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(W,{value:String(n),onValueChange:e=>ae(Number(e)),children:[(0,Y.jsx)(V,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(q,{})}),(0,Y.jsx)(G,{children:kt.map(e=>(0,Y.jsx)(U,{value:String(e),children:p({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:g,onChange:O}),x?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>S(null),title:h(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,Y.jsx)(`code`,{children:$(x)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:Ue()})]})}):null,(0,Y.jsx)(xt,{title:u(),rows:ve,emptyHint:x?pe():Ge(),columns:[{header:ye(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:K(e.at)})},{header:qe(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(H,{variant:`secondary`,children:e.kind})},{header:Ve(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":ge(),children:`✓`})}},{header:we(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(H,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Te(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(H,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Me(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(H,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Fe(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Se(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:xe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:ze(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:je(),onClick:()=>S(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:be(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>w(e),children:Le()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:C,onClose:()=>w(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(gt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(ut,{className:`max-w-lg`,children:[(0,Y.jsxs)(st,{children:[(0,Y.jsxs)(ft,{className:`oc-traces__meta-title`,children:[Pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(H,{variant:`outline`,children:ve()})]}),(0,Y.jsx)(mt,{children:De()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AE as r,Ab as i,BT as a,CE as o,Cb as s,DE as c,Db as l,EE as u,Eb as d,GR as f,ME as p,NE as m,OE as h,Ob as g,SE as _,Sb as v,TE as ee,Tb as y,WR as b,_E as te,aE as ne,bE as x,bb as S,cE as re,dE as ie,df as C,fE as ae,ff as w,gE as oe,hE as T,jE as E,kE as D,kb as O,lE as se,mE as ce,oE as le,pE as ue,pf as k,sE as de,t as A,uE as fe,vE as pe,vb as j,wE as me,wb as M,xE as he,xb as N,yE as ge,yb as P}from"./api-DFyVOofy.js";import{t as F}from"./button-DDBwZ_Mu.js";import{$ as I,Dt as L,Et as R,Fn as _e,Ft as z,Lt as ve,Mt as ye,Nt as be,Pn as xe,Pt as Se,Q as B,U as Ce,W as we,X as V,Z as H,an as U,at as Te,c as W,et as G,l as Ee,nt as De,on as K,ot as Oe,q as ke,rt as Ae,tt as je,u as q,ut as J}from"./index-CdwUN8wX.js";import{t as Y}from"./FilterBar-Cq7zCsPB.js";import{t as Me}from"./DataTableShell-Cfa_aSH0.js";import{t as Ne}from"./DetailChips-B89G7ZGY.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:r}){let a=f(A.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),o=f(A.agents.listUserAgents,n&&e?{profileId:e}:`skip`),c=new Set((o??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=(o??[]).find(e=>e.isDefault)??null,p=u?`${u.instanceName}/${u.agentId}`:null,m=new Set((a?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),h=[...(a?.agents??[]).map(e=>({...e,outOfPool:!1})),...(o??[]).filter(e=>!m.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],_=new Map;for(let e of h){let t=_.get(e.instanceName)??[];t.push(e),_.set(e.instanceName,t)}return(0,Z.jsx)(je,{open:n,onOpenChange:r,children:(0,Z.jsxs)(De,{className:`oc-access`,children:[(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(Oe,{children:i({user:t})}),(0,Z.jsx)(Ae,{children:O()})]}),a?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:a.inGroup?g():l()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:d()}):h.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:s()}):[..._.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:c,defaultKey:p},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=b(A.agents.assignAgent),s=b(A.agents.removeAgent),c=b(A.agents.setDefaultAgent),l=L();if(!e)return null;async function u(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(y(),e)}}async function d(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){l.error(M(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(K,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(J,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void u(e.agentId,r),"aria-label":v({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:N()}):null,e.outOfPool?(0,Z.jsx)(R,{variant:`outline`,className:`oc-access__gone`,children:S()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":P(),title:P(),children:(0,Z.jsx)(U,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":j(),title:j(),disabled:c,onClick:()=>void d(e.agentId),children:(0,Z.jsx)(U,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return C();case`user`:return w();case`admin`:return k();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=W.filter(e=>n.has(q[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ve,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?m():p({count:r})})}),(0,Z.jsxs)(be,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(z,{children:E()}),W.map(e=>{let r=q[e];return(0,Z.jsxs)(Se,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(J,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Ee[e]()})]},e)})]})]})}function Le(){let e=_e({from:`/settings/users`}),t=xe({from:`/settings/users`}),n=e.q??``,i=e.role??Q,s=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),d=f(A.admin.listUsers,{filter:{q:n||void 0,role:i===Q?void 0:i},withAgents:!0}),p=f(A.me.getMe,{host:ke}),m=b(A.admin.setRole),g=b(A.admin.setUserPermissions),v=b(A.admin.startImpersonation),y=b(A.admin.deleteUser),S=b(A.admin.setUserName),C=Ce(),w=we(),E=L(),[O,k]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of d??[])e.add(t.role);return[...e]},[d]),M=n!==``||i!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await m(e)}catch(e){E.error(r(),e)}}async function F(e){try{await g(e)}catch(e){E.error(D(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await C({title:_(),description:he({user:t}),confirmWord:x(),confirmLabel:ge(),destructive:!0}))try{await y({profileId:e._id}),E.success(te({user:t}))}catch(e){E.error(pe(),e)}}async function z(e){let t=e.email||e.name||e.userId.slice(0,8),n=await w({title:T(),label:ce({user:t}),placeholder:ue(),defaultValue:e.name??``,confirmLabel:a()});if(n!==null)try{await S({profileId:e._id,name:n}),E.success(ae())}catch(e){E.error(ie(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{q:n,onQChange:s,searchPlaceholder:h(),onReset:N,canReset:M,children:(0,Z.jsxs)(V,{value:i,onValueChange:l,children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:Q,children:c()}),j.map(e=>(0,Z.jsx)(B,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:u(),rows:d,emptyHint:ee(),rowActions:e=>{let t=[{label:ne(),onSelect:()=>k({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:oe(),onSelect:()=>void z(e)}];return e.userId!==p?.userId&&t.push({label:me(),onSelect:()=>void v({profileId:e._id})},{label:o(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:fe(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:se(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(V,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(G,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(B,{value:`user`,children:$(`user`)}),(0,Z.jsx)(B,{value:`admin`,children:$(`admin`)})]})]})},{header:re(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:de()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:le(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(K,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||k(null)}})]})}export{Le as UsersTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./api-DFyVOofy.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./api-DFyVOofy.js";var t=e(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./api-DFyVOofy.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mt as e}from"./index-CdwUN8wX.js";export{e as Mermaid};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CC as e,SC as t,TC as n,wC as r,xC as i}from"./api-DFyVOofy.js";var a={pending:n,user:r,admin:e,observer:t,agent:i};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./api-DFyVOofy.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|