@whoz-oss/coday-client 0.0.0-workstream-forge.129 → 0.0.0-workstream-forge.131
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-Bexa26_O.js → chunk-1aPU-VYN.js} +1 -1
- package/browser/chunk-2uSZyBhs.js +1 -0
- package/browser/{chunk-CVEPS_Rn.js → chunk-B3wVhaOY.js} +1 -1
- package/browser/{chunk-BmiTW3yx.js → chunk-B94rMV4D.js} +1 -1
- package/browser/{chunk-5HptzHPs.js → chunk-BC30_IWf.js} +1 -1
- package/browser/{chunk-gZNKOvXX.js → chunk-BIEipUAm.js} +1 -1
- package/browser/{chunk-xL_Z39Ql.js → chunk-BJvKgH9M.js} +1 -1
- package/browser/{chunk-_G-8WREs.js → chunk-BPPwlunf.js} +1 -1
- package/browser/{chunk-B7_NgrVx.js → chunk-BYfLHvn5.js} +1 -1
- package/browser/{chunk-DsqUIO8F.js → chunk-BmpYp8SI.js} +1 -1
- package/browser/{chunk-B2vHDJfP.js → chunk-BvNh363O.js} +1 -1
- package/browser/{chunk-eSdZ2k-7.js → chunk-BwDnFY17.js} +1 -1
- package/browser/{chunk-DF_acPg5.js → chunk-C0DGRdrH.js} +1 -1
- package/browser/{chunk-19OX1-Gt.js → chunk-C9ZLvHyT.js} +1 -1
- package/browser/{chunk-jv6Iwz_I.js → chunk-CSbT6gXC.js} +1 -1
- package/browser/{chunk-D6XP4BWo.js → chunk-CXH1B4xE.js} +1 -1
- package/browser/{chunk-DNlwbOfA.js → chunk-Ca58sP9P.js} +1 -1
- package/browser/{chunk-k_Y0FMAi.js → chunk-CaT9J2-R.js} +1 -1
- package/browser/{chunk-C0i4ebMh.js → chunk-ChHdIgC7.js} +1 -1
- package/browser/{chunk-DRNGnRtG.js → chunk-Crn_FmOc.js} +1 -1
- package/browser/{chunk-BwF3DHbG.js → chunk-Cvn7x879.js} +1 -1
- package/browser/{chunk-CXs6UkKM.js → chunk-CzhH5dEk.js} +1 -1
- package/browser/{chunk-CCAO24ac.js → chunk-D745ywTz.js} +1 -1
- package/browser/{chunk-BXu_FjmD.js → chunk-DDBndX8X.js} +1 -1
- package/browser/{chunk-KeRPxWui.js → chunk-DIiUGYyE.js} +1 -1
- package/browser/{chunk-aoT5uADR.js → chunk-DJqD0QrN.js} +1 -1
- package/browser/{chunk-DJFrIWhH.js → chunk-DMBR9TyF.js} +1 -1
- package/browser/{chunk-C58-28vw.js → chunk-DPNvDTDA.js} +1 -1
- package/browser/{chunk-DvvAcQIV.js → chunk-DQhzfd4q.js} +1 -1
- package/browser/{chunk-D75qOKRE.js → chunk-DX_WpNI8.js} +1 -1
- package/browser/{chunk-DFY8wJzc.js → chunk-DdISK7Z0.js} +7 -7
- package/browser/{chunk-Bsez8MRw.js → chunk-DecNPOnx.js} +1 -1
- package/browser/{chunk-C0Mo2fyy.js → chunk-DuNcnigb.js} +1 -1
- package/browser/{chunk-tUfhjSPG.js → chunk-DumghPgi.js} +1 -1
- package/browser/{chunk-P_nMLYiV.js → chunk-Dv74-YPZ.js} +1 -1
- package/browser/{chunk-m03vK40u.js → chunk-DyBGilQA.js} +1 -1
- package/browser/{chunk-ZtDI9Qnf.js → chunk-EEpjj7pA.js} +1 -1
- package/browser/{chunk-Dwul-NdZ.js → chunk-HewsBsjw.js} +1 -1
- package/browser/{chunk-C83lJSkJ.js → chunk-MQfO-veq.js} +1 -1
- package/browser/{chunk-BYfxJkuF.js → chunk-MlnYbyuc.js} +1 -1
- package/browser/{chunk-D5Gj1KMK.js → chunk-QA6-T4TH.js} +1 -1
- package/browser/{chunk-CDDvR3Fj.js → chunk-Z-Rdihxb.js} +1 -1
- package/browser/{chunk-p9ZS47Th.js → chunk-g6gWH0wW.js} +1 -1
- package/browser/{chunk-C-OT1z56.js → chunk-p_goS9vk.js} +1 -1
- package/browser/{chunk-QL_vSGY6.js → chunk-xpXkr85F.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-JPCCD7JL.js → main-OIPNBOIH.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BoZzRsaV.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-BmiTW3yx.js';import {R,q,J}from'./chunk-BwF3DHbG.js';import {p,$ as $t,c as It,M as Me,i as ie,E as Mi,F as Sg,x,w,v as vf,z as za,f as dc,r as r_,C as Cf,h as hT,a as yb,I as Iv,d as pT,e as bT,n as yT,J as mT,s as sS,l as lc,N as NT,t as tv,g as cS,o as vT,R as Rf,H as dT,k as ig,m as sg,ag as WT,V as uc}from'./main-JPCCD7JL.js';import {F,v as vt,a as ve,$,U,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,e as bt,g as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-DFY8wJzc.js';import'./chunk-BoZzRsaV.js';function se(i,t){i&1&&(za(0,"p",5),r_(1,"Loading\u2026"),Cf());}function ce(i,t){if(i&1&&(za(0,"label",23),lc(1,"input",24),sS(),za(2,"span"),r_(3),Cf()()),i&2){let e=t.$implicit,o=NT(3);yb(),tv("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),cS(),yb(2),Iv(e.label);}}function de(i,t){if(i&1&&(za(0,"fieldset",8)(1,"legend",22),r_(2,"Configuration scope"),Cf(),yT(3,ce,4,4,"label",23,dT().trackByScope,true),Cf()),i&2){let e=NT(2);tv("disabled",e.isEditMode()),yb(3),vT(e.scopeOptions);}}function ue(i,t){if(i&1&&(za(0,"option",13),r_(1),Cf()),i&2){let e=t.$implicit,o=NT(2);tv("value",e),yb(),Iv(o.authTypeLabel[e]);}}function pe(i,t){i&1&&r_(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(za(0,"span",11),r_(1,"*"),Cf());}function me(i,t){if(i&1&&(za(0,"p",28),r_(1),Cf()),i&2){let e=NT(2).$implicit;tv("id","as-hint-"+e.key),yb(),Iv(e.hint);}}function ge(i,t){if(i&1&&(lc(0,"input",27),sS(),hT(1,me,2,2,"p",28)),i&2){let e=NT().$implicit;WT("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),tv("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),uc("aria-describedby",e.hint?"as-hint-"+e.key:null),cS(),yb(),pT(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(za(0,"div",9)(1,"label",26),r_(2),hT(3,he,2,0,"span",11),Cf(),hT(4,ge,2,9),Cf()),i&2){let e,o=t.$implicit,l=NT(3);yb(),tv("for","as-cred-"+o.key),yb(),Rf(" ",o.label," "),yb(),pT(o.required?3:-1),yb(),pT((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(za(0,"fieldset",18)(1,"legend",22),r_(2,"Credentials"),Cf(),za(3,"p",25),r_(4," Values are stored encrypted and masked on read. "),hT(5,pe,1,0),Cf(),yT(6,Ce,5,4,"div",9,dT().trackByField,true),Cf()),i&2){let e=NT(2);yb(5),pT(e.isEditMode()?5:-1),yb(),vT(e.credentialFields());}}function ye(i,t){if(i&1){let e=bT();za(0,"form",7),dc("ngSubmit",function(){ig(e);let l=NT();return sg(l.submit())}),hT(1,de,5,1,"fieldset",8),za(2,"div",9)(3,"label",10),r_(4,"Auth type "),za(5,"span",11),r_(6,"*"),Cf()(),za(7,"select",12),yT(8,ue,2,2,"option",13,mT),Cf(),sS(),Cf(),za(10,"div",9)(11,"label",14),r_(12,"Name "),za(13,"span",11),r_(14,"*"),Cf()(),lc(15,"input",15),sS(),Cf(),za(16,"div",9)(17,"label",16),r_(18,"Description"),Cf(),lc(19,"input",17),sS(),Cf(),hT(20,fe,8,1,"fieldset",18),za(21,"div",19)(22,"button",20),r_(23),Cf(),za(24,"button",21),dc("click",function(){ig(e);let l=NT();return sg(l.cancel())}),r_(25,"Cancel"),Cf()()();}if(i&2){let e=NT();tv("formGroup",e.form),yb(),pT(e.isPlatformMode?-1:1),yb(6),tv("formControl",e.authTypeControl),cS(),yb(),vT(e.authTypeOptions),yb(7),tv("formControl",e.nameControl),cS(),yb(4),tv("formControl",e.descriptionControl),cS(),yb(),pT(e.credentialFields().length>0?20:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),Rf(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={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}]},le=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?ie(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=Mi(()=>Se[this.selectedAuthType()]);isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Sg(()=>{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,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.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,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;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,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{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({},l),{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({},l),{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({},l),{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=vf({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return o.cancel()}),za(3,"span",3),r_(4,"\u2190"),Cf(),r_(5," Auth Settings "),Cf(),za(6,"h1",4),r_(7),Cf()(),hT(8,se,2,0,"p",5)(9,ye,26,8,"form",6),Cf()),e&2&&(yb(7),Iv(o.isEditMode()?"Edit auth setting":"New auth setting"),yb(),pT(o.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
1
|
+
import {v}from'./chunk-B94rMV4D.js';import {R,q,J}from'./chunk-Cvn7x879.js';import {p,$ as $t,c as It,M as Me,i as ie,E as Mi,F as Sg,x,w,v as vf,z as za,f as dc,r as r_,C as Cf,h as hT,a as yb,I as Iv,d as pT,e as bT,n as yT,J as mT,s as sS,l as lc,N as NT,t as tv,g as cS,o as vT,R as Rf,H as dT,k as ig,m as sg,ag as WT,V as uc}from'./main-OIPNBOIH.js';import {F,v as vt,a as ve,$,U,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,e as bt,g as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-DdISK7Z0.js';import'./chunk-2uSZyBhs.js';function se(i,t){i&1&&(za(0,"p",5),r_(1,"Loading\u2026"),Cf());}function ce(i,t){if(i&1&&(za(0,"label",23),lc(1,"input",24),sS(),za(2,"span"),r_(3),Cf()()),i&2){let e=t.$implicit,o=NT(3);yb(),tv("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),cS(),yb(2),Iv(e.label);}}function de(i,t){if(i&1&&(za(0,"fieldset",8)(1,"legend",22),r_(2,"Configuration scope"),Cf(),yT(3,ce,4,4,"label",23,dT().trackByScope,true),Cf()),i&2){let e=NT(2);tv("disabled",e.isEditMode()),yb(3),vT(e.scopeOptions);}}function ue(i,t){if(i&1&&(za(0,"option",13),r_(1),Cf()),i&2){let e=t.$implicit,o=NT(2);tv("value",e),yb(),Iv(o.authTypeLabel[e]);}}function pe(i,t){i&1&&r_(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(za(0,"span",11),r_(1,"*"),Cf());}function me(i,t){if(i&1&&(za(0,"p",28),r_(1),Cf()),i&2){let e=NT(2).$implicit;tv("id","as-hint-"+e.key),yb(),Iv(e.hint);}}function ge(i,t){if(i&1&&(lc(0,"input",27),sS(),hT(1,me,2,2,"p",28)),i&2){let e=NT().$implicit;WT("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),tv("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),uc("aria-describedby",e.hint?"as-hint-"+e.key:null),cS(),yb(),pT(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(za(0,"div",9)(1,"label",26),r_(2),hT(3,he,2,0,"span",11),Cf(),hT(4,ge,2,9),Cf()),i&2){let e,o=t.$implicit,l=NT(3);yb(),tv("for","as-cred-"+o.key),yb(),Rf(" ",o.label," "),yb(),pT(o.required?3:-1),yb(),pT((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(za(0,"fieldset",18)(1,"legend",22),r_(2,"Credentials"),Cf(),za(3,"p",25),r_(4," Values are stored encrypted and masked on read. "),hT(5,pe,1,0),Cf(),yT(6,Ce,5,4,"div",9,dT().trackByField,true),Cf()),i&2){let e=NT(2);yb(5),pT(e.isEditMode()?5:-1),yb(),vT(e.credentialFields());}}function ye(i,t){if(i&1){let e=bT();za(0,"form",7),dc("ngSubmit",function(){ig(e);let l=NT();return sg(l.submit())}),hT(1,de,5,1,"fieldset",8),za(2,"div",9)(3,"label",10),r_(4,"Auth type "),za(5,"span",11),r_(6,"*"),Cf()(),za(7,"select",12),yT(8,ue,2,2,"option",13,mT),Cf(),sS(),Cf(),za(10,"div",9)(11,"label",14),r_(12,"Name "),za(13,"span",11),r_(14,"*"),Cf()(),lc(15,"input",15),sS(),Cf(),za(16,"div",9)(17,"label",16),r_(18,"Description"),Cf(),lc(19,"input",17),sS(),Cf(),hT(20,fe,8,1,"fieldset",18),za(21,"div",19)(22,"button",20),r_(23),Cf(),za(24,"button",21),dc("click",function(){ig(e);let l=NT();return sg(l.cancel())}),r_(25,"Cancel"),Cf()()();}if(i&2){let e=NT();tv("formGroup",e.form),yb(),pT(e.isPlatformMode?-1:1),yb(6),tv("formControl",e.authTypeControl),cS(),yb(),vT(e.authTypeOptions),yb(7),tv("formControl",e.nameControl),cS(),yb(4),tv("formControl",e.descriptionControl),cS(),yb(),pT(e.credentialFields().length>0?20:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),Rf(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={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}]},le=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?ie(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=Mi(()=>Se[this.selectedAuthType()]);isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Sg(()=>{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,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.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,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;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,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{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({},l),{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({},l),{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({},l),{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=vf({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return o.cancel()}),za(3,"span",3),r_(4,"\u2190"),Cf(),r_(5," Auth Settings "),Cf(),za(6,"h1",4),r_(7),Cf()(),hT(8,se,2,0,"p",5)(9,ye,26,8,"form",6),Cf()),e&2&&(yb(7),Iv(o.isEditMode()?"Edit auth setting":"New auth setting"),yb(),pT(o.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
2
2
|
export{le as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p,aw as be,q as R}from'./main-
|
|
1
|
+
import {p,aw as be,q as R}from'./main-OIPNBOIH.js';var o=class r{skillController=p(be);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=R({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {t as F,U as U$1,u as vi,x as xi,A as Ci,E}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {t as F,U as U$1,u as vi,x as xi,A as Ci,E}from'./chunk-DdISK7Z0.js';import {v}from'./chunk-B94rMV4D.js';import {R}from'./chunk-Cvn7x879.js';import {p,$ as $t,c as It,M as Me,i as ie,Q as j$1,P as Ae,v as vf,_,z as za,f as dc,r as r_,C as Cf,h as hT,a as yb,d as pT,e as bT,n as yT,N as NT,t as tv,o as vT,I as Iv,k as ig,m as sg}from'./main-OIPNBOIH.js';import'./chunk-2uSZyBhs.js';var j=(i,t)=>t.key;function z(i,t){i&1&&(za(0,"p",2),r_(1,"Loading auth settings\u2026"),Cf());}function G(i,t){i&1&&(za(0,"p",3),r_(1,"No auth settings available."),Cf());}function H(i,t){i&1&&(za(0,"ds-tag",12),r_(1,"Read-only"),Cf());}function U(i,t){if(i&1){let e=bT();za(0,"button",14),dc("click",function(){ig(e);let s=NT().$implicit,r=NT(2);return sg(r.edit(s))}),r_(1,"Edit"),Cf(),za(2,"button",16),dc("click",function(){ig(e);let s=NT().$implicit,r=NT(2);return sg(r.delete(s))}),r_(3,"Delete"),Cf();}}function B(i,t){i&1&&(za(0,"button",15),r_(1,"Inherited"),Cf());}function J(i,t){if(i&1){let e=bT();za(0,"tr")(1,"td",8),r_(2),Cf(),za(3,"td",9),r_(4),Cf(),za(5,"td")(6,"div",10)(7,"ds-tag",11),r_(8),Cf(),hT(9,H,2,0,"ds-tag",12),Cf()(),za(10,"td",13)(11,"button",14),dc("click",function(){let s=ig(e).$implicit,r=NT(2);return sg(r.duplicate(s))}),r_(12,"Duplicate"),Cf(),hT(13,U,4,0)(14,B,2,0,"button",15),Cf()();}if(i&2){let e=t.$implicit;yb(2),Iv(e.config.name),yb(2),Iv(e.config.authType),yb(3),tv("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),yb(),Iv(e.scopeLabel),yb(),pT(e.canMutate?-1:9),yb(4),pT(e.canMutate?13:14);}}function K(i,t){if(i&1){let e=bT();za(0,"agentos-table-filter",4),dc("queryChange",function(s){ig(e);let r=NT();return sg(r.rowFilter.query.set(s))}),Cf(),za(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),r_(6,"Name"),Cf(),za(7,"th"),r_(8,"Authentication type"),Cf(),za(9,"th"),r_(10,"Scope"),Cf(),za(11,"th")(12,"span",7),r_(13,"Actions"),Cf()()()(),za(14,"tbody"),yT(15,J,15,6,"tr",null,j),Cf()()();}if(i&2){let e=NT();tv("query",e.rowFilter.query()),yb(15),vT(e.rowFilter.filteredRows());}}var q=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=ie(false);isLoading=ie(true);rows=ie([]);rowFilter=F(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(j$1(t=>t.get("namespaceId")??""),Ae(t=>t?this.namespaceRole.isAdminOfNamespace$(t):_(false)),U$1(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}delete(t){!t.canMutate||!t.config.id||!confirm(`Delete auth setting \u201C${t.config.name}\u201D?`)||this.state.delete(t.config.id,t.scope).pipe(U$1(this.destroyRef)).subscribe();}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,l,s){return t.map((r,$)=>({key:`${e}:${r.id??$}`,config:r,scope:e,scopeLabel:l,canMutate:s}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vf({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:6,vars:1,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["type","button",1,"auth-settings__new",3,"click"],["role","status",1,"auth-settings__status"],[1,"auth-settings__status"],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],[1,"auth-settings__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"auth-settings__name"],[1,"auth-settings__type"],[1,"auth-settings__tags"],[3,"variant"],["variant","outline"],[1,"auth-settings__actions"],["type","button",3,"click"],["type","button","disabled",""],["type","button",1,"auth-settings__delete",3,"click"]],template:function(e,l){e&1&&(za(0,"ds-section-header",0)(1,"button",1),dc("click",function(){return l.openCreateForm()}),r_(2,"New auth setting"),Cf()(),hT(3,z,2,0,"p",2)(4,G,2,0,"p",3)(5,K,17,1)),e&2&&(yb(3),pT(l.isLoading()?3:l.rows().length===0?4:5));},dependencies:[vi,xi,Ci,E],styles:[".auth-settings__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.auth-settings__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.auth-settings__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.auth-settings__name[_ngcontent-%COMP%]{font-weight:500}.auth-settings__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.auth-settings__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.auth-settings__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.auth-settings__actions[_ngcontent-%COMP%] .auth-settings__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{q as AuthSettingsAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {t as F,U as U$1,u as vi,x as xi,A as Ci,E}from'./chunk-
|
|
1
|
+
import {t as F,U as U$1,u as vi,x as xi,A as Ci,E}from'./chunk-DdISK7Z0.js';import {p,$ as $t,c as It,M as Me,a4 as $,O as De,i as ie,P as Ae,v as vf,a9 as pw,aa as Wn,_,z as za,f as dc,r as r_,C as Cf,h as hT,a as yb,d as pT,e as bT,n as yT,N as NT,t as tv,o as vT,I as Iv,k as ig,m as sg}from'./main-OIPNBOIH.js';var q=(i,e)=>e.key;function j(i,e){i&1&&(za(0,"p",2),r_(1,"Loading agent configs\u2026"),Cf());}function z(i,e){i&1&&(za(0,"p",3),r_(1,"No agent configs available."),Cf());}function B(i,e){i&1&&(za(0,"ds-tag",12),r_(1,"Read-only"),Cf());}function H(i,e){if(i&1){let t=bT();za(0,"button",14),dc("click",function(){ig(t);let c=NT().$implicit,g=NT(2);return sg(g.launch(c))}),r_(1,"Launch"),Cf();}}function J(i,e){if(i&1){let t=bT();za(0,"button",14),dc("click",function(){ig(t);let c=NT().$implicit,g=NT(2);return sg(g.edit(c))}),r_(1,"Edit"),Cf(),za(2,"button",16),dc("click",function(){ig(t);let c=NT().$implicit,g=NT(2);return sg(g.delete(c))}),r_(3,"Delete"),Cf();}}function U(i,e){if(i&1){let t=bT();za(0,"tr")(1,"td",8),r_(2),Cf(),za(3,"td",9),r_(4),Cf(),za(5,"td"),r_(6),Cf(),za(7,"td")(8,"div",10)(9,"ds-tag",11),r_(10),Cf(),hT(11,B,2,0,"ds-tag",12),Cf()(),za(12,"td",13)(13,"button",14),dc("click",function(){let c=ig(t).$implicit,g=NT(2);return sg(g.inspect(c))}),r_(14,"Inspect"),Cf(),hT(15,H,2,0,"button",15),hT(16,J,4,0),Cf()();}if(i&2){let t=e.$implicit,r=NT(2);yb(2),Iv(t.config.name),yb(2),Iv(t.config.description||"\u2014"),yb(2),Iv(r.mode(t)),yb(3),tv("variant",t.scope==="platform"?"neutral":"accent"),yb(),Iv(t.scope==="platform"?"Platform":"Namespace"),yb(),pT(t.scope==="platform"?11:-1),yb(4),pT(r.canLaunch(t)?15:-1),yb(),pT(t.scope==="namespace"?16:-1);}}function G(i,e){if(i&1){let t=bT();za(0,"agentos-table-filter",4),dc("queryChange",function(c){ig(t);let g=NT();return sg(g.rowFilter.query.set(c))}),Cf(),za(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),r_(6,"Name"),Cf(),za(7,"th"),r_(8,"Description"),Cf(),za(9,"th"),r_(10,"Execution mode"),Cf(),za(11,"th"),r_(12,"Scope"),Cf(),za(13,"th")(14,"span",7),r_(15,"Actions"),Cf()()()(),za(16,"tbody"),yT(17,U,17,8,"tr",null,q),Cf()()();}if(i&2){let t=NT();tv("query",t.rowFilter.query()),yb(17),vT(t.rowFilter.filteredRows());}}var L=class i{route=p($t);router=p(It);destroyRef=p(Me);controller=p($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new De(void 0);isLoading=ie(true);rows=ie([]);rowFilter=F(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),pw({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(Wn(()=>_([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((r,c)=>({key:`platform:${r.id??c}`,config:r,scope:"platform"})),...e.map((r,c)=>({key:`namespace:${r.id??c}`,config:r,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"]);}delete(e){e.scope==="platform"||!e.config.id||!confirm(`Delete agent config \u201C${e.config.name}\u201D?`)||this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}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||i)};static \u0275cmp=vf({type:i,selectors:[["agentos-namespace-agent-configs"]],decls:6,vars:1,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["type","button",1,"agent-configs__new",3,"click"],["role","status",1,"agent-configs__status"],[1,"agent-configs__status"],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],[1,"agent-configs__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"agent-configs__name"],[1,"agent-configs__description"],[1,"agent-configs__tags"],[3,"variant"],["variant","outline"],[1,"agent-configs__actions"],["type","button",3,"click"],["type","button"],["type","button",1,"agent-configs__delete",3,"click"]],template:function(t,r){t&1&&(za(0,"ds-section-header",0)(1,"button",1),dc("click",function(){return r.openCreateForm()}),r_(2," New agent config "),Cf()(),hT(3,j,2,0,"p",2)(4,z,2,0,"p",3)(5,G,19,1)),t&2&&(yb(3),pT(r.isLoading()?3:r.rows().length===0?4:5));},dependencies:[vi,xi,Ci,E],styles:[".agent-configs__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.agent-configs__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.agent-configs__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-configs__name[_ngcontent-%COMP%]{font-weight:500}.agent-configs__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.agent-configs__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.agent-configs__actions[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle;text-align:center}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.agent-configs__actions[_ngcontent-%COMP%] .agent-configs__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{L as NamespaceAgentConfigsComponent};
|