@whoz-oss/coday-client 0.0.0-workstream-forge.278 → 0.0.0-workstream-forge.281
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-0JbcW6XU.js +1 -0
- package/browser/chunk-BEjdqTuv.js +1 -0
- package/browser/{chunk-6fDAAwY8.js → chunk-BQrOLW8s.js} +1 -1
- package/browser/{chunk-BBhwwK7X.js → chunk-BXYAYYIa.js} +1 -1
- package/browser/{chunk-BlijPSJE.js → chunk-BYsAPdst.js} +1 -1
- package/browser/chunk-Bb-c0ROH.js +1 -0
- package/browser/{chunk-4sEBawqk.js → chunk-BbXsFpeY.js} +1 -1
- package/browser/chunk-BdGvps3l.js +1 -0
- package/browser/chunk-BiVIEQ9a.js +1 -0
- package/browser/chunk-BiZzqeAP.js +1 -0
- package/browser/chunk-BkYVWjXM.js +1 -0
- package/browser/{chunk-Bi5i4Kkf.js → chunk-Bl2q9K-9.js} +1 -1
- package/browser/{chunk-lXS49hV2.js → chunk-Bl_O73CB.js} +1 -1
- package/browser/chunk-Bw6tipQO.js +1 -0
- package/browser/{chunk-B4OgWFKq.js → chunk-BxyolXEz.js} +1 -1
- package/browser/{chunk-DSTLb91j.js → chunk-C1XiLUJe.js} +1 -1
- package/browser/chunk-CCAHEyrn.js +1 -0
- package/browser/{chunk-C-SfjwGQ.js → chunk-CK-0hHs3.js} +1 -1
- package/browser/chunk-CKVl5Clw.js +1 -0
- package/browser/chunk-CMLKq_d1.js +1 -0
- package/browser/chunk-CUuUezdS.js +2 -0
- package/browser/chunk-Cfwcs5Kc.js +1 -0
- package/browser/chunk-Csvi_3to.js +1 -0
- package/browser/chunk-CxGh-OSF.js +1 -0
- package/browser/chunk-Cz-Jz4NK.js +1 -0
- package/browser/chunk-D4hFKIuc.js +1 -0
- package/browser/chunk-D8p-F6vy.js +1 -0
- package/browser/{chunk-BUz52zHO.js → chunk-DB_JDbO5.js} +1 -1
- package/browser/chunk-DCI35EBd.js +1 -0
- package/browser/{chunk-BgGkMHQh.js → chunk-DEGiKLCd.js} +1 -1
- package/browser/chunk-DJVPAAOR.js +1 -0
- package/browser/{chunk-BBFrt_ui.js → chunk-DM86JaK-.js} +1 -1
- package/browser/{chunk-Bzw6eX2O.js → chunk-DNMiaqnS.js} +1 -1
- package/browser/chunk-DQzepkz_.js +1 -0
- package/browser/chunk-DTUbUaG8.js +1 -0
- package/browser/chunk-DV9A52hr.js +2 -0
- package/browser/chunk-Dm98JW0v.js +1 -0
- package/browser/chunk-TljffFCf.js +1 -0
- package/browser/chunk-Yh9s3GFa.js +1 -0
- package/browser/chunk-YmtXKFPm.js +1 -0
- package/browser/chunk-gJxWDxbF.js +1 -0
- package/browser/{chunk-BSmzFmke.js → chunk-idHJ_h4K.js} +1 -1
- package/browser/chunk-iiXgVxfs.js +1 -0
- package/browser/chunk-qF4-8qpt.js +671 -0
- package/browser/{chunk-9P3XaWWg.js → chunk-rqfGv-7x.js} +1 -1
- package/browser/chunk-tlmUd1Et.js +1 -0
- package/browser/index.html +1 -1
- package/browser/{main-4HEE4DSD.js → main-C2L5IBU7.js} +17 -17
- package/package.json +1 -1
- package/browser/chunk-16x50-2o.js +0 -1
- package/browser/chunk-7pogBin0.js +0 -1
- package/browser/chunk-B4f2_ca9.js +0 -2
- package/browser/chunk-BA-i5BKD.js +0 -1
- package/browser/chunk-BCtndyUL.js +0 -1
- package/browser/chunk-BE6h6pT_.js +0 -1
- package/browser/chunk-BQ5imqmR.js +0 -1
- package/browser/chunk-BT3Kc2zZ.js +0 -1
- package/browser/chunk-BXOJ2TCq.js +0 -1
- package/browser/chunk-C4-DYb1G.js +0 -1
- package/browser/chunk-CB3QL_VJ.js +0 -1
- package/browser/chunk-CODcIR_k.js +0 -1
- package/browser/chunk-CXNhEZjs.js +0 -2
- package/browser/chunk-CY2foyNy.js +0 -1
- package/browser/chunk-Cy47rqqD.js +0 -1
- package/browser/chunk-D3SHcns-.js +0 -1
- package/browser/chunk-DA0pzWja.js +0 -1
- package/browser/chunk-DGXWmn-4.js +0 -1
- package/browser/chunk-DHcXUI30.js +0 -1
- package/browser/chunk-DSY07m68.js +0 -671
- package/browser/chunk-DVqVR--u.js +0 -1
- package/browser/chunk-DWwEMYi2.js +0 -1
- package/browser/chunk-DXhejKLu.js +0 -1
- package/browser/chunk-DZ4B-YtP.js +0 -1
- package/browser/chunk-DrmwwKVW.js +0 -1
- package/browser/chunk-Dz60Uxy_.js +0 -1
- package/browser/chunk-InQGdgxF.js +0 -1
- package/browser/chunk-Zao0hsES.js +0 -1
- package/browser/chunk-bP8lCYXZ.js +0 -1
- package/browser/chunk-s-WZZxtO.js +0 -1
- package/browser/chunk-uWIGwngv.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BYsAPdst.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as On}from'./chunk-qF4-8qpt.js';import {g,W,n as F,K as we,z as zi,i as cT,L as U,ac as _y,a2 as ga,aa as br,I as Iw,au as $t,a as Is,R as vg,O as OC,b as gl,H as Hw,U as UE,c as Uw,s as rC,Q as dg,X as Xw,f as fg,av as eT,F as Fg,E as El,aw as nT,G as Gw,j as Ww,ao as zw,t as hf,u as gf,ax as KD}from'./main-C2L5IBU7.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Is(0,"a",2),OC(1,"Edit skill \u2192"),gl()),e&2){let n=rC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Is(0,"ds-tag",3),OC(1,"Platform level"),gl());}function te(e,t){e&1&&(Is(0,"p",4),OC(1,"Loading\u2026"),gl());}function ne(e,t){e&1&&(Is(0,"ds-notice"),OC(1,"Failed to load skill."),gl());}function ie(e,t){if(e&1&&(Is(0,"dt"),OC(1,"Created by"),gl(),Is(2,"dd"),OC(3),gl()),e&2){let n=rC(2);UE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Is(0,"dt"),OC(1,"Last updated"),gl(),Is(2,"dd"),OC(3),gl()),e&2){let n=rC(2);UE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(Hw(0,ie,4,1),Hw(1,oe,4,1)),e&2){let n=rC();Uw(n.createdBy?0:-1),UE(),Uw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Is(0,"p",4),OC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),gl());}function se(e,t){e&1&&(Is(0,"p",4),OC(1,"Loading\u2026"),gl());}function re(e,t){e&1&&(Is(0,"ds-notice"),OC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),gl());}function de(e,t){e&1&&(Is(0,"p",4),OC(1,"No agent references this skill."),gl());}function ce(e,t){e&1&&(Is(0,"ds-tag",15),OC(1,"platform agent"),gl());}function me(e,t){e&1&&(Is(0,"ds-tag",15),OC(1,"via *"),gl());}function pe(e,t){if(e&1&&(Is(0,"li",13)(1,"span",14),OC(2),gl(),Hw(3,ce,2,0,"ds-tag",15),Hw(4,me,2,0,"ds-tag",15),gl()),e&2){let n=t.$implicit;UE(2),Fg(n.name),UE(),Uw(n.platform?3:-1),UE(),Uw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Is(0,"ul",12),Gw(1,pe,5,3,"li",13,Y),gl(),Is(3,"p",4),OC(4," An agent listed "),Is(5,"code"),OC(6,"via *"),gl(),OC(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. "),gl()),e&2){let n=rC(2);UE(),Ww(n.consumers());}}function _e(e,t){e&1&&(Is(0,"p",4),OC(1,"No resources bundled with this skill."),gl());}function ge(e,t){if(e&1){let n=Xw();Is(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=hf(n).$implicit,g=rC(3);return gf(g.toggleResource(r))}),Is(2,"pre",17),OC(3),gl()()();}if(e&2){let n=t.$implicit,o=rC(3);UE(),dg("heading",n)("open",o.isResourceExpanded(n)),UE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Is(0,"ul",12),Gw(1,ge,4,3,"li",null,zw),gl()),e&2){let n=rC(2);UE(),Ww(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Xw();Is(0,"ds-card",5)(1,"dl",6)(2,"dt"),OC(3,"Name"),gl(),Is(4,"dd",7),OC(5),gl(),Is(6,"dt"),OC(7,"Description"),gl(),Is(8,"dd"),OC(9),gl(),Is(10,"dt"),OC(11,"Scope"),gl(),Is(12,"dd"),OC(13),gl(),Is(14,"dt"),OC(15,"Storage"),gl(),Is(16,"dd")(17,"ds-tag",8),OC(18),gl()(),Hw(19,ae,2,2),gl()(),Is(20,"ds-card",9),Hw(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),gl(),Is(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){hf(n);let r=rC();return gf(r.toggleBody())}),fg(28,"div",11),eT(29,"agentosMarkdown"),gl()(),Is(30,"ds-card",9),Hw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),gl();}if(e&2){let n=t,o=rC();UE(5),Fg(n.name),UE(4),Fg(n.description),UE(4),Fg(n.namespaceId?"Namespace":"Platform"),UE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),UE(),El(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),UE(),Uw(o.isFilesystemBacked()?-1:19),UE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),UE(),Uw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),UE(6),dg("open",!o.bodyCollapsed()),UE(),dg("innerHTML",nT(29,12,n.body),KD),UE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),UE(),Uw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);skill=zi(null);bodyCollapsed=zi(false);expandedResources=zi(new Set);resourcePaths=cT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=cT(()=>this.skill()?.readOnly===true);consumers=zi([]);consumersUnavailable=zi(false);consumersLoading=zi(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),_y({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>br([])))}).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=Iw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),OC(3,"\u2190 Skills"),gl(),Hw(4,Z,2,1,"a",2),Hw(5,ee,2,0,"ds-tag",3),gl(),Hw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),gl()),n&2){let r;UE(4),Uw(o.skill()&&!o.isFilesystemBacked()?4:-1),UE(),Uw(o.isPlatformMode?5:-1),UE(),Uw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,On],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {y}from'./chunk-qF4-8qpt.js';import {g,aB as ie,aC as T,aa as br,a1 as ma,ad as ne,a2 as ga,aD as Gy,a6 as x}from'./main-C2L5IBU7.js';var v=class i{userState=g(y);membership=g(ie);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return br(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(ma(a=>a?a.isAdmin?br(true):this.membership.getMembersNamespaceMembership(e).pipe(ne(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),ga(()=>br(false))):br(false)),Gy({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-qF4-8qpt.js';import {g,n as F,K as we,ag as U$1,$ as Tr,z as zi,a1 as ma,L as U$2,I as Iw,a as Is,R as vg,b as gl,O as OC,H as Hw,U as UE,Q as dg,c as Uw,s as rC,F as Fg,G as Gw,j as Ww,E as El,X as Xw,t as hf,u as gf,l as lg}from'./main-C2L5IBU7.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),OC(1),gl()),n&2){let t=rC();UE(),Fg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),OC(1,"Loading agent configs\u2026"),gl());}function H(n,e){n&1&&(Is(0,"p",5),OC(1,"No platform agent configs defined yet."),gl());}function U(n,e){n&1&&(Is(0,"p",4),OC(1,"No agent configs match the current filter."),gl());}function z(n,e){if(n&1){let t=Xw();Is(0,"button",19),vg("click",function(){hf(t);let d=rC().$implicit,c=rC(2);return gf(c.inspect(d))}),OC(1," Inspect "),gl(),Is(2,"button",19),vg("click",function(){hf(t);let d=rC().$implicit,c=rC(2);return gf(c.edit(d))}),OC(3,"Edit"),gl();}if(n&2){let t=rC().$implicit;lg("aria-label","Inspect "+t.name),UE(2),lg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Xw();Is(0,"agentos-row-delete-action",20),vg("deleteRequested",function(){hf(t);let d=rC().$implicit,c=rC(2);return gf(c.deletion.request(d.id))})("deleteConfirmed",function(){hf(t);let d=rC().$implicit,c=rC(2);return gf(c.confirmDelete(d))})("deleteCancelled",function(){hf(t);let d=rC(3);return gf(d.deletion.cancel())}),gl();}if(n&2){let t=rC().$implicit,a=rC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),OC(2),gl(),Is(3,"td",13),OC(4),gl(),Is(5,"td",14),OC(6),gl(),Is(7,"td",15),OC(8),gl(),Is(9,"td",16)(10,"div",17),Hw(11,z,4,2),Hw(12,G,1,3,"agentos-row-delete-action",18),gl()()()),n&2){let t=e.$implicit,a=rC(2);UE(2),Fg(t.name),UE(2),El(" ",t.description||"\u2014"," "),UE(2),Fg(t.modelName||"\u2014"),UE(2),Fg(a.mode(t)),UE(3),Uw(a.deletion.confirmingId()!==t.id?11:-1),UE(),Uw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),OC(5,"Name"),gl(),Is(6,"th",10),OC(7,"Description"),gl(),Is(8,"th",10),OC(9,"Model"),gl(),Is(10,"th",10),OC(11,"Execution mode"),gl(),Is(12,"th",10)(13,"span",11),OC(14,"Actions"),gl()()()(),Is(15,"tbody",8),Gw(16,J,13,6,"tr",9,B),gl()()()),n&2){let t=rC();UE(16),Ww(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Tr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Iw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["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","Platform agents"],["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","Model"],["role","cell","data-label","Execution mode"],["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"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),gl(),Is(2,"button",2),vg("click",function(){return a.openCreateForm()}),OC(3,"New agent config"),gl()(),Hw(4,j,2,1,"p",3),Hw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(UE(),dg("query",a.rowFilter.query()),UE(3),Uw(a.deletion.error()?4:-1),UE(),Uw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q as k$1,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-qF4-8qpt.js';import {g,n as F,K as we,aq as k,ap as F$1,$ as Tr,z as zi,a1 as ma,at as by,L as U$1,I as Iw,a as Is,R as vg,b as gl,O as OC,H as Hw,U as UE,Q as dg,c as Uw,s as rC,F as Fg,G as Gw,j as Ww,X as Xw,t as hf,u as gf,E as El,l as lg}from'./main-C2L5IBU7.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(Is(0,"p",3),OC(1),gl()),o&2){let e=rC();UE(),Fg(e.deletion.error());}}function U(o,t){o&1&&(Is(0,"p",4),OC(1,"Loading AI models\u2026"),gl());}function z(o,t){o&1&&(Is(0,"p",5),OC(1,"No platform AI models defined yet."),gl());}function G(o,t){o&1&&(Is(0,"p",4),OC(1,"No AI models match the current filter."),gl());}function J(o,t){if(o&1){let e=Xw();Is(0,"button",21),vg("click",function(){hf(e);let r=rC().$implicit,m=rC(2);return gf(m.edit(r))}),OC(1,"Edit"),gl();}if(o&2){let e=rC().$implicit;lg("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=Xw();Is(0,"tr",9)(1,"td",12),OC(2),gl(),Is(3,"td",13),OC(4),gl(),Is(5,"td",14),OC(6),gl(),Is(7,"td",15),OC(8),gl(),Is(9,"td",16),OC(10),gl(),Is(11,"td",17)(12,"div",18),Hw(13,J,2,1,"button",19),Is(14,"agentos-row-delete-action",20),vg("deleteRequested",function(){let r=hf(e).$implicit,m=rC(2);return gf(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=hf(e).$implicit,m=rC(2);return gf(m.confirmDelete(r))})("deleteCancelled",function(){hf(e);let r=rC(2);return gf(r.deletion.cancel())}),gl()()()();}if(o&2){let e=t.$implicit,a=rC(2);UE(2),Fg(e.title),UE(2),Fg(e.providerName),UE(2),El(" ",e.model.apiModelName," "),UE(2),Fg(e.model.priority),UE(2),El(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),UE(3),Uw(a.deletion.confirmingId()!==e.key?13:-1),UE(),dg("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),OC(5,"Name"),gl(),Is(6,"th",10),OC(7,"Provider"),gl(),Is(8,"th",10),OC(9,"API model name"),gl(),Is(10,"th",10),OC(11,"Priority"),gl(),Is(12,"th",10),OC(13,"Reasoning effort"),gl(),Is(14,"th",10)(15,"span",11),OC(16,"Actions"),gl()()()(),Is(17,"tbody",8),Gw(18,O,15,9,"tr",9,K),gl()()()),o&2){let e=rC();UE(18),Ww(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);refresh$=new Tr(void 0);isLoading=zi(true);deletion=k$1();rows=zi([]);rowFilter=O$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),by([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let a=new Map(e.map(r=>[r.id??"",r.name]));this.rows.set(t.map((r,m)=>({key:r.id??`model:${m}`,model:r,title:r.alias??r.apiModelName,providerName:a.get(r.aiProviderId)??r.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Iw({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\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 AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,a){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return a.rowFilter.query.set(m)}),gl(),Is(2,"button",2),vg("click",function(){return a.openCreateForm()}),OC(3,"New AI model"),gl()(),Hw(4,H,2,1,"p",3),Hw(5,U,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,Q,20,0,"div",6)),e&2&&(UE(),dg("query",a.rowFilter.query()),UE(3),Uw(a.deletion.error()?4:-1),UE(),Uw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{j as PlatformAiModelsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-BxyolXEz.js';import {g,W,K as we,z as zi,L as U,I as Iw,a as Is,f as fg,H as Hw,b as gl,U as UE,c as Uw,O as OC,s as rC,F as Fg}from'./main-C2L5IBU7.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-qF4-8qpt.js';import'./chunk-CMLKq_d1.js';function O(r,e){r&1&&(Is(0,"p",1),OC(1,"Loading integration\u2026"),gl());}function T(r,e){r&1&&(Is(0,"ds-notice"),OC(1,"Failed to load this integration configuration."),gl());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),OC(2,"YAML"),gl(),Is(3,"ds-tag",10),OC(4,"Read-only"),gl()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Hw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),OC(4,"Name"),gl(),Is(5,"dd"),OC(6),gl(),Is(7,"dt"),OC(8,"Type"),gl(),Is(9,"dd",5),OC(10),gl(),Is(11,"dt"),OC(12,"Description"),gl(),Is(13,"dd"),OC(14),gl(),Is(15,"dt"),OC(16,"Scope"),gl(),Is(17,"dd"),OC(18),gl(),Is(19,"dt"),OC(20,"Source"),gl(),Is(21,"dd"),OC(22),gl(),Is(23,"dt"),OC(24,"Auto grant"),gl(),Is(25,"dd"),OC(26),gl(),Is(27,"dt"),OC(28,"Auth setting"),gl(),Is(29,"dd"),OC(30),gl()()(),Is(31,"ds-card",6)(32,"p",7),OC(33,"Sensitive values are always redacted."),gl(),Is(34,"pre",8),OC(35),gl()()),r&2){let o=e,a=rC();UE(),Uw(a.source()==="FILESYSTEM"?1:-1),UE(5),Fg(o.name),UE(4),Fg(o.integrationType),UE(4),Fg(o.description||"\u2014"),UE(4),Fg(a.scopeOf(o)),UE(4),Fg(a.source()),UE(4),Fg(o.autoGrant?"Enabled":"Disabled"),UE(4),Fg(o.authSettingName||"None"),UE(5),Fg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=Iw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),fg(1,"ds-section-header",0),Hw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),gl()),o&2){let m;UE(2),Uw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BlijPSJE.js';import {O}from'./chunk-B4OgWFKq.js';import {g,W,t as F$1,K as we,ag as U,ay as N,$ as $i,az as Q,a8 as _,o as oT,a9 as F$2,aA as Me,U as U$1,a2 as ha,aa as br,ac as by,ad as ne,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,T as AI,n as lg,u as Dl,q as $w,z as zw,F as Fg,w as pf,x as hf,as as Pg}from'./main-4HEE4DSD.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-DSY07m68.js';import'./chunk-7pogBin0.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Es(0,"a",2),AC(1,"View resolved definition \u2192"),hl()),n&2){let e=tC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function Qe(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),NI()),n&2){let e=tC(2);dg("formControl",e.modelNameControl),AI();}}function et(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t;dg("ngValue",e.value),VE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Es(0,"optgroup",42),$w(1,tt,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Es(0,"optgroup",43),$w(1,it,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Es(0,"select",18)(1,"option",40),AC(2,"Select a model"),hl(),Bw(3,et,2,2,"option",41),Bw(4,nt,3,0,"optgroup",42),Bw(5,ot,3,0,"optgroup",43),hl(),NI()),n&2){let e,i=tC(2);dg("formControl",i.modelNameControl),AI(),VE(),dg("ngValue",null),VE(2),Vw((e=i.modelOptions().current)?3:-1,e),VE(),Vw(i.modelOptions().aliases.length>0?4:-1),VE(),Vw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),NI()),n&2){let e=tC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),AI();}}function st(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleIntegration(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,lt,2,1,"span",44),hl(),Bw(6,rt,1,2,"input",45),hl();}if(n&2){let e=t.$implicit;VE(2),dg("checked",e.enabled()),VE(2),Fg(e.config.name),VE(),Vw(e.config.integrationType?5:-1),VE(),Vw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Dl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",24),AC(2),Es(3,"span",44),AC(4,"built-in"),hl()(),Es(5,"select",47),vg("change",function(s){let c=pf(e).$implicit,C=tC(4);return hf(C.setBuiltInState(c,s.target.value))}),Es(6,"option",48),AC(7),hl(),Es(8,"option",49),AC(9,"Enabled"),hl(),Es(10,"option",50),AC(11,"Disabled"),hl()(),Bw(12,dt,2,1,"p",13),Es(13,"p",13),AC(14),hl()();}if(n&2){let e=t.$implicit,i=tC(4);VE(),lg("for","built-in-"+e.type),VE(),Dl(" ",e.displayName," "),VE(3),dg("id","built-in-"+e.type)("value",e.state()),VE(2),Fg(i.builtInDefaultLabel(e)),VE(5),Vw(e.state()==="on"&&e.restrictedTools?12:-1),VE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Es(0,"span",46),AC(1,"Built-in integrations"),hl(),$w(2,ct,15,7,"div",10,qe)),n&2){let e=tC(3);VE(2),zw(e.builtInRows());}}function ut(n,t){n&1&&(Es(0,"ds-notice",26),AC(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. "),hl());}function gt(n,t){if(n&1&&(Es(0,"ds-fieldset",21),$w(1,st,7,4,"div",10,Ye),Bw(3,mt,4,0),Bw(4,ut,2,0,"ds-notice",26),hl()),n&2){let e=tC(2);VE(),zw(e.integrationRows()),VE(2),Vw(e.builtInRows().length>0?3:-1),VE(),Vw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&AC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),hl());}function Ct(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function _t(n,t){n&1&&(Es(0,"p",4),AC(1,"No skill available in this scope yet."),hl());}function bt(n,t){n&1&&(Es(0,"span",44),AC(1,"platform"),hl());}function ht(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSkill(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,bt,2,0,"span",44),Bw(6,ht,2,1,"span",44),hl(),Bw(7,yt,2,1,"p",13),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),VE(2),Fg(e.name),VE(),Vw(e.platform?5:-1),VE(),Vw(e.unresolved?6:-1),VE(),Vw(e.description?7:-1);}}function xt(n,t){if(n&1&&$w(0,vt,8,6,"div",10,We),n&2){let e=tC(2);zw(e.skillRows());}}function St(n,t){if(n&1&&(Es(0,"ds-form-field",30),fg(1,"textarea",52),NI(),Es(2,"p",4),AC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Es(4,"code"),AC(5,"AgentLoopPayload"),hl(),AC(6,". Leave empty if you always provide the payload at launch. "),hl()()),n&2){let e=tC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),VE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),AI();}}function At(n,t){n&1&&AC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&AC(0),n&2){let e=tC(3);Pg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),Bw(5,wt,1,2),hl()),n&2){let e=tC(2);VE(5),Vw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function kt(n,t){n&1&&(Es(0,"p",4),AC(1,"No other agent is available in this scope yet."),hl());}function It(n,t){n&1&&(Es(0,"span",44),AC(1,"pattern"),hl());}function Rt(n,t){n&1&&(Es(0,"span",44),AC(1,"via pattern"),hl());}function Mt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Qw();Es(0,"button",55),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(3);return hf(c.removeSubAgent(s))}),AC(1," \xD7 "),hl();}if(n&2){let e=tC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Qw();Es(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSubAgent(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),hl(),Bw(8,Ft,2,1,"button",54),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),VE(2),Fg(e.name),VE(),Vw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),VE(3),Vw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&$w(0,Nt,9,5,"div",32,We),n&2){let e=tC(2);zw(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Qw();Es(0,"div")(1,"button",56),vg("click",function(){pf(e);let s=tC(2);return hf(s.useDefaultDelegationTimeout())}),AC(2," Use server default "),hl()();}}function Vt(n,t){n&1&&(Es(0,"ds-notice"),AC(1),hl()),n&2&&(VE(),Fg(t));}function Pt(n,t){if(n&1){let e=Qw();Es(0,"button",57),vg("click",function(){pf(e);let s=tC(2);return hf(s.exportYaml())}),AC(1),hl();}if(n&2){let e=tC(2);dg("disabled",e.isExporting()),VE(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let s=tC();return hf(s.submit())}),Es(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),NI(),hl(),Es(4,"div",10)(5,"label",11),fg(6,"input",12),NI(),AC(7," Enabled "),hl(),Es(8,"p",13),AC(9,"Disabled agents are excluded from namespace resolution."),hl()(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"ds-form-field",16),Bw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),hl(),Es(15,"ds-form-field",19),fg(16,"textarea",20),NI(),hl()(),Bw(17,gt,5,2,"ds-fieldset",21),Es(18,"ds-fieldset",22)(19,"p",4),AC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Es(21,"code"),AC(22,"readSkill"),hl(),AC(23," and "),Es(24,"code"),AC(25,"readSkillResource"),hl(),AC(26," tools; selecting none grants neither. "),Bw(27,pt,1,0),hl(),Es(28,"label",11)(29,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSkills())}),hl(),Es(30,"span",24),AC(31,"Every skill in the catalogue ("),Es(32,"code",25),AC(33,"*"),hl(),AC(34,")"),hl()(),Es(35,"p",13),AC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),hl(),Bw(37,ft,5,0,"ds-notice",26),Bw(38,Ct,2,0,"ds-notice"),Bw(39,_t,2,0,"p",4)(40,xt,2,0),hl(),Es(41,"ds-form-field",27)(42,"select",28)(43,"option",29),AC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),hl(),Es(45,"option",29),AC(46,"ADVANCED \u2014 Multi-step reasoning loop"),hl(),Es(47,"option",29),AC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),hl()(),NI(),hl(),Bw(49,St,7,3,"ds-form-field",30),Es(50,"ds-fieldset",31)(51,"p",4),AC(52," The agents this one may delegate to. Selecting at least one grants it the "),Es(53,"code"),AC(54,"DELEGATE__delegate"),hl(),AC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Bw(56,At,1,0),hl(),Es(57,"label",11)(58,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSubAgents())}),hl(),Es(59,"span",24),AC(60,"Every agent it can reach ("),Es(61,"code",25),AC(62,"*"),hl(),AC(63,")"),hl()(),Es(64,"p",13),AC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),hl(),Bw(66,Et,6,1,"ds-notice",26),Bw(67,Tt,2,0,"ds-notice"),Bw(68,kt,2,0,"p",4)(69,Dt,2,0),Es(70,"p",4),AC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Es(72,"code"),AC(73,"*Fixer"),hl(),AC(74," to cover BugFixer and StoryFixer. "),hl(),Es(75,"div",32)(76,"input",33),vg("keydown.enter",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),hl(),NI(),Es(77,"button",34),vg("click",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),AC(78," + "),hl()(),Es(79,"ds-form-field",35),fg(80,"input",36),NI(),Bw(81,Lt,3,0,"div"),hl()(),Bw(82,Vt,2,1,"ds-notice"),Es(83,"ds-form-actions")(84,"button",37),AC(85),hl(),Bw(86,Pt,2,2,"button",38),Es(87,"button",39),vg("click",function(){pf(e);let s=tC();return hf(s.cancel())}),AC(88,"Cancel"),hl()()();}if(n&2){let e,i=tC();dg("formGroup",i.form),VE(3),dg("formControl",i.nameControl),AI(),VE(3),dg("formControl",i.enabledControl),AI(),VE(5),dg("formControl",i.descriptionControl),AI(),VE(2),Vw(i.modelAsFreeText()?13:14),VE(3),dg("formControl",i.instructionsControl),AI(),VE(),Vw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),VE(10),Vw(i.isPlatformMode?27:-1),VE(2),dg("checked",i.allSkillsSelected()),VE(8),Vw(i.namedSkillSelectionDropped()?37:-1),VE(),Vw(i.skillCatalogueUnavailable()?38:-1),VE(),Vw(i.skillRows().length===0?39:40),VE(3),dg("formControl",i.executionModeControl),AI(),VE(),dg("value",i.ExecutionMode.SIMPLE),VE(2),dg("value",i.ExecutionMode.ADVANCED),VE(2),dg("value",i.ExecutionMode.LOOP),VE(2),Vw(i.isLoopMode()?49:-1),VE(7),Vw(i.isPlatformMode?56:-1),VE(2),dg("checked",i.allSubAgentsSelected()),VE(8),Vw(i.namedSubAgentSelectionDropped()?66:-1),VE(),Vw(i.subAgentCandidatesUnavailable()?67:-1),VE(),Vw(i.subAgentRows().length===0?68:69),VE(8),dg("formControl",i.newSubAgentControl),AI(),VE(),dg("disabled",!i.newSubAgentControl.value.trim()),VE(2),dg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),VE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),AI(),VE(),Vw(i.delegationTimeoutControl.value!==null?81:-1),VE(),Vw((e=i.submitError())?82:-1,e),VE(2),dg("disabled",i.form.invalid||i.isSubmitting()),VE(),Dl(" ",i.isEditMode()?"Save changes":"Create"," "),VE(),Vw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=$i(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.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(i){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=oT(()=>{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$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=oT(()=>this.executionModeValue()==="LOOP");subAgentRows=$i([]);allSubAgentsSelected=$i(false);subAgentCandidatesUnavailable=$i(false);namedSubAgentSelectionDropped=oT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=oT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=oT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);isExporting=$i(false);submitError=$i(null);ExecutionMode=Me;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=$i([]);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=oT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=$i({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=$i(false);modelAsFreeText=oT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=$i([]);skillRows=$i([]);allSkillsSelected=$i(false);skillCatalogueUnavailable=$i(false);namedSkillSelectionDropped=oT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ha(()=>br(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),by({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),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:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,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 f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),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 N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){by({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),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:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ha(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),br([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:$i(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:$i(true)}));}return E}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()):br([]);return by({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ha(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),br([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:$i(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:$i(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ha(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:$i(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:$i(C),restrictedTools:Array.isArray(c)&&c.length>0?c: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(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:$i(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.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(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);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:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). 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 i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),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=Dw({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,i){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return i.cancel()}),AC(3," \u2190 Agent configs "),hl(),Bw(4,ze,2,1,"a",2),Bw(5,Xe,2,0,"ds-tag",3),hl(),Bw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),hl()),e&2&&(VE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),VE(3),Vw(i.isEditMode()?4:-1),VE(),Vw(i.isPlatformMode?5:-1),VE(),Vw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
|
|
1
|
+
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BYsAPdst.js';import {O}from'./chunk-BxyolXEz.js';import {g,W,n as F$1,K as we,ag as U,ay as N,z as zi,az as Q,a8 as _,i as cT,a9 as F$2,aA as Me,L as U$1,a2 as ga,aa as br,ac as _y,ad as ne,P as x,N as w,I as Iw,au as $t,a as Is,R as vg,O as OC,b as gl,H as Hw,U as UE,Q as dg,c as Uw,s as rC,X as Xw,f as fg,S as AI,T as OI,l as lg,E as El,G as Gw,j as Ww,F as Fg,t as hf,u as gf,as as Pg}from'./main-C2L5IBU7.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-qF4-8qpt.js';import'./chunk-CMLKq_d1.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),OC(1,"View resolved definition \u2192"),gl()),n&2){let e=rC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),OC(1,"Platform level"),gl());}function Qe(n,t){n&1&&(Is(0,"p",4),OC(1,"Loading\u2026"),gl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),AI()),n&2){let e=rC(2);dg("formControl",e.modelNameControl),OI();}}function et(n,t){if(n&1&&(Is(0,"option",41),OC(1),gl()),n&2){let e=t;dg("ngValue",e.value),UE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),OC(1),gl()),n&2){let e=t.$implicit;dg("ngValue",e.value),UE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),Gw(1,tt,2,2,"option",41,je),gl()),n&2){let e=rC(3);UE(),Ww(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),OC(1),gl()),n&2){let e=t.$implicit;dg("ngValue",e.value),UE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),Gw(1,it,2,2,"option",41,je),gl()),n&2){let e=rC(3);UE(),Ww(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),OC(2,"Select a model"),gl(),Hw(3,et,2,2,"option",41),Hw(4,nt,3,0,"optgroup",42),Hw(5,ot,3,0,"optgroup",43),gl(),AI()),n&2){let e,i=rC(2);dg("formControl",i.modelNameControl),OI(),UE(),dg("ngValue",null),UE(2),Uw((e=i.modelOptions().current)?3:-1,e),UE(),Uw(i.modelOptions().aliases.length>0?4:-1),UE(),Uw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),OC(1),gl()),n&2){let e=rC().$implicit;UE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),AI()),n&2){let e=rC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),OI();}}function st(n,t){if(n&1){let e=Xw();Is(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=hf(e).$implicit,c=rC(3);return gf(c.toggleIntegration(s))}),gl(),Is(3,"span",24),OC(4),gl(),Hw(5,lt,2,1,"span",44),gl(),Hw(6,rt,1,2,"input",45),gl();}if(n&2){let e=t.$implicit;UE(2),dg("checked",e.enabled()),UE(2),Fg(e.config.name),UE(),Uw(e.config.integrationType?5:-1),UE(),Uw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),OC(1),gl()),n&2){let e=rC().$implicit;UE(),El(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Xw();Is(0,"div",10)(1,"label",24),OC(2),Is(3,"span",44),OC(4,"built-in"),gl()(),Is(5,"select",47),vg("change",function(s){let c=hf(e).$implicit,C=rC(4);return gf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),OC(7),gl(),Is(8,"option",49),OC(9,"Enabled"),gl(),Is(10,"option",50),OC(11,"Disabled"),gl()(),Hw(12,dt,2,1,"p",13),Is(13,"p",13),OC(14),gl()();}if(n&2){let e=t.$implicit,i=rC(4);UE(),lg("for","built-in-"+e.type),UE(),El(" ",e.displayName," "),UE(3),dg("id","built-in-"+e.type)("value",e.state()),UE(2),Fg(i.builtInDefaultLabel(e)),UE(5),Uw(e.state()==="on"&&e.restrictedTools?12:-1),UE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),OC(1,"Built-in integrations"),gl(),Gw(2,ct,15,7,"div",10,qe)),n&2){let e=rC(3);UE(2),Ww(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),OC(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. "),gl());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),Gw(1,st,7,4,"div",10,Ye),Hw(3,mt,4,0),Hw(4,ut,2,0,"ds-notice",26),gl()),n&2){let e=rC(2);UE(),Ww(e.integrationRows()),UE(2),Uw(e.builtInRows().length>0?3:-1),UE(),Uw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&OC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),OC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),OC(3,"*"),gl(),OC(4,". "),gl());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),OC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),gl());}function _t(n,t){n&1&&(Is(0,"p",4),OC(1,"No skill available in this scope yet."),gl());}function bt(n,t){n&1&&(Is(0,"span",44),OC(1,"platform"),gl());}function ht(n,t){if(n&1&&(Is(0,"span",44),OC(1),gl()),n&2){let e=rC(4);UE(),El(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),OC(1),gl()),n&2){let e=rC().$implicit;UE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Xw();Is(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=hf(e).$implicit,c=rC(3);return gf(c.toggleSkill(s))}),gl(),Is(3,"span",24),OC(4),gl(),Hw(5,bt,2,0,"span",44),Hw(6,ht,2,1,"span",44),gl(),Hw(7,yt,2,1,"p",13),gl();}if(n&2){let e=t.$implicit,i=rC(3);UE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),UE(2),Fg(e.name),UE(),Uw(e.platform?5:-1),UE(),Uw(e.unresolved?6:-1),UE(),Uw(e.description?7:-1);}}function xt(n,t){if(n&1&&Gw(0,vt,8,6,"div",10,We),n&2){let e=rC(2);Ww(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),fg(1,"textarea",52),AI(),Is(2,"p",4),OC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),OC(5,"AgentLoopPayload"),gl(),OC(6,". Leave empty if you always provide the payload at launch. "),gl()()),n&2){let e=rC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),UE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),OI();}}function At(n,t){n&1&&OC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&OC(0),n&2){let e=rC(3);Pg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),OC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),OC(3,"*"),gl(),OC(4,". "),Hw(5,wt,1,2),gl()),n&2){let e=rC(2);UE(5),Uw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),OC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),gl());}function kt(n,t){n&1&&(Is(0,"p",4),OC(1,"No other agent is available in this scope yet."),gl());}function It(n,t){n&1&&(Is(0,"span",44),OC(1,"pattern"),gl());}function Rt(n,t){n&1&&(Is(0,"span",44),OC(1,"via pattern"),gl());}function Mt(n,t){if(n&1&&(Is(0,"span",44),OC(1),gl()),n&2){let e=rC(4);UE(),El(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Xw();Is(0,"button",55),vg("click",function(){hf(e);let s=rC().$implicit,c=rC(3);return gf(c.removeSubAgent(s))}),OC(1," \xD7 "),gl();}if(n&2){let e=rC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Xw();Is(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=hf(e).$implicit,c=rC(3);return gf(c.toggleSubAgent(s))}),gl(),Is(3,"span",24),OC(4),gl(),Hw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),gl(),Hw(8,Ft,2,1,"button",54),gl();}if(n&2){let e=t.$implicit,i=rC(3);UE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),UE(2),Fg(e.name),UE(),Uw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),UE(3),Uw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Gw(0,Nt,9,5,"div",32,We),n&2){let e=rC(2);Ww(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Xw();Is(0,"div")(1,"button",56),vg("click",function(){hf(e);let s=rC(2);return gf(s.useDefaultDelegationTimeout())}),OC(2," Use server default "),gl()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),OC(1),gl()),n&2&&(UE(),Fg(t));}function Pt(n,t){if(n&1){let e=Xw();Is(0,"button",57),vg("click",function(){hf(e);let s=rC(2);return gf(s.exportYaml())}),OC(1),gl();}if(n&2){let e=rC(2);dg("disabled",e.isExporting()),UE(),El(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Xw();Is(0,"form",6),vg("ngSubmit",function(){hf(e);let s=rC();return gf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),AI(),gl(),Is(4,"div",10)(5,"label",11),fg(6,"input",12),AI(),OC(7," Enabled "),gl(),Is(8,"p",13),OC(9,"Disabled agents are excluded from namespace resolution."),gl()(),Is(10,"ds-form-field",14),fg(11,"input",15),AI(),gl(),Is(12,"ds-form-field",16),Hw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),gl(),Is(15,"ds-form-field",19),fg(16,"textarea",20),AI(),gl()(),Hw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),OC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),OC(22,"readSkill"),gl(),OC(23," and "),Is(24,"code"),OC(25,"readSkillResource"),gl(),OC(26," tools; selecting none grants neither. "),Hw(27,pt,1,0),gl(),Is(28,"label",11)(29,"input",23),vg("change",function(){hf(e);let s=rC();return gf(s.toggleAllSkills())}),gl(),Is(30,"span",24),OC(31,"Every skill in the catalogue ("),Is(32,"code",25),OC(33,"*"),gl(),OC(34,")"),gl()(),Is(35,"p",13),OC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),gl(),Hw(37,ft,5,0,"ds-notice",26),Hw(38,Ct,2,0,"ds-notice"),Hw(39,_t,2,0,"p",4)(40,xt,2,0),gl(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),OC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),gl(),Is(45,"option",29),OC(46,"ADVANCED \u2014 Multi-step reasoning loop"),gl(),Is(47,"option",29),OC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),gl()(),AI(),gl(),Hw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),OC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),OC(54,"DELEGATE__delegate"),gl(),OC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Hw(56,At,1,0),gl(),Is(57,"label",11)(58,"input",23),vg("change",function(){hf(e);let s=rC();return gf(s.toggleAllSubAgents())}),gl(),Is(59,"span",24),OC(60,"Every agent it can reach ("),Is(61,"code",25),OC(62,"*"),gl(),OC(63,")"),gl()(),Is(64,"p",13),OC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),gl(),Hw(66,Et,6,1,"ds-notice",26),Hw(67,Tt,2,0,"ds-notice"),Hw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),OC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),OC(73,"*Fixer"),gl(),OC(74," to cover BugFixer and StoryFixer. "),gl(),Is(75,"div",32)(76,"input",33),vg("keydown.enter",function(){hf(e);let s=rC();return gf(s.addSubAgent())}),gl(),AI(),Is(77,"button",34),vg("click",function(){hf(e);let s=rC();return gf(s.addSubAgent())}),OC(78," + "),gl()(),Is(79,"ds-form-field",35),fg(80,"input",36),AI(),Hw(81,Lt,3,0,"div"),gl()(),Hw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),OC(85),gl(),Hw(86,Pt,2,2,"button",38),Is(87,"button",39),vg("click",function(){hf(e);let s=rC();return gf(s.cancel())}),OC(88,"Cancel"),gl()()();}if(n&2){let e,i=rC();dg("formGroup",i.form),UE(3),dg("formControl",i.nameControl),OI(),UE(3),dg("formControl",i.enabledControl),OI(),UE(5),dg("formControl",i.descriptionControl),OI(),UE(2),Uw(i.modelAsFreeText()?13:14),UE(3),dg("formControl",i.instructionsControl),OI(),UE(),Uw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),UE(10),Uw(i.isPlatformMode?27:-1),UE(2),dg("checked",i.allSkillsSelected()),UE(8),Uw(i.namedSkillSelectionDropped()?37:-1),UE(),Uw(i.skillCatalogueUnavailable()?38:-1),UE(),Uw(i.skillRows().length===0?39:40),UE(3),dg("formControl",i.executionModeControl),OI(),UE(),dg("value",i.ExecutionMode.SIMPLE),UE(2),dg("value",i.ExecutionMode.ADVANCED),UE(2),dg("value",i.ExecutionMode.LOOP),UE(2),Uw(i.isLoopMode()?49:-1),UE(7),Uw(i.isPlatformMode?56:-1),UE(2),dg("checked",i.allSubAgentsSelected()),UE(8),Uw(i.namedSubAgentSelectionDropped()?66:-1),UE(),Uw(i.subAgentCandidatesUnavailable()?67:-1),UE(),Uw(i.subAgentRows().length===0?68:69),UE(8),dg("formControl",i.newSubAgentControl),OI(),UE(),dg("disabled",!i.newSubAgentControl.value.trim()),UE(2),dg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),UE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),OI(),UE(),Uw(i.delegationTimeoutControl.value!==null?81:-1),UE(),Uw((e=i.submitError())?82:-1,e),UE(2),dg("disabled",i.form.invalid||i.isSubmitting()),UE(),El(" ",i.isEditMode()?"Save changes":"Create"," "),UE(),Uw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.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(i){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=cT(()=>{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$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=cT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=cT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=cT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=cT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Me;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=zi([]);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=cT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=cT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=cT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>br(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),_y({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),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:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,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 f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),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 N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){_y({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),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:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),br([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}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()):br([]);return _y({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),br([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c: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(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.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(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);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:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). 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 i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),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=Iw({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,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return i.cancel()}),OC(3," \u2190 Agent configs "),gl(),Hw(4,ze,2,1,"a",2),Hw(5,Xe,2,0,"ds-tag",3),gl(),Hw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),gl()),e&2&&(UE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),UE(3),Uw(i.isEditMode()?4:-1),UE(),Uw(i.isPlatformMode?5:-1),UE(),Uw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-qF4-8qpt.js';import {g,W,aN as Y,z as zi,ab as le,o as Of,I as Iw,aO as Tb,a as Is,f as fg,H as Hw,b as gl,U as UE,c as Uw,ak as vd,a1 as ma,a3 as rn,ac as _y,a2 as ga,O as OC,X as Xw,R as vg,aP as Hg,S as AI,s as rC,aQ as Vg,T as OI,G as Gw,j as Ww,aR as YC,aS as ZC,F as Fg,l as lg,av as eT,aw as nT,as as Pg,E as El,aT as rT,t as hf,u as gf,aU as BC}from'./main-C2L5IBU7.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&&(Is(0,"p",2),OC(1,"Loading usage settings\u2026"),gl());}function fe(e,a){if(e&1){let t=Xw();Is(0,"ds-notice"),OC(1,"Could not load usage settings. Please try again."),gl(),Is(2,"div")(3,"button",3),vg("click",function(){hf(t);let s=rC();return gf(s.configuration.retry())}),OC(4,"Retry usage settings"),gl()();}}function ye(e,a){e&1&&(Is(0,"p",2),OC(1,"Usage tracking is disabled."),gl());}function be(e,a){e&1&&(Is(0,"ds-notice"),OC(1),gl()),e&2&&(UE(),Fg(a));}function xe(e,a){e&1&&(Is(0,"p",2),OC(1,"Loading usage\u2026"),gl());}function he(e,a){e&1&&(Is(0,"p",12),OC(1,"No recorded usage for this period."),gl());}function Se(e,a){if(e&1&&(Is(0,"p",10),OC(1),gl()),e&2){let t=rC().$implicit;UE(),El("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Is(0,"tr",16)(1,"td",18),OC(2),gl(),Is(3,"td",19),OC(4),eT(5,"number"),gl(),Is(6,"td",20),OC(7),eT(8,"number"),eT(9,"number"),gl(),Is(10,"td",21),OC(11),eT(12,"number"),eT(13,"number"),gl(),Is(14,"td",22),OC(15),eT(16,"agentosCost"),Hw(17,Se,2,1,"p",10),gl()()),e&2){let t=a.$implicit;UE(2),Fg(t.key),UE(2),Fg(nT(5,8,t.aggregate.totalTokens)),UE(3),Pg(" ",nT(8,10,t.aggregate.inputTokens)," / ",nT(9,12,t.aggregate.outputTokens)," "),UE(4),Pg(" ",nT(12,14,t.aggregate.cacheReadTokens)," / ",nT(13,16,t.aggregate.cacheWriteTokens)," "),UE(4),El(" ",rT(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),UE(2),Uw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),OC(5,"Name"),gl(),Is(6,"th",17),OC(7,"Tokens"),gl(),Is(8,"th",17),OC(9,"Input / output"),gl(),Is(10,"th",17),OC(11,"Cache read / write"),gl(),Is(12,"th",17),OC(13,"Estimated cost"),gl()()(),Is(14,"tbody",15),Gw(15,we,18,21,"tr",16,_e),gl()()()),e&2){let t=rC().$implicit;UE(),lg("aria-label","Usage "+t.title.toLowerCase()),UE(14),Ww(t.rows);}}function Ne(e,a){if(e&1&&(Is(0,"h3",11),OC(1),gl(),Hw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;UE(),Fg(t.title),UE(),Uw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Gw(0,Ne,4,2,null,null,ue),Is(2,"p",10),OC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),gl()),e&2){let t=rC(2);Ww(YC(4,ge,ZC(0,ce,t.agents()),ZC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=Xw();Is(0,"form",4),vg("ngSubmit",function(){hf(t);let s=rC();return gf(s.load())}),Is(1,"ds-form-field",5)(2,"input",6),Hg("ngModelChange",function(s){hf(t);let m=rC();return BC(m.from,s)||(m.from=s),gf(s)}),gl(),AI(),gl(),Is(3,"ds-form-field",7)(4,"input",8),Hg("ngModelChange",function(s){hf(t);let m=rC();return BC(m.to,s)||(m.to=s),gf(s)}),gl(),AI(),gl(),Is(5,"button",9),OC(6,"Refresh"),gl()(),Hw(7,be,2,1,"ds-notice"),Hw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=rC();UE(2),Vg("ngModel",r.from),OI(),UE(2),Vg("ngModel",r.to),OI(),UE(3),Uw((t=r.error())?7:-1,t),UE(),Uw(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=zi([]);models=zi([]);error=zi(null);loading=zi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Of(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(vd(void 0),ma(()=>{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),rn):(this.loading.set(true),_y({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ga(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."),rn))))})).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=Iw({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&&(Is(0,"ds-page",0),fg(1,"ds-section-header",1),Hw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),gl()),t&2&&(UE(2),Uw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Tb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-CMLKq_d1.js';import {y}from'./chunk-qF4-8qpt.js';import {g,aE as X,$ as Tr,at as by,a1 as ma,a2 as ga,aa as br,ad as ne,aD as Gy,P as x,N as w$1,a5 as Dd,aF as an,aG as Ot,aH as cn,a6 as x$1}from'./main-C2L5IBU7.js';var nt=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],it={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"},R="none",w="me",b=2e3,M=15e4,P=3,L={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},k={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function B(i){let t=L[i.authType];return t?x(w$1({},i),{authType:t}):i}function m(i){return U(i)}function f(i){return i.map(U)}function U(i){let t=i;if(typeof t.authType=="string"){let e=k[t.authType];if(e)return x(w$1({},t),{authType:e})}return i}function H(i,t){return t===null?true:i!==void 0&&Date.parse(i)>Date.parse(t)}var I=class i$1{controller=g(X);userState=g(y);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=by([this.namespaceId$,this.refresh$]).pipe(ma(([t])=>{let e=this.loadPlatformSettings().pipe(ga(()=>br([])));return t?by([e,this.loadNamespaceSettings(t).pipe(ga(()=>br([]))),this.loadUserSettings(t).pipe(ga(()=>br([]))),this.loadUserSettings("global").pipe(ga(()=>br([])))]).pipe(ne(([n,o,r,h])=>({platform:n,namespace:o,userOnNs:r,userGlobal:h}))):by([e,this.loadNamespaceSettings("").pipe(ga(()=>br([]))),this.loadUserSettings("global").pipe(ga(()=>br([])))]).pipe(ne(([n,o,r])=>({platform:n,namespace:o,userOnNs:[],userGlobal:r})))}),Gy({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?R:t;return this.controller.listAuthSetting(e,w).pipe(ne(n=>f(n)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(R).pipe(ne(t=>f(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ne(e=>f(e))):br([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ne(n=>m(n)))}create(t,e,n){let r=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!r)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(n===void 0||n===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!n)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let h=B(x(w$1({},t),{namespaceId:e==="namespace"||e==="userOnNs"?n??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?r:void 0}));return this.controller.createAuthSetting(h).pipe(ne(A=>m(A)),Dd(()=>this.refresh()))}update(t,e,n){let o=B(x(w$1({},e),{namespaceId:n.namespaceId,userId:n.userId,authType:n.authType}));return this.controller.updateAuthSetting(t,o).pipe(ne(r=>m(r)),Dd(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Dd(()=>this.refresh()))}getConnection(t,e){return this.controller.getConnectionAuthSetting(t,e)}resetCredential(t,e){return this.controller.resetMyCredentialAuthSetting(t,e)}connect(t,e,n,o){return this.getConnection(t,e).pipe(ma(r=>this.controller.connectAuthSetting(t,e).pipe(Dd(h=>n(h.authorizationUrl)),ma(()=>this.awaitNewConnection(t,e,r.connected?r.connectedAt??null:null,o)))))}awaitNewConnection(t,e,n,o){let r=0,h=0;return an(b,b).pipe(ma(()=>this.getConnection(t,e).pipe(ga(()=>br(null)))),ne(A=>(r++,A?.connected&&H(A.connectedAt,n)?"connected":r*b>=M?"timeout":o()&&++h>=P?"abandoned":null)),Ot(A=>A!==null),cn(1))}static \u0275fac=function(e){return new(e||i$1)};static \u0275prov=x$1({token:i$1,factory:i$1.\u0275fac,providedIn:"root"})};export{I,it as i,nt as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {I as I$1}from'./chunk-DEGiKLCd.js';import {g,n as F,K as we,$ as Tr,z as zi,a1 as ma,L as U$1,I as Iw,a as Is,R as vg,b as gl,O as OC,H as Hw,U as UE,Q as dg,c as Uw,s as rC,F as Fg,G as Gw,j as Ww,E as El,X as Xw,l as lg,t as hf,u as gf}from'./main-C2L5IBU7.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-qF4-8qpt.js';import'./chunk-CMLKq_d1.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Is(0,"p",3),OC(1),gl()),e&2){let n=rC();UE(),Fg(n.deletion.error());}}function K(e,t){e&1&&(Is(0,"p",4),OC(1,"Loading auth settings\u2026"),gl());}function H(e,t){e&1&&(Is(0,"p",5),OC(1,"No platform auth settings defined yet."),gl());}function U(e,t){e&1&&(Is(0,"p",4),OC(1,"No auth settings match the current filter."),gl());}function z(e,t){if(e&1){let n=Xw();Is(0,"button",18),vg("click",function(){hf(n);let d=rC().$implicit,m=rC(2);return gf(m.onEdit(d))}),OC(1," Edit "),gl();}if(e&2){let n=rC().$implicit;lg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Xw();Is(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){hf(n);let d=rC().$implicit,m=rC(2);return gf(m.deletion.request(d.id))})("deleteConfirmed",function(){hf(n);let d=rC().$implicit,m=rC(2);return gf(m.onDelete(d))})("deleteCancelled",function(){hf(n);let d=rC(3);return gf(d.deletion.cancel())}),gl();}if(e&2){let n=rC().$implicit,a=rC(2);dg("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Is(0,"tr",9)(1,"td",12),OC(2),gl(),Is(3,"td",13),OC(4),gl(),Is(5,"td",14)(6,"div",15),Hw(7,z,2,1,"button",16),Hw(8,G,1,3,"agentos-row-delete-action",17),gl()()()),e&2){let n=t.$implicit,a=rC(2);UE(2),Fg(n.name),UE(2),El(" ",n.authType," "),UE(3),Uw(a.deletion.confirmingId()!==n.id?7:-1),UE(),Uw(n.id?8:-1);}}function O(e,t){if(e&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),OC(5,"Name"),gl(),Is(6,"th",10),OC(7,"Authentication type"),gl(),Is(8,"th",10)(9,"span",11),OC(10,"Actions"),gl()()()(),Is(11,"tbody",8),Gw(12,J,9,4,"tr",9,B),gl()()()),e&2){let n=rC();UE(12),Ww(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new Tr(void 0);isLoading=zi(true);deletion=k();settings=zi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=Iw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return a.rowFilter.query.set(m)}),gl(),Is(2,"button",2),vg("click",function(){return a.openCreateForm()}),OC(3,"New auth setting"),gl()(),Hw(4,j,2,1,"p",3),Hw(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&&(UE(),dg("query",a.rowFilter.query()),UE(3),Uw(a.deletion.error()?4:-1),UE(),Uw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {S}from'./chunk-
|
|
1
|
+
import {S}from'./chunk-qF4-8qpt.js';import {I as Iw,Y as br,a as Is,O as OC,b as gl,f as fg,Q as dg}from'./main-C2L5IBU7.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=Iw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Is(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),OC(3,"Platform"),gl(),Is(4,"span",2),OC(5,"/"),gl(),Is(6,"span"),OC(7,"Administration"),gl()(),fg(8,"router-outlet"),gl()),e&2&&dg("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
|