@whoz-oss/coday-client 0.0.0-workstream-forge.185 → 0.0.0-workstream-forge.187
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/browser/{chunk-yNnoMggg.js → chunk-3WW79jMM.js} +1 -1
- package/browser/{chunk-Dip9hqws.js → chunk-B5WH_4FH.js} +1 -1
- package/browser/{chunk-qFzWQjBe.js → chunk-BEsOIKio.js} +1 -1
- package/browser/{chunk-DHs2aKFP.js → chunk-BNTbKRR2.js} +1 -1
- package/browser/{chunk-BcRntJ-f.js → chunk-BNtNbO5E.js} +1 -1
- package/browser/{chunk-DzHTXkbw.js → chunk-BSsRV4Fv.js} +1 -1
- package/browser/{chunk-BDc-xbXC.js → chunk-Bg3nIRj0.js} +1 -1
- package/browser/{chunk-CkcpRLV2.js → chunk-Bol2JxkN.js} +1 -1
- package/browser/{chunk-BP01ZR-w.js → chunk-BvlT1UU9.js} +1 -1
- package/browser/{chunk-CBqrb7sY.js → chunk-C-NRs1Fa.js} +1 -1
- package/browser/{chunk-BWV_tKo4.js → chunk-C-nearu2.js} +1 -1
- package/browser/{chunk-DxD41Wpl.js → chunk-C4FR_eY4.js} +1 -1
- package/browser/{chunk-Dy-jqKED.js → chunk-C6IBoWC1.js} +1 -1
- package/browser/chunk-C6abvjjM.js +670 -0
- package/browser/{chunk-cudzLb_7.js → chunk-CBlHmoPp.js} +1 -1
- package/browser/{chunk-bir_vdHS.js → chunk-CEUf0XVF.js} +1 -1
- package/browser/{chunk-Dpp5qieV.js → chunk-CNIgVis0.js} +1 -1
- package/browser/{chunk-DDEKNHYj.js → chunk-CRKSJ8O0.js} +1 -1
- package/browser/chunk-CS0VTNy3.js +1 -0
- package/browser/{chunk-BTuAxVDp.js → chunk-CbDPIeAp.js} +1 -1
- package/browser/{chunk-Cn9pDxST.js → chunk-CdUkMLzU.js} +1 -1
- package/browser/{chunk-CqygV_yT.js → chunk-CmaRhQVd.js} +1 -1
- package/browser/{chunk-CvH1PYW_.js → chunk-CuAGAd4W.js} +1 -1
- package/browser/{chunk-D6ZmkGQx.js → chunk-D-Qlr6Wg.js} +1 -1
- package/browser/{chunk-DhUPCR8x.js → chunk-D0BZatSz.js} +1 -1
- package/browser/{chunk-CJ0bvrpa.js → chunk-DB5CNJmL.js} +1 -1
- package/browser/{chunk-CZq0sS47.js → chunk-DCQ55yGY.js} +1 -1
- package/browser/{chunk-Z5CORV68.js → chunk-DEb8JHkr.js} +1 -1
- package/browser/{chunk-CrlEsza5.js → chunk-DEpnxPHI.js} +1 -1
- package/browser/{chunk-Bb14uEa9.js → chunk-DLL0-X45.js} +1 -1
- package/browser/{chunk-WZ5n_WKd.js → chunk-DiZ4OzVo.js} +1 -1
- package/browser/{chunk-BjECEnNM.js → chunk-Dy4MmMVN.js} +1 -1
- package/browser/{chunk-IUT0U7MD.js → chunk-Fij8nktv.js} +1 -1
- package/browser/{chunk-cW39VhFz.js → chunk-HxHl935L.js} +1 -1
- package/browser/{chunk-Cgo9jwAr.js → chunk-SZWEz0ba.js} +1 -1
- package/browser/{chunk-CZ3swGRG.js → chunk-SzOkzSvH.js} +1 -1
- package/browser/{chunk-BaROBgKr.js → chunk-TMk5JI4C.js} +1 -1
- package/browser/{chunk-BVAhKRxf.js → chunk-Z2NbDhln.js} +1 -1
- package/browser/{chunk-CYpUOOXu.js → chunk-dKeZZvzF.js} +1 -1
- package/browser/{chunk-CRE2m4-M.js → chunk-gf10W9wo.js} +1 -1
- package/browser/{chunk-a30sSJMH.js → chunk-iuaAdzdQ.js} +1 -1
- package/browser/{chunk-BCj_QScJ.js → chunk-kZ9HbUrN.js} +1 -1
- package/browser/{chunk-BKcbagcs.js → chunk-oPrucL6T.js} +1 -1
- package/browser/{chunk-bmNwF1EA.js → chunk-prPPZpkY.js} +1 -1
- package/browser/{chunk-C1HA3aCU.js → chunk-rOhgxte3.js} +1 -1
- package/browser/{chunk-BuW-L7NV.js → chunk-w_Aq6bAN.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-HBKYHCPK.js → main-SWYRVFGZ.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BiMuA5X-.js +0 -670
- package/browser/chunk-DQ6ffgp1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-C-NRs1Fa.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-C6abvjjM.js';import {g,W,F,I as Ie,U as Ui,aj as Ty,a2 as da,aa as Cr,x as U,E as x,z as w,ag as Ue,ak as Fe,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,k as df,n as ff,e as cg}from'./main-SWYRVFGZ.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let e=Xw();jE(),Og(e.deletion.error());}}function Y(n,t){n&1&&(Ds(0,"p",4),MC(1,"Loading scheduled prompts\u2026"),pl());}function z(n,t){n&1&&(Ds(0,"p",5),MC(1,"No scheduled prompts available."),pl());}function G(n,t){n&1&&(Ds(0,"p",4),MC(1,"No scheduled prompts match the current filter."),pl());}function Q(n,t){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.prompt.description);}}function X(n,t){n&1&&(Ds(0,"ds-tag",20),MC(1,"Read-only"),pl());}function Z(n,t){if(n&1){let e=qw();Ds(0,"button",25),mg("click",function(){df(e);let l=Xw(2).$implicit,p=Xw(2);return ff(p.toggle(l))}),MC(1),pl(),Ds(2,"button",25),mg("click",function(){df(e);let l=Xw(2).$implicit,p=Xw(2);return ff(p.edit(l))}),MC(3," Edit "),pl();}if(n&2){let e=Xw(2).$implicit;jE(),Og(e.prompt.enabled?"Disable":"Enable"),jE(),cg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=qw();Pw(0,Z,4,2),Ds(1,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(e);let l=Xw().$implicit,p=Xw(2);return ff(p.deletion.request(l.key))})("deleteConfirmed",function(){df(e);let l=Xw().$implicit,p=Xw(2);return ff(p.confirmDelete(l))})("deleteCancelled",function(){df(e);let l=Xw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let e=Xw().$implicit,i=Xw(2);Lw(i.deletion.confirmingId()!==e.key?0:-1),jE(),ug("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Ds(0,"button",23),MC(1,"Inherited"),pl());}function ne(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,Q,2,1,"span",14),pl(),Ds(5,"td",15),MC(6),pl(),Ds(7,"td",16)(8,"ds-tag",17),MC(9),pl()(),Ds(10,"td",18)(11,"div",19)(12,"ds-tag",17),MC(13),pl(),Pw(14,X,2,0,"ds-tag",20),pl()(),Ds(15,"td",21)(16,"div",22),Pw(17,ee,2,4)(18,te,2,0,"button",23),pl()()()),n&2){let e=t.$implicit,i=Xw(2);jE(3),Og(e.prompt.name),jE(),Lw(e.prompt.description?4:-1),jE(2),Og(i.scheduleLabel(e.prompt)),jE(2),ug("variant",e.prompt.enabled?"accent":"outline"),jE(),Og(e.prompt.enabled?"Enabled":"Disabled"),jE(3),ug("variant",e.scope==="platform"?"neutral":"accent"),jE(),Og(e.scope==="platform"?"Platform":"Namespace"),jE(),Lw(e.scope==="platform"?14:-1),jE(3),Lw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Schedule"),pl(),Ds(8,"th",10),MC(9,"Status"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ne,19,9,"tr",9,J),pl()()()),n&2){let e=Xw();jE(16),Hw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(Ie);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Ui([]);isLoading=Ui(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ty({platform:this.state.listPlatform().pipe(da(()=>Cr([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===Ue.WEEK?"week":"month",l=e.unit===Ue.WEEK&&e.days?.length?` (${e.days.map(p=>Fe[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return i.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New scheduled prompt"),pl()(),Pw(4,O,2,1,"p",3),Pw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {R}from'./chunk-
|
|
1
|
+
import {R}from'./chunk-CuAGAd4W.js';import {g,F,I as Ie,$ as wr,U as Ui,a1 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-SWYRVFGZ.js';import {z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Ds(0,"p",3),MC(1),pl()),e&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function H(e,t){e&1&&(Ds(0,"p",5),MC(1,"No platform auth settings defined yet."),pl());}function U(e,t){e&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function z(e,t){if(e&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.onEdit(d))}),MC(1," Edit "),pl();}if(e&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.onDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(e&2){let n=Xw().$implicit,a=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),e&2){let n=t.$implicit,a=Xw(2);jE(2),Og(n.name),jE(2),vl(" ",n.authType," "),jE(3),Lw(a.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(e,t){if(e&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,B),pl()()()),e&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(Ie);state=g(R);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();settings=Ui([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New auth setting"),pl()(),Pw(4,j,2,1,"p",3),Pw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,a3 as id,n as nd,L as Lt,m as mo,c as po,a4 as so,a5 as da,a6 as ra,d as pn,h as hn,e as cn,C as mn,i as at,j as an,I as Io,a7 as f$1}from'./chunk-
|
|
1
|
+
import {f,a3 as id,n as nd,L as Lt,m as mo,c as po,a4 as so,a5 as da,a6 as ra,d as pn,h as hn,e as cn,C as mn,i as at,j as an,I as Io,a7 as f$1}from'./chunk-C6abvjjM.js';import {g,W,aH as Y,U as Ui,aI as ue$1,A as Af,m as mw,aJ as pb,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,ai as md,a1 as fa,a3 as nn,aj as Ty,a2 as da$1,M as MC,q as qw,N as mg,aK as Bg,Q as SI,X as Xw,aL as jg,T as MI,V as Vw,H as Hw,aM as UC,aN as HC,O as Og,e as cg,at as $C,au as GC,aq as kg,v as vl,aO as WC,k as df,n as ff,aP as kC}from'./main-SWYRVFGZ.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Ds(0,"p",2),MC(1,"Loading usage settings\u2026"),pl());}function fe(e,a){if(e&1){let t=qw();Ds(0,"ds-notice"),MC(1,"Could not load usage settings. Please try again."),pl(),Ds(2,"div")(3,"button",3),mg("click",function(){df(t);let s=Xw();return ff(s.configuration.retry())}),MC(4,"Retry usage settings"),pl()();}}function ye(e,a){e&1&&(Ds(0,"p",2),MC(1,"Usage tracking is disabled."),pl());}function be(e,a){e&1&&(Ds(0,"ds-notice"),MC(1),pl()),e&2&&(jE(),Og(a));}function xe(e,a){e&1&&(Ds(0,"p",2),MC(1,"Loading usage\u2026"),pl());}function he(e,a){e&1&&(Ds(0,"p",12),MC(1,"No recorded usage for this period."),pl());}function Se(e,a){if(e&1&&(Ds(0,"p",10),MC(1),pl()),e&2){let t=Xw().$implicit;jE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Ds(0,"tr",16)(1,"td",18),MC(2),pl(),Ds(3,"td",19),MC(4),$C(5,"number"),pl(),Ds(6,"td",20),MC(7),$C(8,"number"),$C(9,"number"),pl(),Ds(10,"td",21),MC(11),$C(12,"number"),$C(13,"number"),pl(),Ds(14,"td",22),MC(15),$C(16,"agentosCost"),Pw(17,Se,2,1,"p",10),pl()()),e&2){let t=a.$implicit;jE(2),Og(t.key),jE(2),Og(GC(5,8,t.aggregate.totalTokens)),jE(3),kg(" ",GC(8,10,t.aggregate.inputTokens)," / ",GC(9,12,t.aggregate.outputTokens)," "),jE(4),kg(" ",GC(12,14,t.aggregate.cacheReadTokens)," / ",GC(13,16,t.aggregate.cacheWriteTokens)," "),jE(4),vl(" ",WC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),jE(2),Lw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Ds(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),MC(5,"Name"),pl(),Ds(6,"th",17),MC(7,"Tokens"),pl(),Ds(8,"th",17),MC(9,"Input / output"),pl(),Ds(10,"th",17),MC(11,"Cache read / write"),pl(),Ds(12,"th",17),MC(13,"Estimated cost"),pl()()(),Ds(14,"tbody",15),Vw(15,we,18,21,"tr",16,_e),pl()()()),e&2){let t=Xw().$implicit;jE(),cg("aria-label","Usage "+t.title.toLowerCase()),jE(14),Hw(t.rows);}}function Ne(e,a){if(e&1&&(Ds(0,"h3",11),MC(1),pl(),Pw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;jE(),Og(t.title),jE(),Lw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Vw(0,Ne,4,2,null,null,ue),Ds(2,"p",10),MC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),pl()),e&2){let t=Xw(2);Hw(UC(4,ge,HC(0,ce,t.agents()),HC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(t);let s=Xw();return ff(s.load())}),Ds(1,"ds-form-field",5)(2,"input",6),Bg("ngModelChange",function(s){df(t);let m=Xw();return kC(m.from,s)||(m.from=s),ff(s)}),pl(),SI(),pl(),Ds(3,"ds-form-field",7)(4,"input",8),Bg("ngModelChange",function(s){df(t);let m=Xw();return kC(m.to,s)||(m.to=s),ff(s)}),pl(),SI(),pl(),Ds(5,"button",9),MC(6,"Refresh"),pl()(),Pw(7,be,2,1,"ds-notice"),Pw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=Xw();jE(2),jg("ngModel",r.from),MI(),jE(2),jg("ngModel",r.to),MI(),jE(3),Lw((t=r.error())?7:-1,t),jE(),Lw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Y);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=Ui([]);models=Ui([]);error=Ui(null);loading=Ui(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Af(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(md(void 0),fa(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),nn):(this.loading.set(true),Ty({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(da$1(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),nn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),pl()),t&2&&(jE(2),Lw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[id,nd,Lt,mo,po,so,da,ra,pn,hn,cn,mn,at,an,Io,pb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,y,a as pt,T as Te,b as fn,U as Ut,n as nd,L as Lt,k as kn,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-BiMuA5X-.js';import {g,W,F,J,I as Ie,K as KC,U as Ui,A as Af,x as U,z as w,E as x,m as mw,D as Ds,l as lg,P as Pw,a as pl,G as ug,j as jE,L as Lw,M as MC,q as qw,N as mg,Q as SI,X as Xw,T as MI,e as cg,v as vl,k as df,n as ff}from'./main-HBKYHCPK.js';var ne=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function re(i){return ne.test(i)}function ee(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||re(e)?null:{absolutePath:true}}}function ae(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ie(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Xw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),SI(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),SI(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),SI(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),SI(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),SI(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),SI(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let oe=Xw();return ff(oe.onMaxToolRoundsInput(p))}),pl(),SI(),pl(),Ds(17,"ds-form-actions")(18,"button",21),MC(19),pl(),Ds(20,"button",22),mg("click",function(){df(e);let p=Xw();return ff(p.cancel())}),MC(21,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(2),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.externalIdControl),MI(),jE(2),ug("formControl",e.defaultAgentNameControl),MI(),jE(2),ug("formControl",e.configPathControl),MI(),jE(),ug("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),jE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),MI(),jE(),ug("hint",e.runCostThresholdHint()),jE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),MI(),jE(),ug("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),jE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var le=1,se=2147483647,te=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=KC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=KC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=KC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=KC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ee(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(le),fn.max(se),fn.pattern(/^\d+$/)]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,ae,2,0,"p",2)(3,ie,22,19,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),jE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),jE(),Lw(u.isLoading()?2:3));},dependencies:[Ut,nd,Lt,kn,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{te as NamespaceFormComponent};
|
|
1
|
+
import {f,y,a as pt,T as Te,b as fn,U as Ut,n as nd,L as Lt,k as kn,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-C6abvjjM.js';import {g,W,F,J,I as Ie,K as KC,U as Ui,A as Af,x as U,z as w,E as x,m as mw,D as Ds,l as lg,P as Pw,a as pl,G as ug,j as jE,L as Lw,M as MC,q as qw,N as mg,Q as SI,X as Xw,T as MI,e as cg,v as vl,k as df,n as ff}from'./main-SWYRVFGZ.js';var ne=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function re(i){return ne.test(i)}function ee(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||re(e)?null:{absolutePath:true}}}function ae(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ie(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Xw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),SI(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),SI(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),SI(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),SI(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),SI(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),SI(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let oe=Xw();return ff(oe.onMaxToolRoundsInput(p))}),pl(),SI(),pl(),Ds(17,"ds-form-actions")(18,"button",21),MC(19),pl(),Ds(20,"button",22),mg("click",function(){df(e);let p=Xw();return ff(p.cancel())}),MC(21,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(2),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.externalIdControl),MI(),jE(2),ug("formControl",e.defaultAgentNameControl),MI(),jE(2),ug("formControl",e.configPathControl),MI(),jE(),ug("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),jE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),MI(),jE(),ug("hint",e.runCostThresholdHint()),jE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),MI(),jE(),ug("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),jE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var le=1,se=2147483647,te=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=KC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=KC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=KC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=KC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ee(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(le),fn.max(se),fn.pattern(/^\d+$/)]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,ae,2,0,"p",2)(3,ie,22,19,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),jE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),jE(),Lw(u.isLoading()?2:3));},dependencies:[Ut,nd,Lt,kn,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{te as NamespaceFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a1 as fa,a2 as da,aa as Cr,aC as Uy}from'./main-SWYRVFGZ.js';function i(t,o,p){return t.pipe(fa(()=>o().pipe(da(()=>Cr(p)))),Uy({bufferSize:1,refCount:true}))}export{i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CrlEsza5.js';import {O}from'./chunk-CZ3swGRG.js';import {g,W as W$1,F,I as Ie,ae as U,aw as N,U as Ui,ax as Q,a8 as _,K as KC,a9 as F$1,ay as Se,x as U$1,a2 as da,aa as Cr,aj as Ty,az as ne,E as x,z as w,m as mw,as as $t$1,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,ao as k,a6 as x$1,X as Xw,q as qw,l as lg,Q as SI,T as MI,e as cg,v as vl,V as Vw,H as Hw,O as Og,k as df,n as ff,aq as kg}from'./main-HBKYHCPK.js';import {a as pt$1,T as Te,b as fn,U as Ut$1,n as nd,o as bo,x as xo,L as Lt$1,k as kn,u as vn,G as Gt$1,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at$1,j as an,t as rn,l as ko}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';var W=class n{aiModelController=g(k);listAvailable(t){let e=this.aiModelController.listPlatformLevelAiModel().pipe(this.orEmpty("platform")),o=t?this.aiModelController.listByNamespaceIdAiModel(t).pipe(this.orEmpty("namespace")):Cr([]);return Ty({platform:e,namespace:o}).pipe(ne(({platform:r,namespace:d})=>[...r,...d]))}orEmpty(t){return da(e=>(console.error(`[ai-model-state] failed to load the ${t} AI models`,e),Cr([])))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x$1({token:n,factory:n.\u0275fac,providedIn:"root"})};var D="*";function Ge(n){return (n??[]).some(t=>t.trim()===D)}function Ue(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D).map(e=>e.toLowerCase());return new Set(t)}function H(n){return n.includes(D)}function Xe(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function z(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D&&H(e)).some(e=>Xe(e)?.test(n)??false)}var je="AGENTOS_CONFIG",Qe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ke(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Qe.has(t)))}var $=n=>n.trim().toLowerCase();function Ze(n,t){let e=o=>o.namespaceId?1:0;return e(n)-e(t)||n.priority-t.priority}var We=(n,t)=>n.label.localeCompare(t.label);function He(n,t){let e=new Map;for(let _ of n){let m=_.alias?.trim();if(!m)continue;let I=e.get($(m));(!I||Ze(_,I)>0)&&e.set($(m),_);}let o=[...e.values()].map(_=>({value:_.alias.trim(),label:`${_.alias.trim()} (${_.apiModelName})`})).sort(We),r=new Set,d=[];for(let _ of n){let m=_.apiModelName?.trim();!m||r.has($(m))||(r.add($(m)),e.has($(m))||d.push({value:m,label:m}));}d.sort(We);let f=t??"";if(f.trim().length===0||[...o,...d].some(_=>_.value===f))return {aliases:o,apiNames:d,current:null};let S=e.has($(f))||r.has($(f));return {aliases:o,apiNames:d,current:{value:f,label:S?f:`${f} (not in the list)`}}}var Ye=(n,t)=>t.value,et=(n,t)=>t.config.id,tt=(n,t)=>t.type,qe=(n,t)=>t.selector;function nt(n,t){if(n&1&&(Ds(0,"a",2),MC(1,"View resolved definition \u2192"),pl()),n&2){let e=Xw();ug("routerLink",e.inspectRoute());}}function ot(n,t){n&1&&(Ds(0,"ds-tag",3),MC(1,"Platform level"),pl());}function it(n,t){n&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function at(n,t){if(n&1&&(lg(0,"input",17),SI()),n&2){let e=Xw(2);ug("formControl",e.modelNameControl),MI();}}function lt(n,t){if(n&1&&(Ds(0,"option",41),MC(1),pl()),n&2){let e=t;ug("ngValue",e.value),jE(),Og(e.label);}}function rt(n,t){if(n&1&&(Ds(0,"option",41),MC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),jE(),Og(e.label);}}function st(n,t){if(n&1&&(Ds(0,"optgroup",42),Vw(1,rt,2,2,"option",41,Ye),pl()),n&2){let e=Xw(3);jE(),Hw(e.modelOptions().aliases);}}function dt(n,t){if(n&1&&(Ds(0,"option",41),MC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),jE(),Og(e.label);}}function ct(n,t){if(n&1&&(Ds(0,"optgroup",43),Vw(1,dt,2,2,"option",41,Ye),pl()),n&2){let e=Xw(3);jE(),Hw(e.modelOptions().apiNames);}}function mt(n,t){if(n&1&&(Ds(0,"select",18)(1,"option",40),MC(2,"Select a model"),pl(),Pw(3,lt,2,2,"option",41),Pw(4,st,3,0,"optgroup",42),Pw(5,ct,3,0,"optgroup",43),pl(),SI()),n&2){let e,o=Xw(2);ug("formControl",o.modelNameControl),MI(),jE(),ug("ngValue",null),jE(2),Lw((e=o.modelOptions().current)?3:-1,e),jE(),Lw(o.modelOptions().aliases.length>0?4:-1),jE(),Lw(o.modelOptions().apiNames.length>0?5:-1);}}function ut(n,t){if(n&1&&(Ds(0,"span",44),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.config.integrationType);}}function gt(n,t){if(n&1&&(lg(0,"input",45),SI()),n&2){let e=Xw().$implicit;ug("formControl",e.toolsControl),cg("aria-label","Tools of "+e.config.name),MI();}}function pt(n,t){if(n&1){let e=qw();Ds(0,"div",10)(1,"label",11)(2,"input",23),mg("change",function(){let r=df(e).$implicit,d=Xw(3);return ff(d.toggleIntegration(r))}),pl(),Ds(3,"span",24),MC(4),pl(),Pw(5,ut,2,1,"span",44),pl(),Pw(6,gt,1,2,"input",45),pl();}if(n&2){let e=t.$implicit;jE(2),ug("checked",e.enabled()),jE(2),Og(e.config.name),jE(),Lw(e.config.integrationType?5:-1),jE(),Lw(e.enabled()?6:-1);}}function ft(n,t){if(n&1&&(Ds(0,"p",13),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ct(n,t){if(n&1){let e=qw();Ds(0,"div",10)(1,"label",24),MC(2),Ds(3,"span",44),MC(4,"built-in"),pl()(),Ds(5,"select",47),mg("change",function(r){let d=df(e).$implicit,f=Xw(4);return ff(f.setBuiltInState(d,r.target.value))}),Ds(6,"option",48),MC(7),pl(),Ds(8,"option",49),MC(9,"Enabled"),pl(),Ds(10,"option",50),MC(11,"Disabled"),pl()(),Pw(12,ft,2,1,"p",13),Ds(13,"p",13),MC(14),pl()();}if(n&2){let e=t.$implicit,o=Xw(4);jE(),cg("for","built-in-"+e.type),jE(),vl(" ",e.displayName," "),jE(3),ug("id","built-in-"+e.type)("value",e.state()),jE(2),Og(o.builtInDefaultLabel(e)),jE(5),Lw(e.state()==="on"&&e.restrictedTools?12:-1),jE(2),Og(e.description);}}function _t(n,t){if(n&1&&(Ds(0,"span",46),MC(1,"Built-in integrations"),pl(),Vw(2,Ct,15,7,"div",10,tt)),n&2){let e=Xw(3);jE(2),Hw(e.builtInRows());}}function bt(n,t){n&1&&(Ds(0,"ds-notice",26),MC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),pl());}function ht(n,t){if(n&1&&(Ds(0,"ds-fieldset",21),Vw(1,pt,7,4,"div",10,et),Pw(3,_t,4,0),Pw(4,bt,2,0,"ds-notice",26),pl()),n&2){let e=Xw(2);jE(),Hw(e.integrationRows()),jE(2),Lw(e.builtInRows().length>0?3:-1),jE(),Lw(e.configAgentExposureWarning()?4:-1);}}function yt(n,t){n&1&&MC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function vt(n,t){n&1&&(Ds(0,"ds-notice",26),MC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),MC(3,"*"),pl(),MC(4,". "),pl());}function xt(n,t){n&1&&(Ds(0,"ds-notice"),MC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function St(n,t){n&1&&(Ds(0,"p",4),MC(1,"No skill available in this scope yet."),pl());}function At(n,t){n&1&&(Ds(0,"span",44),MC(1,"platform"),pl());}function wt(n,t){if(n&1&&(Ds(0,"span",44),MC(1),pl()),n&2){let e=Xw(4);jE(),vl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Et(n,t){if(n&1&&(Ds(0,"p",13),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.description);}}function Tt(n,t){if(n&1){let e=qw();Ds(0,"div",10)(1,"label",11)(2,"input",51),mg("change",function(){let r=df(e).$implicit,d=Xw(3);return ff(d.toggleSkill(r))}),pl(),Ds(3,"span",24),MC(4),pl(),Pw(5,At,2,0,"span",44),Pw(6,wt,2,1,"span",44),pl(),Pw(7,Et,2,1,"p",13),pl();}if(n&2){let e=t.$implicit,o=Xw(3);jE(2),ug("checked",e.selected())("disabled",o.allSkillsSelected()),jE(2),Og(e.name),jE(),Lw(e.platform?5:-1),jE(),Lw(e.unresolved?6:-1),jE(),Lw(e.description?7:-1);}}function kt(n,t){if(n&1&&Vw(0,Tt,8,6,"div",10,qe),n&2){let e=Xw(2);Hw(e.skillRows());}}function It(n,t){if(n&1&&(Ds(0,"ds-form-field",30),lg(1,"textarea",52),SI(),Ds(2,"p",4),MC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Ds(4,"code"),MC(5,"AgentLoopPayload"),pl(),MC(6,". Leave empty if you always provide the payload at launch. "),pl()()),n&2){let e=Xw(2);ug("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),jE(),ug("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),MI();}}function Mt(n,t){n&1&&MC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Rt(n,t){if(n&1&&MC(0),n&2){let e=Xw(3);kg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Ft(n,t){if(n&1&&(Ds(0,"ds-notice",26),MC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),MC(3,"*"),pl(),MC(4,". "),Pw(5,Rt,1,2),pl()),n&2){let e=Xw(2);jE(5),Lw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Nt(n,t){n&1&&(Ds(0,"ds-notice"),MC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function Dt(n,t){n&1&&(Ds(0,"p",4),MC(1,"No other agent is available in this scope yet."),pl());}function Lt(n,t){n&1&&(Ds(0,"span",44),MC(1,"pattern"),pl());}function Ot(n,t){n&1&&(Ds(0,"span",44),MC(1,"via pattern"),pl());}function Vt(n,t){if(n&1&&(Ds(0,"span",44),MC(1),pl()),n&2){let e=Xw(4);jE(),vl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Pt(n,t){if(n&1){let e=qw();Ds(0,"button",55),mg("click",function(){df(e);let r=Xw().$implicit,d=Xw(3);return ff(d.removeSubAgent(r))}),MC(1," \xD7 "),pl();}if(n&2){let e=Xw().$implicit;cg("aria-label","Remove "+e.selector);}}function Bt(n,t){if(n&1){let e=qw();Ds(0,"div",32)(1,"label",53)(2,"input",51),mg("change",function(){let r=df(e).$implicit,d=Xw(3);return ff(d.toggleSubAgent(r))}),pl(),Ds(3,"span",24),MC(4),pl(),Pw(5,Lt,2,0,"span",44)(6,Ot,2,0,"span",44)(7,Vt,2,1,"span",44),pl(),Pw(8,Pt,2,1,"button",54),pl();}if(n&2){let e=t.$implicit,o=Xw(3);jE(2),ug("checked",e.selected())("disabled",o.allSubAgentsSelected()),jE(2),Og(e.name),jE(),Lw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),jE(3),Lw(e.unresolved?8:-1);}}function $t(n,t){if(n&1&&Vw(0,Bt,9,5,"div",32,qe),n&2){let e=Xw(2);Hw(e.subAgentRows());}}function Gt(n,t){if(n&1){let e=qw();Ds(0,"div")(1,"button",56),mg("click",function(){df(e);let r=Xw(2);return ff(r.useDefaultDelegationTimeout())}),MC(2," Use server default "),pl()();}}function Ut(n,t){n&1&&(Ds(0,"ds-notice"),MC(1),pl()),n&2&&(jE(),Og(t));}function jt(n,t){if(n&1){let e=qw();Ds(0,"button",57),mg("click",function(){df(e);let r=Xw(2);return ff(r.exportYaml())}),MC(1),pl();}if(n&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Kt(n,t){if(n&1){let e=qw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let r=Xw();return ff(r.submit())}),Ds(1,"ds-fieldset",7)(2,"ds-form-field",8),lg(3,"input",9),SI(),pl(),Ds(4,"div",10)(5,"label",11),lg(6,"input",12),SI(),MC(7," Enabled "),pl(),Ds(8,"p",13),MC(9,"Disabled agents are excluded from namespace resolution."),pl()(),Ds(10,"ds-form-field",14),lg(11,"input",15),SI(),pl(),Ds(12,"ds-form-field",16),Pw(13,at,1,1,"input",17)(14,mt,6,5,"select",18),pl(),Ds(15,"ds-form-field",19),lg(16,"textarea",20),SI(),pl()(),Pw(17,ht,5,2,"ds-fieldset",21),Ds(18,"ds-fieldset",22)(19,"p",4),MC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Ds(21,"code"),MC(22,"readSkill"),pl(),MC(23," and "),Ds(24,"code"),MC(25,"readSkillResource"),pl(),MC(26," tools; selecting none grants neither. "),Pw(27,yt,1,0),pl(),Ds(28,"label",11)(29,"input",23),mg("change",function(){df(e);let r=Xw();return ff(r.toggleAllSkills())}),pl(),Ds(30,"span",24),MC(31,"Every skill in the catalogue ("),Ds(32,"code",25),MC(33,"*"),pl(),MC(34,")"),pl()(),Ds(35,"p",13),MC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),pl(),Pw(37,vt,5,0,"ds-notice",26),Pw(38,xt,2,0,"ds-notice"),Pw(39,St,2,0,"p",4)(40,kt,2,0),pl(),Ds(41,"ds-form-field",27)(42,"select",28)(43,"option",29),MC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),Ds(45,"option",29),MC(46,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),Ds(47,"option",29),MC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),SI(),pl(),Pw(49,It,7,3,"ds-form-field",30),Ds(50,"ds-fieldset",31)(51,"p",4),MC(52," The agents this one may delegate to. Selecting at least one grants it the "),Ds(53,"code"),MC(54,"DELEGATE__delegate"),pl(),MC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Pw(56,Mt,1,0),pl(),Ds(57,"label",11)(58,"input",23),mg("change",function(){df(e);let r=Xw();return ff(r.toggleAllSubAgents())}),pl(),Ds(59,"span",24),MC(60,"Every agent it can reach ("),Ds(61,"code",25),MC(62,"*"),pl(),MC(63,")"),pl()(),Ds(64,"p",13),MC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),pl(),Pw(66,Ft,6,1,"ds-notice",26),Pw(67,Nt,2,0,"ds-notice"),Pw(68,Dt,2,0,"p",4)(69,$t,2,0),Ds(70,"p",4),MC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Ds(72,"code"),MC(73,"*Fixer"),pl(),MC(74," to cover BugFixer and StoryFixer. "),pl(),Ds(75,"div",32)(76,"input",33),mg("keydown.enter",function(){df(e);let r=Xw();return ff(r.addSubAgent())}),pl(),SI(),Ds(77,"button",34),mg("click",function(){df(e);let r=Xw();return ff(r.addSubAgent())}),MC(78," + "),pl()(),Ds(79,"ds-form-field",35),lg(80,"input",36),SI(),Pw(81,Gt,3,0,"div"),pl()(),Pw(82,Ut,2,1,"ds-notice"),Ds(83,"ds-form-actions")(84,"button",37),MC(85),pl(),Pw(86,jt,2,2,"button",38),Ds(87,"button",39),mg("click",function(){df(e);let r=Xw();return ff(r.cancel())}),MC(88,"Cancel"),pl()()();}if(n&2){let e,o=Xw();ug("formGroup",o.form),jE(3),ug("formControl",o.nameControl),MI(),jE(3),ug("formControl",o.enabledControl),MI(),jE(5),ug("formControl",o.descriptionControl),MI(),jE(2),Lw(o.modelAsFreeText()?13:14),jE(3),ug("formControl",o.instructionsControl),MI(),jE(),Lw(o.integrationRows().length>0||o.builtInRows().length>0?17:-1),jE(10),Lw(o.isPlatformMode?27:-1),jE(2),ug("checked",o.allSkillsSelected()),jE(8),Lw(o.namedSkillSelectionDropped()?37:-1),jE(),Lw(o.skillCatalogueUnavailable()?38:-1),jE(),Lw(o.skillRows().length===0?39:40),jE(3),ug("formControl",o.executionModeControl),MI(),jE(),ug("value",o.ExecutionMode.SIMPLE),jE(2),ug("value",o.ExecutionMode.ADVANCED),jE(2),ug("value",o.ExecutionMode.LOOP),jE(2),Lw(o.isLoopMode()?49:-1),jE(7),Lw(o.isPlatformMode?56:-1),jE(2),ug("checked",o.allSubAgentsSelected()),jE(8),Lw(o.namedSubAgentSelectionDropped()?66:-1),jE(),Lw(o.subAgentCandidatesUnavailable()?67:-1),jE(),Lw(o.subAgentRows().length===0?68:69),jE(8),ug("formControl",o.newSubAgentControl),MI(),jE(),ug("disabled",!o.newSubAgentControl.value.trim()),jE(2),ug("hint",o.delegationTimeoutHint())("error",o.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),jE(),ug("formControl",o.delegationTimeoutControl),cg("aria-invalid",o.delegationTimeoutControl.invalid),MI(),jE(),Lw(o.delegationTimeoutControl.value!==null?81:-1),jE(),Lw((e=o.submitError())?82:-1,e),jE(2),ug("disabled",o.form.invalid||o.isSubmitting()),jE(),vl(" ",o.isEditMode()?"Save changes":"Create"," "),jE(),Lw(o.isEditMode()?86:-1);}}var Je=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=Ui(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(W);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[fn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[fn.min(1),fn.max(2147483647),fn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(o){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=KC(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=KC(()=>this.executionModeValue()==="LOOP");subAgentRows=Ui([]);allSubAgentsSelected=Ui(false);subAgentCandidatesUnavailable=Ui(false);namedSubAgentSelectionDropped=KC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=KC(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=KC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);submitError=Ui(null);ExecutionMode=Se;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Ui([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=KC(()=>Ke({configEnabled:this.builtInRows().some(t=>t.type===je&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=Ui({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=Ui(false);modelAsFreeText=KC(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(He(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=Ui([]);skillRows=Ui([]);allSkillsSelected=Ui(false);skillCatalogueUnavailable=Ui(false);namedSkillSelectionDropped=KC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),da(()=>Cr(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ty({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Cr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:o,platformIntegrations:r,builtInTypes:d,skillCatalogue:f,delegationCandidates:S,models:_})=>{this.existingConfig=e,this.applyModelCatalogue(_,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let m=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(m),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let I=[...r,...o];this.integrationRows.set(this.buildIntegrationRows(I,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(d,e.integrations??void 0)),this.allSubAgentsSelected.set(Ge(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(S,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(f,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ty({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Cr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:o,builtInTypes:r,skillCatalogue:d,delegationCandidates:f,models:S})=>{this.applyModelCatalogue(S,null);let _=[...o,...e];this.integrationRows.set(this.buildIntegrationRows(_,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(r,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(f,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(d,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(o=>({id:o.id??"",name:o.name,description:o.description,namespaceId:o.namespaceId??null,readOnly:o.readOnly===true}))))).pipe(da(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Cr([]))))}buildSkillRows(t,e){let r$1=(e??[]).map(m=>m.trim()).filter(m=>m.length>0).filter(m=>m!==r),d=i(r$1),f=new Set(t.map(m=>m.name.toLowerCase())),S=t.map(m=>({selector:m.name,name:m.name,description:m.description,platform:m.namespaceId==null,unresolved:false,selected:Ui(d.has(m.name.toLowerCase()))})),_=new Set;for(let m of r$1){let I=l(m).toLowerCase();f.has(I)||_.has(I)||(_.add(I),S.push({selector:m,name:m,description:"",platform:false,unresolved:true,selected:Ui(true)}));}return S}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):Cr([]);return Ty({platform:t,namespace:e}).pipe(ne(({platform:o,namespace:r})=>[...o,...r]),ne(o=>o.map(r=>r.name).filter(r=>r.length>0)),ne(o=>n.dedupeByKey(o)))}orNoCandidates(){return da(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),Cr([])))}static dedupeByKey(t){let e=new Set;return t.filter(o=>{let r=o.toLowerCase();return e.has(r)?false:(e.add(r),true)})}buildSubAgentRows(t,e,o){let r=Ue(e),d=o?.toLowerCase()??null,f=t.filter(b=>{let G=b.toLowerCase();return G!==d||r.has(G)}),S=new Set(f.map(b=>b.toLowerCase())),_=f.map(b=>({selector:b,name:b,unresolved:false,pattern:false,grantedByPattern:z(b,e),selected:Ui(r.has(b.toLowerCase()))})),m=new Set,I=(e??[]).map(b=>b.trim()).filter(b=>b.length>0&&b!==D);for(let b of I){let G=b.toLowerCase();S.has(G)||m.has(G)||(m.add(G),_.push({selector:b,name:b,unresolved:true,pattern:H(b),grantedByPattern:false,selected:Ui(true)}));}return _}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),da(t=>(console.error("[agent-config-form] failed to load integration types",t),Cr([]))))}buildIntegrationRows(t,e){return t.map(o=>{let r=o.name??"",d=e?.[r],f=e!=null&&r in e,S=Array.isArray(d)?d.join(", "):"";return {config:o,enabled:Ui(f),toolsControl:new Te(S,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(o=>{let r=e!=null&&o.type in e,d=e?.[o.type],f=r?Array.isArray(d)&&d.length===0?"off":"on":"default";return {type:o.type,displayName:o.displayName,description:o.description,enabledByDefault:o.enabledByDefault===true,state:Ui(f),restrictedTools:Array.isArray(d)&&d.length>0?d:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(o=>o.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===D?this.allSubAgentsSelected.set(true):this.subAgentRows.update(o=>this.withPatternGrants([...o,{selector:t,name:t,unresolved:true,pattern:H(t),grantedByPattern:false,selected:Ui(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(o=>this.withPatternGrants(o.filter(r=>r.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(o=>o.selected()).map(o=>o.selector);return t.map(o=>o.unresolved?o:x(w({},o),{grantedByPattern:z(o.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [D];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let o of this.integrationRows().filter(r=>r.enabled())){let r=o.config.name??"",d=o.toolsControl.value.trim();t[r]=d===""?null:d.split(",").map(f=>f.trim()).filter(f=>f.length>0);}for(let o of this.builtInRows()){let r=o.state();r==="on"?t[o.type]=o.restrictedTools??null:r==="off"&&(t[o.type]=[]);}let e=new Set([...this.integrationRows().map(o=>o.config.name??""),...this.builtInRows().map(o=>o.type)]);for(let[o,r]of Object.entries(this.existingConfig?.integrations??{}))e.has(o)||(t[o]=r);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(o));}});}static serverMessage(t){let o=t?.error?.message;if(typeof o=="string"&&o.trim().length>0)return o;let r=t?.status;return r===0?"The server could not be reached. The agent was not saved.":typeof r=="number"&&r>=500?`The server failed to save the agent (HTTP ${r}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let o=new Blob([e],{type:"application/yaml"}),r=URL.createObjectURL(o),d=document.createElement("a");d.href=r,d.download=`${this.existingConfig?.name??"agent"}.yaml`,d.click(),URL.revokeObjectURL(r),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,o){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),MC(3," \u2190 Agent configs "),pl(),Pw(4,nt,2,1,"a",2),Pw(5,ot,2,0,"ds-tag",3),pl(),Pw(6,it,2,0,"p",4)(7,Kt,89,33,"form",5),pl()),e&2&&(jE(),ug("title",o.isEditMode()?"Edit agent config":"New agent config"),jE(3),Lw(o.isEditMode()?4:-1),jE(),Lw(o.isPlatformMode?5:-1),jE(),Lw(o.isLoading()?6:7));},dependencies:[Ut$1,nd,bo,xo,Lt$1,kn,vn,Gt$1,mo,po,$r,qr,Vn,An,$t$1,pn,hn,cn,ln,dn,mn,at$1,an,rn,ko],encapsulation:2})};export{Je as AgentConfigFormComponent};
|
|
1
|
+
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DEpnxPHI.js';import {O}from'./chunk-SzOkzSvH.js';import {g,W as W$1,F,I as Ie,ae as U,aw as N,U as Ui,ax as Q,a8 as _,K as KC,a9 as F$1,ay as Se,x as U$1,a2 as da,aa as Cr,aj as Ty,az as ne,E as x,z as w,m as mw,as as $t$1,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,ao as k,a6 as x$1,X as Xw,q as qw,l as lg,Q as SI,T as MI,e as cg,v as vl,V as Vw,H as Hw,O as Og,k as df,n as ff,aq as kg}from'./main-SWYRVFGZ.js';import {a as pt$1,T as Te,b as fn,U as Ut$1,n as nd,o as bo,x as xo,L as Lt$1,k as kn,u as vn,G as Gt$1,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at$1,j as an,t as rn,l as ko}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';var W=class n{aiModelController=g(k);listAvailable(t){let e=this.aiModelController.listPlatformLevelAiModel().pipe(this.orEmpty("platform")),o=t?this.aiModelController.listByNamespaceIdAiModel(t).pipe(this.orEmpty("namespace")):Cr([]);return Ty({platform:e,namespace:o}).pipe(ne(({platform:r,namespace:d})=>[...r,...d]))}orEmpty(t){return da(e=>(console.error(`[ai-model-state] failed to load the ${t} AI models`,e),Cr([])))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x$1({token:n,factory:n.\u0275fac,providedIn:"root"})};var D="*";function Ge(n){return (n??[]).some(t=>t.trim()===D)}function Ue(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D).map(e=>e.toLowerCase());return new Set(t)}function H(n){return n.includes(D)}function Xe(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function z(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D&&H(e)).some(e=>Xe(e)?.test(n)??false)}var je="AGENTOS_CONFIG",Qe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ke(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Qe.has(t)))}var $=n=>n.trim().toLowerCase();function Ze(n,t){let e=o=>o.namespaceId?1:0;return e(n)-e(t)||n.priority-t.priority}var We=(n,t)=>n.label.localeCompare(t.label);function He(n,t){let e=new Map;for(let _ of n){let m=_.alias?.trim();if(!m)continue;let I=e.get($(m));(!I||Ze(_,I)>0)&&e.set($(m),_);}let o=[...e.values()].map(_=>({value:_.alias.trim(),label:`${_.alias.trim()} (${_.apiModelName})`})).sort(We),r=new Set,d=[];for(let _ of n){let m=_.apiModelName?.trim();!m||r.has($(m))||(r.add($(m)),e.has($(m))||d.push({value:m,label:m}));}d.sort(We);let f=t??"";if(f.trim().length===0||[...o,...d].some(_=>_.value===f))return {aliases:o,apiNames:d,current:null};let S=e.has($(f))||r.has($(f));return {aliases:o,apiNames:d,current:{value:f,label:S?f:`${f} (not in the list)`}}}var Ye=(n,t)=>t.value,et=(n,t)=>t.config.id,tt=(n,t)=>t.type,qe=(n,t)=>t.selector;function nt(n,t){if(n&1&&(Ds(0,"a",2),MC(1,"View resolved definition \u2192"),pl()),n&2){let e=Xw();ug("routerLink",e.inspectRoute());}}function ot(n,t){n&1&&(Ds(0,"ds-tag",3),MC(1,"Platform level"),pl());}function it(n,t){n&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function at(n,t){if(n&1&&(lg(0,"input",17),SI()),n&2){let e=Xw(2);ug("formControl",e.modelNameControl),MI();}}function lt(n,t){if(n&1&&(Ds(0,"option",41),MC(1),pl()),n&2){let e=t;ug("ngValue",e.value),jE(),Og(e.label);}}function rt(n,t){if(n&1&&(Ds(0,"option",41),MC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),jE(),Og(e.label);}}function st(n,t){if(n&1&&(Ds(0,"optgroup",42),Vw(1,rt,2,2,"option",41,Ye),pl()),n&2){let e=Xw(3);jE(),Hw(e.modelOptions().aliases);}}function dt(n,t){if(n&1&&(Ds(0,"option",41),MC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),jE(),Og(e.label);}}function ct(n,t){if(n&1&&(Ds(0,"optgroup",43),Vw(1,dt,2,2,"option",41,Ye),pl()),n&2){let e=Xw(3);jE(),Hw(e.modelOptions().apiNames);}}function mt(n,t){if(n&1&&(Ds(0,"select",18)(1,"option",40),MC(2,"Select a model"),pl(),Pw(3,lt,2,2,"option",41),Pw(4,st,3,0,"optgroup",42),Pw(5,ct,3,0,"optgroup",43),pl(),SI()),n&2){let e,o=Xw(2);ug("formControl",o.modelNameControl),MI(),jE(),ug("ngValue",null),jE(2),Lw((e=o.modelOptions().current)?3:-1,e),jE(),Lw(o.modelOptions().aliases.length>0?4:-1),jE(),Lw(o.modelOptions().apiNames.length>0?5:-1);}}function ut(n,t){if(n&1&&(Ds(0,"span",44),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.config.integrationType);}}function gt(n,t){if(n&1&&(lg(0,"input",45),SI()),n&2){let e=Xw().$implicit;ug("formControl",e.toolsControl),cg("aria-label","Tools of "+e.config.name),MI();}}function pt(n,t){if(n&1){let e=qw();Ds(0,"div",10)(1,"label",11)(2,"input",23),mg("change",function(){let r=df(e).$implicit,d=Xw(3);return ff(d.toggleIntegration(r))}),pl(),Ds(3,"span",24),MC(4),pl(),Pw(5,ut,2,1,"span",44),pl(),Pw(6,gt,1,2,"input",45),pl();}if(n&2){let e=t.$implicit;jE(2),ug("checked",e.enabled()),jE(2),Og(e.config.name),jE(),Lw(e.config.integrationType?5:-1),jE(),Lw(e.enabled()?6:-1);}}function ft(n,t){if(n&1&&(Ds(0,"p",13),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ct(n,t){if(n&1){let e=qw();Ds(0,"div",10)(1,"label",24),MC(2),Ds(3,"span",44),MC(4,"built-in"),pl()(),Ds(5,"select",47),mg("change",function(r){let d=df(e).$implicit,f=Xw(4);return ff(f.setBuiltInState(d,r.target.value))}),Ds(6,"option",48),MC(7),pl(),Ds(8,"option",49),MC(9,"Enabled"),pl(),Ds(10,"option",50),MC(11,"Disabled"),pl()(),Pw(12,ft,2,1,"p",13),Ds(13,"p",13),MC(14),pl()();}if(n&2){let e=t.$implicit,o=Xw(4);jE(),cg("for","built-in-"+e.type),jE(),vl(" ",e.displayName," "),jE(3),ug("id","built-in-"+e.type)("value",e.state()),jE(2),Og(o.builtInDefaultLabel(e)),jE(5),Lw(e.state()==="on"&&e.restrictedTools?12:-1),jE(2),Og(e.description);}}function _t(n,t){if(n&1&&(Ds(0,"span",46),MC(1,"Built-in integrations"),pl(),Vw(2,Ct,15,7,"div",10,tt)),n&2){let e=Xw(3);jE(2),Hw(e.builtInRows());}}function bt(n,t){n&1&&(Ds(0,"ds-notice",26),MC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),pl());}function ht(n,t){if(n&1&&(Ds(0,"ds-fieldset",21),Vw(1,pt,7,4,"div",10,et),Pw(3,_t,4,0),Pw(4,bt,2,0,"ds-notice",26),pl()),n&2){let e=Xw(2);jE(),Hw(e.integrationRows()),jE(2),Lw(e.builtInRows().length>0?3:-1),jE(),Lw(e.configAgentExposureWarning()?4:-1);}}function yt(n,t){n&1&&MC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function vt(n,t){n&1&&(Ds(0,"ds-notice",26),MC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),MC(3,"*"),pl(),MC(4,". "),pl());}function xt(n,t){n&1&&(Ds(0,"ds-notice"),MC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function St(n,t){n&1&&(Ds(0,"p",4),MC(1,"No skill available in this scope yet."),pl());}function At(n,t){n&1&&(Ds(0,"span",44),MC(1,"platform"),pl());}function wt(n,t){if(n&1&&(Ds(0,"span",44),MC(1),pl()),n&2){let e=Xw(4);jE(),vl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Et(n,t){if(n&1&&(Ds(0,"p",13),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.description);}}function Tt(n,t){if(n&1){let e=qw();Ds(0,"div",10)(1,"label",11)(2,"input",51),mg("change",function(){let r=df(e).$implicit,d=Xw(3);return ff(d.toggleSkill(r))}),pl(),Ds(3,"span",24),MC(4),pl(),Pw(5,At,2,0,"span",44),Pw(6,wt,2,1,"span",44),pl(),Pw(7,Et,2,1,"p",13),pl();}if(n&2){let e=t.$implicit,o=Xw(3);jE(2),ug("checked",e.selected())("disabled",o.allSkillsSelected()),jE(2),Og(e.name),jE(),Lw(e.platform?5:-1),jE(),Lw(e.unresolved?6:-1),jE(),Lw(e.description?7:-1);}}function kt(n,t){if(n&1&&Vw(0,Tt,8,6,"div",10,qe),n&2){let e=Xw(2);Hw(e.skillRows());}}function It(n,t){if(n&1&&(Ds(0,"ds-form-field",30),lg(1,"textarea",52),SI(),Ds(2,"p",4),MC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Ds(4,"code"),MC(5,"AgentLoopPayload"),pl(),MC(6,". Leave empty if you always provide the payload at launch. "),pl()()),n&2){let e=Xw(2);ug("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),jE(),ug("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),MI();}}function Mt(n,t){n&1&&MC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Rt(n,t){if(n&1&&MC(0),n&2){let e=Xw(3);kg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Ft(n,t){if(n&1&&(Ds(0,"ds-notice",26),MC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),MC(3,"*"),pl(),MC(4,". "),Pw(5,Rt,1,2),pl()),n&2){let e=Xw(2);jE(5),Lw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Nt(n,t){n&1&&(Ds(0,"ds-notice"),MC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function Dt(n,t){n&1&&(Ds(0,"p",4),MC(1,"No other agent is available in this scope yet."),pl());}function Lt(n,t){n&1&&(Ds(0,"span",44),MC(1,"pattern"),pl());}function Ot(n,t){n&1&&(Ds(0,"span",44),MC(1,"via pattern"),pl());}function Vt(n,t){if(n&1&&(Ds(0,"span",44),MC(1),pl()),n&2){let e=Xw(4);jE(),vl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Pt(n,t){if(n&1){let e=qw();Ds(0,"button",55),mg("click",function(){df(e);let r=Xw().$implicit,d=Xw(3);return ff(d.removeSubAgent(r))}),MC(1," \xD7 "),pl();}if(n&2){let e=Xw().$implicit;cg("aria-label","Remove "+e.selector);}}function Bt(n,t){if(n&1){let e=qw();Ds(0,"div",32)(1,"label",53)(2,"input",51),mg("change",function(){let r=df(e).$implicit,d=Xw(3);return ff(d.toggleSubAgent(r))}),pl(),Ds(3,"span",24),MC(4),pl(),Pw(5,Lt,2,0,"span",44)(6,Ot,2,0,"span",44)(7,Vt,2,1,"span",44),pl(),Pw(8,Pt,2,1,"button",54),pl();}if(n&2){let e=t.$implicit,o=Xw(3);jE(2),ug("checked",e.selected())("disabled",o.allSubAgentsSelected()),jE(2),Og(e.name),jE(),Lw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),jE(3),Lw(e.unresolved?8:-1);}}function $t(n,t){if(n&1&&Vw(0,Bt,9,5,"div",32,qe),n&2){let e=Xw(2);Hw(e.subAgentRows());}}function Gt(n,t){if(n&1){let e=qw();Ds(0,"div")(1,"button",56),mg("click",function(){df(e);let r=Xw(2);return ff(r.useDefaultDelegationTimeout())}),MC(2," Use server default "),pl()();}}function Ut(n,t){n&1&&(Ds(0,"ds-notice"),MC(1),pl()),n&2&&(jE(),Og(t));}function jt(n,t){if(n&1){let e=qw();Ds(0,"button",57),mg("click",function(){df(e);let r=Xw(2);return ff(r.exportYaml())}),MC(1),pl();}if(n&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Kt(n,t){if(n&1){let e=qw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let r=Xw();return ff(r.submit())}),Ds(1,"ds-fieldset",7)(2,"ds-form-field",8),lg(3,"input",9),SI(),pl(),Ds(4,"div",10)(5,"label",11),lg(6,"input",12),SI(),MC(7," Enabled "),pl(),Ds(8,"p",13),MC(9,"Disabled agents are excluded from namespace resolution."),pl()(),Ds(10,"ds-form-field",14),lg(11,"input",15),SI(),pl(),Ds(12,"ds-form-field",16),Pw(13,at,1,1,"input",17)(14,mt,6,5,"select",18),pl(),Ds(15,"ds-form-field",19),lg(16,"textarea",20),SI(),pl()(),Pw(17,ht,5,2,"ds-fieldset",21),Ds(18,"ds-fieldset",22)(19,"p",4),MC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Ds(21,"code"),MC(22,"readSkill"),pl(),MC(23," and "),Ds(24,"code"),MC(25,"readSkillResource"),pl(),MC(26," tools; selecting none grants neither. "),Pw(27,yt,1,0),pl(),Ds(28,"label",11)(29,"input",23),mg("change",function(){df(e);let r=Xw();return ff(r.toggleAllSkills())}),pl(),Ds(30,"span",24),MC(31,"Every skill in the catalogue ("),Ds(32,"code",25),MC(33,"*"),pl(),MC(34,")"),pl()(),Ds(35,"p",13),MC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),pl(),Pw(37,vt,5,0,"ds-notice",26),Pw(38,xt,2,0,"ds-notice"),Pw(39,St,2,0,"p",4)(40,kt,2,0),pl(),Ds(41,"ds-form-field",27)(42,"select",28)(43,"option",29),MC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),Ds(45,"option",29),MC(46,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),Ds(47,"option",29),MC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),SI(),pl(),Pw(49,It,7,3,"ds-form-field",30),Ds(50,"ds-fieldset",31)(51,"p",4),MC(52," The agents this one may delegate to. Selecting at least one grants it the "),Ds(53,"code"),MC(54,"DELEGATE__delegate"),pl(),MC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Pw(56,Mt,1,0),pl(),Ds(57,"label",11)(58,"input",23),mg("change",function(){df(e);let r=Xw();return ff(r.toggleAllSubAgents())}),pl(),Ds(59,"span",24),MC(60,"Every agent it can reach ("),Ds(61,"code",25),MC(62,"*"),pl(),MC(63,")"),pl()(),Ds(64,"p",13),MC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),pl(),Pw(66,Ft,6,1,"ds-notice",26),Pw(67,Nt,2,0,"ds-notice"),Pw(68,Dt,2,0,"p",4)(69,$t,2,0),Ds(70,"p",4),MC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Ds(72,"code"),MC(73,"*Fixer"),pl(),MC(74," to cover BugFixer and StoryFixer. "),pl(),Ds(75,"div",32)(76,"input",33),mg("keydown.enter",function(){df(e);let r=Xw();return ff(r.addSubAgent())}),pl(),SI(),Ds(77,"button",34),mg("click",function(){df(e);let r=Xw();return ff(r.addSubAgent())}),MC(78," + "),pl()(),Ds(79,"ds-form-field",35),lg(80,"input",36),SI(),Pw(81,Gt,3,0,"div"),pl()(),Pw(82,Ut,2,1,"ds-notice"),Ds(83,"ds-form-actions")(84,"button",37),MC(85),pl(),Pw(86,jt,2,2,"button",38),Ds(87,"button",39),mg("click",function(){df(e);let r=Xw();return ff(r.cancel())}),MC(88,"Cancel"),pl()()();}if(n&2){let e,o=Xw();ug("formGroup",o.form),jE(3),ug("formControl",o.nameControl),MI(),jE(3),ug("formControl",o.enabledControl),MI(),jE(5),ug("formControl",o.descriptionControl),MI(),jE(2),Lw(o.modelAsFreeText()?13:14),jE(3),ug("formControl",o.instructionsControl),MI(),jE(),Lw(o.integrationRows().length>0||o.builtInRows().length>0?17:-1),jE(10),Lw(o.isPlatformMode?27:-1),jE(2),ug("checked",o.allSkillsSelected()),jE(8),Lw(o.namedSkillSelectionDropped()?37:-1),jE(),Lw(o.skillCatalogueUnavailable()?38:-1),jE(),Lw(o.skillRows().length===0?39:40),jE(3),ug("formControl",o.executionModeControl),MI(),jE(),ug("value",o.ExecutionMode.SIMPLE),jE(2),ug("value",o.ExecutionMode.ADVANCED),jE(2),ug("value",o.ExecutionMode.LOOP),jE(2),Lw(o.isLoopMode()?49:-1),jE(7),Lw(o.isPlatformMode?56:-1),jE(2),ug("checked",o.allSubAgentsSelected()),jE(8),Lw(o.namedSubAgentSelectionDropped()?66:-1),jE(),Lw(o.subAgentCandidatesUnavailable()?67:-1),jE(),Lw(o.subAgentRows().length===0?68:69),jE(8),ug("formControl",o.newSubAgentControl),MI(),jE(),ug("disabled",!o.newSubAgentControl.value.trim()),jE(2),ug("hint",o.delegationTimeoutHint())("error",o.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),jE(),ug("formControl",o.delegationTimeoutControl),cg("aria-invalid",o.delegationTimeoutControl.invalid),MI(),jE(),Lw(o.delegationTimeoutControl.value!==null?81:-1),jE(),Lw((e=o.submitError())?82:-1,e),jE(2),ug("disabled",o.form.invalid||o.isSubmitting()),jE(),vl(" ",o.isEditMode()?"Save changes":"Create"," "),jE(),Lw(o.isEditMode()?86:-1);}}var Je=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=Ui(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(W);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[fn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[fn.min(1),fn.max(2147483647),fn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(o){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=KC(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=KC(()=>this.executionModeValue()==="LOOP");subAgentRows=Ui([]);allSubAgentsSelected=Ui(false);subAgentCandidatesUnavailable=Ui(false);namedSubAgentSelectionDropped=KC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=KC(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=KC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);submitError=Ui(null);ExecutionMode=Se;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Ui([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=KC(()=>Ke({configEnabled:this.builtInRows().some(t=>t.type===je&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=Ui({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=Ui(false);modelAsFreeText=KC(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(He(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=Ui([]);skillRows=Ui([]);allSkillsSelected=Ui(false);skillCatalogueUnavailable=Ui(false);namedSkillSelectionDropped=KC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),da(()=>Cr(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ty({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Cr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:o,platformIntegrations:r,builtInTypes:d,skillCatalogue:f,delegationCandidates:S,models:_})=>{this.existingConfig=e,this.applyModelCatalogue(_,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let m=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(m),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let I=[...r,...o];this.integrationRows.set(this.buildIntegrationRows(I,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(d,e.integrations??void 0)),this.allSubAgentsSelected.set(Ge(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(S,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(f,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ty({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Cr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:o,builtInTypes:r,skillCatalogue:d,delegationCandidates:f,models:S})=>{this.applyModelCatalogue(S,null);let _=[...o,...e];this.integrationRows.set(this.buildIntegrationRows(_,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(r,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(f,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(d,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(o=>({id:o.id??"",name:o.name,description:o.description,namespaceId:o.namespaceId??null,readOnly:o.readOnly===true}))))).pipe(da(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Cr([]))))}buildSkillRows(t,e){let r$1=(e??[]).map(m=>m.trim()).filter(m=>m.length>0).filter(m=>m!==r),d=i(r$1),f=new Set(t.map(m=>m.name.toLowerCase())),S=t.map(m=>({selector:m.name,name:m.name,description:m.description,platform:m.namespaceId==null,unresolved:false,selected:Ui(d.has(m.name.toLowerCase()))})),_=new Set;for(let m of r$1){let I=l(m).toLowerCase();f.has(I)||_.has(I)||(_.add(I),S.push({selector:m,name:m,description:"",platform:false,unresolved:true,selected:Ui(true)}));}return S}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):Cr([]);return Ty({platform:t,namespace:e}).pipe(ne(({platform:o,namespace:r})=>[...o,...r]),ne(o=>o.map(r=>r.name).filter(r=>r.length>0)),ne(o=>n.dedupeByKey(o)))}orNoCandidates(){return da(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),Cr([])))}static dedupeByKey(t){let e=new Set;return t.filter(o=>{let r=o.toLowerCase();return e.has(r)?false:(e.add(r),true)})}buildSubAgentRows(t,e,o){let r=Ue(e),d=o?.toLowerCase()??null,f=t.filter(b=>{let G=b.toLowerCase();return G!==d||r.has(G)}),S=new Set(f.map(b=>b.toLowerCase())),_=f.map(b=>({selector:b,name:b,unresolved:false,pattern:false,grantedByPattern:z(b,e),selected:Ui(r.has(b.toLowerCase()))})),m=new Set,I=(e??[]).map(b=>b.trim()).filter(b=>b.length>0&&b!==D);for(let b of I){let G=b.toLowerCase();S.has(G)||m.has(G)||(m.add(G),_.push({selector:b,name:b,unresolved:true,pattern:H(b),grantedByPattern:false,selected:Ui(true)}));}return _}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),da(t=>(console.error("[agent-config-form] failed to load integration types",t),Cr([]))))}buildIntegrationRows(t,e){return t.map(o=>{let r=o.name??"",d=e?.[r],f=e!=null&&r in e,S=Array.isArray(d)?d.join(", "):"";return {config:o,enabled:Ui(f),toolsControl:new Te(S,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(o=>{let r=e!=null&&o.type in e,d=e?.[o.type],f=r?Array.isArray(d)&&d.length===0?"off":"on":"default";return {type:o.type,displayName:o.displayName,description:o.description,enabledByDefault:o.enabledByDefault===true,state:Ui(f),restrictedTools:Array.isArray(d)&&d.length>0?d:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(o=>o.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===D?this.allSubAgentsSelected.set(true):this.subAgentRows.update(o=>this.withPatternGrants([...o,{selector:t,name:t,unresolved:true,pattern:H(t),grantedByPattern:false,selected:Ui(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(o=>this.withPatternGrants(o.filter(r=>r.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(o=>o.selected()).map(o=>o.selector);return t.map(o=>o.unresolved?o:x(w({},o),{grantedByPattern:z(o.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [D];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let o of this.integrationRows().filter(r=>r.enabled())){let r=o.config.name??"",d=o.toolsControl.value.trim();t[r]=d===""?null:d.split(",").map(f=>f.trim()).filter(f=>f.length>0);}for(let o of this.builtInRows()){let r=o.state();r==="on"?t[o.type]=o.restrictedTools??null:r==="off"&&(t[o.type]=[]);}let e=new Set([...this.integrationRows().map(o=>o.config.name??""),...this.builtInRows().map(o=>o.type)]);for(let[o,r]of Object.entries(this.existingConfig?.integrations??{}))e.has(o)||(t[o]=r);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(o));}});}static serverMessage(t){let o=t?.error?.message;if(typeof o=="string"&&o.trim().length>0)return o;let r=t?.status;return r===0?"The server could not be reached. The agent was not saved.":typeof r=="number"&&r>=500?`The server failed to save the agent (HTTP ${r}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let o=new Blob([e],{type:"application/yaml"}),r=URL.createObjectURL(o),d=document.createElement("a");d.href=r,d.download=`${this.existingConfig?.name??"agent"}.yaml`,d.click(),URL.revokeObjectURL(r),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,o){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),MC(3," \u2190 Agent configs "),pl(),Pw(4,nt,2,1,"a",2),Pw(5,ot,2,0,"ds-tag",3),pl(),Pw(6,it,2,0,"p",4)(7,Kt,89,33,"form",5),pl()),e&2&&(jE(),ug("title",o.isEditMode()?"Edit agent config":"New agent config"),jE(3),Lw(o.isEditMode()?4:-1),jE(),Lw(o.isPlatformMode?5:-1),jE(),Lw(o.isLoading()?6:7));},dependencies:[Ut$1,nd,bo,xo,Lt$1,kn,vn,Gt$1,mo,po,$r,qr,Vn,An,$t$1,pn,hn,cn,ln,dn,mn,at$1,an,rn,ko],encapsulation:2})};export{Je as AgentConfigFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-BVAhKRxf.js';import {R}from'./chunk-CvH1PYW_.js';import {O}from'./chunk-CZ3swGRG.js';import {g,I as Ie$1,U as Ui,K as KC,a9 as F,ar as wy,az as ne,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,q as qw,N as mg,X as Xw,G as ug,Q as SI,V as Vw,O as Og,T as MI,H as Hw,v as vl,ab as kw,k as df,n as ff,E as x,z as w}from'./main-HBKYHCPK.js';import {y,N as D,Q as B,R as a,a as pt,T as Te$1,X as f,Y as A,U as Ut,n as nd,o as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,A as An,v as va,d as pn,h as hn,e as cn,Z as un,g as dn,i as at,j as an,s as sn,a0 as Ti,K as Oi,a1 as d,a2 as v}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function xe(o,e){if(o&1&&(Ds(0,"option",27),MC(1),pl()),o&2){let t=e.$implicit;ug("value",t.value),jE(),Og(t.label);}}function Se(o,e){if(o&1){let t=qw();Ds(0,"form",15),mg("ngSubmit",function(){df(t);let s=Xw(2);return ff(s.save())}),Ds(1,"ds-group",16)(2,"dl",17)(3,"dt"),MC(4,"Email"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"External ID"),pl(),Ds(9,"dd"),MC(10),pl()()(),Ds(11,"ds-group",18)(12,"ds-form-field",19),lg(13,"input",20),SI(),pl(),Ds(14,"ds-form-field",21),lg(15,"input",22),SI(),pl(),Ds(16,"ds-form-field",23),lg(17,"textarea",24),SI(),pl(),Ds(18,"ds-form-field",25)(19,"select",26),Vw(20,xe,2,2,"option",27,ye),pl(),SI(),pl()(),Ds(22,"ds-form-actions")(23,"button",28),MC(24),pl(),Ds(25,"button",29),mg("click",function(){df(t);let s=Xw(2);return ff(s.cancelEditing())}),MC(26,"Cancel"),pl()()();}if(o&2){let t=Xw(),l=Xw();ug("formGroup",l.form),jE(6),Og(t.email),jE(4),Og(t.externalId),jE(3),MI(),jE(2),MI(),jE(2),MI(),jE(2),MI(),jE(),Hw(l.languageOptions),jE(3),ug("disabled",l.isSaving()),jE(),vl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Ds(0,"p",2),MC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),pl());}function Pe(o,e){if(o&1){let t=qw();Ds(0,"span",38),MC(1,"Delete?"),pl(),Ds(2,"button",39),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(5);return ff(m.confirmDelete(s))}),MC(3,"Confirm"),pl(),Ds(4,"button",40),mg("click",function(){df(t);let s=Xw(6);return ff(s.cancelDelete())}),MC(5,"Cancel"),pl();}}function Te(o,e){if(o&1){let t=qw();Ds(0,"button",40),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(5);return ff(m.armDelete(s))}),MC(1,"Delete"),pl();}}function De(o,e){if(o&1&&(Ds(0,"li",34)(1,"span",35),MC(2),pl(),Ds(3,"span",36),MC(4),pl(),Pw(5,Pe,6,0)(6,Te,2,0,"button",37),pl()),o&2){let t=e.$implicit,l=Xw(5);jE(2),Og(t.name),jE(2),Og(t.subtitle),jE(),Lw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Ds(0,"span",32),MC(1),pl(),Ds(2,"ul",33),Vw(3,De,7,3,"li",34,kw().trackEntry,true),pl()),o&2){let t=e.$implicit;jE(),Og(t.title),jE(2),Hw(t.entries);}}function Ve(o,e){if(o&1&&Vw(0,we,5,1,null,null,Ce),o&2){let t=Xw(3);Hw(t.recapSections());}}function Ue(o,e){if(o&1){let t=qw();Ds(0,"ds-group",16)(1,"dl",17)(2,"dt"),MC(3,"Email"),pl(),Ds(4,"dd"),MC(5),pl(),Ds(6,"dt"),MC(7,"External ID"),pl(),Ds(8,"dd"),MC(9),pl()()(),Ds(10,"ds-group",18)(11,"dl",17)(12,"dt"),MC(13,"First name"),pl(),Ds(14,"dd"),MC(15),pl(),Ds(16,"dt"),MC(17,"Last name"),pl(),Ds(18,"dd"),MC(19),pl(),Ds(20,"dt"),MC(21,"Bio"),pl(),Ds(22,"dd"),MC(23),pl(),Ds(24,"dt"),MC(25,"Language"),pl(),Ds(26,"dd"),MC(27),pl()()(),Ds(28,"ds-form-actions")(29,"button",30),mg("click",function(){df(t);let s=Xw(2);return ff(s.startEditing())}),MC(30,"Edit profile"),pl()(),Ds(31,"ds-disclosure",31),mg("toggled",function(){df(t);let s=Xw(2);return ff(s.toggleOverrides())}),Pw(32,Ee,2,0,"p",2)(33,Ve,2,0),pl();}if(o&2){let t=Xw(),l=Xw();jE(5),Og(t.email),jE(4),Og(t.externalId),jE(6),Og(t.firstname||"\u2014"),jE(4),Og(t.lastname||"\u2014"),jE(4),Og(t.bio||"\u2014"),jE(4),Og(t.preferredLanguage||"\u2014"),jE(4),ug("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),jE(),Lw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=qw();Ds(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setThemeVariant(s))}),pl()(),Ds(3,"ds-form-field",6)(4,"ds-segmented",7),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setTheme(s))}),pl()()(),Ds(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setEnterKeyBehavior(s))}),pl()()(),Ds(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setShowTechnical(s))}),pl()()(),Pw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=Xw();jE(),ug("hint",t.activeVariantDescription()),jE(),ug("options",t.themeVariantOptions)("value",t.themeVariant()),jE(),ug("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),jE(),ug("options",t.modeOptions())("value",t.shownMode()),jE(3),ug("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),jE(3),ug("options",t.showTechnicalOptions)("value",t.showTechnical()),jE(),Lw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Ds(0,"p",2),MC(1,"Unable to load profile."),pl());}var ve=class o{userState=g(y);destroyRef=g(Ie$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(R);themePort=g(D);preferencesPort=g(B);isEditing=Ui(false);isLoading=Ui(false);isSaving=Ui(false);isOverridesExpanded=Ui(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=KC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=KC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=KC(()=>!A(this.themeVariant(),this.themeMode()));activeVariantLabel=KC(()=>d(this.themeVariant()).label);activeVariantDescription=KC(()=>d(this.themeVariant()).description);modeOptions=KC(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=KC(()=>this.modeOverridden()?v(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(wy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=KC(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){f(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !A(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=Ui(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),pl()),t&2){let s;jE(2),Lw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,un,dn,at,an,sn,Ti,Oi],encapsulation:2})};export{ve as UserProfileComponent};
|
|
1
|
+
import {O as O$1}from'./chunk-Z2NbDhln.js';import {R}from'./chunk-CuAGAd4W.js';import {O}from'./chunk-SzOkzSvH.js';import {g,I as Ie$1,U as Ui,K as KC,a9 as F,ar as wy,az as ne,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,q as qw,N as mg,X as Xw,G as ug,Q as SI,V as Vw,O as Og,T as MI,H as Hw,v as vl,ab as kw,k as df,n as ff,E as x,z as w}from'./main-SWYRVFGZ.js';import {y,N as D,Q as B,R as a,a as pt,T as Te$1,X as f,Y as A,U as Ut,n as nd,o as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,A as An,v as va,d as pn,h as hn,e as cn,Z as un,g as dn,i as at,j as an,s as sn,a0 as Ti,K as Oi,a1 as d,a2 as v}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function xe(o,e){if(o&1&&(Ds(0,"option",27),MC(1),pl()),o&2){let t=e.$implicit;ug("value",t.value),jE(),Og(t.label);}}function Se(o,e){if(o&1){let t=qw();Ds(0,"form",15),mg("ngSubmit",function(){df(t);let s=Xw(2);return ff(s.save())}),Ds(1,"ds-group",16)(2,"dl",17)(3,"dt"),MC(4,"Email"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"External ID"),pl(),Ds(9,"dd"),MC(10),pl()()(),Ds(11,"ds-group",18)(12,"ds-form-field",19),lg(13,"input",20),SI(),pl(),Ds(14,"ds-form-field",21),lg(15,"input",22),SI(),pl(),Ds(16,"ds-form-field",23),lg(17,"textarea",24),SI(),pl(),Ds(18,"ds-form-field",25)(19,"select",26),Vw(20,xe,2,2,"option",27,ye),pl(),SI(),pl()(),Ds(22,"ds-form-actions")(23,"button",28),MC(24),pl(),Ds(25,"button",29),mg("click",function(){df(t);let s=Xw(2);return ff(s.cancelEditing())}),MC(26,"Cancel"),pl()()();}if(o&2){let t=Xw(),l=Xw();ug("formGroup",l.form),jE(6),Og(t.email),jE(4),Og(t.externalId),jE(3),MI(),jE(2),MI(),jE(2),MI(),jE(2),MI(),jE(),Hw(l.languageOptions),jE(3),ug("disabled",l.isSaving()),jE(),vl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Ds(0,"p",2),MC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),pl());}function Pe(o,e){if(o&1){let t=qw();Ds(0,"span",38),MC(1,"Delete?"),pl(),Ds(2,"button",39),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(5);return ff(m.confirmDelete(s))}),MC(3,"Confirm"),pl(),Ds(4,"button",40),mg("click",function(){df(t);let s=Xw(6);return ff(s.cancelDelete())}),MC(5,"Cancel"),pl();}}function Te(o,e){if(o&1){let t=qw();Ds(0,"button",40),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(5);return ff(m.armDelete(s))}),MC(1,"Delete"),pl();}}function De(o,e){if(o&1&&(Ds(0,"li",34)(1,"span",35),MC(2),pl(),Ds(3,"span",36),MC(4),pl(),Pw(5,Pe,6,0)(6,Te,2,0,"button",37),pl()),o&2){let t=e.$implicit,l=Xw(5);jE(2),Og(t.name),jE(2),Og(t.subtitle),jE(),Lw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Ds(0,"span",32),MC(1),pl(),Ds(2,"ul",33),Vw(3,De,7,3,"li",34,kw().trackEntry,true),pl()),o&2){let t=e.$implicit;jE(),Og(t.title),jE(2),Hw(t.entries);}}function Ve(o,e){if(o&1&&Vw(0,we,5,1,null,null,Ce),o&2){let t=Xw(3);Hw(t.recapSections());}}function Ue(o,e){if(o&1){let t=qw();Ds(0,"ds-group",16)(1,"dl",17)(2,"dt"),MC(3,"Email"),pl(),Ds(4,"dd"),MC(5),pl(),Ds(6,"dt"),MC(7,"External ID"),pl(),Ds(8,"dd"),MC(9),pl()()(),Ds(10,"ds-group",18)(11,"dl",17)(12,"dt"),MC(13,"First name"),pl(),Ds(14,"dd"),MC(15),pl(),Ds(16,"dt"),MC(17,"Last name"),pl(),Ds(18,"dd"),MC(19),pl(),Ds(20,"dt"),MC(21,"Bio"),pl(),Ds(22,"dd"),MC(23),pl(),Ds(24,"dt"),MC(25,"Language"),pl(),Ds(26,"dd"),MC(27),pl()()(),Ds(28,"ds-form-actions")(29,"button",30),mg("click",function(){df(t);let s=Xw(2);return ff(s.startEditing())}),MC(30,"Edit profile"),pl()(),Ds(31,"ds-disclosure",31),mg("toggled",function(){df(t);let s=Xw(2);return ff(s.toggleOverrides())}),Pw(32,Ee,2,0,"p",2)(33,Ve,2,0),pl();}if(o&2){let t=Xw(),l=Xw();jE(5),Og(t.email),jE(4),Og(t.externalId),jE(6),Og(t.firstname||"\u2014"),jE(4),Og(t.lastname||"\u2014"),jE(4),Og(t.bio||"\u2014"),jE(4),Og(t.preferredLanguage||"\u2014"),jE(4),ug("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),jE(),Lw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=qw();Ds(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setThemeVariant(s))}),pl()(),Ds(3,"ds-form-field",6)(4,"ds-segmented",7),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setTheme(s))}),pl()()(),Ds(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setEnterKeyBehavior(s))}),pl()()(),Ds(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setShowTechnical(s))}),pl()()(),Pw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=Xw();jE(),ug("hint",t.activeVariantDescription()),jE(),ug("options",t.themeVariantOptions)("value",t.themeVariant()),jE(),ug("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),jE(),ug("options",t.modeOptions())("value",t.shownMode()),jE(3),ug("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),jE(3),ug("options",t.showTechnicalOptions)("value",t.showTechnical()),jE(),Lw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Ds(0,"p",2),MC(1,"Unable to load profile."),pl());}var ve=class o{userState=g(y);destroyRef=g(Ie$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(R);themePort=g(D);preferencesPort=g(B);isEditing=Ui(false);isLoading=Ui(false);isSaving=Ui(false);isOverridesExpanded=Ui(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=KC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=KC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=KC(()=>!A(this.themeVariant(),this.themeMode()));activeVariantLabel=KC(()=>d(this.themeVariant()).label);activeVariantDescription=KC(()=>d(this.themeVariant()).description);modeOptions=KC(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=KC(()=>this.modeOverridden()?v(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(wy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=KC(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){f(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !A(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=Ui(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),pl()),t&2){let s;jE(2),Lw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,un,dn,at,an,sn,Ti,Oi],encapsulation:2})};export{ve as UserProfileComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DEpnxPHI.js';import {J as s,d as pn,h as hn,q as on,C as mn,i as at,s as sn,l as ko,K as Oi,M as On}from'./chunk-C6abvjjM.js';import {g,W,F,I as Ie,U as Ui,K as KC,x as U,aj as Ty,a2 as da,aa as Cr,m as mw,as as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,L as Lw,X as Xw,G as ug,q as qw,l as lg,at as $C,O as Og,v as vl,au as GC,V as Vw,H as Hw,ac as Bw,k as df,n as ff,av as ZD}from'./main-SWYRVFGZ.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Ds(0,"a",2),MC(1,"Edit skill \u2192"),pl()),e&2){let n=Xw();ug("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Ds(0,"ds-tag",3),MC(1,"Platform level"),pl());}function te(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function ne(e,t){e&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load skill."),pl());}function ie(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Created by"),pl(),Ds(2,"dd"),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.createdBy);}}function oe(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Last updated"),pl(),Ds(2,"dd"),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.updatedOn);}}function ae(e,t){if(e&1&&(Pw(0,ie,4,1),Pw(1,oe,4,1)),e&2){let n=Xw();Lw(n.createdBy?0:-1),jE(),Lw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Ds(0,"p",4),MC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),pl());}function se(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function re(e,t){e&1&&(Ds(0,"ds-notice"),MC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),pl());}function de(e,t){e&1&&(Ds(0,"p",4),MC(1,"No agent references this skill."),pl());}function ce(e,t){e&1&&(Ds(0,"ds-tag",15),MC(1,"platform agent"),pl());}function me(e,t){e&1&&(Ds(0,"ds-tag",15),MC(1,"via *"),pl());}function pe(e,t){if(e&1&&(Ds(0,"li",13)(1,"span",14),MC(2),pl(),Pw(3,ce,2,0,"ds-tag",15),Pw(4,me,2,0,"ds-tag",15),pl()),e&2){let n=t.$implicit;jE(2),Og(n.name),jE(),Lw(n.platform?3:-1),jE(),Lw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Ds(0,"ul",12),Vw(1,pe,5,3,"li",13,Y),pl(),Ds(3,"p",4),MC(4," An agent listed "),Ds(5,"code"),MC(6,"via *"),pl(),MC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),pl()),e&2){let n=Xw(2);jE(),Hw(n.consumers());}}function _e(e,t){e&1&&(Ds(0,"p",4),MC(1,"No resources bundled with this skill."),pl());}function ge(e,t){if(e&1){let n=qw();Ds(0,"li")(1,"ds-disclosure",16),mg("toggled",function(){let r=df(n).$implicit,g=Xw(3);return ff(g.toggleResource(r))}),Ds(2,"pre",17),MC(3),pl()()();}if(e&2){let n=t.$implicit,o=Xw(3);jE(),ug("heading",n)("open",o.isResourceExpanded(n)),jE(2),Og(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Ds(0,"ul",12),Vw(1,ge,4,3,"li",null,Bw),pl()),e&2){let n=Xw(2);jE(),Hw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=qw();Ds(0,"ds-card",5)(1,"dl",6)(2,"dt"),MC(3,"Name"),pl(),Ds(4,"dd",7),MC(5),pl(),Ds(6,"dt"),MC(7,"Description"),pl(),Ds(8,"dd"),MC(9),pl(),Ds(10,"dt"),MC(11,"Scope"),pl(),Ds(12,"dd"),MC(13),pl(),Ds(14,"dt"),MC(15,"Storage"),pl(),Ds(16,"dd")(17,"ds-tag",8),MC(18),pl()(),Pw(19,ae,2,2),pl()(),Ds(20,"ds-card",9),Pw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),pl(),Ds(26,"ds-card")(27,"ds-disclosure",10),mg("toggled",function(){df(n);let r=Xw();return ff(r.toggleBody())}),lg(28,"div",11),$C(29,"agentosMarkdown"),pl()(),Ds(30,"ds-card",9),Pw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),pl();}if(e&2){let n=t,o=Xw();jE(5),Og(n.name),jE(4),Og(n.description),jE(4),Og(n.namespaceId?"Namespace":"Platform"),jE(4),ug("variant",o.isFilesystemBacked()?"outline":"neutral"),jE(),vl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),jE(),Lw(o.isFilesystemBacked()?-1:19),jE(),ug("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),jE(),Lw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),jE(6),ug("open",!o.bodyCollapsed()),jE(),ug("innerHTML",GC(29,12,n.body),ZD),jE(2),ug("heading","Resources ("+o.resourcePaths().length+")"),jE(),Lw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);skill=Ui(null);bodyCollapsed=Ui(false);expandedResources=Ui(new Set);resourcePaths=KC(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=KC(()=>this.skill()?.readOnly===true);consumers=Ui([]);consumersUnavailable=Ui(false);consumersLoading=Ui(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Cr([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.back()}),MC(3,"\u2190 Skills"),pl(),Pw(4,Z,2,1,"a",2),Pw(5,ee,2,0,"ds-tag",3),pl(),Pw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),pl()),n&2){let r;jE(4),Lw(o.skill()&&!o.isFilesystemBacked()?4:-1),jE(),Lw(o.isPlatformMode?5:-1),jE(),Lw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,pn,hn,on,mn,at,sn,ko,Oi,On],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-CS0VTNy3.js';import {y}from'./chunk-C6abvjjM.js';import {g,aD as Z,$ as wr,ar as wy,a1 as fa,a2 as da,aa as Cr,az as ne,aC as Uy,E as x,z as w,a5 as yd,a6 as x$1}from'./main-SWYRVFGZ.js';var q=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],J={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},E="none",C="me",I={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},U={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function v(n){let t=I[n.authType];return t?x(w({},n),{authType:t}):n}function d(n){return B(n)}function O(n){return n.map(B)}function B(n){let t=n;if(typeof t.authType=="string"){let e=U[t.authType];if(e)return x(w({},t),{authType:e})}return n}var R=class n{controller=g(Z);userState=g(y);refresh$=new wr(void 0);namespaceId$=new wr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([t])=>{let e=this.loadPlatformSettings().pipe(da(()=>Cr([])));return t?wy([e,this.loadNamespaceSettings(t).pipe(da(()=>Cr([]))),this.loadUserSettings(t).pipe(da(()=>Cr([]))),this.loadUserSettings("global").pipe(da(()=>Cr([])))]).pipe(ne(([i,s,u,p])=>({platform:i,namespace:s,userOnNs:u,userGlobal:p}))):wy([e,this.loadNamespaceSettings("").pipe(da(()=>Cr([]))),this.loadUserSettings("global").pipe(da(()=>Cr([])))]).pipe(ne(([i,s,u])=>({platform:i,namespace:s,userOnNs:[],userGlobal:u})))}),Uy({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?E:t;return this.controller.listAuthSetting(e,C).pipe(ne(i=>O(i)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(E).pipe(ne(t=>O(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ne(e=>O(e))):Cr([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ne(i=>d(i)))}create(t,e,i){let u=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!u)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(i===void 0||i===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!i)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let p=v(x(w({},t),{namespaceId:e==="namespace"||e==="userOnNs"?i??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?u:void 0}));return this.controller.createAuthSetting(p).pipe(ne(_=>d(_)),yd(()=>this.refresh()))}update(t,e,i){let s=v(x(w({},e),{namespaceId:i.namespaceId,userId:i.userId,authType:i.authType}));return this.controller.updateAuthSetting(t,s).pipe(ne(u=>d(u)),yd(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(yd(()=>this.refresh()))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x$1({token:n,factory:n.\u0275fac,providedIn:"root"})};export{J,R,q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-C6abvjjM.js';import {g,W as W$1,F,I as Ie,ae as U$1,$ as wr,U as Ui,a1 as fa,aj as Ty,a2 as da,aa as Cr,x as U$2,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-SWYRVFGZ.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function z(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading agent configs\u2026"),pl());}function G(n,e){n&1&&(Ds(0,"p",5),MC(1,"No agent configs available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),MC(1,"No agent configs match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",18),MC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,d=Xw(2);return ff(d.launch(s))}),MC(1," Launch "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,d=Xw(2);return ff(d.edit(s))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.inspect(s))}),MC(1," Inspect "),pl(),Pw(2,X,2,1,"button",23),Pw(3,Y,2,1,"button",23);}if(n&2){let t=Xw().$implicit,i=Xw(2);cg("aria-label","Inspect "+t.config.name),jE(2),Lw(i.canLaunch(t)?2:-1),jE(),Lw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,i=Xw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16)(9,"ds-tag",17),MC(10),pl(),Pw(11,W,2,0,"ds-tag",18),pl()(),Ds(12,"td",19)(13,"div",20),Pw(14,Z,4,3),Pw(15,ee,1,3,"agentos-row-delete-action",21),pl()()()),n&2){let t=e.$implicit,i=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.description||"\u2014"," "),jE(2),Og(i.mode(t)),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?11:-1),jE(3),Lw(i.deletion.confirmingId()!==t.key?14:-1),jE(),Lw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Execution mode"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,te,16,8,"tr",9,J),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();rows=Ui([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(da(()=>Cr([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return i.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New agent config"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
|