@whoz-oss/coday-client 0.0.0-workstream-messaging.6 → 0.0.0-workstream-forge.246

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.
Files changed (96) hide show
  1. package/browser/chunk-2rx1a3bg.js +1 -0
  2. package/browser/chunk-44iNe1uu.js +1 -0
  3. package/browser/chunk-6fEcW1af.js +1 -0
  4. package/browser/chunk-BOAakMd1.js +1 -0
  5. package/browser/chunk-BOu7cjfB.js +1 -0
  6. package/browser/chunk-BRf--TAM.js +1 -0
  7. package/browser/chunk-BXEuZdL_.js +1 -0
  8. package/browser/chunk-BXjaHG4X.js +1 -0
  9. package/browser/chunk-BZl7Iiay.js +1 -0
  10. package/browser/chunk-Bb4ZghwW.js +1 -0
  11. package/browser/chunk-BgUbG3v4.js +2 -0
  12. package/browser/{chunk-D0vHzITV.js → chunk-Bjb4ofPZ.js} +1 -1
  13. package/browser/chunk-Blm_gDNW.js +1 -0
  14. package/browser/chunk-Bm9jTMyL.js +1 -0
  15. package/browser/chunk-Boa1rtr3.js +1 -0
  16. package/browser/chunk-BzRZcbeu.js +1 -0
  17. package/browser/{chunk-DmRaBKc6.js → chunk-C1C0RiZa.js} +1 -1
  18. package/browser/chunk-C7-dVBzk.js +1 -0
  19. package/browser/chunk-CIVLU6Kt.js +1 -0
  20. package/browser/chunk-COuqiVBt.js +1 -0
  21. package/browser/chunk-Cbx6LzEu.js +1 -0
  22. package/browser/chunk-CjYCW_MM.js +1 -0
  23. package/browser/chunk-CuO_LCF5.js +1 -0
  24. package/browser/chunk-D-1TnBnZ.js +1 -0
  25. package/browser/chunk-D0tfduku.js +1 -0
  26. package/browser/chunk-DE6sgNNV.js +1 -0
  27. package/browser/chunk-DHe0DwEl.js +1 -0
  28. package/browser/chunk-DO-ovLg3.js +1 -0
  29. package/browser/chunk-DOAcv-0n.js +1 -0
  30. package/browser/chunk-DRRpPNnR.js +1 -0
  31. package/browser/chunk-DT2PdsWA.js +1 -0
  32. package/browser/chunk-DY9-csXz.js +1 -0
  33. package/browser/chunk-DmcssVrC.js +1 -0
  34. package/browser/chunk-Dq6TitFH.js +1 -0
  35. package/browser/chunk-Ds02yuKZ.js +1 -0
  36. package/browser/chunk-Dyr7sRIs.js +1 -0
  37. package/browser/chunk-HBNTqJMB.js +2 -0
  38. package/browser/chunk-HNE4DSTY.js +2 -0
  39. package/browser/chunk-JvVR12Id.js +1 -0
  40. package/browser/chunk-TdvCGQY1.js +674 -0
  41. package/browser/chunk-X1BEhfE5.js +1 -0
  42. package/browser/chunk-eYQBIph9.js +1 -0
  43. package/browser/{chunk-DGEz4p7l.js → chunk-oRtfYKfO.js} +1 -1
  44. package/browser/chunk-s9o_sIbq.js +1 -0
  45. package/browser/chunk-ujBeU4_3.js +1 -0
  46. package/browser/chunk-yXcf610a.js +1 -0
  47. package/browser/index.html +1 -1
  48. package/browser/main-C57PASRG.js +1253 -0
  49. package/package.json +1 -1
  50. package/browser/chunk-5j6qVmNr.js +0 -2
  51. package/browser/chunk-BRlHxogh.js +0 -1
  52. package/browser/chunk-BZzn53bQ.js +0 -1
  53. package/browser/chunk-BeT-E8P2.js +0 -1
  54. package/browser/chunk-Bp_ymzom.js +0 -1
  55. package/browser/chunk-BsJuusWB.js +0 -1
  56. package/browser/chunk-BtrZ-Mv4.js +0 -1
  57. package/browser/chunk-BvPY6zMm.js +0 -1
  58. package/browser/chunk-Bz76f5F9.js +0 -1
  59. package/browser/chunk-C3ILbsIC.js +0 -1
  60. package/browser/chunk-C3IqVFBm.js +0 -1
  61. package/browser/chunk-CH4u_0xa.js +0 -1
  62. package/browser/chunk-CIXkHX9u.js +0 -1
  63. package/browser/chunk-COmLfT0N.js +0 -674
  64. package/browser/chunk-Cc0MCjmC.js +0 -1
  65. package/browser/chunk-CgBP6cXi.js +0 -1
  66. package/browser/chunk-Cmjv1U23.js +0 -1
  67. package/browser/chunk-CoioEeqa.js +0 -1
  68. package/browser/chunk-Cq9jD9x7.js +0 -1
  69. package/browser/chunk-Cs7JPANX.js +0 -1
  70. package/browser/chunk-Ct5SlLjd.js +0 -2
  71. package/browser/chunk-D1kq6J6C.js +0 -1
  72. package/browser/chunk-D2xRGvgz.js +0 -1
  73. package/browser/chunk-DIVQtNVn.js +0 -1
  74. package/browser/chunk-DKL6wv8w.js +0 -1
  75. package/browser/chunk-DSMx6Y5L.js +0 -1
  76. package/browser/chunk-DTS0hzha.js +0 -1
  77. package/browser/chunk-DX8h3arb.js +0 -1
  78. package/browser/chunk-DkBkSmvX.js +0 -1
  79. package/browser/chunk-DnB0tF3N.js +0 -1
  80. package/browser/chunk-DnkCIZhe.js +0 -2
  81. package/browser/chunk-Dx9mLY6-.js +0 -1
  82. package/browser/chunk-DxIOAne_.js +0 -1
  83. package/browser/chunk-Dzy8eQLO.js +0 -1
  84. package/browser/chunk-GF2Xn6bl.js +0 -1
  85. package/browser/chunk-YrkvQ7uA.js +0 -1
  86. package/browser/chunk-ZPs3mDFS.js +0 -1
  87. package/browser/chunk-_RBJYLm-.js +0 -1
  88. package/browser/chunk-_VwpOjoS.js +0 -1
  89. package/browser/chunk-aqEkIRN7.js +0 -1
  90. package/browser/chunk-b_xoWNAu.js +0 -1
  91. package/browser/chunk-m4ODhjhI.js +0 -1
  92. package/browser/chunk-rLH5JBfe.js +0 -1
  93. package/browser/chunk-sEql4aGA.js +0 -1
  94. package/browser/chunk-vEjTDtHB.js +0 -1
  95. package/browser/chunk-v_8QrHNJ.js +0 -1
  96. package/browser/main-B6UJJXO7.js +0 -1254
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "0.0.0-workstream-messaging.6",
3
+ "version": "0.0.0-workstream-forge.246",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,2 +0,0 @@
1
- import {v}from'./chunk-aqEkIRN7.js';import {I,n as nt,i as it}from'./chunk-Cq9jD9x7.js';import {g,W,F,w as we,M as Mi,ad as F$1,h as BC,s as sf,x as U,K as x,C as w,J as JI,o as os,Q as qh,f as fC,z as zu,E as Ew,a as EE,N as Vh,I as Iw,n as Aw,i as bw,as as Cw,R as uI,H as Hh,P as Pw,S as dI,T as Tw,Y as Yu,ai as vw,l as lg,d as Bh,q as Pd,L as Ld}from'./main-B6UJJXO7.js';import {T as Te,g as gn,p as pt,b as hn,c as fn,u as un,t as dn,d as cn,e as at,i as sn,v as an,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,z as ya,a as po,h as ho,A as An,O as On}from'./chunk-COmLfT0N.js';import'./chunk-DxIOAne_.js';function Ce(i,t){i&1&&(os(0,"p",2),fC(1,"Loading\u2026"),zu());}function ye(i,t){if(i&1&&(os(0,"label",16),Hh(1,"input",17),uI(),fC(2),zu()),i&2){let e=t.$implicit,n=Pw(3);EE(),Vh("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),dI(),EE(),Yu(" ",e.label," ");}}function ge(i,t){if(i&1&&(os(0,"ds-fieldset",5),bw(1,ye,3,4,"label",16,vw().trackByScope,true),zu()),i&2){let e=Pw(2);Vh("disabled",e.isEditMode()),EE(),Tw(e.scopeOptions);}}function fe(i,t){if(i&1&&(os(0,"option",8),fC(1),zu()),i&2){let e=t.$implicit,n=Pw(2);Vh("value",e),EE(),lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(os(0,"ds-form-field",18),Hh(1,"input",19),uI(),zu()),i&2){let e=Pw().$implicit;Vh("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),EE(),Vh("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Bh("aria-describedby",e.hint?"as-hint-"+e.key:null),dI();}}function Ae(i,t){if(i&1&&Ew(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=Pw(3);Iw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(os(0,"ds-fieldset",13),bw(1,Ae,1,1,null,null,vw().trackByField,true),zu()),i&2){let e=Pw(2);Vh("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),EE(),Tw(e.credentialFields());}}function be(i,t){if(i&1){let e=Aw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let o=Pw();return Ld(o.submit())}),Ew(1,ge,3,1,"ds-fieldset",5),os(2,"ds-form-field",6)(3,"select",7),bw(4,fe,2,2,"option",8,Cw),zu(),uI(),zu(),os(6,"ds-form-field",9),Hh(7,"input",10),uI(),zu(),os(8,"ds-form-field",11),Hh(9,"input",12),uI(),zu(),Ew(10,ve,3,1,"ds-fieldset",13),os(11,"ds-form-actions")(12,"button",14),fC(13),zu(),os(14,"button",15),qh("click",function(){Pd(e);let o=Pw();return Ld(o.cancel())}),fC(15,"Cancel"),zu()()();}if(i&2){let e=Pw();Vh("formGroup",e.form),EE(),Iw(e.isPlatformMode?-1:1),EE(2),Vh("formControl",e.authTypeControl),dI(),EE(),Tw(e.authTypeOptions),EE(3),Vh("formControl",e.nameControl),dI(),EE(2),Vh("formControl",e.descriptionControl),dI(),EE(),Iw(e.credentialFields().length>0?10:-1),EE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),EE(),Yu(" ",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?Mi(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=BC(()=>_e[this.selectedAuthType()]);isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||sf(()=>{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=JI({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&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return n.cancel()}),fC(3," \u2190 Auth settings "),zu()(),Ew(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),zu()),e&2&&(EE(),Vh("title",n.isEditMode()?"Edit auth setting":"New auth setting"),EE(3),Iw(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
- export{me as AuthSettingFormComponent};
@@ -1 +0,0 @@
1
- import {o}from'./chunk-DmRaBKc6.js';import {B as k,k as O$1,e as at,c as fn,l as ko,n as Fo,P,D as P$1}from'./chunk-COmLfT0N.js';import {g,F,w as we,a3 as vr,M as Mi,a5 as Ys,x as U$1,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,i as bw,T as Tw,Y as Yu,n as Aw,q as Pd,L as Ld,d as Bh}from'./main-B6UJJXO7.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(os(0,"p",3),fC(1),zu()),i&2){let t=Pw();EE(),lg(t.deletion.error());}}function A(i,e){i&1&&(os(0,"p",4),fC(1,"Loading skills\u2026"),zu());}function H(i,e){i&1&&(os(0,"p",5),fC(1,"No platform skills defined yet."),zu());}function U(i,e){i&1&&(os(0,"p",4),fC(1,"No skills match the current filter."),zu());}function z(i,e){i&1&&(os(0,"ds-tag",15),fC(1,"SKILL.md"),zu());}function G(i,e){if(i&1){let t=Aw();os(0,"button",21),qh("click",function(){Pd(t);let d=Pw(2).$implicit,m=Pw(2);return Ld(m.edit(d))}),fC(1,"Edit"),zu();}if(i&2){let t=Pw(2).$implicit;Bh("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Aw();os(0,"button",21),qh("click",function(){Pd(t);let d=Pw().$implicit,m=Pw(2);return Ld(m.inspect(d))}),fC(1,"View"),zu(),Ew(2,G,2,1,"button",22);}if(i&2){let t=Pw().$implicit;Bh("aria-label","View "+t.name),EE(2),Iw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Aw();os(0,"agentos-row-delete-action",23),qh("deleteRequested",function(){Pd(t);let d=Pw().$implicit,m=Pw(2);return Ld(m.deletion.request(d.id))})("deleteConfirmed",function(){Pd(t);let d=Pw().$implicit,m=Pw(2);return Ld(m.confirmDelete(d))})("deleteCancelled",function(){Pd(t);let d=Pw(3);return Ld(d.deletion.cancel())}),zu();}if(i&2){let t=Pw().$implicit,l=Pw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),fC(4),zu(),Ew(5,z,2,0,"ds-tag",15),zu()(),os(6,"td",16),fC(7),zu(),os(8,"td",17),fC(9),zu(),os(10,"td",18)(11,"div",19),Ew(12,J,3,2),Ew(13,Q,1,3,"agentos-row-delete-action",20),zu()()()),i&2){let t=e.$implicit,l=Pw(2);EE(4),lg(t.name),EE(),Iw(t.readOnly?5:-1),EE(2),Yu(" ",t.description||"\u2014"," "),EE(2),lg(l.resourceCount(t)),EE(3),Iw(l.deletion.confirmingId()!==t.id?12:-1),EE(),Iw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),fC(5,"Name"),zu(),os(6,"th",10),fC(7,"Description"),zu(),os(8,"th",10),fC(9,"Resources"),zu(),os(10,"th",10)(11,"span",11),fC(12,"Actions"),zu()()()(),os(13,"tbody",8),bw(14,W,14,6,"tr",9,K),zu()()()),i&2){let t=Pw();EE(14),Tw(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();skills=Mi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(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=JI({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&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return l.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return l.openCreateForm()}),fC(3,"New skill"),zu()(),Ew(4,O,2,1,"p",3),Ew(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&&(EE(),Vh("query",l.rowFilter.query()),EE(3),Iw(l.deletion.error()?4:-1),EE(),Iw(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};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DmRaBKc6.js';import {J as s,b as hn,c as fn,r as rn,E as pn,e as at,o as ln,n as Fo,K as Pi,N as On}from'./chunk-COmLfT0N.js';import {g,W,F,w as we,M as Mi,h as BC,x as U,ag as Gm,a6 as Zs,ae as Dr,J as JI,ax as $t,o as os,Q as qh,f as fC,z as zu,E as Ew,a as EE,I as Iw,P as Pw,N as Vh,n as Aw,H as Hh,a0 as AC,l as lg,Y as Yu,ay as OC,i as bw,T as Tw,as as Cw,q as Pd,L as Ld,az as xD}from'./main-B6UJJXO7.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(os(0,"a",2),fC(1,"Edit skill \u2192"),zu()),e&2){let n=Pw();Vh("routerLink",n.editRoute());}}function ee(e,t){e&1&&(os(0,"ds-tag",3),fC(1,"Platform level"),zu());}function te(e,t){e&1&&(os(0,"p",4),fC(1,"Loading\u2026"),zu());}function ne(e,t){e&1&&(os(0,"ds-notice"),fC(1,"Failed to load skill."),zu());}function ie(e,t){if(e&1&&(os(0,"dt"),fC(1,"Created by"),zu(),os(2,"dd"),fC(3),zu()),e&2){let n=Pw(2);EE(3),lg(n.createdBy);}}function oe(e,t){if(e&1&&(os(0,"dt"),fC(1,"Last updated"),zu(),os(2,"dd"),fC(3),zu()),e&2){let n=Pw(2);EE(3),lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Ew(0,ie,4,1),Ew(1,oe,4,1)),e&2){let n=Pw();Iw(n.createdBy?0:-1),EE(),Iw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(os(0,"p",4),fC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),zu());}function se(e,t){e&1&&(os(0,"p",4),fC(1,"Loading\u2026"),zu());}function re(e,t){e&1&&(os(0,"ds-notice"),fC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),zu());}function de(e,t){e&1&&(os(0,"p",4),fC(1,"No agent references this skill."),zu());}function ce(e,t){e&1&&(os(0,"ds-tag",15),fC(1,"platform agent"),zu());}function me(e,t){e&1&&(os(0,"ds-tag",15),fC(1,"via *"),zu());}function pe(e,t){if(e&1&&(os(0,"li",13)(1,"span",14),fC(2),zu(),Ew(3,ce,2,0,"ds-tag",15),Ew(4,me,2,0,"ds-tag",15),zu()),e&2){let n=t.$implicit;EE(2),lg(n.name),EE(),Iw(n.platform?3:-1),EE(),Iw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(os(0,"ul",12),bw(1,pe,5,3,"li",13,Y),zu(),os(3,"p",4),fC(4," An agent listed "),os(5,"code"),fC(6,"via *"),zu(),fC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),zu()),e&2){let n=Pw(2);EE(),Tw(n.consumers());}}function _e(e,t){e&1&&(os(0,"p",4),fC(1,"No resources bundled with this skill."),zu());}function ge(e,t){if(e&1){let n=Aw();os(0,"li")(1,"ds-disclosure",16),qh("toggled",function(){let r=Pd(n).$implicit,g=Pw(3);return Ld(g.toggleResource(r))}),os(2,"pre",17),fC(3),zu()()();}if(e&2){let n=t.$implicit,o=Pw(3);EE(),Vh("heading",n)("open",o.isResourceExpanded(n)),EE(2),lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(os(0,"ul",12),bw(1,ge,4,3,"li",null,Cw),zu()),e&2){let n=Pw(2);EE(),Tw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Aw();os(0,"ds-card",5)(1,"dl",6)(2,"dt"),fC(3,"Name"),zu(),os(4,"dd",7),fC(5),zu(),os(6,"dt"),fC(7,"Description"),zu(),os(8,"dd"),fC(9),zu(),os(10,"dt"),fC(11,"Scope"),zu(),os(12,"dd"),fC(13),zu(),os(14,"dt"),fC(15,"Storage"),zu(),os(16,"dd")(17,"ds-tag",8),fC(18),zu()(),Ew(19,ae,2,2),zu()(),os(20,"ds-card",9),Ew(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),zu(),os(26,"ds-card")(27,"ds-disclosure",10),qh("toggled",function(){Pd(n);let r=Pw();return Ld(r.toggleBody())}),Hh(28,"div",11),AC(29,"agentosMarkdown"),zu()(),os(30,"ds-card",9),Ew(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),zu();}if(e&2){let n=t,o=Pw();EE(5),lg(n.name),EE(4),lg(n.description),EE(4),lg(n.namespaceId?"Namespace":"Platform"),EE(4),Vh("variant",o.isFilesystemBacked()?"outline":"neutral"),EE(),Yu(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),EE(),Iw(o.isFilesystemBacked()?-1:19),EE(),Vh("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),EE(),Iw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),EE(6),Vh("open",!o.bodyCollapsed()),EE(),Vh("innerHTML",OC(29,12,n.body),xD),EE(2),Vh("heading","Resources ("+o.resourcePaths().length+")"),EE(),Iw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Mi(true);hasError=Mi(false);skill=Mi(null);bodyCollapsed=Mi(false);expandedResources=Mi(new Set);resourcePaths=BC(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=BC(()=>this.skill()?.readOnly===true);consumers=Mi([]);consumersUnavailable=Mi(false);consumersLoading=Mi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Gm({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(Zs(()=>Dr([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=JI({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return o.back()}),fC(3,"\u2190 Skills"),zu(),Ew(4,Z,2,1,"a",2),Ew(5,ee,2,0,"ds-tag",3),zu(),Ew(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),zu()),n&2){let r;EE(4),Iw(o.skill()&&!o.isFilesystemBacked()?4:-1),EE(),Iw(o.isPlatformMode?5:-1),EE(),Iw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Fo,Pi,On],encapsulation:2})};export{X as SkillInspectComponent};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-DGEz4p7l.js';import {B as k,k as O$1,e as at,c as fn,l as ko,n as Fo,P,D as P$1}from'./chunk-COmLfT0N.js';import {g,W,F,w as we,M as Mi,ag as Gm,a6 as Zs,ae as Dr,x as U,K as x,C as w,am as De,ap as _e,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,i as bw,T as Tw,n as Aw,q as Pd,L as Ld,d as Bh}from'./main-B6UJJXO7.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(os(0,"p",3),fC(1),zu()),n&2){let e=Pw();EE(),lg(e.deletion.error());}}function Y(n,t){n&1&&(os(0,"p",4),fC(1,"Loading scheduled prompts\u2026"),zu());}function z(n,t){n&1&&(os(0,"p",5),fC(1,"No scheduled prompts available."),zu());}function G(n,t){n&1&&(os(0,"p",4),fC(1,"No scheduled prompts match the current filter."),zu());}function Q(n,t){if(n&1&&(os(0,"span",14),fC(1),zu()),n&2){let e=Pw().$implicit;EE(),lg(e.prompt.description);}}function X(n,t){n&1&&(os(0,"ds-tag",20),fC(1,"Read-only"),zu());}function Z(n,t){if(n&1){let e=Aw();os(0,"button",25),qh("click",function(){Pd(e);let l=Pw(2).$implicit,p=Pw(2);return Ld(p.toggle(l))}),fC(1),zu(),os(2,"button",25),qh("click",function(){Pd(e);let l=Pw(2).$implicit,p=Pw(2);return Ld(p.edit(l))}),fC(3," Edit "),zu();}if(n&2){let e=Pw(2).$implicit;EE(),lg(e.prompt.enabled?"Disable":"Enable"),EE(),Bh("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=Aw();Ew(0,Z,4,2),os(1,"agentos-row-delete-action",24),qh("deleteRequested",function(){Pd(e);let l=Pw().$implicit,p=Pw(2);return Ld(p.deletion.request(l.key))})("deleteConfirmed",function(){Pd(e);let l=Pw().$implicit,p=Pw(2);return Ld(p.confirmDelete(l))})("deleteCancelled",function(){Pd(e);let l=Pw(3);return Ld(l.deletion.cancel())}),zu();}if(n&2){let e=Pw().$implicit,i=Pw(2);Iw(i.deletion.confirmingId()!==e.key?0:-1),EE(),Vh("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(os(0,"button",23),fC(1,"Inherited"),zu());}function ne(n,t){if(n&1&&(os(0,"tr",9)(1,"td",12)(2,"span",13),fC(3),zu(),Ew(4,Q,2,1,"span",14),zu(),os(5,"td",15),fC(6),zu(),os(7,"td",16)(8,"ds-tag",17),fC(9),zu()(),os(10,"td",18)(11,"div",19)(12,"ds-tag",17),fC(13),zu(),Ew(14,X,2,0,"ds-tag",20),zu()(),os(15,"td",21)(16,"div",22),Ew(17,ee,2,4)(18,te,2,0,"button",23),zu()()()),n&2){let e=t.$implicit,i=Pw(2);EE(3),lg(e.prompt.name),EE(),Iw(e.prompt.description?4:-1),EE(2),lg(i.scheduleLabel(e.prompt)),EE(2),Vh("variant",e.prompt.enabled?"accent":"outline"),EE(),lg(e.prompt.enabled?"Enabled":"Disabled"),EE(3),Vh("variant",e.scope==="platform"?"neutral":"accent"),EE(),lg(e.scope==="platform"?"Platform":"Namespace"),EE(),Iw(e.scope==="platform"?14:-1),EE(3),Iw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),fC(5,"Name"),zu(),os(6,"th",10),fC(7,"Schedule"),zu(),os(8,"th",10),fC(9,"Status"),zu(),os(10,"th",10),fC(11,"Scope"),zu(),os(12,"th",10)(13,"span",11),fC(14,"Actions"),zu()()()(),os(15,"tbody",8),bw(16,ne,19,9,"tr",9,J),zu()()()),n&2){let e=Pw();EE(16),Tw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Mi([]);isLoading=Mi(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Gm({platform:this.state.listPlatform().pipe(Zs(()=>Dr([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===De.WEEK?"week":"month",l=e.unit===De.WEEK&&e.days?.length?` (${e.days.map(p=>_e[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JI({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(p){return i.rowFilter.query.set(p)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),fC(3,"New scheduled prompt"),zu()(),Ew(4,O,2,1,"p",3),Ew(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(EE(),Vh("query",i.rowFilter.query()),EE(3),Iw(i.deletion.error()?4:-1),EE(),Iw(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 ScheduledPromptListComponent};
@@ -1 +0,0 @@
1
- import {B as k$1,k as O$1,e as at,c as fn,l as ko,P,D as P$1}from'./chunk-COmLfT0N.js';import {g,F,w as we,au as k,at as F$1,a3 as vr,M as Mi,a5 as Ys,aw as $m,x as U$1,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,i as bw,T as Tw,n as Aw,q as Pd,L as Ld,Y as Yu,d as Bh}from'./main-B6UJJXO7.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(os(0,"p",3),fC(1),zu()),o&2){let e=Pw();EE(),lg(e.deletion.error());}}function U(o,t){o&1&&(os(0,"p",4),fC(1,"Loading AI models\u2026"),zu());}function z(o,t){o&1&&(os(0,"p",5),fC(1,"No platform AI models defined yet."),zu());}function G(o,t){o&1&&(os(0,"p",4),fC(1,"No AI models match the current filter."),zu());}function J(o,t){if(o&1){let e=Aw();os(0,"button",21),qh("click",function(){Pd(e);let r=Pw().$implicit,m=Pw(2);return Ld(m.edit(r))}),fC(1,"Edit"),zu();}if(o&2){let e=Pw().$implicit;Bh("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=Aw();os(0,"tr",9)(1,"td",12),fC(2),zu(),os(3,"td",13),fC(4),zu(),os(5,"td",14),fC(6),zu(),os(7,"td",15),fC(8),zu(),os(9,"td",16),fC(10),zu(),os(11,"td",17)(12,"div",18),Ew(13,J,2,1,"button",19),os(14,"agentos-row-delete-action",20),qh("deleteRequested",function(){let r=Pd(e).$implicit,m=Pw(2);return Ld(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=Pd(e).$implicit,m=Pw(2);return Ld(m.confirmDelete(r))})("deleteCancelled",function(){Pd(e);let r=Pw(2);return Ld(r.deletion.cancel())}),zu()()()();}if(o&2){let e=t.$implicit,a=Pw(2);EE(2),lg(e.title),EE(2),lg(e.providerName),EE(2),Yu(" ",e.model.apiModelName," "),EE(2),lg(e.model.priority),EE(2),Yu(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),EE(3),Iw(a.deletion.confirmingId()!==e.key?13:-1),EE(),Vh("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),fC(5,"Name"),zu(),os(6,"th",10),fC(7,"Provider"),zu(),os(8,"th",10),fC(9,"API model name"),zu(),os(10,"th",10),fC(11,"Priority"),zu(),os(12,"th",10),fC(13,"Reasoning effort"),zu(),os(14,"th",10)(15,"span",11),fC(16,"Actions"),zu()()()(),os(17,"tbody",8),bw(18,O,15,9,"tr",9,K),zu()()()),o&2){let e=Pw();EE(18),Tw(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k$1();rows=Mi([]);rowFilter=O$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),$m([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let a=new Map(e.map(r=>[r.id??"",r.name]));this.rows.set(t.map((r,m)=>({key:r.id??`model:${m}`,model:r,title:r.alias??r.apiModelName,providerName:a.get(r.aiProviderId)??r.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=JI({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,a){e&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return a.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),fC(3,"New AI model"),zu()(),Ew(4,H,2,1,"p",3),Ew(5,U,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,Q,20,0,"div",6)),e&2&&(EE(),Vh("query",a.rowFilter.query()),EE(3),Iw(a.deletion.error()?4:-1),EE(),Iw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,P,P$1],encapsulation:2})};export{j as PlatformAiModelsComponent};
@@ -1 +0,0 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DmRaBKc6.js';import {q}from'./chunk-YrkvQ7uA.js';import'./chunk-D1kq6J6C.js';import'./chunk-aqEkIRN7.js';import {O}from'./chunk-DIVQtNVn.js';import {g,W,F as F$1,w as we,ak as U,aA as N,M as Mi,aB as Q,ac as _,h as BC,ad as F$2,aC as $e$1,x as U$1,a6 as Zs,ae as Dr,ag as Gm,ah as te,K as x,C as w,J as JI,ax as $t$1,o as os,Q as qh,f as fC,z as zu,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,n as Aw,H as Hh,R as uI,S as dI,d as Bh,Y as Yu,i as bw,T as Tw,l as lg,q as Pd,L as Ld,$ as dg}from'./main-B6UJJXO7.js';import {Q as A,p as pt$1,T as Te,g as gn,R as E,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,x as yn,U as Ut,a as po,h as ho,Z as Zr,Y as Yr,A as An,O as On,b as hn,c as fn,u as un,t as dn,d as cn,E as pn,e as at$1,i as sn,v as an,n as Fo}from'./chunk-COmLfT0N.js';import'./chunk-DxIOAne_.js';var F="*";function $e(n){return (n??[]).some(t=>t.trim()===F)}function Ge(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function Je(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>Je(e)?.test(n)??false)}var Ue="AGENTOS_CONFIG",Ye=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ke(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Ye.has(t)))}var We=(n,t)=>t.value,qe=(n,t)=>t.config.id,ze=(n,t)=>t.type,He=(n,t)=>t.selector;function Xe(n,t){if(n&1&&(os(0,"a",2),fC(1,"View resolved definition \u2192"),zu()),n&2){let e=Pw();Vh("routerLink",e.inspectRoute());}}function Qe(n,t){n&1&&(os(0,"ds-tag",3),fC(1,"Platform level"),zu());}function Ze(n,t){n&1&&(os(0,"p",4),fC(1,"Loading\u2026"),zu());}function et(n,t){if(n&1&&(Hh(0,"input",16),uI()),n&2){let e=Pw(2);Vh("formControl",e.modelNameControl),dI();}}function tt(n,t){if(n&1&&(os(0,"option",41),fC(1),zu()),n&2){let e=t;Vh("ngValue",e.value),EE(),lg(e.label);}}function nt(n,t){if(n&1&&(os(0,"option",41),fC(1),zu()),n&2){let e=t.$implicit;Vh("ngValue",e.value),EE(),lg(e.label);}}function it(n,t){if(n&1&&(os(0,"optgroup",42),bw(1,nt,2,2,"option",41,We),zu()),n&2){let e=Pw(3);EE(),Tw(e.modelOptions().aliases);}}function ot(n,t){if(n&1&&(os(0,"option",41),fC(1),zu()),n&2){let e=t.$implicit;Vh("ngValue",e.value),EE(),lg(e.label);}}function at(n,t){if(n&1&&(os(0,"optgroup",43),bw(1,ot,2,2,"option",41,We),zu()),n&2){let e=Pw(3);EE(),Tw(e.modelOptions().apiNames);}}function lt(n,t){if(n&1&&(os(0,"select",17)(1,"option",40),fC(2,"Select a model"),zu(),Ew(3,tt,2,2,"option",41),Ew(4,it,3,0,"optgroup",42),Ew(5,at,3,0,"optgroup",43),zu(),uI()),n&2){let e,i=Pw(2);Vh("formControl",i.modelNameControl),dI(),EE(),Vh("ngValue",null),EE(2),Iw((e=i.modelOptions().current)?3:-1,e),EE(),Iw(i.modelOptions().aliases.length>0?4:-1),EE(),Iw(i.modelOptions().apiNames.length>0?5:-1);}}function rt(n,t){if(n&1&&(os(0,"span",44),fC(1),zu()),n&2){let e=Pw().$implicit;EE(),lg(e.config.integrationType);}}function st(n,t){if(n&1&&(Hh(0,"input",45),uI()),n&2){let e=Pw().$implicit;Vh("formControl",e.toolsControl),Bh("aria-label","Tools of "+e.config.name),dI();}}function dt(n,t){if(n&1){let e=Aw();os(0,"div",9)(1,"label",10)(2,"input",22),qh("change",function(){let s=Pd(e).$implicit,m=Pw(3);return Ld(m.toggleIntegration(s))}),zu(),os(3,"span",23),fC(4),zu(),Ew(5,rt,2,1,"span",44),zu(),Ew(6,st,1,2,"input",45),zu();}if(n&2){let e=t.$implicit;EE(2),Vh("checked",e.enabled()),EE(2),lg(e.config.name),EE(),Iw(e.config.integrationType?5:-1),EE(),Iw(e.enabled()?6:-1);}}function ct(n,t){if(n&1&&(os(0,"p",12),fC(1),zu()),n&2){let e=Pw().$implicit;EE(),Yu(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function mt(n,t){if(n&1){let e=Aw();os(0,"div",9)(1,"label",23),fC(2),os(3,"span",44),fC(4,"built-in"),zu()(),os(5,"select",47),qh("change",function(s){let m=Pd(e).$implicit,C=Pw(4);return Ld(C.setBuiltInState(m,s.target.value))}),os(6,"option",48),fC(7),zu(),os(8,"option",49),fC(9,"Enabled"),zu(),os(10,"option",50),fC(11,"Disabled"),zu()(),Ew(12,ct,2,1,"p",12),os(13,"p",12),fC(14),zu()();}if(n&2){let e=t.$implicit,i=Pw(4);EE(),Bh("for","built-in-"+e.type),EE(),Yu(" ",e.displayName," "),EE(3),Vh("id","built-in-"+e.type)("value",e.state()),EE(2),lg(i.builtInDefaultLabel(e)),EE(5),Iw(e.state()==="on"&&e.restrictedTools?12:-1),EE(2),lg(e.description);}}function gt(n,t){if(n&1&&(os(0,"span",46),fC(1,"Built-in integrations"),zu(),bw(2,mt,15,7,"div",9,ze)),n&2){let e=Pw(3);EE(2),Tw(e.builtInRows());}}function ut(n,t){n&1&&(os(0,"ds-notice",25),fC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),zu());}function pt(n,t){if(n&1&&(os(0,"ds-fieldset",20),bw(1,dt,7,4,"div",9,qe),Ew(3,gt,4,0),Ew(4,ut,2,0,"ds-notice",25),zu()),n&2){let e=Pw(2);EE(),Tw(e.integrationRows()),EE(2),Iw(e.builtInRows().length>0?3:-1),EE(),Iw(e.configAgentExposureWarning()?4:-1);}}function ft(n,t){n&1&&fC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function Ct(n,t){n&1&&(os(0,"ds-notice",25),fC(1," Saving with this on replaces the selection below with "),os(2,"code",24),fC(3,"*"),zu(),fC(4,". "),zu());}function _t(n,t){n&1&&(os(0,"ds-notice"),fC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),zu());}function bt(n,t){n&1&&(os(0,"p",4),fC(1,"No skill available in this scope yet."),zu());}function ht(n,t){n&1&&(os(0,"span",44),fC(1,"platform"),zu());}function yt(n,t){if(n&1&&(os(0,"span",44),fC(1),zu()),n&2){let e=Pw(4);EE(),Yu(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function xt(n,t){if(n&1&&(os(0,"p",12),fC(1),zu()),n&2){let e=Pw().$implicit;EE(),lg(e.description);}}function vt(n,t){if(n&1){let e=Aw();os(0,"div",9)(1,"label",10)(2,"input",51),qh("change",function(){let s=Pd(e).$implicit,m=Pw(3);return Ld(m.toggleSkill(s))}),zu(),os(3,"span",23),fC(4),zu(),Ew(5,ht,2,0,"span",44),Ew(6,yt,2,1,"span",44),zu(),Ew(7,xt,2,1,"p",12),zu();}if(n&2){let e=t.$implicit,i=Pw(3);EE(2),Vh("checked",e.selected())("disabled",i.allSkillsSelected()),EE(2),lg(e.name),EE(),Iw(e.platform?5:-1),EE(),Iw(e.unresolved?6:-1),EE(),Iw(e.description?7:-1);}}function St(n,t){if(n&1&&bw(0,vt,8,6,"div",9,He),n&2){let e=Pw(2);Tw(e.skillRows());}}function At(n,t){if(n&1&&(os(0,"ds-form-field",29),Hh(1,"textarea",52),uI(),os(2,"p",4),fC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),os(4,"code"),fC(5,"AgentLoopPayload"),zu(),fC(6,". Leave empty if you always provide the payload at launch. "),zu()()),n&2){let e=Pw(2);Vh("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),EE(),Vh("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),dI();}}function wt(n,t){n&1&&fC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Et(n,t){if(n&1&&fC(0),n&2){let e=Pw(3);dg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Tt(n,t){if(n&1&&(os(0,"ds-notice",25),fC(1," Saving with this on replaces the selection below with "),os(2,"code",24),fC(3,"*"),zu(),fC(4,". "),Ew(5,Et,1,2),zu()),n&2){let e=Pw(2);EE(5),Iw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function It(n,t){n&1&&(os(0,"ds-notice"),fC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),zu());}function kt(n,t){n&1&&(os(0,"p",4),fC(1,"No other agent is available in this scope yet."),zu());}function Rt(n,t){n&1&&(os(0,"span",44),fC(1,"pattern"),zu());}function Mt(n,t){n&1&&(os(0,"span",44),fC(1,"via pattern"),zu());}function Ft(n,t){if(n&1&&(os(0,"span",44),fC(1),zu()),n&2){let e=Pw(4);EE(),Yu(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Nt(n,t){if(n&1){let e=Aw();os(0,"button",55),qh("click",function(){Pd(e);let s=Pw().$implicit,m=Pw(3);return Ld(m.removeSubAgent(s))}),fC(1," \xD7 "),zu();}if(n&2){let e=Pw().$implicit;Bh("aria-label","Remove "+e.selector);}}function Dt(n,t){if(n&1){let e=Aw();os(0,"div",31)(1,"label",53)(2,"input",51),qh("change",function(){let s=Pd(e).$implicit,m=Pw(3);return Ld(m.toggleSubAgent(s))}),zu(),os(3,"span",23),fC(4),zu(),Ew(5,Rt,2,0,"span",44)(6,Mt,2,0,"span",44)(7,Ft,2,1,"span",44),zu(),Ew(8,Nt,2,1,"button",54),zu();}if(n&2){let e=t.$implicit,i=Pw(3);EE(2),Vh("checked",e.selected())("disabled",i.allSubAgentsSelected()),EE(2),lg(e.name),EE(),Iw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),EE(3),Iw(e.unresolved?8:-1);}}function Lt(n,t){if(n&1&&bw(0,Dt,9,5,"div",31,He),n&2){let e=Pw(2);Tw(e.subAgentRows());}}function Vt(n,t){if(n&1){let e=Aw();os(0,"div")(1,"button",56),qh("click",function(){Pd(e);let s=Pw(2);return Ld(s.useDefaultDelegationTimeout())}),fC(2," Use server default "),zu()();}}function Pt(n,t){n&1&&(os(0,"ds-notice"),fC(1),zu()),n&2&&(EE(),lg(t));}function Ot(n,t){if(n&1){let e=Aw();os(0,"button",57),qh("click",function(){Pd(e);let s=Pw(2);return Ld(s.exportYaml())}),fC(1),zu();}if(n&2){let e=Pw(2);Vh("disabled",e.isExporting()),EE(),Yu(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Bt(n,t){if(n&1&&Hh(0,"agentos-agent-messaging",39),n&2){let e=Pw(2);Vh("namespaceId",e.namespaceId)("agentId",e.agentConfigId);}}function $t(n,t){if(n&1){let e=Aw();os(0,"form",5),qh("ngSubmit",function(){Pd(e);let s=Pw();return Ld(s.submit())}),os(1,"ds-fieldset",6)(2,"ds-form-field",7),Hh(3,"input",8),uI(),zu(),os(4,"div",9)(5,"label",10),Hh(6,"input",11),uI(),fC(7," Enabled "),zu(),os(8,"p",12),fC(9,"Disabled agents are excluded from namespace resolution."),zu()(),os(10,"ds-form-field",13),Hh(11,"input",14),uI(),zu(),os(12,"ds-form-field",15),Ew(13,et,1,1,"input",16)(14,lt,6,5,"select",17),zu(),os(15,"ds-form-field",18),Hh(16,"textarea",19),uI(),zu()(),Ew(17,pt,5,2,"ds-fieldset",20),os(18,"ds-fieldset",21)(19,"p",4),fC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),os(21,"code"),fC(22,"readSkill"),zu(),fC(23," and "),os(24,"code"),fC(25,"readSkillResource"),zu(),fC(26," tools; selecting none grants neither. "),Ew(27,ft,1,0),zu(),os(28,"label",10)(29,"input",22),qh("change",function(){Pd(e);let s=Pw();return Ld(s.toggleAllSkills())}),zu(),os(30,"span",23),fC(31,"Every skill in the catalogue ("),os(32,"code",24),fC(33,"*"),zu(),fC(34,")"),zu()(),os(35,"p",12),fC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),zu(),Ew(37,Ct,5,0,"ds-notice",25),Ew(38,_t,2,0,"ds-notice"),Ew(39,bt,2,0,"p",4)(40,St,2,0),zu(),os(41,"ds-form-field",26)(42,"select",27)(43,"option",28),fC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),zu(),os(45,"option",28),fC(46,"ADVANCED \u2014 Multi-step reasoning loop"),zu(),os(47,"option",28),fC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),zu()(),uI(),zu(),Ew(49,At,7,3,"ds-form-field",29),os(50,"ds-fieldset",30)(51,"p",4),fC(52," The agents this one may delegate to. Selecting at least one grants it the "),os(53,"code"),fC(54,"DELEGATE__delegate"),zu(),fC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Ew(56,wt,1,0),zu(),os(57,"label",10)(58,"input",22),qh("change",function(){Pd(e);let s=Pw();return Ld(s.toggleAllSubAgents())}),zu(),os(59,"span",23),fC(60,"Every agent it can reach ("),os(61,"code",24),fC(62,"*"),zu(),fC(63,")"),zu()(),os(64,"p",12),fC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),zu(),Ew(66,Tt,6,1,"ds-notice",25),Ew(67,It,2,0,"ds-notice"),Ew(68,kt,2,0,"p",4)(69,Lt,2,0),os(70,"p",4),fC(71," Advanced \u2014 add a glob instead of picking a name, for example "),os(72,"code"),fC(73,"*Fixer"),zu(),fC(74," to cover BugFixer and StoryFixer. "),zu(),os(75,"div",31)(76,"input",32),qh("keydown.enter",function(){Pd(e);let s=Pw();return Ld(s.addSubAgent())}),zu(),uI(),os(77,"button",33),qh("click",function(){Pd(e);let s=Pw();return Ld(s.addSubAgent())}),fC(78," + "),zu()(),os(79,"ds-form-field",34),Hh(80,"input",35),uI(),Ew(81,Vt,3,0,"div"),zu()(),Ew(82,Pt,2,1,"ds-notice"),os(83,"ds-form-actions")(84,"button",36),fC(85),zu(),Ew(86,Ot,2,2,"button",37),os(87,"button",38),qh("click",function(){Pd(e);let s=Pw();return Ld(s.cancel())}),fC(88,"Cancel"),zu()()(),Ew(89,Bt,1,2,"agentos-agent-messaging",39);}if(n&2){let e,i=Pw();Vh("formGroup",i.form),EE(3),Vh("formControl",i.nameControl),dI(),EE(3),Vh("formControl",i.enabledControl),dI(),EE(5),Vh("formControl",i.descriptionControl),dI(),EE(2),Iw(i.modelAsFreeText()?13:14),EE(3),Vh("formControl",i.instructionsControl),dI(),EE(),Iw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),EE(10),Iw(i.isPlatformMode?27:-1),EE(2),Vh("checked",i.allSkillsSelected()),EE(8),Iw(i.namedSkillSelectionDropped()?37:-1),EE(),Iw(i.skillCatalogueUnavailable()?38:-1),EE(),Iw(i.skillRows().length===0?39:40),EE(3),Vh("formControl",i.executionModeControl),dI(),EE(),Vh("value",i.ExecutionMode.SIMPLE),EE(2),Vh("value",i.ExecutionMode.ADVANCED),EE(2),Vh("value",i.ExecutionMode.LOOP),EE(2),Iw(i.isLoopMode()?49:-1),EE(7),Iw(i.isPlatformMode?56:-1),EE(2),Vh("checked",i.allSubAgentsSelected()),EE(8),Iw(i.namedSubAgentSelectionDropped()?66:-1),EE(),Iw(i.subAgentCandidatesUnavailable()?67:-1),EE(),Iw(i.subAgentRows().length===0?68:69),EE(8),Vh("formControl",i.newSubAgentControl),dI(),EE(),Vh("disabled",!i.newSubAgentControl.value.trim()),EE(2),Vh("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),EE(),Vh("formControl",i.delegationTimeoutControl),Bh("aria-invalid",i.delegationTimeoutControl.invalid),dI(),EE(),Iw(i.delegationTimeoutControl.value!==null?81:-1),EE(),Iw((e=i.submitError())?82:-1,e),EE(2),Vh("disabled",i.form.invalid||i.isSubmitting()),EE(),Yu(" ",i.isEditMode()?"Save changes":"Create"," "),EE(),Iw(i.isEditMode()?86:-1),EE(3),Iw(i.isEditMode()&&i.namespaceId?89:-1);}}var je=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=Mi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.paramMap.get("agentConfigId")??"";isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[gn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[gn.min(1),gn.max(2147483647),gn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=BC(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=BC(()=>this.executionModeValue()==="LOOP");subAgentRows=Mi([]);allSubAgentsSelected=Mi(false);subAgentCandidatesUnavailable=Mi(false);namedSubAgentSelectionDropped=BC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=BC(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=BC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);isExporting=Mi(false);submitError=Mi(null);ExecutionMode=$e$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Mi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=BC(()=>Ke({configEnabled:this.builtInRows().some(t=>t.type===Ue&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=Mi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=Mi(false);modelAsFreeText=BC(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=Mi([]);skillRows=Mi([]);allSkillsSelected=Mi(false);skillCatalogueUnavailable=Mi(false);namedSkillSelectionDropped=BC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),Zs(()=>Dr(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Gm({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Dr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:m,skillCatalogue:C,delegationCandidates:E,models:I})=>{this.existingConfig=e,this.applyModelCatalogue(I,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(m,e.integrations??void 0)),this.allSubAgentsSelected.set($e(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Gm({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Dr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:m,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let I=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(I,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(m,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(te(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(Zs(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Dr([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),m=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:Mi(m.has(f.name.toLowerCase()))})),I=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||I.has(N)||(I.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:Mi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):Dr([]);return Gm({platform:t,namespace:e}).pipe(te(({platform:i,namespace:s})=>[...i,...s]),te(i=>i.map(s=>s.name).filter(s=>s.length>0)),te(i=>n.dedupeByKey(i)))}orNoCandidates(){return Zs(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),Dr([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=Ge(e),m=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==m||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),I=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:Mi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),I.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:Mi(true)}));}return I}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(te(t=>t.filter(e=>!e.configSchema)),Zs(t=>(console.error("[agent-config-form] failed to load integration types",t),Dr([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",m=e?.[s],C=e!=null&&s in e,E=Array.isArray(m)?m.join(", "):"";return {config:i,enabled:Mi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,m=e?.[i.type],C=s?Array.isArray(m)&&m.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:Mi(C),restrictedTools:Array.isArray(m)&&m.length>0?m:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:Mi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",m=i.toolsControl.value.trim();t[s]=m===""?null:m.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"agent"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JI({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],[3,"namespaceId","agentId"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return i.cancel()}),fC(3," \u2190 Agent configs "),zu(),Ew(4,Xe,2,1,"a",2),Ew(5,Qe,2,0,"ds-tag",3),zu(),Ew(6,Ze,2,0,"p",4)(7,$t,90,34),zu()),e&2&&(EE(),Vh("title",i.isEditMode()?"Edit agent config":"New agent config"),EE(3),Iw(i.isEditMode()?4:-1),EE(),Iw(i.isPlatformMode?5:-1),EE(),Iw(i.isLoading()?6:7));},dependencies:[qt,md,Co,Mo,Ht,Fn,yn,Ut,po,ho,Zr,Yr,An,On,$t$1,hn,fn,un,dn,cn,pn,at$1,sn,an,Fo,q],encapsulation:2})};export{je as AgentConfigFormComponent};
@@ -1 +0,0 @@
1
- import {q as q$1}from'./chunk-YrkvQ7uA.js';import'./chunk-D1kq6J6C.js';import'./chunk-aqEkIRN7.js';import {b as hn,c as fn,r as rn,E as pn,e as at,o as ln,K as Pi,N as On}from'./chunk-COmLfT0N.js';import {g,W as W$1,F,w as we,ak as U$1,M as Mi,h as BC,x as U$2,J as JI,ax as $t,o as os,Q as qh,f as fC,z as zu,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,r as rg,Y as Yu,i as bw,T as Tw,H as Hh,n as Aw,a0 as AC,ay as OC,q as Pd,L as Ld,az as xD}from'./main-B6UJJXO7.js';var z=(t,n)=>n.id,q=(t,n)=>n.name;function Q(t,n){t&1&&(os(0,"p",3),fC(1,"Loading\u2026"),zu());}function W(t,n){t&1&&(os(0,"ds-notice"),fC(1,"Failed to load agent definition."),zu());}function X(t,n){if(t&1&&(os(0,"dt"),fC(1,"User context"),zu(),os(2,"dd",6),fC(3),zu()),t&2){let e=Pw();EE(3),lg(e.userId);}}function Y(t,n){if(t&1){let e=Aw();os(0,"ds-card")(1,"ds-disclosure",13),qh("toggled",function(){Pd(e);let m=Pw(2);return Ld(m.toggleSystemPrompt())}),os(2,"pre",14),fC(3),zu()()();}if(t&2){let e=Pw(),d=Pw();EE(),Vh("open",!d.systemPromptCollapsed()),EE(2),lg(e.systemPrompt);}}function Z(t,n){if(t&1){let e=Aw();os(0,"ds-card")(1,"ds-disclosure",15),qh("toggled",function(){Pd(e);let m=Pw(2);return Ld(m.toggleInstructions())}),os(2,"pre",14),fC(3),zu()()();}if(t&2){let e=Pw(),d=Pw();EE(),Vh("open",!d.instructionsCollapsed()),EE(2),lg(e.instructions);}}function ee(t,n){t&1&&(os(0,"p",3),fC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),zu());}function te(t,n){t&1&&(os(0,"span",18),fC(1,"platform"),zu());}function ne(t,n){t&1&&(os(0,"span",18),fC(1,"SKILL.md"),zu());}function ie(t,n){if(t&1&&(os(0,"li",16)(1,"span")(2,"span",17),fC(3),zu(),Ew(4,te,2,0,"span",18),Ew(5,ne,2,0,"span",18),zu(),os(6,"p",3),fC(7),zu()()),t&2){let e=n.$implicit;EE(3),lg(e.name),EE(),Iw(e.namespaceId?-1:4),EE(),Iw(e.readOnly?5:-1),EE(2),lg(e.description);}}function oe(t,n){if(t&1&&(os(0,"ul",11),bw(1,ie,8,4,"li",16,z),zu()),t&2){let e=Pw(2);EE(),Tw(e.resolvedSkills());}}function ae(t,n){t&1&&(os(0,"p",3),fC(1,"No tools available for this agent."),zu());}function de(t,n){if(t&1&&(Hh(0,"div",20),AC(1,"agentosMarkdown")),t&2){let e=Pw().$implicit;Vh("innerHTML",OC(1,1,e.description),xD);}}function re(t,n){if(t&1){let e=Aw();os(0,"li")(1,"ds-disclosure",19),qh("toggled",function(){let m=Pd(e).$implicit,j=Pw(3);return Ld(j.toggleTool(m))}),Ew(2,de,2,3,"div",20),os(3,"pre",21),fC(4),zu()()();}if(t&2){let e=n.$implicit,d=Pw(3);EE(),Vh("heading",e.name)("open",d.isToolExpanded(e)),EE(),Iw(e.description?2:-1),EE(2),lg(d.formatSchema(e.inputSchema));}}function se(t,n){if(t&1&&(os(0,"ul",11),bw(1,re,5,4,"li",null,q),zu()),t&2){let e=Pw();EE(),Tw(e.tools);}}function le(t,n){if(t&1&&Hh(0,"agentos-agent-messaging",12),t&2){let e=Pw(2);Vh("namespaceId",e.namespaceId)("agentId",e.agentConfigId);}}function ce(t,n){if(t&1&&(os(0,"ds-card",4)(1,"dl",5)(2,"dt"),fC(3,"Name"),zu(),os(4,"dd"),fC(5),zu(),os(6,"dt"),fC(7,"Resolved model"),zu(),os(8,"dd",6),fC(9),zu(),os(10,"dt"),fC(11,"Provider"),zu(),os(12,"dd"),fC(13),zu(),os(14,"dt",7),fC(15,"Execution mode"),zu(),os(16,"dd",8)(17,"span",9),fC(18),zu()(),Ew(19,X,4,1),zu()(),Ew(20,Y,4,2,"ds-card"),Ew(21,Z,4,2,"ds-card"),os(22,"ds-card",10),Ew(23,ee,2,0,"p",3)(24,oe,3,0,"ul",11),zu(),os(25,"ds-card",10),Ew(26,ae,2,0,"p",3)(27,se,3,0,"ul",11),zu(),Ew(28,le,1,2,"agentos-agent-messaging",12)),t&2){let e=n,d=Pw();EE(5),lg(e.name),EE(4),lg(e.resolvedModelApiName),EE(4),lg(e.resolvedProviderName),EE(4),rg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),EE(),Yu(" ",e.executionMode," "),EE(),Iw(e.userId?19:-1),EE(),Iw(e.systemPrompt?20:-1),EE(),Iw(e.instructions?21:-1),EE(),Vh("heading","Skills ("+d.resolvedSkills().length+")"),EE(),Iw(d.resolvedSkills().length===0?23:24),EE(2),Vh("heading","Tools ("+e.tools.length+")"),EE(),Iw(e.tools.length===0?26:27),EE(2),Iw(d.namespaceId?28:-1);}}var U=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Mi(true);hasError=Mi(false);definition=Mi(null);expandedTools=Mi(new Set);resolvedSkills=BC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Mi(true);instructionsCollapsed=Mi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$2(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let d=new Set(e);return d.has(n.name)?d.delete(n.name):d.add(n.name),d});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=JI({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],[3,"namespaceId","agentId"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,d){if(e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return d.back()}),fC(3," \u2190 Agent configs "),zu(),os(4,"a",2),fC(5,"Edit config \u2192"),zu()(),Ew(6,Q,2,0,"p",3)(7,W,2,0,"ds-notice")(8,ce,29,14),zu()),e&2){let m;EE(4),Vh("routerLink",d.editRoute()),EE(2),Iw(d.isLoading()?6:d.hasError()?7:(m=d.definition())?8:-1,m);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Pi,q$1,On],encapsulation:2})};export{U as AgentConfigInspectComponent};
@@ -1 +0,0 @@
1
- import {O as O$1}from'./chunk-Dx9mLY6-.js';import {I}from'./chunk-Cq9jD9x7.js';import {O}from'./chunk-DIVQtNVn.js';import {g,w as we,M as Mi,h as BC,ad as F,aw as $m,ah as te,x as U,J as JI,o as os,H as Hh,E as Ew,z as zu,a as EE,I as Iw,aF as Qs,K as x,C as w,_ as Qb,f as fC,n as Aw,Q as qh,P as Pw,N as Vh,G as Gu,b as Wu,i as bw,T as Tw,R as uI,l as lg,S as dI,Y as Yu,c as Gh,$ as dg,Z as Zh,q as Pd,L as Ld,ai as vw,a0 as AC,a1 as kC,O as Op}from'./main-B6UJJXO7.js';import {y,$ as k,a0 as B,a1 as a,p as pt,T as Te,a2 as v,a3 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,a4 as mn,d as cn,e as at$1,i as sn,o as ln,a5 as Ni,K as Pi,V as M,j as e,a6 as m,a7 as S}from'./chunk-COmLfT0N.js';import'./chunk-DxIOAne_.js';var Ve=(n,t)=>t.id;function Ne(n,t){if(n&1){let e=Aw();Gu(0,"span",10),fC(1,"Unlink?"),Wu(),Gu(2,"button",11),Zh("click",function(){Pd(e);let r=Pw(),c=Pw(3);return Ld(c.unlink(r))}),fC(3," Confirm "),Wu(),Gu(4,"button",12),Zh("click",function(){Pd(e);let r=Pw(4);return Ld(r.pendingUnlinkId.set(null))}),fC(5,"Cancel"),Wu();}}function Fe(n,t){if(n&1){let e=Aw();Gu(0,"button",12),Zh("click",function(){Pd(e);let r=Pw(),c=Pw(3);return Ld(c.pendingUnlinkId.set(r.id))}),fC(1," Unlink "),Wu();}}function Ae(n,t){if(n&1&&(Gu(0,"span",7),fC(1),Gu(2,"span",8),fC(3),AC(4,"date"),Wu()(),Ew(5,Ne,6,0)(6,Fe,2,0,"button",9)),n&2){let e=t,i=Pw(3);EE(),Yu(" ",e.displayName," "),EE(2),Yu("linked ",kC(4,3,e.linkedAt,"mediumDate")),EE(2),Iw(i.pendingUnlinkId()===e.id?5:6);}}function Le(n,t){if(n&1){let e=Aw();Gu(0,"span",8),fC(1," Then send it this message: "),Gu(2,"code",14),fC(3),Wu(),Gu(4,"button",12),Zh("click",function(){let r=Pd(e),c=Pw(4);return Ld(c.copy(r))}),fC(5,"Copy"),Wu(),fC(6),AC(7,"date"),Wu();}if(n&2){let e=Pw();EE(3),lg(t),EE(3),Yu(" Valid until ",kC(7,2,e.expiresAt,"shortTime"),". ");}}function Ge(n,t){if(n&1&&(Gu(0,"span",8),fC(1),AC(2,"date"),Wu()),n&2){let e=Pw(),i=Pw().$implicit,r=Pw(2);EE(),dg(" Press Start in ",r.platformName(i.platform),", then come back here. Valid until ",kC(2,2,e.expiresAt,"shortTime"),". ");}}function Re(n,t){if(n&1&&(Gu(0,"a",13),fC(1),Wu(),Ew(2,Le,8,5,"span",8)(3,Ge,3,5,"span",8)),n&2){let e,i=t,r=Pw().$implicit;Gh("href",i.url,Op),EE(),Yu(" Open @",r.username," "),EE(),Iw((e=i.code)?2:3,e);}}function $e(n,t){if(n&1){let e=Aw();Gu(0,"span",15),fC(1,"Not connected"),Wu(),Gu(2,"button",16),Zh("click",function(){Pd(e);let r=Pw().$implicit,c=Pw(2);return Ld(c.connect(r))}),fC(3," Connect "),Wu();}}function Be(n,t){if(n&1&&(Gu(0,"div",3)(1,"span",5),fC(2),Gu(3,"a",6),fC(4),Wu()(),Ew(5,Ae,7,6)(6,Re,4,3)(7,$e,4,0),Wu()),n&2){let e,i=t.$implicit,r=Pw(2);EE(2),Yu(" ",i.agentName," "),EE(),Gh("href",i.url,Op),EE(),dg(" @",i.username," on ",r.platformName(i.platform)," "),EE(),Iw((e=r.identityOf(i))?5:(e=r.linkOf(i))?6:7,e);}}function Ke(n,t){if(n&1){let e=Aw();Gu(0,"div",3)(1,"span",5),fC(2),Gu(3,"span",8),fC(4),Wu()(),Gu(5,"span",7),fC(6),Wu(),Gu(7,"button",12),Zh("click",function(){let r=Pd(e).$implicit,c=Pw(2);return Ld(c.unlink(r))}),fC(8,"Unlink"),Wu()();}if(n&2){let e=t.$implicit,i=Pw(2);EE(2),Yu(" ",e.agentName??"A removed bot"," "),EE(2),lg(i.platformName(e.platform)),EE(2),lg(e.displayName);}}function ze(n,t){n&1&&(Gu(0,"p",4),fC(1),Wu()),n&2&&(EE(),lg(t));}function je(n,t){if(n&1&&(Gu(0,"div",0)(1,"h2",1),fC(2,"Messaging"),Wu(),Gu(3,"p",2),fC(4," Talk to your agents from a messaging application: each agent with a bot answers there, in your cases. "),Wu(),bw(5,Be,8,5,"div",3,Ve),bw(7,Ke,9,3,"div",3,Ve),Ew(9,ze,2,1,"p",4),Wu()),n&2){let e,i=Pw();EE(5),Tw(i.bots()),EE(2),Tw(i.orphanIdentities()),EE(2),Iw((e=i.error())?9:-1,e);}}var R=class n{messagingState=g(M);destroyRef=g(we);bots=this.messagingState.bots;platformName=e;orphanIdentities=BC(()=>this.messagingState.identities().filter(t=>!this.bots().some(e=>e.id===t.botId)));visible=BC(()=>this.bots().length>0||this.messagingState.identities().length>0);links=Mi({});pendingUnlinkId=Mi(null);error=Mi(null);constructor(){this.refresh(),Qs(window,"focus").pipe(U()).subscribe(()=>{Object.keys(this.links()).length>0&&this.refresh();});}identityOf(t){return this.messagingState.identities().find(e=>e.botId===t.id)}linkOf(t){return this.links()[t.id]}connect(t){this.error.set(null),this.messagingState.createLink(t.id).pipe(U(this.destroyRef)).subscribe({next:e=>this.links.update(i=>x(w({},i),{[t.id]:e})),error:e=>{console.error(`[MessagingAccounts] Could not get a link to @${t.username}:`,e),this.error.set(`Could not get a link to @${t.username}. Please try again.`);}});}copy(t){navigator.clipboard?.writeText(t).catch(()=>{});}unlink(t){this.pendingUnlinkId.set(null),this.messagingState.unlink(t.id).pipe(U(this.destroyRef)).subscribe({error:e=>{console.error(`[MessagingAccounts] Unlink failed for ${t.id}:`,e),this.error.set("Could not unlink the account. Please try again.");}});}refresh(){this.messagingState.load().pipe(U(this.destroyRef)).subscribe({next:([,t])=>this.links.update(e=>Object.fromEntries(Object.entries(e).filter(([i])=>!t.some(r=>r.botId===i)))),error:t=>console.error("[MessagingAccounts] Could not load the messaging accounts:",t)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JI({type:n,selectors:[["agentos-messaging-accounts"]],decls:1,vars:1,consts:[[1,"messaging-accounts"],[1,"messaging-accounts__title"],[1,"messaging-accounts__hint"],[1,"messaging-accounts__row"],["role","alert",1,"messaging-accounts__error"],[1,"messaging-accounts__platform"],["target","_blank","rel","noopener",1,"messaging-accounts__since",3,"href"],[1,"messaging-accounts__account"],[1,"messaging-accounts__since"],["type","button",1,"messaging-accounts__btn"],[1,"messaging-accounts__confirm"],["type","button",1,"messaging-accounts__btn","messaging-accounts__btn--danger",3,"click"],["type","button",1,"messaging-accounts__btn",3,"click"],["target","_blank","rel","noopener",1,"messaging-accounts__btn","messaging-accounts__btn--primary",3,"href"],[1,"messaging-accounts__code"],[1,"messaging-accounts__account","messaging-accounts__account--none"],["type","button",1,"messaging-accounts__btn","messaging-accounts__btn--primary",3,"click"]],template:function(e,i){e&1&&Ew(0,je,10,1,"div",0),e&2&&Iw(i.visible()?0:-1);},dependencies:[Qb],styles:[".messaging-accounts[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.messaging-accounts__title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.messaging-accounts__hint[_ngcontent-%COMP%], .messaging-accounts__since[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-text-secondary)}.messaging-accounts__row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.75rem}.messaging-accounts__platform[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;gap:.125rem;min-width:180px;font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.messaging-accounts__platform[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.messaging-accounts__platform[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.messaging-accounts__account[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;gap:.125rem;flex:1;font-size:.9375rem;color:var(--color-text)}.messaging-accounts__account--none[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.messaging-accounts__confirm[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text-secondary)}.messaging-accounts__btn[_ngcontent-%COMP%]{padding:.4rem .9rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;text-decoration:none;cursor:pointer}.messaging-accounts__btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.messaging-accounts__btn--primary[_ngcontent-%COMP%]{border-color:var(--color-accent);color:var(--color-accent)}.messaging-accounts__btn--danger[_ngcontent-%COMP%]{border-color:var(--color-error, #c62828);color:var(--color-error, #c62828)}.messaging-accounts__error[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-error, #c62828)}.messaging-accounts__code[_ngcontent-%COMP%]{padding:.1rem .4rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);font-family:var(--font-mono, monospace);word-break:break-all}"]})};var He=(n,t)=>t.value,Ye=(n,t)=>t.title;function Je(n,t){n&1&&(os(0,"p",2),fC(1,"Loading\u2026"),zu());}function qe(n,t){if(n&1&&(os(0,"option",27),fC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.value),EE(),lg(e.label);}}function Qe(n,t){if(n&1){let e=Aw();os(0,"form",15),qh("ngSubmit",function(){Pd(e);let r=Pw(2);return Ld(r.save())}),os(1,"ds-group",16)(2,"dl",17)(3,"dt"),fC(4,"Email"),zu(),os(5,"dd"),fC(6),zu(),os(7,"dt"),fC(8,"External ID"),zu(),os(9,"dd"),fC(10),zu()()(),os(11,"ds-group",18)(12,"ds-form-field",19),Hh(13,"input",20),uI(),zu(),os(14,"ds-form-field",21),Hh(15,"input",22),uI(),zu(),os(16,"ds-form-field",23),Hh(17,"textarea",24),uI(),zu(),os(18,"ds-form-field",25)(19,"select",26),bw(20,qe,2,2,"option",27,He),zu(),uI(),zu()(),os(22,"ds-form-actions")(23,"button",28),fC(24),zu(),os(25,"button",29),qh("click",function(){Pd(e);let r=Pw(2);return Ld(r.cancelEditing())}),fC(26,"Cancel"),zu()()();}if(n&2){let e=Pw(),i=Pw();Vh("formGroup",i.form),EE(6),lg(e.email),EE(4),lg(e.externalId),EE(3),dI(),EE(2),dI(),EE(2),dI(),EE(2),dI(),EE(),Tw(i.languageOptions),EE(3),Vh("disabled",i.isSaving()),EE(),Yu(" ",i.isSaving()?"Saving\u2026":"Save changes"," ");}}function We(n,t){n&1&&(os(0,"p",2),fC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),zu());}function Xe(n,t){if(n&1){let e=Aw();os(0,"span",38),fC(1,"Delete?"),zu(),os(2,"button",39),qh("click",function(){Pd(e);let r=Pw().$implicit,c=Pw(5);return Ld(c.confirmDelete(r))}),fC(3,"Confirm"),zu(),os(4,"button",40),qh("click",function(){Pd(e);let r=Pw(6);return Ld(r.cancelDelete())}),fC(5,"Cancel"),zu();}}function Ze(n,t){if(n&1){let e=Aw();os(0,"button",40),qh("click",function(){Pd(e);let r=Pw().$implicit,c=Pw(5);return Ld(c.armDelete(r))}),fC(1,"Delete"),zu();}}function et(n,t){if(n&1&&(os(0,"li",34)(1,"span",35),fC(2),zu(),os(3,"span",36),fC(4),zu(),Ew(5,Xe,6,0)(6,Ze,2,0,"button",37),zu()),n&2){let e=t.$implicit,i=Pw(5);EE(2),lg(e.name),EE(2),lg(e.subtitle),EE(),Iw(i.isPendingDelete(e)?5:6);}}function tt(n,t){if(n&1&&(os(0,"span",32),fC(1),zu(),os(2,"ul",33),bw(3,et,7,3,"li",34,vw().trackEntry,true),zu()),n&2){let e=t.$implicit;EE(),lg(e.title),EE(2),Tw(e.entries);}}function nt(n,t){if(n&1&&bw(0,tt,5,1,null,null,Ye),n&2){let e=Pw(3);Tw(e.recapSections());}}function it(n,t){if(n&1){let e=Aw();os(0,"ds-group",16)(1,"dl",17)(2,"dt"),fC(3,"Email"),zu(),os(4,"dd"),fC(5),zu(),os(6,"dt"),fC(7,"External ID"),zu(),os(8,"dd"),fC(9),zu()()(),os(10,"ds-group",18)(11,"dl",17)(12,"dt"),fC(13,"First name"),zu(),os(14,"dd"),fC(15),zu(),os(16,"dt"),fC(17,"Last name"),zu(),os(18,"dd"),fC(19),zu(),os(20,"dt"),fC(21,"Bio"),zu(),os(22,"dd"),fC(23),zu(),os(24,"dt"),fC(25,"Language"),zu(),os(26,"dd"),fC(27),zu()()(),os(28,"ds-form-actions")(29,"button",30),qh("click",function(){Pd(e);let r=Pw(2);return Ld(r.startEditing())}),fC(30,"Edit profile"),zu()(),os(31,"ds-disclosure",31),qh("toggled",function(){Pd(e);let r=Pw(2);return Ld(r.toggleOverrides())}),Ew(32,We,2,0,"p",2)(33,nt,2,0),zu();}if(n&2){let e=Pw(),i=Pw();EE(5),lg(e.email),EE(4),lg(e.externalId),EE(6),lg(e.firstname||"\u2014"),EE(4),lg(e.lastname||"\u2014"),EE(4),lg(e.bio||"\u2014"),EE(4),lg(e.preferredLanguage||"\u2014"),EE(4),Vh("heading","My global user configurations ("+i.recap().total+")")("open",i.isOverridesExpanded()),EE(),Iw(i.recap().total===0?32:33);}}function ot(n,t){if(n&1){let e=Aw();os(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),qh("valueChange",function(r){Pd(e);let c=Pw();return Ld(c.setThemeVariant(r))}),zu()(),os(3,"ds-form-field",6)(4,"ds-segmented",7),qh("valueChange",function(r){Pd(e);let c=Pw();return Ld(c.setTheme(r))}),zu()()(),os(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),qh("valueChange",function(r){Pd(e);let c=Pw();return Ld(c.setEnterKeyBehavior(r))}),zu()()(),os(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),qh("valueChange",function(r){Pd(e);let c=Pw();return Ld(c.setShowTechnical(r))}),zu()()(),Hh(11,"agentos-messaging-accounts"),Ew(12,Qe,27,5,"form",14)(13,it,34,9);}if(n&2){let e=Pw();EE(),Vh("hint",e.activeVariantDescription()),EE(),Vh("options",e.themeVariantOptions)("value",e.themeVariant()),EE(),Vh("hint",e.modeOverridden()?e.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),EE(),Vh("options",e.modeOptions())("value",e.shownMode()),EE(3),Vh("options",e.enterKeyOptions)("value",e.enterKeyBehavior()),EE(3),Vh("options",e.showTechnicalOptions)("value",e.showTechnical()),EE(2),Iw(e.isEditing()?12:13);}}function at(n,t){n&1&&(os(0,"p",2),fC(1,"Unable to load profile."),zu());}var Ie=class n{userState=g(y);destroyRef=g(we);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=Mi(false);isLoading=Mi(false);isSaving=Mi(false);isOverridesExpanded=Mi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=BC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=BC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:t,label:e,description:i})=>({value:t,label:e,description:i}));modeOverridden=BC(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=BC(()=>m(this.themeVariant()).label);activeVariantDescription=BC(()=>m(this.themeVariant()).description);modeOptions=BC(()=>this.themeOptions.map(t=>x(w({},t),{disabled:this.isModeDisabled(t.value)})));shownMode=BC(()=>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("",{nonNullable:true}),lastname:new Te("",{nonNullable:true}),bio:new Te("",{nonNullable:true}),preferredLanguage:new Te("",{nonNullable:true})});recap=F($m([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(te(([t,e,i])=>{let r=t.map(h=>({category:"integration",id:h.id??"",name:h.name,subtitle:h.integrationType})),c=e.map(h=>({category:"aiProvider",id:h.id??"",name:h.name,subtitle:h.apiType})),H=i.map(h=>({category:"authSetting",id:h.id??"",name:h.name,subtitle:h.authType}));return {integrations:r,aiProviders:c,authSettings:H,total:r.length+c.length+H.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=BC(()=>{let t=this.recap();return [{title:"Integrations",entries:t.integrations},{title:"AI Providers",entries:t.aiProviders},{title:"My global auth settings",entries:t.authSettings}].filter(e=>e.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(t){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:t});}setThemeVariant(t){v(t)&&this.themePort.setTheme({variant:t,mode:this.themePort.theme().mode});}isModeDisabled(t){return !V(this.themeVariant(),t)}setEnterKeyBehavior(t){this.preferencesPort.setEnterKeyBehavior(t);}setShowTechnical(t){this.preferencesPort.setShowTechnical(t);}save(){if(this.isSaving())return;this.isSaving.set(true);let t=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:t||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(t=>!t),this.pendingDeleteKey.set(null);}pendingDeleteKey=Mi(null);isPendingDelete(t){return this.pendingDeleteKey()===this.entryKey(t)}armDelete(t){t.id&&this.pendingDeleteKey.set(this.entryKey(t));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(t){if(!t.id)return;this.pendingDeleteKey.set(null),(t.category==="integration"?this.integrationState.delete(t.id,"userGlobal"):t.category==="authSetting"?this.authSettingState.delete(t.id,"userGlobal"):this.providerState.delete(t.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:i=>{console.error(`[UserProfile] Delete failed for ${t.category}:${t.id}:`,i);}});}entryKey(t){return `${t.category}:${t.id}`}trackEntry(t,e){return this.entryKey(e)}syncFormFromState(){let t=this.currentUser();t&&this.form.setValue({firstname:t.firstname??"",lastname:t.lastname??"",bio:t.bio??"",preferredLanguage:t.preferredLanguage??""});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=JI({type:n,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(e,i){if(e&1&&(os(0,"ds-page",0),Hh(1,"ds-section-header",1),Ew(2,Je,2,0,"p",2)(3,ot,14,11)(4,at,2,0,"p",2),zu()),e&2){let r;EE(2),Iw(i.isLoading()?2:(r=i.currentUser())?3:4,r);}},dependencies:[qt,md,Co,Mo,Ht,Ut,po,ho,On,wa,hn,fn,un,mn,cn,at$1,sn,ln,Ni,Pi,R],encapsulation:2})};export{Ie as UserProfileComponent};
@@ -1 +0,0 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-DIVQtNVn.js';import {g,W,w as we,M as Mi,x as U,J as JI,o as os,H as Hh,E as Ew,z as zu,a as EE,I as Iw,f as fC,P as Pw,l as lg}from'./main-B6UJJXO7.js';import {b as hn,c as fn,r as rn,E as pn,o as ln,n as Fo}from'./chunk-COmLfT0N.js';import'./chunk-DxIOAne_.js';function O(r,e){r&1&&(os(0,"p",1),fC(1,"Loading integration\u2026"),zu());}function T(r,e){r&1&&(os(0,"ds-notice"),fC(1,"Failed to load this integration configuration."),zu());}function L(r,e){r&1&&(os(0,"div",3)(1,"ds-tag",9),fC(2,"YAML"),zu(),os(3,"ds-tag",10),fC(4,"Read-only"),zu()());}function k(r,e){if(r&1&&(os(0,"ds-card",2),Ew(1,L,5,0,"div",3),os(2,"dl",4)(3,"dt"),fC(4,"Name"),zu(),os(5,"dd"),fC(6),zu(),os(7,"dt"),fC(8,"Type"),zu(),os(9,"dd",5),fC(10),zu(),os(11,"dt"),fC(12,"Description"),zu(),os(13,"dd"),fC(14),zu(),os(15,"dt"),fC(16,"Scope"),zu(),os(17,"dd"),fC(18),zu(),os(19,"dt"),fC(20,"Source"),zu(),os(21,"dd"),fC(22),zu(),os(23,"dt"),fC(24,"Auto grant"),zu(),os(25,"dd"),fC(26),zu(),os(27,"dt"),fC(28,"Auth setting"),zu(),os(29,"dd"),fC(30),zu()()(),os(31,"ds-card",6)(32,"p",7),fC(33,"Sensitive values are always redacted."),zu(),os(34,"pre",8),fC(35),zu()()),r&2){let o=e,a=Pw();EE(),Iw(a.source()==="FILESYSTEM"?1:-1),EE(5),lg(o.name),EE(4),lg(o.integrationType),EE(4),lg(o.description||"\u2014"),EE(4),lg(a.scopeOf(o)),EE(4),lg(a.source()),EE(4),lg(o.autoGrant?"Enabled":"Disabled"),EE(4),lg(o.authSettingName||"None"),EE(5),lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Mi(true);hasError=Mi(false);config=Mi(null);source=Mi("NEO4J");parameters=Mi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=JI({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(os(0,"ds-page"),Hh(1,"ds-section-header",0),Ew(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),zu()),o&2){let m;EE(2),Iw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[hn,fn,rn,pn,ln,Fo],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -1 +0,0 @@
1
- import {B as k$1,k as O,e as at,c as fn,l as ko,P,D as P$1}from'./chunk-COmLfT0N.js';import {g,F,w as we,at as F$1,a3 as vr,M as Mi,a5 as Ys,x as U$1,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,i as bw,T as Tw,n as Aw,d as Bh,q as Pd,L as Ld}from'./main-B6UJJXO7.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(os(0,"p",3),fC(1),zu()),i&2){let t=Pw();EE(),lg(t.deletion.error());}}function U(i,e){i&1&&(os(0,"p",4),fC(1,"Loading AI providers\u2026"),zu());}function j(i,e){i&1&&(os(0,"p",5),fC(1,"No platform AI providers defined yet."),zu());}function K(i,e){i&1&&(os(0,"p",4),fC(1,"No AI providers match the current filter."),zu());}function H(i,e){if(i&1){let t=Aw();os(0,"button",19),qh("click",function(){Pd(t);let s=Pw().$implicit,m=Pw(2);return Ld(m.edit(s))}),fC(1," Edit "),zu();}if(i&2){let t=Pw().$implicit;Bh("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=Aw();os(0,"agentos-row-delete-action",20),qh("deleteRequested",function(){Pd(t);let s=Pw().$implicit,m=Pw(2);return Ld(m.deletion.request(s.id))})("deleteConfirmed",function(){Pd(t);let s=Pw().$implicit,m=Pw(2);return Ld(m.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Pw(3);return Ld(s.deletion.cancel())}),zu();}if(i&2){let t=Pw().$implicit,r=Pw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12),fC(2),zu(),os(3,"td",13),fC(4),zu(),os(5,"td",14),fC(6),zu(),os(7,"td",15)(8,"div",16),Ew(9,H,2,1,"button",17),Ew(10,z,1,3,"agentos-row-delete-action",18),zu()()()),i&2){let t=e.$implicit,r=Pw(2);EE(2),lg(t.name),EE(2),lg(t.apiType),EE(2),lg(t.baseUrl||"\u2014"),EE(3),Iw(r.deletion.confirmingId()!==t.id?9:-1),EE(),Iw(t.id?10:-1);}}function J(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),fC(5,"Name"),zu(),os(6,"th",10),fC(7,"API type"),zu(),os(8,"th",10),fC(9,"Base URL"),zu(),os(10,"th",10)(11,"span",11),fC(12,"Actions"),zu()()()(),os(13,"tbody",8),bw(14,G,11,5,"tr",9,B),zu()()()),i&2){let t=Pw();EE(14),Tw(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(we);aiProviderController=g(F$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k$1();providers=Mi([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JI({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return r.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return r.openCreateForm()}),fC(3,"New AI provider"),zu()(),Ew(4,M,2,1,"p",3),Ew(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(EE(),Vh("query",r.rowFilter.query()),EE(3),Iw(r.deletion.error()?4:-1),EE(),Iw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
@@ -1 +0,0 @@
1
- import {G as m,B as k,k as O$1,e as at,c as fn,l as ko,n as Fo,P,D as P$1}from'./chunk-COmLfT0N.js';import {g,W as W$1,F,w as we,a3 as vr,M as Mi,a5 as Ys,ag as Gm,a6 as Zs,ae as Dr,x as U$1,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,i as bw,T as Tw,Y as Yu,n as Aw,q as Pd,L as Ld,d as Bh}from'./main-B6UJJXO7.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(os(0,"p",3),fC(1),zu()),n&2){let t=Pw();EE(),lg(t.deletion.error());}}function G(n,e){n&1&&(os(0,"p",4),fC(1,"Loading prompts\u2026"),zu());}function O(n,e){n&1&&(os(0,"p",5),fC(1,"No prompts available."),zu());}function Q(n,e){n&1&&(os(0,"p",4),fC(1,"No prompts match the current filter."),zu());}function W(n,e){n&1&&(os(0,"ds-tag",17),fC(1,"Read-only"),zu());}function X(n,e){if(n&1){let t=Aw();os(0,"button",23),qh("click",function(){Pd(t);let l=Pw(2).$implicit,m=Pw(2);return Ld(m.edit(l))}),fC(1," Edit "),zu();}if(n&2){let t=Pw(2).$implicit;Bh("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=Aw();Ew(0,X,2,1,"button",21),os(1,"agentos-row-delete-action",22),qh("deleteRequested",function(){Pd(t);let l=Pw().$implicit,m=Pw(2);return Ld(m.deletion.request(l.key))})("deleteConfirmed",function(){Pd(t);let l=Pw().$implicit,m=Pw(2);return Ld(m.confirmDelete(l))})("deleteCancelled",function(){Pd(t);let l=Pw(3);return Ld(l.deletion.cancel())}),zu();}if(n&2){let t=Pw().$implicit,i=Pw(2);Iw(i.deletion.confirmingId()!==t.key?0:-1),EE(),Vh("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(os(0,"button",20),fC(1,"Inherited"),zu());}function ee(n,e){if(n&1&&(os(0,"tr",9)(1,"td",12),fC(2),zu(),os(3,"td",13),fC(4),zu(),os(5,"td",14)(6,"div",15)(7,"ds-tag",16),fC(8),zu(),Ew(9,W,2,0,"ds-tag",17),zu()(),os(10,"td",18)(11,"div",19),Ew(12,Y,2,4)(13,Z,2,0,"button",20),zu()()()),n&2){let t=e.$implicit;EE(2),lg(t.prompt.name),EE(2),Yu(" ",t.prompt.description||"\u2014"," "),EE(3),Vh("variant",t.scope==="platform"?"neutral":"accent"),EE(),lg(t.scope==="platform"?"Platform":"Namespace"),EE(),Iw(t.scope==="platform"?9:-1),EE(3),Iw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),fC(5,"Name"),zu(),os(6,"th",10),fC(7,"Description"),zu(),os(8,"th",10),fC(9,"Scope"),zu(),os(10,"th",10)(11,"span",11),fC(12,"Actions"),zu()()()(),os(13,"tbody",8),bw(14,ee,14,6,"tr",9,U),zu()()()),n&2){let t=Pw();EE(14),Tw(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();rows=Mi([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),Gm({platform:this.promptState.listPlatform().pipe(Zs(()=>Dr([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=JI({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["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","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,i){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return i.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),fC(3,"New prompt"),zu()(),Ew(4,z,2,1,"p",3),Ew(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(EE(),Vh("query",i.rowFilter.query()),EE(3),Iw(i.deletion.error()?4:-1),EE(),Iw(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{J as NamespacePromptsComponent};
@@ -1 +0,0 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-aqEkIRN7.js';import {I}from'./chunk-Cq9jD9x7.js';import {g,W,F,w as we,M as Mi,x as U,ah as te$1,a5 as Ys,ae as Dr,aS as qo,a6 as Zs,ag as Gm,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,P as Pw,l as lg,t as tC,d as Bh,Y as Yu,i as bw,T as Tw,n as Aw,q as Pd,L as Ld}from'./main-B6UJJXO7.js';import {B as k,k as O,a8 as w,e as at,c as fn,l as ko,n as Fo,P,D as P$1}from'./chunk-COmLfT0N.js';import'./chunk-DxIOAne_.js';var Q=(i,t)=>t.key;function X(i,t){if(i&1&&(os(0,"p",3),fC(1),zu()),i&2){let e=Pw();EE(),lg(e.deletion.error());}}function Z(i,t){if(i&1&&(os(0,"p"),fC(1),zu()),i&2){let e=t;tC(e.kind==="error"?"settings-table__error":"settings-table__status"),Bh("role",e.kind==="error"?"alert":"status"),EE(),Yu(" ",e.text," ");}}function ee(i,t){i&1&&(os(0,"p",5),fC(1,"Loading auth settings\u2026"),zu());}function te(i,t){i&1&&(os(0,"p",6),fC(1,"No auth settings available."),zu());}function ne(i,t){i&1&&(os(0,"p",5),fC(1,"No auth settings match the current filter."),zu());}function ie(i,t){i&1&&(os(0,"ds-tag",18),fC(1,"Read-only"),zu());}function oe(i,t){i&1&&(os(0,"ds-tag",20),fC(1,"Connected"),zu());}function ae(i,t){i&1&&(os(0,"ds-tag",18),fC(1,"Not connected"),zu());}function se(i,t){i&1&&(os(0,"span",21),fC(1,"\u2014"),zu());}function re(i,t){if(i&1){let e=Aw();os(0,"span",26),fC(1,"Waiting for authorization\u2026"),zu(),os(2,"button",27),qh("click",function(){Pd(e);let r=Pw(4);return Ld(r.cancelConnect())}),fC(3," Cancel "),zu();}if(i&2){let e=Pw(2).$implicit;EE(2),Bh("aria-label","Stop waiting for the authorization of "+e.config.name);}}function le(i,t){if(i&1){let e=Aw();os(0,"span",28),fC(1,"Disconnect?"),zu(),os(2,"button",29),qh("click",function(){Pd(e);let r=Pw(2).$implicit,d=Pw(2);return Ld(d.confirmReset(r))}),fC(3),zu(),os(4,"button",29),qh("click",function(){Pd(e);let r=Pw(4);return Ld(r.cancelReset())}),fC(5," Cancel "),zu();}if(i&2){let e=Pw(2).$implicit,n=Pw(2);EE(2),Vh("disabled",n.resettingKey()===e.key),Bh("aria-label","Confirm disconnecting "+e.config.name),EE(),Yu(" ",n.resettingKey()===e.key?"Disconnecting\u2026":"Confirm"," "),EE(),Vh("disabled",n.resettingKey()===e.key),Bh("aria-label","Cancel disconnecting "+e.config.name);}}function ce(i,t){if(i&1){let e=Aw();os(0,"button",29),qh("click",function(){Pd(e);let r=Pw(3).$implicit,d=Pw(2);return Ld(d.requestReset(r))}),fC(1," Disconnect "),zu();}if(i&2){let e=Pw(3).$implicit,n=Pw(2);Vh("disabled",n.connectingKey()!==null),Bh("aria-label","Disconnect "+e.config.name);}}function de(i,t){if(i&1){let e=Aw();os(0,"button",29),qh("click",function(){Pd(e);let r=Pw(2).$implicit,d=Pw(2);return Ld(d.connect(r))}),fC(1),zu(),Ew(2,ce,2,2,"button",30);}if(i&2){let e=Pw(2).$implicit,n=Pw(2);Vh("disabled",n.connectingKey()!==null||n.resettingKey()!==null),Bh("aria-label",(n.connectionOf(e)==="connected"?"Reconnect ":"Connect ")+e.config.name),EE(),Yu(" ",n.connectionOf(e)==="connected"?"Reconnect":"Connect"," "),EE(),Iw(n.connectionOf(e)==="connected"?2:-1);}}function pe(i,t){if(i&1&&Ew(0,re,4,1)(1,le,6,5)(2,de,3,4),i&2){let e=Pw().$implicit,n=Pw(2);Iw(n.connectingKey()===e.key?0:n.resetConfirmingKey()===e.key?1:n.deletion.confirmingId()!==e.key?2:-1);}}function ue(i,t){if(i&1){let e=Aw();os(0,"button",27),qh("click",function(){Pd(e);let r=Pw().$implicit,d=Pw(2);return Ld(d.duplicate(r))}),fC(1," Duplicate "),zu();}if(i&2){let e=Pw().$implicit;Bh("aria-label","Duplicate "+e.config.name);}}function _e(i,t){if(i&1){let e=Aw();os(0,"button",27),qh("click",function(){Pd(e);let r=Pw(2).$implicit,d=Pw(2);return Ld(d.edit(r))}),fC(1," Edit "),zu();}if(i&2){let e=Pw(2).$implicit;Bh("aria-label","Edit "+e.config.name);}}function me(i,t){if(i&1){let e=Aw();Ew(0,_e,2,1,"button",24),os(1,"agentos-row-delete-action",31),qh("deleteRequested",function(){Pd(e);let r=Pw().$implicit,d=Pw(2);return Ld(d.deletion.request(r.key))})("deleteConfirmed",function(){Pd(e);let r=Pw().$implicit,d=Pw(2);return Ld(d.confirmDelete(r))})("deleteCancelled",function(){Pd(e);let r=Pw(3);return Ld(r.deletion.cancel())}),zu();}if(i&2){let e=Pw().$implicit,n=Pw(2);Iw(n.deletion.confirmingId()!==e.key?0:-1),EE(),Vh("rowKey",e.key)("rowLabel",e.config.name)("state",n.deletion);}}function ge(i,t){i&1&&(os(0,"button",25),fC(1,"Inherited"),zu());}function he(i,t){if(i&1&&(os(0,"tr",10)(1,"td",13),fC(2),zu(),os(3,"td",14),fC(4),zu(),os(5,"td",15)(6,"div",16)(7,"ds-tag",17),fC(8),zu(),Ew(9,ie,2,0,"ds-tag",18),zu()(),os(10,"td",19),Ew(11,oe,2,0,"ds-tag",20)(12,ae,2,0,"ds-tag",18)(13,se,2,0,"span",21),zu(),os(14,"td",22)(15,"div",23),Ew(16,pe,3,1),Ew(17,ue,2,1,"button",24),Ew(18,me,2,4)(19,ge,2,0,"button",25),zu()()()),i&2){let e=t.$implicit,n=Pw(2);EE(2),lg(e.config.name),EE(2),Yu(" ",e.config.authType," "),EE(3),Vh("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),EE(),lg(e.scopeLabel),EE(),Iw(e.canMutate?-1:9),EE(2),Iw(n.isOAuth(e)&&n.connectionOf(e)==="connected"?11:n.isOAuth(e)&&n.connectionOf(e)==="disconnected"?12:13),EE(5),Iw(n.isOAuth(e)?16:-1),EE(),Iw(n.deletion.confirmingId()!==e.key&&n.resetConfirmingKey()!==e.key&&n.connectingKey()!==e.key?17:-1),EE(),Iw(e.canMutate?18:19);}}function Ce(i,t){if(i&1&&(os(0,"div",7)(1,"table",8)(2,"thead",9)(3,"tr",10)(4,"th",11),fC(5,"Name"),zu(),os(6,"th",11),fC(7,"Authentication type"),zu(),os(8,"th",11),fC(9,"Scope"),zu(),os(10,"th",11),fC(11,"Connection"),zu(),os(12,"th",11)(13,"span",12),fC(14,"Actions"),zu()()()(),os(15,"tbody",9),bw(16,he,20,9,"tr",10,Q),zu()()()),i&2){let e=Pw();EE(16),Tw(e.rowFilter.filteredRows());}}var fe=new Set(["OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"]),J=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Mi(false);isLoading=Mi(true);rows=Mi([]);deletion=k();connections=Mi({});connectingKey=Mi(null);resetConfirmingKey=Mi(null);resettingKey=Mi(null);actionMessage=Mi(null);connectAttempt=null;connectPopup=null;connectionsLoad=null;rowFilter=O(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(te$1(t=>t.get("namespaceId")??""),Ys(t=>t?this.namespaceRole.isAdminOfNamespace$(t):Dr(false)),U(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false),this.loadConnections();},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}});}confirmDelete(t){!t.canMutate||!t.config.id||this.deletion.execute(t.key,{request$:this.state.delete(t.config.id,t.scope).pipe(U(this.destroyRef)),errorMessage:`Deleting "${t.config.name}" failed. Try again.`});}isOAuth(t){return fe.has(t.config.authType)}connectionOf(t){return this.connections()[t.key]??"unknown"}connect(t){let e=t.config.id;if(!e||this.connectingKey()||this.resettingKey())return;let n=w();if(!n){this.actionMessage.set({kind:"error",text:"The browser blocked the authorization window. Allow pop-ups for this site and try again."});return}this.actionMessage.set(null),this.resetConfirmingKey.set(null),this.connectPopup=n,this.connectingKey.set(t.key),this.connectAttempt=this.state.connect(e,this.namespaceParam(),r=>n.location.href=r,()=>n.closed).pipe(qo(()=>{this.connectingKey.set(null),this.connectAttempt=null,this.connectPopup=null;}),U(this.destroyRef)).subscribe({next:r=>this.onConnectOutcome(t,r,n),error:()=>{n.close(),this.actionMessage.set({kind:"error",text:`Connecting "${t.config.name}" failed. Check that its OAuth settings are complete, then try again.`});}});}cancelConnect(){this.connectAttempt?.unsubscribe(),this.connectPopup?.close();}requestReset(t){this.resettingKey()||this.connectingKey()||(this.actionMessage.set(null),this.resetConfirmingKey.set(t.key));}cancelReset(){this.resettingKey()||this.resetConfirmingKey.set(null);}confirmReset(t){let e=t.config.id;!e||this.resettingKey()||this.resetConfirmingKey()!==t.key||(this.resettingKey.set(t.key),this.state.resetCredential(e,this.namespaceParam()).pipe(U(this.destroyRef)).subscribe({next:()=>{this.resettingKey.set(null),this.resetConfirmingKey.set(null),this.loadConnections();},error:()=>{this.resettingKey.set(null),this.actionMessage.set({kind:"error",text:`Disconnecting "${t.config.name}" failed. Try again.`});}}));}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}});}onConnectOutcome(t,e,n){n.close(),this.loadConnections(),e==="abandoned"?this.actionMessage.set({kind:"info",text:`The authorization window was closed before "${t.config.name}" got connected.`}):e==="timeout"&&this.actionMessage.set({kind:"info",text:`No authorization was received for "${t.config.name}" in time. Try again.`});}namespaceParam(){return this.namespaceId||void 0}loadConnections(){this.connectionsLoad?.unsubscribe();let t=this.rows().filter(e=>this.isOAuth(e)&&e.config.id).map(e=>this.state.getConnection(e.config.id,this.namespaceParam()).pipe(te$1(n=>[e.key,n.connected?"connected":"disconnected"]),Zs(()=>Dr([e.key,"unknown"]))));if(t.length===0){this.connections.set({});return}this.connectionsLoad=Gm(t).pipe(U(this.destroyRef)).subscribe(e=>this.connections.set(Object.fromEntries(e)));}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,n,r){return t.map((d,Y)=>({key:`${e}:${d.id??Y}`,config:d,scope:e,scopeLabel:n,canMutate:r}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=JI({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:10,vars:4,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],[3,"class"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Connection"],["variant","accent"],[1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["role","status",1,"settings-table__confirm-label"],["type","button",3,"click"],[1,"settings-table__confirm-label"],["type","button",3,"click","disabled"],["type","button",3,"disabled"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,n){if(e&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(d){return n.rowFilter.query.set(d)}),zu(),os(2,"button",2),qh("click",function(){return n.openCreateForm()}),fC(3,"New auth setting"),zu()(),Ew(4,X,2,1,"p",3),Ew(5,Z,2,4,"p",4),Ew(6,ee,2,0,"p",5)(7,te,2,0,"p",6)(8,ne,2,0,"p",5)(9,Ce,18,0,"div",7)),e&2){let r;EE(),Vh("query",n.rowFilter.query()),EE(3),Iw(n.deletion.error()?4:-1),EE(),Iw((r=n.actionMessage())?5:-1,r),EE(),Iw(n.isLoading()?6:n.rows().length===0?7:n.rowFilter.filteredRows().length===0?8:9);}},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{J as AuthSettingsAllScopesComponent};
@@ -1 +0,0 @@
1
- import {k as O$1,e as at,c as fn,l as ko,n as Fo,P}from'./chunk-COmLfT0N.js';import {g,w as we,a2 as W,a3 as vr,M as Mi,h as BC,a4 as Ne,a5 as Ys,a6 as Zs,a7 as Kt,x as U$1,J as JI,o as os,Q as qh,z as zu,f as fC,E as Ew,a as EE,N as Vh,I as Iw,i as bw,P as Pw,T as Tw,Y as Yu,l as lg}from'./main-B6UJJXO7.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(os(0,"p",10),fC(1,"Loading the configuration failed. Try refreshing."),zu());}function V(e,t){e&1&&(os(0,"p",11),fC(1,"Loading configuration\u2026"),zu());}function j(e,t){e&1&&(os(0,"p",12),fC(1,"The service reported no settings."),zu());}function O(e,t){e&1&&(os(0,"p",11),fC(1,"No settings match the current filters."),zu());}function Y(e,t){e&1&&(os(0,"ds-tag",22),fC(1,"on"),zu());}function z(e,t){e&1&&(os(0,"ds-tag",20),fC(1,"off"),zu());}function H(e,t){if(e&1&&(os(0,"ds-tag",20),fC(1),zu()),e&2){let i=Pw().$implicit;EE(),lg(i.display.text);}}function G(e,t){if(e&1&&(os(0,"ds-tag",23),fC(1),zu()),e&2){let i=Pw().$implicit;EE(),lg(i.display.text);}}function J(e,t){if(e&1&&(os(0,"span",24),fC(1),zu()),e&2){let i=Pw().$implicit;EE(),lg(i.display.text);}}function K(e,t){if(e&1&&(os(0,"tr",16)(1,"td",18),fC(2),zu(),os(3,"td",19)(4,"ds-tag",20),fC(5),zu()(),os(6,"td",21),Ew(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),zu(),os(12,"td",25),fC(13),zu()()),e&2){let i,a=t.$implicit,m=Pw(2);EE(2),Yu(" ",a.entry.key," "),EE(3),Yu(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),EE(2),Iw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),EE(6),Yu(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(os(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),fC(5,"Setting"),zu(),os(6,"th",17),fC(7,"Source"),zu(),os(8,"th",17),fC(9,"Value"),zu(),os(10,"th",17),fC(11,"Description"),zu()()(),os(12,"tbody",15),bw(13,K,14,4,"tr",16,U),zu()()()),e&2){let i=Pw();EE(13),Tw(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new vr(void 0);isLoading=Mi(true);loadError=Mi(false);rows=Mi([]);source=Mi("ALL");status=Mi("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=BC(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Ne;constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(Zs(()=>(this.loadError.set(true),this.isLoading.set(false),Kt))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=JI({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["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","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return a.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return a.reload()}),fC(3,"Refresh"),zu()(),os(4,"div",3)(5,"select",4),qh("change",function(c){return a.source.set(c.target.value)}),os(6,"option",5),fC(7,"All sources"),zu(),os(8,"option",6),fC(9,"Environment variables"),zu(),os(10,"option",6),fC(11,"Spring properties"),zu()(),os(12,"select",7),qh("change",function(c){return a.status.set(c.target.value)}),os(13,"option",5),fC(14,"Set and unset"),zu(),os(15,"option",8),fC(16,"Set only"),zu(),os(17,"option",9),fC(18,"Unset only"),zu()()(),Ew(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(EE(),Vh("query",a.rowFilter.query()),EE(4),Vh("value",a.source()),EE(3),Vh("value",a.Source.ENVIRONMENT),EE(2),Vh("value",a.Source.PROPERTY),EE(2),Vh("value",a.status()),EE(7),Iw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,fn,ko,Fo,P],encapsulation:2})};export{A as PlatformConfigurationComponent};