@whoz-oss/coday-client 0.0.0-workstream-forge.252 → 0.0.0-workstream-forge.253
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-7jUvxE8F.js → chunk-0rWkqE7F.js} +14 -14
- package/browser/{chunk-DjFydCPj.js → chunk-4QPnXZGI.js} +1 -1
- package/browser/{chunk-C0O3Eqof.js → chunk-6PgBoN-T.js} +1 -1
- package/browser/{chunk-SvfUCd0A.js → chunk-B8id5BCX.js} +1 -1
- package/browser/{chunk-CDT8qslW.js → chunk-B9auxcFn.js} +1 -1
- package/browser/{chunk-fxc_8ZX_.js → chunk-BFkNzGvf.js} +1 -1
- package/browser/{chunk-C2aFGVSn.js → chunk-BGLIJwXG.js} +1 -1
- package/browser/{chunk-CWGwIkyA.js → chunk-BHGXa4Jk.js} +1 -1
- package/browser/{chunk-Bl1r_e1F.js → chunk-BKdHqvrx.js} +1 -1
- package/browser/{chunk-DeaKTM3T.js → chunk-BNfS9gqG.js} +1 -1
- package/browser/{chunk-BA0W_yCm.js → chunk-BPiV6rjO.js} +1 -1
- package/browser/{chunk-CkH04L_E.js → chunk-BXxiZ-ch.js} +1 -1
- package/browser/{chunk-CNBYs6t8.js → chunk-Bl4JILoJ.js} +1 -1
- package/browser/{chunk-qWBNWkQK.js → chunk-Bm5g68MQ.js} +1 -1
- package/browser/{chunk-DhCxC7Gl.js → chunk-BrPYAXps.js} +1 -1
- package/browser/{chunk-uZ2Y3Ych.js → chunk-C9tesIt3.js} +1 -1
- package/browser/{chunk-B8qCpVGq.js → chunk-CF4gtYrV.js} +1 -1
- package/browser/{chunk-CYKSujxe.js → chunk-CIr1xkM7.js} +1 -1
- package/browser/{chunk-CklMXprZ.js → chunk-CSKtdDpE.js} +1 -1
- package/browser/{chunk-CYYD_3Vr.js → chunk-CUJxxcVR.js} +1 -1
- package/browser/{chunk-k-tWVPSJ.js → chunk-CfZRxQD1.js} +1 -1
- package/browser/{chunk-DxIgARQ4.js → chunk-Cn01h5n9.js} +1 -1
- package/browser/{chunk-JJlqZa2p.js → chunk-CxA_xqW_.js} +1 -1
- package/browser/{chunk-C-OvQKFa.js → chunk-D4PKaYXM.js} +1 -1
- package/browser/{chunk-BQdF-isH.js → chunk-D4eJc3W1.js} +1 -1
- package/browser/{chunk-F7rfSSxt.js → chunk-D7g02i9Y.js} +1 -1
- package/browser/{chunk-D-3dhk2F.js → chunk-D7hL0BBZ.js} +1 -1
- package/browser/{chunk-B-EYVKME.js → chunk-DI92LX4c.js} +1 -1
- package/browser/{chunk-Ce_VtAp4.js → chunk-Dm-C0-9-.js} +1 -1
- package/browser/{chunk-0PGnFUES.js → chunk-DoX_Nvew.js} +1 -1
- package/browser/{chunk-DQJE-N1a.js → chunk-DvRawlbU.js} +1 -1
- package/browser/{chunk-B04JLnyV.js → chunk-Dwf5lQGo.js} +1 -1
- package/browser/{chunk-Bb_4LQTi.js → chunk-FWD9NFbg.js} +1 -1
- package/browser/{chunk-CEqneXgA.js → chunk-HtmwgODm.js} +1 -1
- package/browser/{chunk-CwrNUco6.js → chunk-IHekMYOY.js} +1 -1
- package/browser/{chunk-ixyF_QjT.js → chunk-N28VXTjy.js} +1 -1
- package/browser/{chunk-CIY43vEB.js → chunk-OblIjDXe.js} +1 -1
- package/browser/{chunk-Dp9KXF16.js → chunk-POnNwWp0.js} +1 -1
- package/browser/{chunk-IHPi4qHF.js → chunk-ROlDzTu9.js} +1 -1
- package/browser/{chunk-BCdQDAxq.js → chunk-TphGc3H4.js} +1 -1
- package/browser/{chunk-h4AUp61g.js → chunk-UDd9uaqS.js} +1 -1
- package/browser/{chunk-C9gXeaxT.js → chunk-_oXbiQ1y.js} +1 -1
- package/browser/{chunk-CB4cyWpw.js → chunk-a5BmxDG0.js} +1 -1
- package/browser/{chunk-NXB--tnM.js → chunk-aycY_ip-.js} +1 -1
- package/browser/chunk-m1ylN0EP.js +1 -0
- package/browser/{chunk-DDD9qfze.js → chunk-nTODHMVM.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-VAVXYALE.js → main-PZMWRMRC.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-D3iYEK2Q.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-CEqneXgA.js';import {I,n as nt,i as it}from'./chunk-BQdF-isH.js';import {g,W,t as F,K as we,$ as $i,a9 as F$1,o as oT,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,q as $w,ao as Uw,S as NI,f as fg,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,n as lg,w as pf,x as hf}from'./main-VAVXYALE.js';import {T as Te,g as gn,p as pt,b as hn,c as fn,u as un,o as dn,d as cn,e as at,i as sn,t as an,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,x as ya,a as po,h as ho,A as An,O as On}from'./chunk-7jUvxE8F.js';import'./chunk-D3iYEK2Q.js';function Ce(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ye(i,t){if(i&1&&(Es(0,"label",16),fg(1,"input",17),NI(),AC(2),hl()),i&2){let e=t.$implicit,n=tC(3);VE(),dg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),AI(),VE(),Dl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Es(0,"ds-fieldset",5),$w(1,ye,3,4,"label",16,Lw().trackByScope,true),hl()),i&2){let e=tC(2);dg("disabled",e.isEditMode()),VE(),zw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Es(0,"option",8),AC(1),hl()),i&2){let e=t.$implicit,n=tC(2);dg("value",e),VE(),Fg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Es(0,"ds-form-field",18),fg(1,"input",19),NI(),hl()),i&2){let e=tC().$implicit;dg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),VE(),dg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),lg("aria-describedby",e.hint?"as-hint-"+e.key:null),AI();}}function Ae(i,t){if(i&1&&Bw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=tC(3);Vw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Es(0,"ds-fieldset",13),$w(1,Ae,1,1,null,null,Lw().trackByField,true),hl()),i&2){let e=tC(2);dg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),VE(),zw(e.credentialFields());}}function be(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let o=tC();return hf(o.submit())}),Bw(1,ge,3,1,"ds-fieldset",5),Es(2,"ds-form-field",6)(3,"select",7),$w(4,fe,2,2,"option",8,Uw),hl(),NI(),hl(),Es(6,"ds-form-field",9),fg(7,"input",10),NI(),hl(),Es(8,"ds-form-field",11),fg(9,"input",12),NI(),hl(),Bw(10,ve,3,1,"ds-fieldset",13),Es(11,"ds-form-actions")(12,"button",14),AC(13),hl(),Es(14,"button",15),vg("click",function(){pf(e);let o=tC();return hf(o.cancel())}),AC(15,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(),Vw(e.isPlatformMode?-1:1),VE(2),dg("formControl",e.authTypeControl),AI(),VE(),zw(e.authTypeOptions),VE(3),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(),Vw(e.credentialFields().length>0?10:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?$i(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=nt;authTypeLabel=it;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[gn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=oT(()=>_e[this.selectedAuthType()]);isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Of(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return n.cancel()}),AC(3," \u2190 Auth settings "),hl()(),Bw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),hl()),e&2&&(VE(),dg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),VE(3),Vw(n.isLoading()?4:5));},dependencies:[hn,fn,un,dn,cn,at,sn,an,qt,md,Co,Mo,Ht,Ut,ya,po,ho,An,On],encapsulation:2})};
|
|
1
|
+
import {v}from'./chunk-HtmwgODm.js';import {I,n as nt,i as it}from'./chunk-D4eJc3W1.js';import {g,W,t as F,K as we,$ as $i,a9 as F$1,o as oT,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,q as $w,ao as Uw,S as NI,f as fg,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,n as lg,w as pf,x as hf}from'./main-PZMWRMRC.js';import {T as Te,g as gn,p as pt,b as hn,c as fn,u as un,o as dn,d as cn,e as at,i as sn,t as an,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,x as ya,a as po,h as ho,A as An,O as On}from'./chunk-0rWkqE7F.js';import'./chunk-m1ylN0EP.js';function Ce(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ye(i,t){if(i&1&&(Es(0,"label",16),fg(1,"input",17),NI(),AC(2),hl()),i&2){let e=t.$implicit,n=tC(3);VE(),dg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),AI(),VE(),Dl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Es(0,"ds-fieldset",5),$w(1,ye,3,4,"label",16,Lw().trackByScope,true),hl()),i&2){let e=tC(2);dg("disabled",e.isEditMode()),VE(),zw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Es(0,"option",8),AC(1),hl()),i&2){let e=t.$implicit,n=tC(2);dg("value",e),VE(),Fg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Es(0,"ds-form-field",18),fg(1,"input",19),NI(),hl()),i&2){let e=tC().$implicit;dg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),VE(),dg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),lg("aria-describedby",e.hint?"as-hint-"+e.key:null),AI();}}function Ae(i,t){if(i&1&&Bw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=tC(3);Vw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Es(0,"ds-fieldset",13),$w(1,Ae,1,1,null,null,Lw().trackByField,true),hl()),i&2){let e=tC(2);dg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),VE(),zw(e.credentialFields());}}function be(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let o=tC();return hf(o.submit())}),Bw(1,ge,3,1,"ds-fieldset",5),Es(2,"ds-form-field",6)(3,"select",7),$w(4,fe,2,2,"option",8,Uw),hl(),NI(),hl(),Es(6,"ds-form-field",9),fg(7,"input",10),NI(),hl(),Es(8,"ds-form-field",11),fg(9,"input",12),NI(),hl(),Bw(10,ve,3,1,"ds-fieldset",13),Es(11,"ds-form-actions")(12,"button",14),AC(13),hl(),Es(14,"button",15),vg("click",function(){pf(e);let o=tC();return hf(o.cancel())}),AC(15,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(),Vw(e.isPlatformMode?-1:1),VE(2),dg("formControl",e.authTypeControl),AI(),VE(),zw(e.authTypeOptions),VE(3),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(),Vw(e.credentialFields().length>0?10:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?$i(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=nt;authTypeLabel=it;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[gn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=oT(()=>_e[this.selectedAuthType()]);isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Of(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return n.cancel()}),AC(3," \u2190 Auth settings "),hl()(),Bw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),hl()),e&2&&(VE(),dg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),VE(3),Vw(n.isLoading()?4:5));},dependencies:[hn,fn,un,dn,cn,at,sn,an,qt,md,Co,Mo,Ht,Ut,ya,po,ho,An,On],encapsulation:2})};
|
|
2
2
|
export{me as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,aJ as fe,a6 as x}from'./main-
|
|
1
|
+
import {g,aJ as fe,a6 as x}from'./main-PZMWRMRC.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,W as W$1,t as F,K as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U as U$2,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function z(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading agent configs\u2026"),hl());}function G(n,e){n&1&&(Es(0,"p",5),AC(1,"No agent configs available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),AC(1,"No agent configs match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(2).$implicit,d=tC(2);return hf(d.launch(s))}),AC(1," Launch "),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(2).$implicit,d=tC(2);return hf(d.edit(s))}),AC(1," Edit "),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC().$implicit,d=tC(2);return hf(d.inspect(s))}),AC(1," Inspect "),hl(),Bw(2,X,2,1,"button",23),Bw(3,Y,2,1,"button",23);}if(n&2){let t=tC().$implicit,i=tC(2);lg("aria-label","Inspect "+t.config.name),VE(2),Vw(i.canLaunch(t)?2:-1),VE(),Vw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(t);let s=tC().$implicit,d=tC(2);return hf(d.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC().$implicit,d=tC(2);return hf(d.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,i=tC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),AC(10),hl(),Bw(11,W,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),Bw(14,Z,4,3),Bw(15,ee,1,3,"agentos-row-delete-action",21),hl()()()),n&2){let t=e.$implicit,i=tC(2);VE(2),Fg(t.config.name),VE(2),Dl(" ",t.config.description||"\u2014"," "),VE(2),Fg(i.mode(t)),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?11:-1),VE(3),Vw(i.deletion.confirmingId()!==t.key?14:-1),VE(),Vw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Execution mode"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,te,16,8,"tr",9,J),hl()()()),n&2){let t=tC();VE(16),zw(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 Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(ha(()=>br([])))}))));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=Dw({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&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(d){return i.rowFilter.query.set(d)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New agent config"),hl()(),Bw(4,U,2,1,"p",3),Bw(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&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-Bl1r_e1F.js';import {I}from'./chunk-BQdF-isH.js';import {O}from'./chunk-CIY43vEB.js';import {g,K as we$1,$ as $i,o as oT,a9 as F,at as Cy,ad as ne,U,D as Dw,E as Es,f as fg,a as Bw,c as hl,d as VE,i as Vw,b as AC,Q as Qw,R as vg,v as tC,P as dg,S as NI,q as $w,F as Fg,T as AI,z as zw,u as Dl,ae as Lw,w as pf,x as hf,N as x,L as w}from'./main-VAVXYALE.js';import {y,R as k,V as B,X as a,p as pt,T as Te$1,$ as v,a0 as V,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,a as po,h as ho,O as On,w as wa,b as hn,c as fn,u as un,a1 as mn,d as cn,e as at,i as sn,n as ln,a2 as Ni,J as Pi,a3 as m,a4 as S}from'./chunk-7jUvxE8F.js';import'./chunk-D3iYEK2Q.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function xe(o,e){if(o&1&&(Es(0,"option",27),AC(1),hl()),o&2){let t=e.$implicit;dg("value",t.value),VE(),Fg(t.label);}}function Se(o,e){if(o&1){let t=Qw();Es(0,"form",15),vg("ngSubmit",function(){pf(t);let s=tC(2);return hf(s.save())}),Es(1,"ds-group",16)(2,"dl",17)(3,"dt"),AC(4,"Email"),hl(),Es(5,"dd"),AC(6),hl(),Es(7,"dt"),AC(8,"External ID"),hl(),Es(9,"dd"),AC(10),hl()()(),Es(11,"ds-group",18)(12,"ds-form-field",19),fg(13,"input",20),NI(),hl(),Es(14,"ds-form-field",21),fg(15,"input",22),NI(),hl(),Es(16,"ds-form-field",23),fg(17,"textarea",24),NI(),hl(),Es(18,"ds-form-field",25)(19,"select",26),$w(20,xe,2,2,"option",27,ye),hl(),NI(),hl()(),Es(22,"ds-form-actions")(23,"button",28),AC(24),hl(),Es(25,"button",29),vg("click",function(){pf(t);let s=tC(2);return hf(s.cancelEditing())}),AC(26,"Cancel"),hl()()();}if(o&2){let t=tC(),l=tC();dg("formGroup",l.form),VE(6),Fg(t.email),VE(4),Fg(t.externalId),VE(3),AI(),VE(2),AI(),VE(2),AI(),VE(2),AI(),VE(),zw(l.languageOptions),VE(3),dg("disabled",l.isSaving()),VE(),Dl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Es(0,"p",2),AC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),hl());}function Pe(o,e){if(o&1){let t=Qw();Es(0,"span",38),AC(1,"Delete?"),hl(),Es(2,"button",39),vg("click",function(){pf(t);let s=tC().$implicit,m=tC(5);return hf(m.confirmDelete(s))}),AC(3,"Confirm"),hl(),Es(4,"button",40),vg("click",function(){pf(t);let s=tC(6);return hf(s.cancelDelete())}),AC(5,"Cancel"),hl();}}function Te(o,e){if(o&1){let t=Qw();Es(0,"button",40),vg("click",function(){pf(t);let s=tC().$implicit,m=tC(5);return hf(m.armDelete(s))}),AC(1,"Delete"),hl();}}function De(o,e){if(o&1&&(Es(0,"li",34)(1,"span",35),AC(2),hl(),Es(3,"span",36),AC(4),hl(),Bw(5,Pe,6,0)(6,Te,2,0,"button",37),hl()),o&2){let t=e.$implicit,l=tC(5);VE(2),Fg(t.name),VE(2),Fg(t.subtitle),VE(),Vw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Es(0,"span",32),AC(1),hl(),Es(2,"ul",33),$w(3,De,7,3,"li",34,Lw().trackEntry,true),hl()),o&2){let t=e.$implicit;VE(),Fg(t.title),VE(2),zw(t.entries);}}function Ve(o,e){if(o&1&&$w(0,we,5,1,null,null,Ce),o&2){let t=tC(3);zw(t.recapSections());}}function Ue(o,e){if(o&1){let t=Qw();Es(0,"ds-group",16)(1,"dl",17)(2,"dt"),AC(3,"Email"),hl(),Es(4,"dd"),AC(5),hl(),Es(6,"dt"),AC(7,"External ID"),hl(),Es(8,"dd"),AC(9),hl()()(),Es(10,"ds-group",18)(11,"dl",17)(12,"dt"),AC(13,"First name"),hl(),Es(14,"dd"),AC(15),hl(),Es(16,"dt"),AC(17,"Last name"),hl(),Es(18,"dd"),AC(19),hl(),Es(20,"dt"),AC(21,"Bio"),hl(),Es(22,"dd"),AC(23),hl(),Es(24,"dt"),AC(25,"Language"),hl(),Es(26,"dd"),AC(27),hl()()(),Es(28,"ds-form-actions")(29,"button",30),vg("click",function(){pf(t);let s=tC(2);return hf(s.startEditing())}),AC(30,"Edit profile"),hl()(),Es(31,"ds-disclosure",31),vg("toggled",function(){pf(t);let s=tC(2);return hf(s.toggleOverrides())}),Bw(32,Ee,2,0,"p",2)(33,Ve,2,0),hl();}if(o&2){let t=tC(),l=tC();VE(5),Fg(t.email),VE(4),Fg(t.externalId),VE(6),Fg(t.firstname||"\u2014"),VE(4),Fg(t.lastname||"\u2014"),VE(4),Fg(t.bio||"\u2014"),VE(4),Fg(t.preferredLanguage||"\u2014"),VE(4),dg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),VE(),Vw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=Qw();Es(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setThemeVariant(s))}),hl()(),Es(3,"ds-form-field",6)(4,"ds-segmented",7),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setTheme(s))}),hl()()(),Es(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setEnterKeyBehavior(s))}),hl()()(),Es(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setShowTechnical(s))}),hl()()(),Bw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=tC();VE(),dg("hint",t.activeVariantDescription()),VE(),dg("options",t.themeVariantOptions)("value",t.themeVariant()),VE(),dg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),VE(),dg("options",t.modeOptions())("value",t.shownMode()),VE(3),dg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),VE(3),dg("options",t.showTechnicalOptions)("value",t.showTechnical()),VE(),Vw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Es(0,"p",2),AC(1,"Unable to load profile."),hl());}var ve=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=$i(false);isLoading=$i(false);isSaving=$i(false);isOverridesExpanded=$i(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=oT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=oT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=oT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=oT(()=>m(this.themeVariant()).label);activeVariantDescription=oT(()=>m(this.themeVariant()).description);modeOptions=oT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=oT(()=>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"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(Cy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=oT(()=>{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);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=$i(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Dw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),hl()),t&2){let s;VE(2),Vw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[qt,md,Co,Mo,Ht,Ut,po,ho,On,wa,hn,fn,un,mn,cn,at,sn,ln,Ni,Pi],encapsulation:2})};export{ve as UserProfileComponent};
|
|
1
|
+
import {O as O$1}from'./chunk-BKdHqvrx.js';import {I}from'./chunk-D4eJc3W1.js';import {O}from'./chunk-OblIjDXe.js';import {g,K as we$1,$ as $i,o as oT,a9 as F,at as Cy,ad as ne,U,D as Dw,E as Es,f as fg,a as Bw,c as hl,d as VE,i as Vw,b as AC,Q as Qw,R as vg,v as tC,P as dg,S as NI,q as $w,F as Fg,T as AI,z as zw,u as Dl,ae as Lw,w as pf,x as hf,N as x,L as w}from'./main-PZMWRMRC.js';import {y,R as k,V as B,X as a,p as pt,T as Te$1,$ as v,a0 as V,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,a as po,h as ho,O as On,w as wa,b as hn,c as fn,u as un,a1 as mn,d as cn,e as at,i as sn,n as ln,a2 as Ni,J as Pi,a3 as m,a4 as S}from'./chunk-0rWkqE7F.js';import'./chunk-m1ylN0EP.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function xe(o,e){if(o&1&&(Es(0,"option",27),AC(1),hl()),o&2){let t=e.$implicit;dg("value",t.value),VE(),Fg(t.label);}}function Se(o,e){if(o&1){let t=Qw();Es(0,"form",15),vg("ngSubmit",function(){pf(t);let s=tC(2);return hf(s.save())}),Es(1,"ds-group",16)(2,"dl",17)(3,"dt"),AC(4,"Email"),hl(),Es(5,"dd"),AC(6),hl(),Es(7,"dt"),AC(8,"External ID"),hl(),Es(9,"dd"),AC(10),hl()()(),Es(11,"ds-group",18)(12,"ds-form-field",19),fg(13,"input",20),NI(),hl(),Es(14,"ds-form-field",21),fg(15,"input",22),NI(),hl(),Es(16,"ds-form-field",23),fg(17,"textarea",24),NI(),hl(),Es(18,"ds-form-field",25)(19,"select",26),$w(20,xe,2,2,"option",27,ye),hl(),NI(),hl()(),Es(22,"ds-form-actions")(23,"button",28),AC(24),hl(),Es(25,"button",29),vg("click",function(){pf(t);let s=tC(2);return hf(s.cancelEditing())}),AC(26,"Cancel"),hl()()();}if(o&2){let t=tC(),l=tC();dg("formGroup",l.form),VE(6),Fg(t.email),VE(4),Fg(t.externalId),VE(3),AI(),VE(2),AI(),VE(2),AI(),VE(2),AI(),VE(),zw(l.languageOptions),VE(3),dg("disabled",l.isSaving()),VE(),Dl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Es(0,"p",2),AC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),hl());}function Pe(o,e){if(o&1){let t=Qw();Es(0,"span",38),AC(1,"Delete?"),hl(),Es(2,"button",39),vg("click",function(){pf(t);let s=tC().$implicit,m=tC(5);return hf(m.confirmDelete(s))}),AC(3,"Confirm"),hl(),Es(4,"button",40),vg("click",function(){pf(t);let s=tC(6);return hf(s.cancelDelete())}),AC(5,"Cancel"),hl();}}function Te(o,e){if(o&1){let t=Qw();Es(0,"button",40),vg("click",function(){pf(t);let s=tC().$implicit,m=tC(5);return hf(m.armDelete(s))}),AC(1,"Delete"),hl();}}function De(o,e){if(o&1&&(Es(0,"li",34)(1,"span",35),AC(2),hl(),Es(3,"span",36),AC(4),hl(),Bw(5,Pe,6,0)(6,Te,2,0,"button",37),hl()),o&2){let t=e.$implicit,l=tC(5);VE(2),Fg(t.name),VE(2),Fg(t.subtitle),VE(),Vw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Es(0,"span",32),AC(1),hl(),Es(2,"ul",33),$w(3,De,7,3,"li",34,Lw().trackEntry,true),hl()),o&2){let t=e.$implicit;VE(),Fg(t.title),VE(2),zw(t.entries);}}function Ve(o,e){if(o&1&&$w(0,we,5,1,null,null,Ce),o&2){let t=tC(3);zw(t.recapSections());}}function Ue(o,e){if(o&1){let t=Qw();Es(0,"ds-group",16)(1,"dl",17)(2,"dt"),AC(3,"Email"),hl(),Es(4,"dd"),AC(5),hl(),Es(6,"dt"),AC(7,"External ID"),hl(),Es(8,"dd"),AC(9),hl()()(),Es(10,"ds-group",18)(11,"dl",17)(12,"dt"),AC(13,"First name"),hl(),Es(14,"dd"),AC(15),hl(),Es(16,"dt"),AC(17,"Last name"),hl(),Es(18,"dd"),AC(19),hl(),Es(20,"dt"),AC(21,"Bio"),hl(),Es(22,"dd"),AC(23),hl(),Es(24,"dt"),AC(25,"Language"),hl(),Es(26,"dd"),AC(27),hl()()(),Es(28,"ds-form-actions")(29,"button",30),vg("click",function(){pf(t);let s=tC(2);return hf(s.startEditing())}),AC(30,"Edit profile"),hl()(),Es(31,"ds-disclosure",31),vg("toggled",function(){pf(t);let s=tC(2);return hf(s.toggleOverrides())}),Bw(32,Ee,2,0,"p",2)(33,Ve,2,0),hl();}if(o&2){let t=tC(),l=tC();VE(5),Fg(t.email),VE(4),Fg(t.externalId),VE(6),Fg(t.firstname||"\u2014"),VE(4),Fg(t.lastname||"\u2014"),VE(4),Fg(t.bio||"\u2014"),VE(4),Fg(t.preferredLanguage||"\u2014"),VE(4),dg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),VE(),Vw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=Qw();Es(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setThemeVariant(s))}),hl()(),Es(3,"ds-form-field",6)(4,"ds-segmented",7),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setTheme(s))}),hl()()(),Es(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setEnterKeyBehavior(s))}),hl()()(),Es(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),vg("valueChange",function(s){pf(t);let m=tC();return hf(m.setShowTechnical(s))}),hl()()(),Bw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=tC();VE(),dg("hint",t.activeVariantDescription()),VE(),dg("options",t.themeVariantOptions)("value",t.themeVariant()),VE(),dg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),VE(),dg("options",t.modeOptions())("value",t.shownMode()),VE(3),dg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),VE(3),dg("options",t.showTechnicalOptions)("value",t.showTechnical()),VE(),Vw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Es(0,"p",2),AC(1,"Unable to load profile."),hl());}var ve=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=$i(false);isLoading=$i(false);isSaving=$i(false);isOverridesExpanded=$i(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=oT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=oT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=oT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=oT(()=>m(this.themeVariant()).label);activeVariantDescription=oT(()=>m(this.themeVariant()).description);modeOptions=oT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=oT(()=>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"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(Cy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=oT(()=>{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);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=$i(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Dw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),hl()),t&2){let s;VE(2),Vw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[qt,md,Co,Mo,Ht,Ut,po,ho,On,wa,hn,fn,un,mn,cn,at,sn,ln,Ni,Pi],encapsulation:2})};export{ve as UserProfileComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {y}from'./chunk-
|
|
1
|
+
import {y}from'./chunk-0rWkqE7F.js';import {g,aB as ie,aC as T,aa as br,a1 as ga,ad as ne,a2 as ha,aD as $y,a6 as x}from'./main-PZMWRMRC.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(ga(a=>a?a.isAdmin?br(true):this.membership.getMembersNamespaceMembership(e).pipe(ne(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),ha(()=>br(false))):br(false)),$y({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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-HtmwgODm.js';import {O}from'./chunk-OblIjDXe.js';import {g,W as W$1,t as F,K as we,I as J,$ as $i,U as U$1,ad as ne$1,a1 as ga,aa as br,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,P as dg,d as VE,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,n as lg,w as pf,x as hf}from'./main-PZMWRMRC.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import'./chunk-m1ylN0EP.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function X(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading integrations\u2026"),hl());}function Z(n,e){n&1&&(Es(0,"p",5),AC(1,"No integrations available."),hl());}function ee(n,e){n&1&&(Es(0,"p",4),AC(1,"No integrations match the current filter."),hl());}function te(n,e){n&1&&(Es(0,"ds-tag",20),AC(1,"YAML"),hl(),Es(2,"ds-tag",21),AC(3,"Read-only"),hl());}function ne(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC().$implicit,c=tC(2);return hf(c.view(s))}),AC(1,"View"),hl();}if(n&2){let t=tC().$implicit;lg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(3).$implicit,c=tC(2);return hf(c.edit(s))}),AC(1," Edit "),hl();}if(n&2){let t=tC(3).$implicit;lg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(2).$implicit,c=tC(2);return hf(c.duplicate(s))}),AC(1," Duplicate "),hl(),Bw(2,ie,2,1,"button",19);}if(n&2){let t=tC(2).$implicit;lg("aria-label","Duplicate "+t.config.name),VE(2),Vw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",25),vg("deleteRequested",function(){pf(t);let s=tC(2).$implicit,c=tC(2);return hf(c.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC(2).$implicit,c=tC(2);return hf(c.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(4);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=tC(2).$implicit,a=tC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Es(0,"button",24),AC(1,"Inherited"),hl());}function le(n,e){if(n&1&&(Bw(0,oe,3,2),Bw(1,ae,1,3,"agentos-row-delete-action",23),Bw(2,re,2,0,"button",24)),n&2){let t=tC().$implicit,a=tC(2);Vw(a.deletion.confirmingId()!==t.key?0:-1),VE(),Vw(t.canDelete?1:-1),VE(),Vw(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),AC(8),hl(),Bw(9,te,4,0),hl()(),Es(10,"td",17)(11,"div",18),Bw(12,ne,2,1,"button",19)(13,le,3,3),hl()()()),n&2){let t=e.$implicit;VE(2),Fg(t.config.name),VE(2),Dl(" ",t.config.integrationType," "),VE(3),dg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),VE(),Dl(" ",t.scopeLabel," "),VE(),Vw(t.source==="FILESYSTEM"?9:-1),VE(3),Vw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Type"),hl(),Es(8,"th",10),AC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,se,14,6,"tr",9,Q),hl()()()),n&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceApi=g(J);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=$i("this namespace");isAdmin=$i(false);isLoading=$i(true);rows=$i([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=Dw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\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","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),AC(3,"New integration"),hl()(),Bw(4,W,2,1,"p",3),Bw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(dg("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),VE(),dg("query",a.rowFilter.query()),VE(3),Vw(a.deletion.error()?4:-1),VE(),Vw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,aK as ue,a6 as x}from'./main-
|
|
1
|
+
import {g,aK as ue,a6 as x}from'./main-PZMWRMRC.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-m1ylN0EP.js';import {y}from'./chunk-0rWkqE7F.js';import {g,af as G,aI as Pe,Z as Tr,at as Cy,a1 as ga,a2 as ha,aa as br,ad as ne,aD as $y,a5 as vd,a6 as x}from'./main-PZMWRMRC.js';var u=s=>s,N="none",w="me",O=class s{nsController=g(G);exportService=g(Pe);userState=g(y);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Cy([this.namespaceId$,this.refresh$]).pipe(ga(([e])=>{let n=this.loadPlatformConfigs().pipe(ha(()=>br([]))),t=this.loadUserConfigs("global").pipe(ha(()=>br([])));return e?Cy([n,this.loadNamespaceConfigs(e).pipe(ha(()=>br([]))),this.loadUserConfigs(e).pipe(ha(()=>br([]))),t]).pipe(ne(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):Cy([n,t]).pipe(ne(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),$y({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):br([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(vd(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(vd(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(vd(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(vd(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(vd(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k$1,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k$1,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,W as W$1,t as F,K as we,aq as k,ap as F$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function W(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading AI models\u2026"),hl());}function X(i,e){i&1&&(Es(0,"p",5),AC(1,"No AI models configured."),hl());}function Y(i,e){i&1&&(Es(0,"p",4),AC(1,"No AI models match the current filter."),hl());}function Z(i,e){i&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function ee(i,e){if(i&1){let t=Qw();Es(0,"button",24),vg("click",function(){pf(t);let s=tC(2).$implicit,m=tC(2);return hf(m.edit(s))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit,n=tC(2);lg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Qw();Bw(0,ee,2,1,"button",22),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,n=tC(2);Vw(n.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Es(0,"button",21),AC(1,"Inherited"),hl());}function ne(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),AC(10),hl(),Bw(11,Z,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),Bw(14,te,2,4)(15,ie,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,n=tC(2);VE(2),Fg(n.title(t)),VE(2),Fg(t.providerName),VE(2),Dl(" ",t.model.apiModelName," "),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?11:-1),VE(3),Vw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Provider"),hl(),Es(8,"th",10),AC(9,"API model name"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ne,16,7,"tr",9,G),hl()()()),i&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k$1();rows=$i([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ha(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(ga(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return by({namespace:br(e),platform:br(t),providers:br(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(ha(()=>br([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["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","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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,n){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return n.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),AC(3,"New AI model"),hl()(),Bw(4,Q,2,1,"p",3),Bw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(VE(),dg("query",n.rowFilter.query()),VE(3),Vw(n.deletion.error()?4:-1),VE(),Vw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k,j as O$1,e as at,c as fn,k as ko,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k,j as O$1,e as at,c as fn,k as ko,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,t as F,K as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,U as U$2,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function K(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading agent configs\u2026"),hl());}function H(n,e){n&1&&(Es(0,"p",5),AC(1,"No platform agent configs defined yet."),hl());}function U(n,e){n&1&&(Es(0,"p",4),AC(1,"No agent configs match the current filter."),hl());}function z(n,e){if(n&1){let t=Qw();Es(0,"button",19),vg("click",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.inspect(d))}),AC(1," Inspect "),hl(),Es(2,"button",19),vg("click",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.edit(d))}),AC(3,"Edit"),hl();}if(n&2){let t=tC().$implicit;lg("aria-label","Inspect "+t.name),VE(2),lg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",20),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,a=tC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15),AC(8),hl(),Es(9,"td",16)(10,"div",17),Bw(11,z,4,2),Bw(12,G,1,3,"agentos-row-delete-action",18),hl()()()),n&2){let t=e.$implicit,a=tC(2);VE(2),Fg(t.name),VE(2),Dl(" ",t.description||"\u2014"," "),VE(2),Fg(t.modelName||"\u2014"),VE(2),Fg(a.mode(t)),VE(3),Vw(a.deletion.confirmingId()!==t.id?11:-1),VE(),Vw(t.id?12:-1);}}function O(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Model"),hl(),Es(10,"th",10),AC(11,"Execution mode"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,J,13,6,"tr",9,B),hl()()()),n&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();configs=$i([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(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=Dw({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&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),AC(3,"New agent config"),hl()(),Bw(4,j,2,1,"p",3),Bw(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&&(VE(),dg("query",a.rowFilter.query()),VE(3),Vw(a.deletion.error()?4:-1),VE(),Vw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {s}from'./chunk-
|
|
1
|
+
import {s}from'./chunk-0rWkqE7F.js';import {g,W,J as Jm,H as y,D as Dw,j as gl,b as AC,m as ml,d as VE,F as Fg}from'./main-PZMWRMRC.js';var A=class r{route=g(W);http=g(Jm);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(s,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(s,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Dw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(gl(0,"p",0),AC(1),ml()),t&2&&(VE(),Fg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {I}from'./chunk-BQdF-isH.js';import {g,W,aW as L,K as we,$ as $i,o as oT,aX as Ue,ac as by,U,a2 as ha,aa as br,D as Dw,E as Es,f as fg,a as Bw,c as hl,R as vg,d as VE,i as Vw,P as dg,b as AC,Q as Qw,S as NI,q as $w,v as tC,T as AI,z as zw,u as Dl,as as Pg,w as pf,x as hf,F as Fg}from'./main-VAVXYALE.js';import {a6 as pd,C as Co,M as Mo,H as Ht,v as yn,U as Ut,a as po,a8 as fa,ac as Ri,b as hn,c as fn,u as un,o as dn,d as cn,D as pn,e as at,i as sn,t as an}from'./chunk-7jUvxE8F.js';import'./chunk-D3iYEK2Q.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Es(0,"p",1),AC(1,"Loading\u2026"),hl());}function se(i,t){if(i&1&&(Es(0,"ds-notice"),AC(1),hl()),i&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function re(i,t){if(i&1){let e=Qw();Es(0,"div")(1,"button",23),vg("click",function(){pf(e);let s=tC(2);return hf(s.retryLoad())}),AC(2,"Retry loading"),hl()();}}function ce(i,t){if(i&1&&(fg(0,"br"),AC(1)),i&2){let e=tC(3);VE(),Dl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Es(0,"ds-notice",3),AC(1),Bw(2,ce,2,1),hl()),i&2){let e=tC(2);dg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),VE(),Dl(" Repository: ",e.checkoutStatus()," "),VE(),Vw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Es(0,"option",12),AC(1),hl()),i&2){let e=t.$implicit,c=tC(2);dg("value",e.id),VE(),Pg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Es(0,"p",13),AC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),hl());}function pe(i,t){if(i&1){let e=Qw();Es(0,"button",24),vg("click",function(){pf(e);let s=tC(2);return hf(s.remove())}),AC(1," Remove association "),hl();}if(i&2){let e=tC(2);dg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Qw();Bw(0,se,2,1,"ds-notice"),Bw(1,re,3,0,"div"),Bw(2,de,3,3,"ds-notice",3),Es(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.repositoryUrl.set(s))}),hl(),NI(),hl(),Es(6,"ds-form-field",7)(7,"input",8),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.mainBranch.set(s))}),hl(),NI(),hl(),Es(8,"ds-form-field",9)(9,"select",10),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.serviceAuthSettingId.set(s))}),Es(10,"option",11),AC(11,"Select an auth setting\u2026"),hl(),$w(12,le,2,3,"option",12,oe),hl(),NI(),Bw(14,me,2,0,"p",13),hl()(),Es(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.autoWorktree.set(s))}),hl(),NI(),AC(19," Offer a worktree to every new top-level case "),hl(),Es(20,"p",18),AC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),hl()(),Es(22,"ds-form-field",19)(23,"input",20),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.setupCommand.set(s))}),hl(),NI(),Es(24,"p",13),AC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),hl()()(),Es(26,"ds-form-actions")(27,"button",21),vg("click",function(){pf(e);let s=tC();return hf(s.save())}),AC(28),hl(),Bw(29,pe,2,1,"button",22),hl();}if(i&2){let e=tC();Vw(e.errorMessage()?0:-1),VE(),Vw(e.associationLoaded()?-1:1),VE(),Vw(e.isAssociated()&&e.checkoutStatus()?2:-1),VE(),dg("disabled",!e.associationLoaded()||e.isSaving()),VE(2),dg("ngModel",e.repositoryUrl()),AI(),VE(2),dg("ngModel",e.mainBranch()),AI(),VE(2),dg("ngModel",e.serviceAuthSettingId()),AI(),VE(3),zw(e.eligibleAuthSettings()),VE(2),Vw(e.eligibleAuthSettings().length===0?14:-1),VE(),dg("disabled",!e.associationLoaded()||e.isSaving()),VE(3),dg("ngModel",e.autoWorktree()),AI(),VE(5),dg("ngModel",e.setupCommand()),AI(),VE(4),dg("disabled",!e.canSave()),VE(),Dl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),VE(),Vw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=$i(true);isSaving=$i(false);confirmingRemove=$i(false);associationLoaded=$i(false);errorMessage=$i(null);association=$i(null);authSettings=$i([]);repositoryUrl=$i("");mainBranch=$i("main");serviceAuthSettingId=$i("");autoWorktree=$i(false);setupCommand=$i("");namespaceId="";isAssociated=oT(()=>this.association()?.associated===true);eligibleAuthSettings=oT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=oT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=oT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),by({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),Bw(2,ae,2,0,"p",1)(3,ue,30,14),hl(),Es(4,"ds-confirm-dialog",2),vg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),hl()),e&2&&(VE(2),Vw(c.isLoading()?2:3),VE(2),dg("open",c.confirmingRemove()));},dependencies:[pd,Co,Mo,Ht,yn,Ut,po,fa,Ri,hn,fn,un,dn,cn,pn,at,sn,an],encapsulation:2})};
|
|
1
|
+
import {I}from'./chunk-D4eJc3W1.js';import {g,W,aW as L,K as we,$ as $i,o as oT,aX as Ue,ac as by,U,a2 as ha,aa as br,D as Dw,E as Es,f as fg,a as Bw,c as hl,R as vg,d as VE,i as Vw,P as dg,b as AC,Q as Qw,S as NI,q as $w,v as tC,T as AI,z as zw,u as Dl,as as Pg,w as pf,x as hf,F as Fg}from'./main-PZMWRMRC.js';import {a6 as pd,C as Co,M as Mo,H as Ht,v as yn,U as Ut,a as po,a8 as fa,ac as Ri,b as hn,c as fn,u as un,o as dn,d as cn,D as pn,e as at,i as sn,t as an}from'./chunk-0rWkqE7F.js';import'./chunk-m1ylN0EP.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Es(0,"p",1),AC(1,"Loading\u2026"),hl());}function se(i,t){if(i&1&&(Es(0,"ds-notice"),AC(1),hl()),i&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function re(i,t){if(i&1){let e=Qw();Es(0,"div")(1,"button",23),vg("click",function(){pf(e);let s=tC(2);return hf(s.retryLoad())}),AC(2,"Retry loading"),hl()();}}function ce(i,t){if(i&1&&(fg(0,"br"),AC(1)),i&2){let e=tC(3);VE(),Dl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Es(0,"ds-notice",3),AC(1),Bw(2,ce,2,1),hl()),i&2){let e=tC(2);dg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),VE(),Dl(" Repository: ",e.checkoutStatus()," "),VE(),Vw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Es(0,"option",12),AC(1),hl()),i&2){let e=t.$implicit,c=tC(2);dg("value",e.id),VE(),Pg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Es(0,"p",13),AC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),hl());}function pe(i,t){if(i&1){let e=Qw();Es(0,"button",24),vg("click",function(){pf(e);let s=tC(2);return hf(s.remove())}),AC(1," Remove association "),hl();}if(i&2){let e=tC(2);dg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Qw();Bw(0,se,2,1,"ds-notice"),Bw(1,re,3,0,"div"),Bw(2,de,3,3,"ds-notice",3),Es(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.repositoryUrl.set(s))}),hl(),NI(),hl(),Es(6,"ds-form-field",7)(7,"input",8),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.mainBranch.set(s))}),hl(),NI(),hl(),Es(8,"ds-form-field",9)(9,"select",10),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.serviceAuthSettingId.set(s))}),Es(10,"option",11),AC(11,"Select an auth setting\u2026"),hl(),$w(12,le,2,3,"option",12,oe),hl(),NI(),Bw(14,me,2,0,"p",13),hl()(),Es(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.autoWorktree.set(s))}),hl(),NI(),AC(19," Offer a worktree to every new top-level case "),hl(),Es(20,"p",18),AC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),hl()(),Es(22,"ds-form-field",19)(23,"input",20),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.setupCommand.set(s))}),hl(),NI(),Es(24,"p",13),AC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),hl()()(),Es(26,"ds-form-actions")(27,"button",21),vg("click",function(){pf(e);let s=tC();return hf(s.save())}),AC(28),hl(),Bw(29,pe,2,1,"button",22),hl();}if(i&2){let e=tC();Vw(e.errorMessage()?0:-1),VE(),Vw(e.associationLoaded()?-1:1),VE(),Vw(e.isAssociated()&&e.checkoutStatus()?2:-1),VE(),dg("disabled",!e.associationLoaded()||e.isSaving()),VE(2),dg("ngModel",e.repositoryUrl()),AI(),VE(2),dg("ngModel",e.mainBranch()),AI(),VE(2),dg("ngModel",e.serviceAuthSettingId()),AI(),VE(3),zw(e.eligibleAuthSettings()),VE(2),Vw(e.eligibleAuthSettings().length===0?14:-1),VE(),dg("disabled",!e.associationLoaded()||e.isSaving()),VE(3),dg("ngModel",e.autoWorktree()),AI(),VE(5),dg("ngModel",e.setupCommand()),AI(),VE(4),dg("disabled",!e.canSave()),VE(),Dl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),VE(),Vw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=$i(true);isSaving=$i(false);confirmingRemove=$i(false);associationLoaded=$i(false);errorMessage=$i(null);association=$i(null);authSettings=$i([]);repositoryUrl=$i("");mainBranch=$i("main");serviceAuthSettingId=$i("");autoWorktree=$i(false);setupCommand=$i("");namespaceId="";isAssociated=oT(()=>this.association()?.associated===true);eligibleAuthSettings=oT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=oT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=oT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),by({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),Bw(2,ae,2,0,"p",1)(3,ue,30,14),hl(),Es(4,"ds-confirm-dialog",2),vg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),hl()),e&2&&(VE(2),Vw(c.isLoading()?2:3),VE(2),dg("open",c.confirmingRemove()));},dependencies:[pd,Co,Mo,Ht,yn,Ut,po,fa,Ri,hn,fn,un,dn,cn,pn,at,sn,an],encapsulation:2})};
|
|
2
2
|
export{ne as NamespaceGitComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {ab as N,b as hn,c as fn,u as un,d as cn,D as pn,e as at,i as sn}from'./chunk-
|
|
1
|
+
import {ab as N,b as hn,c as fn,u as un,d as cn,D as pn,e as at,i as sn}from'./chunk-0rWkqE7F.js';import {g,W,t as F,aU as D,ag as U,K as we,$ as $i,U as U$1,B,aV as gy,D as Dw,E as Es,R as vg,b as AC,c as hl,f as fg,a as Bw,d as VE,P as dg,i as Vw,u as Dl,v as tC,F as Fg}from'./main-PZMWRMRC.js';function P(l,t){if(l&1&&(Es(0,"ds-notice"),AC(1),hl()),l&2){let n=tC();VE(),Fg(n.launchError());}}var T=class l{route=g(W);router=g(F);caseController=g(D);caseState=g(N);agentConfigController=g(U);destroyRef=g(we);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=$i("");launchError=$i(null);isLaunching=$i(false);isLoading=$i(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.resolvedAgentConfig=t,t.loopConfig!=null&&this.payloadJson.set(JSON.stringify(t.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let t=this.resolvedAgentConfig??(yield gy(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield gy(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield gy(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(t){console.error("[AgentConfigLaunch] Failed to launch loop agent",t),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=Dw({type:l,selectors:[["agentos-agent-config-launch"]],decls:17,vars:6,consts:[["title","Launch loop agent"],["dsButton","","variant","ghost","type","button","title","Back to agent config",3,"click"],[1,"ds-hint"],["label","Loop configuration (read-only)","controlId","agent-loop-payload"],["dsControl","","mono","","id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",3,"value","disabled"],["dsButton","","variant","primary","type","button",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(n,e){n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return e.back()}),AC(3," \u2190 Edit agent config "),hl()(),Es(4,"p",2),AC(5," The loop configuration below is read from "),Es(6,"code"),AC(7,"AgentConfig.loopConfig"),hl(),AC(8," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),hl(),Es(9,"ds-form-field",3),fg(10,"textarea",4),hl(),Bw(11,P,2,1,"ds-notice"),Es(12,"ds-form-actions")(13,"button",5),vg("click",function(){return e.launch()}),AC(14),hl(),Es(15,"button",6),vg("click",function(){return e.back()}),AC(16,"Cancel"),hl()()()),n&2&&(VE(10),dg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),VE(),Vw(e.launchError()?11:-1),VE(2),dg("disabled",e.isLaunching()),VE(),Dl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),VE(),dg("disabled",e.isLaunching()));},dependencies:[hn,fn,un,cn,pn,at,sn],encapsulation:2})};export{T as AgentConfigLaunchComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-N28VXTjy.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,t as F,K as we,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function A(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading skills\u2026"),hl());}function H(i,e){i&1&&(Es(0,"p",5),AC(1,"No platform skills defined yet."),hl());}function U(i,e){i&1&&(Es(0,"p",4),AC(1,"No skills match the current filter."),hl());}function z(i,e){i&1&&(Es(0,"ds-tag",15),AC(1,"SKILL.md"),hl());}function G(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC(2).$implicit,m=tC(2);return hf(m.edit(d))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.inspect(d))}),AC(1,"View"),hl(),Bw(2,G,2,1,"button",22);}if(i&2){let t=tC().$implicit;lg("aria-label","View "+t.name),VE(2),Vw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Qw();Es(0,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,l=tC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),AC(4),hl(),Bw(5,z,2,0,"ds-tag",15),hl()(),Es(6,"td",16),AC(7),hl(),Es(8,"td",17),AC(9),hl(),Es(10,"td",18)(11,"div",19),Bw(12,J,3,2),Bw(13,Q,1,3,"agentos-row-delete-action",20),hl()()()),i&2){let t=e.$implicit,l=tC(2);VE(4),Fg(t.name),VE(),Vw(t.readOnly?5:-1),VE(2),Dl(" ",t.description||"\u2014"," "),VE(2),Fg(l.resourceCount(t)),VE(3),Vw(l.deletion.confirmingId()!==t.id?12:-1),VE(),Vw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Resources"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,W,14,6,"tr",9,K),hl()()()),i&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();skills=$i([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\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 skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["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,l){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return l.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return l.openCreateForm()}),AC(3,"New skill"),hl()(),Bw(4,O,2,1,"p",3),Bw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(VE(),dg("query",l.rowFilter.query()),VE(3),Vw(l.deletion.error()?4:-1),VE(),Vw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
|