@whoz-oss/coday-client 0.0.0-workstream-forge.307 → 0.0.0-workstream-forge.318
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-0PeLV_Cu.js +1 -0
- package/browser/chunk-4sRiWz5d.js +1 -0
- package/browser/{chunk-D7NecoRJ.js → chunk-B4vPSwvB.js} +1 -1
- package/browser/{chunk-nXzIdvrn.js → chunk-B7vuc5oo.js} +1 -1
- package/browser/chunk-BJWYcYdG.js +855 -0
- package/browser/{chunk-Al6GR_hf.js → chunk-BJ_2tsip.js} +1 -1
- package/browser/chunk-BM0ZeEkn.js +1 -0
- package/browser/{chunk-DZPQ_9kb.js → chunk-BZftfpBZ.js} +1 -1
- package/browser/{chunk-BCog1UaJ.js → chunk-BfbRo2eq.js} +1 -1
- package/browser/{chunk-BT6UzCxf.js → chunk-BiyTqy2W.js} +1 -1
- package/browser/chunk-Bl2V557L.js +1 -0
- package/browser/{chunk-DvOfi4de.js → chunk-BobfaCoK.js} +1 -1
- package/browser/{chunk-DDGYxARA.js → chunk-BqP68YVZ.js} +1 -1
- package/browser/{chunk-C3qyrvj1.js → chunk-C2ZVcJof.js} +1 -1
- package/browser/{chunk-DRdCkC5Y.js → chunk-C7VxZP8K.js} +1 -1
- package/browser/chunk-COQO5pZ-.js +1 -0
- package/browser/{chunk-6gjcqKIy.js → chunk-CPBSXO4y.js} +1 -1
- package/browser/{chunk-DbdlZfWp.js → chunk-CR_i3pME.js} +1 -1
- package/browser/{chunk-Bu0ccdr8.js → chunk-CYdD0V3D.js} +1 -1
- package/browser/{chunk-CqOpmDij.js → chunk-CZrMmk2_.js} +1 -1
- package/browser/{chunk-Tr_JjO6b.js → chunk-CaEHspO8.js} +1 -1
- package/browser/{chunk-CpPTgCB_.js → chunk-CaqVk39O.js} +1 -1
- package/browser/{chunk-CgUDp7GS.js → chunk-Cdq764lV.js} +1 -1
- package/browser/{chunk-JGTJHpTi.js → chunk-Ce5zYetC.js} +1 -1
- package/browser/{chunk-SWiZLd08.js → chunk-Cg0Y0Rx9.js} +1 -1
- package/browser/chunk-Co53pbT4.js +1 -0
- package/browser/{chunk-Bxm5X6iI.js → chunk-D3-ObXWx.js} +1 -1
- package/browser/{chunk-B9QejRf8.js → chunk-D3d3XS5H.js} +1 -1
- package/browser/{chunk-oiQFtllx.js → chunk-DI9poEf6.js} +1 -1
- package/browser/{chunk-BXzpDMqb.js → chunk-DUUl8Ujj.js} +1 -1
- package/browser/{chunk-CuChgDmJ.js → chunk-DeRUUEre.js} +1 -1
- package/browser/{chunk-BU7axmzu.js → chunk-DepcXmP8.js} +1 -1
- package/browser/{chunk-BJyGEW7T.js → chunk-Dj-RDcJY.js} +1 -1
- package/browser/{chunk-hws9FxUt.js → chunk-DjQuloiH.js} +1 -1
- package/browser/{chunk-IxT8086h.js → chunk-DlLEAMMg.js} +1 -1
- package/browser/{chunk-CeWSwjXE.js → chunk-Dqwn2r3a.js} +1 -1
- package/browser/{chunk-DkJ3QAxm.js → chunk-DwgCb6Fq.js} +1 -1
- package/browser/{chunk-CN9Fd9u0.js → chunk-EucrAwun.js} +1 -1
- package/browser/{chunk--FNFLRDT.js → chunk-QFSmJ65x.js} +1 -1
- package/browser/{chunk-B0eHxgci.js → chunk-YyFQSeEa.js} +1 -1
- package/browser/{chunk-BJ1zFFps.js → chunk-a582tmG6.js} +1 -1
- package/browser/{chunk-oMuzSDaX.js → chunk-aD-SvXOi.js} +1 -1
- package/browser/{chunk-BbgSm4CI.js → chunk-bUBZ4IKo.js} +1 -1
- package/browser/{chunk-sLzhy0Up.js → chunk-eUlhzJed.js} +1 -1
- package/browser/{chunk-Bi6SxDMh.js → chunk-gNHkkkJA.js} +1 -1
- package/browser/{chunk-BoXayaJA.js → chunk-zOPOfeyq.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-2UMSYJ2Z.js → main-TQWWQMKE.js} +13 -13
- package/package.json +1 -1
- package/browser/chunk-B5yHUXsb.js +0 -1
- package/browser/chunk-Bh6fIPe1.js +0 -1
- package/browser/chunk-ByYeYdQg.js +0 -1
- package/browser/chunk-Cp8ULs7k.js +0 -1
- package/browser/chunk-D-2ZvJkQ.js +0 -1
- package/browser/chunk-DJQT-u6K.js +0 -855
- package/browser/chunk-DjS8Dvjk.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-BT6UzCxf.js';import {O}from'./chunk-JGTJHpTi.js';import {I}from'./chunk-CgUDp7GS.js';import {g,H as we$1,z as zi,k as yT,a9 as F,at as _y,ad as ne,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,s as aC,S as Eg,r as fC,R as pg,T as VI,l as eC,L as Lg,X as UI,t as tC,q as Il,ae as Zw,u as mf,w as yf,aO as EC,P as x,O as w}from'./main-2UMSYJ2Z.js';import {y,J as k,L as K,X as a,p as pt,T as Te$1,$ as v,a0 as V,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,a1 as gn,h as hn,i as at,u as un,m as mn,a2 as ji,F as Ni,a3 as m,a4 as S}from'./chunk-DJQT-u6K.js';import'./chunk-Cp8ULs7k.js';var Ce=(o,e)=>e.value,be=(o,e)=>e.title;function xe(o,e){o&1&&(Is(0,"p",3),UC(1,"Loading\u2026"),ml());}function Se(o,e){if(o&1&&(Is(0,"option",31),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Ee(o,e){if(o&1&&(Is(0,"option",31),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Te(o,e){if(o&1){let t=aC();Is(0,"form",19),Eg("ngSubmit",function(){mf(t);let s=fC(2);return yf(s.save())}),Is(1,"ds-group",20)(2,"dl",21)(3,"dt"),UC(4,"Email"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"External ID"),ml(),Is(9,"dd"),UC(10),ml()()(),Is(11,"ds-group",22)(12,"ds-form-field",23),hg(13,"input",24),VI(),ml(),Is(14,"ds-form-field",25),hg(15,"input",26),VI(),ml(),Is(16,"ds-form-field",27),hg(17,"textarea",28),VI(),ml(),Is(18,"ds-form-field",29)(19,"select",30),eC(20,Se,2,2,"option",31,Ce),ml(),VI(),ml(),Is(22,"ds-form-field",32)(23,"select",33),eC(24,Ee,2,2,"option",31,Ce),ml(),VI(),ml()(),Is(26,"ds-form-actions")(27,"button",34),UC(28),ml(),Is(29,"button",35),Eg("click",function(){mf(t);let s=fC(2);return yf(s.cancelEditing())}),UC(30,"Cancel"),ml()()();}if(o&2){let t=fC(),l=fC();pg("formGroup",l.form),KE(6),Lg(t.email),KE(4),Lg(t.externalId),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),UI(),KE(),tC(l.languageOptions),KE(3),UI(),KE(),tC(l.promptCacheTtlOptions),KE(3),pg("disabled",l.isSaving()),KE(),Il(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function De(o,e){o&1&&(Is(0,"p",3),UC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),ml());}function Pe(o,e){if(o&1){let t=aC();Is(0,"span",44),UC(1,"Delete?"),ml(),Is(2,"button",45),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(5);return yf(m.confirmDelete(s))}),UC(3,"Confirm"),ml(),Is(4,"button",46),Eg("click",function(){mf(t);let s=fC(6);return yf(s.cancelDelete())}),UC(5,"Cancel"),ml();}}function Ue(o,e){if(o&1){let t=aC();Is(0,"button",46),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(5);return yf(m.armDelete(s))}),UC(1,"Delete"),ml();}}function we(o,e){if(o&1&&(Is(0,"li",40)(1,"span",41),UC(2),ml(),Is(3,"span",42),UC(4),ml(),Qw(5,Pe,6,0)(6,Ue,2,0,"button",43),ml()),o&2){let t=e.$implicit,l=fC(5);KE(2),Lg(t.name),KE(2),Lg(t.subtitle),KE(),Kw(l.isPendingDelete(t)?5:6);}}function Ve(o,e){if(o&1&&(Is(0,"span",38),UC(1),ml(),Is(2,"ul",39),eC(3,we,7,3,"li",40,Zw().trackEntry,true),ml()),o&2){let t=e.$implicit;KE(),Lg(t.title),KE(2),tC(t.entries);}}function Ie(o,e){if(o&1&&eC(0,Ve,5,1,null,null,be),o&2){let t=fC(3);tC(t.recapSections());}}function Ne(o,e){if(o&1){let t=aC();Is(0,"ds-group",20)(1,"dl",21)(2,"dt"),UC(3,"Email"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"External ID"),ml(),Is(8,"dd"),UC(9),ml()()(),Is(10,"ds-group",22)(11,"dl",21)(12,"dt"),UC(13,"First name"),ml(),Is(14,"dd"),UC(15),ml(),Is(16,"dt"),UC(17,"Last name"),ml(),Is(18,"dd"),UC(19),ml(),Is(20,"dt"),UC(21,"Bio"),ml(),Is(22,"dd"),UC(23),ml(),Is(24,"dt"),UC(25,"Language"),ml(),Is(26,"dd"),UC(27),ml(),Is(28,"dt"),UC(29,"Prompt cache"),ml(),Is(30,"dd"),UC(31),ml()()(),Is(32,"ds-form-actions")(33,"button",36),Eg("click",function(){mf(t);let s=fC(2);return yf(s.startEditing())}),UC(34,"Edit profile"),ml()(),Is(35,"ds-disclosure",37),Eg("toggled",function(){mf(t);let s=fC(2);return yf(s.toggleOverrides())}),Qw(36,De,2,0,"p",3)(37,Ie,2,0),ml();}if(o&2){let t=fC(),l=fC();KE(5),Lg(t.email),KE(4),Lg(t.externalId),KE(6),Lg(t.firstname||"\u2014"),KE(4),Lg(t.lastname||"\u2014"),KE(4),Lg(t.bio||"\u2014"),KE(4),Lg(t.preferredLanguage||"\u2014"),KE(4),Lg(l.promptCacheTtlLabel()),KE(4),pg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),KE(),Kw(l.recap().total===0?36:37);}}function Me(o,e){if(o&1){let t=aC();Is(0,"ds-group",4)(1,"ds-form-field",5)(2,"ds-segmented",6),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setThemeVariant(s))}),ml()(),Is(3,"ds-form-field",7)(4,"ds-segmented",8),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setTheme(s))}),ml()()(),Is(5,"ds-group",9)(6,"ds-form-field",10)(7,"ds-segmented",11),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setEnterKeyBehavior(s))}),ml()()(),Is(8,"ds-group",12)(9,"ds-form-field",13)(10,"ds-segmented",14),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setShowTechnical(s))}),ml()()(),Is(11,"ds-group",15)(12,"ds-form-field",16)(13,"input",17,0),Eg("change",function(){mf(t);let s=EC(14),m=fC();return yf(m.setIdeUrlTemplate(s.value))}),ml()()(),Qw(15,Te,31,5,"form",18)(16,Ne,38,10);}if(o&2){let t=fC();KE(),pg("hint",t.activeVariantDescription()),KE(),pg("options",t.themeVariantOptions)("value",t.themeVariant()),KE(),pg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),KE(),pg("options",t.modeOptions())("value",t.shownMode()),KE(3),pg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),KE(3),pg("options",t.showTechnicalOptions)("value",t.showTechnical()),KE(3),pg("value",t.ideUrlTemplate()),KE(2),Kw(t.isEditing()?15:16);}}function Fe(o,e){o&1&&(Is(0,"p",3),UC(1,"Unable to load profile."),ml());}var ye=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(K);isEditing=zi(false);isLoading=zi(false);isSaving=zi(false);isOverridesExpanded=zi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=yT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=yT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=yT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=yT(()=>m(this.themeVariant()).label);activeVariantDescription=yT(()=>m(this.themeVariant()).description);modeOptions=yT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=yT(()=>this.modeOverridden()?S(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];ideUrlTemplate=this.preferencesPort.ideUrlTemplate;languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];promptCacheTtlOptions=[{value:"STANDARD",label:"Standard"},{value:"EXTENDED",label:"Extended"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true}),promptCacheTtl:new Te$1("STANDARD",{nonNullable:true})});promptCacheTtlLabel=yT(()=>{let e=this.currentUser()?.promptCacheTtl??"STANDARD";return this.promptCacheTtlOptions.find(t=>t.value===e)?.label??e});recap=F(_y([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),N=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:N,total:s.length+m.length+N.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=yT(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){v(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !V(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}setIdeUrlTemplate(e){this.preferencesPort.setIdeUrlTemplate(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0,promptCacheTtl:this.form.controls.promptCacheTtl.value}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=zi(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??"",promptCacheTtl:e.promptCacheTtl??"STANDARD"});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["urlTemplateInput",""],["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],["heading","IDE links"],["label","IDE URL template","controlId","ide-url-template","hint","Opens a file in IntelliJ IDEA. {file} is the URL-encoded absolute path, {line} and {column} the position."],["dsControl","","id","ide-url-template","type","text",3,"change","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["label","Prompt cache","controlId","up-promptCacheTtl","hintId","up-promptCacheTtl-hint","hint","Extended keeps the conversation cached through longer pauses (Claude models via Requesty: 1 hour instead of 5 minutes; each cache write costs more). Other models keep their provider's default."],["dsControl","","id","up-promptCacheTtl","aria-describedby","up-promptCacheTtl-hint","formControlName","promptCacheTtl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Is(0,"ds-page",1),hg(1,"ds-section-header",2),Qw(2,xe,2,0,"p",3)(3,Me,17,12)(4,Fe,2,0,"p",3),ml()),t&2){let s;KE(2),Kw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,gn,hn,at,un,mn,ji,Ni],encapsulation:2})};export{ye as UserProfileComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-Bu0ccdr8.js';import {O}from'./chunk-JGTJHpTi.js';import {g,W,F,H as we,ag as U,ay as N,z as zi,az as Q,a8 as _,k as yT,a9 as F$1,aA as QB,aB as $e,M as U$1,a2 as ga,aa as _r,ac as Ny,ad as ne,P as x,O as w,x as xw,au as $t$1,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,aC as Sg,aD as DC,r as fC,s as aC,a as hg,T as VI,u as mf,w as yf,X as UI,c as xg,j as fg,q as Il,l as eC,t as tC,L as Lg,as as jg}from'./main-2UMSYJ2Z.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt$1,a as fd,M as Mo,D as Do,U as Ut$1,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-DJQT-u6K.js';import'./chunk-Cp8ULs7k.js';var D="*";function Ke(i){return (i??[]).some(t=>t.trim()===D)}function He(i){let t=(i??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D).map(e=>e.toLowerCase());return new Set(t)}function K(i){return i.includes(D)}function Qe(i){let t=i.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(i,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D&&K(e)).some(e=>Qe(e)?.test(i)??false)}var We="AGENTOS_CONFIG",Xe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Je(i){return i.configEnabled&&(i.hasSubAgents||i.integrationTypes.some(t=>Xe.has(t)))}var Ze=["instructionsTextarea"],Ye=(i,t)=>t.value,et=(i,t)=>t.config.id,tt=(i,t)=>t.type,ze=(i,t)=>t.selector;function nt(i,t){if(i&1&&(Is(0,"a",3),UC(1,"View resolved definition \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function it(i,t){i&1&&(Is(0,"ds-tag",4),UC(1,"Platform level"),ml());}function ot(i,t){i&1&&(Is(0,"p",5),UC(1,"Loading\u2026"),ml());}function at(i,t){if(i&1&&(hg(0,"input",18),VI()),i&2){let e=fC(2);pg("formControl",e.modelNameControl),UI();}}function lt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t;pg("ngValue",e.value),KE(),Lg(e.label);}}function rt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function st(i,t){if(i&1&&(Is(0,"optgroup",46),eC(1,rt,2,2,"option",45,Ye),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().aliases);}}function dt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function ct(i,t){if(i&1&&(Is(0,"optgroup",47),eC(1,dt,2,2,"option",45,Ye),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().apiNames);}}function ut(i,t){if(i&1&&(Is(0,"select",19)(1,"option",44),UC(2,"Select a model"),ml(),Qw(3,lt,2,2,"option",45),Qw(4,st,3,0,"optgroup",46),Qw(5,ct,3,0,"optgroup",47),ml(),VI()),i&2){let e,n=fC(2);pg("formControl",n.modelNameControl),UI(),KE(),pg("ngValue",null),KE(2),Kw((e=n.modelOptions().current)?3:-1,e),KE(),Kw(n.modelOptions().aliases.length>0?4:-1),KE(),Kw(n.modelOptions().apiNames.length>0?5:-1);}}function gt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.config.integrationType);}}function mt(i,t){if(i&1&&(hg(0,"input",49),VI()),i&2){let e=fC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),UI();}}function pt(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",27),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleIntegration(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,gt,2,1,"span",48),ml(),Qw(6,mt,1,2,"input",49),ml();}if(i&2){let e=t.$implicit;KE(2),pg("checked",e.enabled()),KE(2),Lg(e.config.name),KE(),Kw(e.config.integrationType?5:-1),KE(),Kw(e.enabled()?6:-1);}}function ft(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ct(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",28),UC(2),Is(3,"span",48),UC(4,"built-in"),ml()(),Is(5,"select",51),Eg("change",function(s){let u=mf(e).$implicit,C=fC(4);return yf(C.setBuiltInState(u,s.target.value))}),Is(6,"option",52),UC(7),ml(),Is(8,"option",53),UC(9,"Enabled"),ml(),Is(10,"option",54),UC(11,"Disabled"),ml()(),Qw(12,ft,2,1,"p",14),Is(13,"p",14),UC(14),ml()();}if(i&2){let e=t.$implicit,n=fC(4);KE(),fg("for","built-in-"+e.type),KE(),Il(" ",e.displayName," "),KE(3),pg("id","built-in-"+e.type)("value",e.state()),KE(2),Lg(n.builtInDefaultLabel(e)),KE(5),Kw(e.state()==="on"&&e.restrictedTools?12:-1),KE(2),Lg(e.description);}}function _t(i,t){if(i&1&&(Is(0,"span",50),UC(1,"Built-in integrations"),ml(),eC(2,Ct,15,7,"div",11,tt)),i&2){let e=fC(3);KE(2),tC(e.builtInRows());}}function bt(i,t){i&1&&(Is(0,"ds-notice",30),UC(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. "),ml());}function ht(i,t){if(i&1&&(Is(0,"ds-fieldset",25),eC(1,pt,7,4,"div",11,et),Qw(3,_t,4,0),Qw(4,bt,2,0,"ds-notice",30),ml()),i&2){let e=fC(2);KE(),tC(e.integrationRows()),KE(2),Kw(e.builtInRows().length>0?3:-1),KE(),Kw(e.configAgentExposureWarning()?4:-1);}}function yt(i,t){i&1&&UC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function xt(i,t){i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),ml());}function vt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function St(i,t){i&1&&(Is(0,"p",5),UC(1,"No skill available in this scope yet."),ml());}function At(i,t){i&1&&(Is(0,"span",48),UC(1,"platform"),ml());}function wt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Et(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.description);}}function Tt(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSkill(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,At,2,0,"span",48),Qw(6,wt,2,1,"span",48),ml(),Qw(7,Et,2,1,"p",14),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSkillsSelected()),KE(2),Lg(e.name),KE(),Kw(e.platform?5:-1),KE(),Kw(e.unresolved?6:-1),KE(),Kw(e.description?7:-1);}}function kt(i,t){if(i&1&&eC(0,Tt,8,6,"div",11,ze),i&2){let e=fC(2);tC(e.skillRows());}}function It(i,t){if(i&1&&(Is(0,"ds-form-field",34),hg(1,"textarea",56),VI(),Is(2,"p",5),UC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),UC(5,"AgentLoopPayload"),ml(),UC(6,". Leave empty if you always provide the payload at launch. "),ml()()),i&2){let e=fC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),KE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI();}}function Mt(i,t){i&1&&UC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Ft(i,t){if(i&1&&UC(0),i&2){let e=fC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Rt(i,t){if(i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),Qw(5,Ft,1,2),ml()),i&2){let e=fC(2);KE(5),Kw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Nt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function Dt(i,t){i&1&&(Is(0,"p",5),UC(1,"No other agent is available in this scope yet."),ml());}function Lt(i,t){i&1&&(Is(0,"span",48),UC(1,"pattern"),ml());}function Vt(i,t){i&1&&(Is(0,"span",48),UC(1,"via pattern"),ml());}function Pt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ot(i,t){if(i&1){let e=aC();Is(0,"button",59),Eg("click",function(){mf(e);let s=fC().$implicit,u=fC(3);return yf(u.removeSubAgent(s))}),UC(1," \xD7 "),ml();}if(i&2){let e=fC().$implicit;fg("aria-label","Remove "+e.selector);}}function Bt(i,t){if(i&1){let e=aC();Is(0,"div",36)(1,"label",57)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSubAgent(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,Lt,2,0,"span",48)(6,Vt,2,0,"span",48)(7,Pt,2,1,"span",48),ml(),Qw(8,Ot,2,1,"button",58),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSubAgentsSelected()),KE(2),Lg(e.name),KE(),Kw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),KE(3),Kw(e.unresolved?8:-1);}}function $t(i,t){if(i&1&&eC(0,Bt,9,5,"div",36,ze),i&2){let e=fC(2);tC(e.subAgentRows());}}function Ut(i,t){if(i&1){let e=aC();Is(0,"div")(1,"button",60),Eg("click",function(){mf(e);let s=fC(2);return yf(s.useDefaultDelegationTimeout())}),UC(2," Use server default "),ml()();}}function Gt(i,t){i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2&&(KE(),Lg(t));}function jt(i,t){if(i&1){let e=aC();Is(0,"button",61),Eg("click",function(){mf(e);let s=fC(2);return yf(s.exportYaml())}),UC(1),ml();}if(i&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Kt(i,t){if(i&1){let e=aC();Is(0,"form",7),Eg("ngSubmit",function(){mf(e);let s=fC();return yf(s.submit())}),Is(1,"ds-fieldset",8)(2,"ds-form-field",9),hg(3,"input",10),VI(),ml(),Is(4,"div",11)(5,"label",12),hg(6,"input",13),VI(),UC(7," Enabled "),ml(),Is(8,"p",14),UC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",15),hg(11,"input",16),VI(),ml(),Is(12,"ds-form-field",17),Qw(13,at,1,1,"input",18)(14,ut,6,5,"select",19),ml(),Is(15,"div",20)(16,"div",21)(17,"button",22),Eg("click",function(){mf(e);let s=fC();return yf(s.toggleInstructionsFullscreen())})("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),UC(18),ml()(),Is(19,"ds-form-field",23)(20,"textarea",24,0),Eg("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),ml(),VI(),ml()()(),Qw(22,ht,5,2,"ds-fieldset",25),Is(23,"ds-fieldset",26)(24,"p",5),UC(25," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(26,"code"),UC(27,"readSkill"),ml(),UC(28," and "),Is(29,"code"),UC(30,"readSkillResource"),ml(),UC(31," tools; selecting none grants neither. "),Qw(32,yt,1,0),ml(),Is(33,"label",12)(34,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSkills())}),ml(),Is(35,"span",28),UC(36,"Every skill in the catalogue ("),Is(37,"code",29),UC(38,"*"),ml(),UC(39,")"),ml()(),Is(40,"p",14),UC(41," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Qw(42,xt,5,0,"ds-notice",30),Qw(43,vt,2,0,"ds-notice"),Qw(44,St,2,0,"p",5)(45,kt,2,0),ml(),Is(46,"ds-form-field",31)(47,"select",32)(48,"option",33),UC(49,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(50,"option",33),UC(51,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(52,"option",33),UC(53,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),VI(),ml(),Qw(54,It,7,3,"ds-form-field",34),Is(55,"ds-fieldset",35)(56,"p",5),UC(57," The agents this one may delegate to. Selecting at least one grants it the "),Is(58,"code"),UC(59,"DELEGATE__delegate"),ml(),UC(60," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Qw(61,Mt,1,0),ml(),Is(62,"label",12)(63,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSubAgents())}),ml(),Is(64,"span",28),UC(65,"Every agent it can reach ("),Is(66,"code",29),UC(67,"*"),ml(),UC(68,")"),ml()(),Is(69,"p",14),UC(70," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Qw(71,Rt,6,1,"ds-notice",30),Qw(72,Nt,2,0,"ds-notice"),Qw(73,Dt,2,0,"p",5)(74,$t,2,0),Is(75,"p",5),UC(76," Advanced \u2014 add a glob instead of picking a name, for example "),Is(77,"code"),UC(78,"*Fixer"),ml(),UC(79," to cover BugFixer and StoryFixer. "),ml(),Is(80,"div",36)(81,"input",37),Eg("keydown.enter",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),ml(),VI(),Is(82,"button",38),Eg("click",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),UC(83," + "),ml()(),Is(84,"ds-form-field",39),hg(85,"input",40),VI(),Qw(86,Ut,3,0,"div"),ml()(),Qw(87,Gt,2,1,"ds-notice"),Is(88,"ds-form-actions")(89,"button",41),UC(90),ml(),Qw(91,jt,2,2,"button",42),Is(92,"button",43),Eg("click",function(){mf(e);let s=fC();return yf(s.cancel())}),UC(93,"Cancel"),ml()()();}if(i&2){let e,n=fC();pg("formGroup",n.form),KE(3),pg("formControl",n.nameControl),UI(),KE(3),pg("formControl",n.enabledControl),UI(),KE(5),pg("formControl",n.descriptionControl),UI(),KE(2),Kw(n.modelAsFreeText()?13:14),KE(2),xg("agent-config-instructions--fullscreen",n.instructionsFullscreen()),KE(2),fg("aria-pressed",n.instructionsFullscreen()),KE(),Il(" ",n.instructionsFullscreen()?"Exit full screen":"Full screen"," "),KE(),pg("hint",n.instructionsCounter())("error",n.instructionsError()),KE(),pg("formControl",n.instructionsControl),fg("aria-invalid",n.instructionsControl.invalid),UI(),KE(2),Kw(n.integrationRows().length>0||n.builtInRows().length>0?22:-1),KE(10),Kw(n.isPlatformMode?32:-1),KE(2),pg("checked",n.allSkillsSelected()),KE(8),Kw(n.namedSkillSelectionDropped()?42:-1),KE(),Kw(n.skillCatalogueUnavailable()?43:-1),KE(),Kw(n.skillRows().length===0?44:45),KE(3),pg("formControl",n.executionModeControl),UI(),KE(),pg("value",n.ExecutionMode.SIMPLE),KE(2),pg("value",n.ExecutionMode.ADVANCED),KE(2),pg("value",n.ExecutionMode.LOOP),KE(2),Kw(n.isLoopMode()?54:-1),KE(7),Kw(n.isPlatformMode?61:-1),KE(2),pg("checked",n.allSubAgentsSelected()),KE(8),Kw(n.namedSubAgentSelectionDropped()?71:-1),KE(),Kw(n.subAgentCandidatesUnavailable()?72:-1),KE(),Kw(n.subAgentRows().length===0?73:74),KE(8),pg("formControl",n.newSubAgentControl),UI(),KE(),pg("disabled",!n.newSubAgentControl.value.trim()),KE(2),pg("hint",n.delegationTimeoutHint())("error",n.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),KE(),pg("formControl",n.delegationTimeoutControl),fg("aria-invalid",n.delegationTimeoutControl.invalid),UI(),KE(),Kw(n.delegationTimeoutControl.value!==null?86:-1),KE(),Kw((e=n.submitError())?87:-1,e),KE(2),pg("disabled",n.form.invalid||n.isSubmitting()),KE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),KE(),Kw(n.isEditMode()?91:-1);}}var z=2e4,qe=class i$1{route=g(W);router=g(F);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,i$1.notBlankValidator]}),instructions:new Te(null,{validators:[bn.maxLength(z)]}),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:[i$1.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(n){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=yT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=yT(()=>this.executionModeValue()==="LOOP");static maxInstructionsLabel=z.toLocaleString("en-US");instructionsValue=F$1(this.form.controls.instructions.valueChanges,{initialValue:this.form.controls.instructions.value});instructionsLength=yT(()=>(this.instructionsValue()??"").length);instructionsCounter=yT(()=>`${this.instructionsLength().toLocaleString("en-US")} / ${i$1.maxInstructionsLabel} characters`);instructionsError=yT(()=>{let t=this.instructionsLength();return t<=z?null:`Instructions must not exceed ${i$1.maxInstructionsLabel} characters (currently ${t.toLocaleString("en-US")}).`});instructionsFullscreen=zi(false);instructionsTextarea=QB("instructionsTextarea");toggleInstructionsFullscreen(){this.instructionsFullscreen.update(t=>!t),this.instructionsTextarea()?.nativeElement.focus();}closeInstructionsFullscreen(){this.instructionsFullscreen()&&(this.instructionsFullscreen.set(false),this.instructionsTextarea()?.nativeElement.focus());}subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=yT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=yT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=yT(()=>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=$e;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=yT(()=>Je({configEnabled:this.builtInRows().some(t=>t.type===We&&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=yT(()=>{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=yT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(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),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),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:n,platformIntegrations:s,builtInTypes:u,skillCatalogue:C,delegationCandidates:T,models:k})=>{this.existingConfig=e,this.applyModelCatalogue(k,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 L=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(L,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(u,e.integrations??void 0)),this.allSubAgentsSelected.set(Ke(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(T,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){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),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:n,builtInTypes:s,skillCatalogue:u,delegationCandidates:C,models:T})=>{this.applyModelCatalogue(T,null);let k=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(k,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(u,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),u=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),T=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(u.has(f.name.toLowerCase()))})),k=new Set;for(let f of s){let L=l(f).toLowerCase();C.has(L)||k.has(L)||(k.add(L),T.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return T}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()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:n,namespace:s})=>[...n,...s]),ne(n=>n.map(s=>s.name).filter(s=>s.length>0)),ne(n=>i$1.dedupeByKey(n)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(n=>{let s=n.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,n){let s=He(e),u=n?.toLowerCase()??null,C=t.filter(_=>{let B=_.toLowerCase();return B!==u||s.has(B)}),T=new Set(C.map(_=>_.toLowerCase())),k=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,L=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==D);for(let _ of L){let B=_.toLowerCase();T.has(B)||f.has(B)||(f.add(B),k.push({selector:_,name:_,unresolved:true,pattern:K(_),grantedByPattern:false,selected:zi(true)}));}return k}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),_r([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",u=e?.[s],C=e!=null&&s in e,T=Array.isArray(u)?u.join(", "):"";return {config:n,enabled:zi(C),toolsControl:new Te(T,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,u=e?.[n.type],C=s?Array.isArray(u)&&u.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(u)&&u.length>0?u: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(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===D?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>this.withPatternGrants([...n,{selector:t,name:t,unresolved:true,pattern:K(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(n=>this.withPatternGrants(n.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(n=>n.selected()).map(n=>n.selector);return t.map(n=>n.unresolved?n:x(w({},n),{grantedByPattern:Y(n.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [D];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",u=n.toolsControl.value.trim();t[s]=u===""?null:u.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=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:n=>{this.isSubmitting.set(false),this.submitError.set(i$1.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;if(typeof n=="string"&&n.trim().length>0)return n;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 n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),u=document.createElement("a");u.href=s,u.download=`${this.existingConfig?.name??"agent"}.yaml`,u.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||i$1)};static \u0275cmp=xw({type:i$1,selectors:[["agentos-agent-config-form"]],viewQuery:function(e,n){e&1&&Sg(n.instructionsTextarea,Ze,5),e&2&&DC();},decls:8,vars:4,consts:[["instructionsTextarea",""],[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"],[1,"agent-config-instructions"],[1,"agent-config-instructions__toolbar"],["dsButton","","variant","ghost","type","button",3,"click","keydown.escape"],["label","Instructions","controlId","agent-config-instructions","hintId","agent-config-instructions-hint","errorId","agent-config-instructions-error",3,"hint","error"],["dsControl","","id","agent-config-instructions","rows","20","placeholder","Optional \u2014 system instructions for this agent","aria-describedby","agent-config-instructions-hint agent-config-instructions-error",3,"keydown.escape","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,n){e&1&&(Is(0,"ds-page")(1,"ds-section-header",1)(2,"button",2),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Agent configs "),ml(),Qw(4,nt,2,1,"a",3),Qw(5,it,2,0,"ds-tag",4),ml(),Qw(6,ot,2,0,"p",5)(7,Kt,94,40,"form",6),ml()),e&2&&(KE(),pg("title",n.isEditMode()?"Edit agent config":"New agent config"),KE(3),Kw(n.isEditMode()?4:-1),KE(),Kw(n.isPlatformMode?5:-1),KE(),Kw(n.isLoading()?6:7));},dependencies:[Kt$1,fd,Mo,Do,Ut$1,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t$1,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],styles:[".agent-config-instructions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.agent-config-instructions[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:24rem}.agent-config-instructions__toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;box-sizing:border-box;padding:1.5rem;background:var(--color-bg, #fff)}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] ds-form-field[_ngcontent-%COMP%]{flex:1;min-height:0}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{flex:1;min-height:0;resize:none}@media(max-width:760px){.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{padding:.75rem}}"]})};export{qe as AgentConfigFormComponent,z as MAX_INSTRUCTIONS_LENGTH};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {q as k,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-DJQT-u6K.js';import {g,W as W$1,F,H as we,ag as U$1,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,M as U$2,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-2UMSYJ2Z.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let t=fC();KE(),Lg(t.deletion.error());}}function z(n,e){n&1&&(Is(0,"p",4),UC(1,"Loading agent configs\u2026"),ml());}function G(n,e){n&1&&(Is(0,"p",5),UC(1,"No agent configs available."),ml());}function Q(n,e){n&1&&(Is(0,"p",4),UC(1,"No agent configs match the current filter."),ml());}function W(n,e){n&1&&(Is(0,"ds-tag",18),UC(1,"Read-only"),ml());}function X(n,e){if(n&1){let t=aC();Is(0,"button",22),Eg("click",function(){mf(t);let s=fC(2).$implicit,d=fC(2);return yf(d.launch(s))}),UC(1," Launch "),ml();}if(n&2){let t=fC(2).$implicit;fg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=aC();Is(0,"button",22),Eg("click",function(){mf(t);let s=fC(2).$implicit,d=fC(2);return yf(d.edit(s))}),UC(1," Edit "),ml();}if(n&2){let t=fC(2).$implicit;fg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=aC();Is(0,"button",22),Eg("click",function(){mf(t);let s=fC().$implicit,d=fC(2);return yf(d.inspect(s))}),UC(1," Inspect "),ml(),Qw(2,X,2,1,"button",23),Qw(3,Y,2,1,"button",23);}if(n&2){let t=fC().$implicit,i=fC(2);fg("aria-label","Inspect "+t.config.name),KE(2),Kw(i.canLaunch(t)?2:-1),KE(),Kw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=aC();Is(0,"agentos-row-delete-action",24),Eg("deleteRequested",function(){mf(t);let s=fC().$implicit,d=fC(2);return yf(d.deletion.request(s.key))})("deleteConfirmed",function(){mf(t);let s=fC().$implicit,d=fC(2);return yf(d.confirmDelete(s))})("deleteCancelled",function(){mf(t);let s=fC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let t=fC().$implicit,i=fC(2);pg("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14),UC(6),ml(),Is(7,"td",15)(8,"div",16)(9,"ds-tag",17),UC(10),ml(),Qw(11,W,2,0,"ds-tag",18),ml()(),Is(12,"td",19)(13,"div",20),Qw(14,Z,4,3),Qw(15,ee,1,3,"agentos-row-delete-action",21),ml()()()),n&2){let t=e.$implicit,i=fC(2);KE(2),Lg(t.config.name),KE(2),Il(" ",t.config.description||"\u2014"," "),KE(2),Lg(i.mode(t)),KE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),KE(),Lg(t.scope==="platform"?"Platform":"Namespace"),KE(),Kw(t.scope==="platform"?11:-1),KE(3),Kw(i.deletion.confirmingId()!==t.key?14:-1),KE(),Kw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Execution mode"),ml(),Is(10,"th",10),UC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,te,16,8,"tr",9,J),ml()()()),n&2){let t=fC();KE(16),tC(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(we);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(ga(()=>_r([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(d){return i.rowFilter.query.set(d)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New agent config"),ml()(),Qw(4,U,2,1,"p",3),Qw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a1 as ma,a2 as ga,aa as _r,aF as Jy}from'./main-2UMSYJ2Z.js';function i(t,o,p){return t.pipe(ma(()=>o().pipe(ga(()=>_r(p)))),Jy({bufferSize:1,refCount:true}))}export{i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-DJQT-u6K.js';import {g,H as we,W,J,z as zi,M as U,x as xw,I as Is,a as hg,S as Eg,Q as Qw,m as ml,T as VI,U as UC,K as KE,R as pg,b as Kw,X as UI,q as Il,a4 as Te$1,a5 as Ed,a6 as A,r as fC,s as aC,L as Lg,a7 as Ln,u as mf,w as yf,l as eC,t as tC}from'./main-2UMSYJ2Z.js';var I=class e{api=g(Te$1);isLoading=zi(false);result=zi(null);errorMessage=zi(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(Ed({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=A({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Is(0,"p",14),UC(1,"Loading namespaces\u2026"),ml());}function pe(e,t){if(e&1&&(Is(0,"option",17),UC(1),ml()),e&2){let n=t.$implicit;pg("value",n.id),KE(),Lg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),UC(2,"Select a namespace"),ml(),eC(3,pe,2,2,"option",17,de),ml(),VI()),e&2){let n=fC(2);UI(),KE(3),tC(n.namespaces());}}function ue(e,t){if(e&1&&Qw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=fC();Kw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&hg(0,"input",3),e&2){let n=fC();pg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let l=fC();return yf(l.reset())}),UC(1,"Clear result"),ml();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),UC(2),ml()()),e&2&&(KE(2),Lg(t));}function ye(e,t){e&1&&(Is(0,"span",21),UC(1,"Metadata"),ml(),Is(2,"pre",19),UC(3),ml()),e&2&&(KE(3),Lg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Type"),ml(),Is(2,"dd",23),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Message"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),UC(1,"Tool error details"),ml(),Is(2,"dl",22),Qw(3,Ce,4,1),Qw(4,_e,4,1),ml()),e&2){let n=fC();KE(3),Kw(n.errorType?3:-1),KE(),Kw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),UC(3),ml()(),Is(4,"span",21),UC(5,"Output"),ml(),Is(6,"pre",19),UC(7),ml(),Qw(8,ye,4,1),Is(9,"span",21),UC(10,"Structured output"),ml(),Is(11,"pre",19),UC(12),ml(),Qw(13,be,5,2),ml()),e&2){let n,o=t,l=fC();pg("heading","Result \u2014 "+o.toolName),KE(2),pg("variant",o.success?"accent":"outline"),KE(),Lg(o.success?"Success":"Tool error"),KE(4),Lg(o.output),KE(),Kw((n=l.formatMetadata(o.metadata))?8:-1,n),KE(4),Lg(l.formatStructuredOutput(o.structuredOutput)??"null"),KE(),Kw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=zi([]);namespacesLoading=zi(true);namespaceName=zi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Is(2,"form",1),Eg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Qw(4,ue,2,1)(5,fe,1,1,"input",3),ml(),Is(6,"ds-form-field",4),hg(7,"input",5),VI(),ml(),Is(8,"ds-form-field",6),hg(9,"input",7),VI(),ml(),Is(10,"ds-form-field",8),hg(11,"textarea",9),VI(),ml(),Is(12,"ds-form-actions")(13,"button",10),UC(14),ml(),Qw(15,ge,2,0,"button",11),ml()(),Qw(16,ve,3,1,"ds-card",12),Qw(17,he,14,7,"ds-card",13),ml()),n&2){let l,v;KE(),pg("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),KE(),pg("formGroup",o.form),KE(2),Kw(o.isPlatformMode?4:5),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),pg("disabled",o.form.invalid||o.state.isLoading()),KE(),Il(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),KE(),Kw(o.state.result()||o.state.errorMessage()?15:-1),KE(),Kw((l=o.state.errorMessage())?16:-1,l),KE(),Kw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
|