@whoz-oss/coday-client 3.33.0 → 3.33.1

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 (80) hide show
  1. package/browser/{chunk-DsFEZkSl.js → chunk--u1fh-bE.js} +1 -1
  2. package/browser/chunk-2e1XJLC3.js +1 -0
  3. package/browser/{chunk-D6BBuWSd.js → chunk-6LX0m2KK.js} +1 -1
  4. package/browser/{chunk--r2IPkvN.js → chunk-7OibMkdV.js} +1 -1
  5. package/browser/{chunk-Mxaxers6.js → chunk-97Ur9CVM.js} +1 -1
  6. package/browser/{chunk-4NMdLPHF.js → chunk-BA-NscEe.js} +1 -1
  7. package/browser/{chunk-P6Fi8ohd.js → chunk-BAW4T6Di.js} +1 -1
  8. package/browser/{chunk-B_-1xOxe.js → chunk-BJy7Ev8t.js} +1 -1
  9. package/browser/{chunk-BhXLqAug.js → chunk-BMMVal6G.js} +1 -1
  10. package/browser/{chunk-DFLL0Odh.js → chunk-BR2UGTBA.js} +1 -1
  11. package/browser/{chunk-D3gurhpR.js → chunk-BVHP3O1y.js} +1 -1
  12. package/browser/{chunk-C_J2R_PK.js → chunk-BYRF4k2F.js} +1 -1
  13. package/browser/{chunk-CZmNdEYy.js → chunk-Bb0cfZpR.js} +1 -1
  14. package/browser/{chunk-O4nbXJCv.js → chunk-Bdo-PzpO.js} +1 -1
  15. package/browser/{chunk-DWSvE7KY.js → chunk-BfgOvSfj.js} +1 -1
  16. package/browser/{chunk-D3fatnCm.js → chunk-BgHBODRL.js} +1 -1
  17. package/browser/{chunk-CJIgE5YB.js → chunk-Bp6uMEC4.js} +1 -1
  18. package/browser/{chunk-COD2O4SF.js → chunk-BrwKLScI.js} +1 -1
  19. package/browser/{chunk-B-Ejl4sU.js → chunk-BuwCQJib.js} +1 -1
  20. package/browser/chunk-BvidtKG2.js +10 -0
  21. package/browser/{chunk-C2Inb2UP.js → chunk-BwA9KDbo.js} +1 -1
  22. package/browser/{chunk-F5WjZgr6.js → chunk-ByHd8LOC.js} +1 -1
  23. package/browser/chunk-CCjiYUwJ.js +1 -0
  24. package/browser/{chunk-KIJUJ9nq.js → chunk-CDVp9M5o.js} +1 -1
  25. package/browser/{chunk-DZUhjamf.js → chunk-CWhMBwZt.js} +1 -1
  26. package/browser/{chunk-S9BROQKc.js → chunk-CY4cIdrD.js} +1 -1
  27. package/browser/{chunk-BPkyqr-f.js → chunk-CaZu6-ik.js} +1 -1
  28. package/browser/{chunk-C0KRHI6e.js → chunk-CfLw6giw.js} +1 -1
  29. package/browser/{chunk-CtHF-uul.js → chunk-CgZso3Sn.js} +1 -1
  30. package/browser/{chunk-CGn0orvL.js → chunk-Cjnbx8x8.js} +1 -1
  31. package/browser/{chunk-AB2V4DzP.js → chunk-CrDpiJQ_.js} +1 -1
  32. package/browser/{chunk-B3KKH9dW.js → chunk-CrtwjGyv.js} +1 -1
  33. package/browser/{chunk-CEQ5C5Tx.js → chunk-CvSL9m7J.js} +1 -1
  34. package/browser/{chunk-1mA1C1Ia.js → chunk-D0hAJFb0.js} +1 -1
  35. package/browser/{chunk-Bx_FH6m3.js → chunk-D1wn67qT.js} +1 -1
  36. package/browser/{chunk-VE530Qd2.js → chunk-D2JaJwBk.js} +1 -1
  37. package/browser/{chunk-4QqbIPaR.js → chunk-DFN1Pyx5.js} +1 -1
  38. package/browser/{chunk-DzWQQKpk.js → chunk-DHVomWlH.js} +1 -1
  39. package/browser/{chunk-BjFLkaZE.js → chunk-DKZE1MMp.js} +1 -1
  40. package/browser/{chunk-B4hQ_D8H.js → chunk-DMb_O3oJ.js} +1 -1
  41. package/browser/{chunk-Bk2EXxig.js → chunk-DQhceK5b.js} +1 -1
  42. package/browser/chunk-DRINXf1H.js +1 -0
  43. package/browser/{chunk-DZuvl0-q.js → chunk-DRl5lKc8.js} +1 -1
  44. package/browser/{chunk-CJGzYd_S.js → chunk-DSWc3xOX.js} +1 -1
  45. package/browser/{chunk-CNmZmLwF.js → chunk-DTO-7qsb.js} +1 -1
  46. package/browser/{chunk-CJxkwaxD.js → chunk-DYl74_xV.js} +1 -1
  47. package/browser/{chunk-DR5zNU0n.js → chunk-Dg2L56ka.js} +1 -1
  48. package/browser/{chunk-CG3MF0H4.js → chunk-DkYkMN4g.js} +1 -1
  49. package/browser/{chunk-bgvmHk7z.js → chunk-Dl_uhmYA.js} +1 -1
  50. package/browser/{chunk-CK18gZ63.js → chunk-DmspnNZU.js} +1 -1
  51. package/browser/{chunk-Cq3KqN1m.js → chunk-DngrH8va.js} +1 -1
  52. package/browser/{chunk-BpSHA6TV.js → chunk-DoBiZHJP.js} +1 -1
  53. package/browser/{chunk-D8sYWCcr.js → chunk-Dq_iutg_.js} +1 -1
  54. package/browser/{chunk-DVrM3JI8.js → chunk-DrktTXS1.js} +1 -1
  55. package/browser/{chunk-BrUYkz33.js → chunk-DzIeB2JV.js} +1 -1
  56. package/browser/{chunk-CnEa9fH2.js → chunk-Fswp1zS2.js} +1 -1
  57. package/browser/chunk-I798FyiF.js +1 -0
  58. package/browser/chunk-JXiqGD2F.js +1 -0
  59. package/browser/{chunk-DqzTsn7a.js → chunk-KJgXoqSt.js} +1 -1
  60. package/browser/{chunk-BopMYlkE.js → chunk-WJVIVGQ_.js} +1 -1
  61. package/browser/{chunk-DAk8SIkq.js → chunk-XRvc0QGl.js} +1 -1
  62. package/browser/{chunk-BFY0pXEf.js → chunk-Xqo-i29q.js} +1 -1
  63. package/browser/{chunk-CkBh9-Fw.js → chunk-ZI_RF6mJ.js} +1 -1
  64. package/browser/{chunk-DstI03OT.js → chunk-amKg4vsy.js} +1 -1
  65. package/browser/{chunk-QcmfFN_C.js → chunk-gfpawxnm.js} +1 -1
  66. package/browser/{chunk-CniyJRG1.js → chunk-nyQxv1ai.js} +1 -1
  67. package/browser/{chunk-B_gHVcU6.js → chunk-qnkDdlfN.js} +1 -1
  68. package/browser/{chunk-DmNKvrHl.js → chunk-s2nIreh9.js} +1 -1
  69. package/browser/{chunk-CglVp4ZH.js → chunk-tpkg6uRN.js} +1 -1
  70. package/browser/{chunk-BXZoje_o.js → chunk-vuYNru7F.js} +1 -1
  71. package/browser/{chunk-D-l2ORqm.js → chunk-zoDBYyjf.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-2EYBZUJC.js → main-COD2LZKB.js} +13 -13
  74. package/package.json +1 -1
  75. package/browser/chunk-BWcVMw4T.js +0 -1
  76. package/browser/chunk-D-QPhn7p.js +0 -1
  77. package/browser/chunk-D3BAOO_0.js +0 -1
  78. package/browser/chunk-DnMJl9Ao.js +0 -1
  79. package/browser/chunk-kFOHrPbJ.js +0 -10
  80. package/browser/chunk-lU3996br.js +0 -1
@@ -1 +1 @@
1
- import {I}from'./chunk-CglVp4ZH.js';import {g,G,C as Ce,dm as $,df as U,aJ as Tr,a as Gi,bS as va,aD as Ly,r as re,b as U$1,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-2EYBZUJC.js';import {W as Wn,S as Se}from'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';var V=()=>[];function F(n,t){if(n&1){let o=lC();ws(0,"agentos-ai-model-item",4),Rg("editRequested",function(e){If(o);let s=gC(2);return wf(s.onEdit(e))})("deleteRequested",function(e){If(o);let s=gC(2);return wf(s.deleteModel(e))}),pl();}n&2&&bg("model",t);}function O(n,t){if(n&1&&Jw(0,F,1,1,"agentos-ai-model-item",3),n&2){let o,i=t.$implicit,e=gC();eC((o=e.resolveModel(i.id))?0:-1,o);}}var S=class n{router=g(G);destroyRef=g(Ce);aiModelController=g($);aiProviderController=g(U);refresh$=new Tr(void 0);isLoading=Gi(true);data$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),Ly([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))));modelItems$=this.data$.pipe(re(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(U$1(this.destroyRef)).subscribe({next:([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"]);}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-platform-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return i.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return i.goBack()}),pl()(),Eg(3,O,1,1,"ng-template",null,0,fT)),o&2){let e=CC(4);bg("items",uT(1,4,i.modelItems$)??rT(6,V))("loading",i.isLoading())("showCreate",true)("itemTemplate",e);}},dependencies:[Wn,I,Se,xb],styles:[".platform-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{S as PlatformAiModelsComponent};
1
+ import {I}from'./chunk-tpkg6uRN.js';import {g,G,C as Ce,dm as $,df as U,aJ as Tr,a as Gi,bS as va,aD as Ly,r as re,b as U$1,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import {W as Wn,S as Se}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';var V=()=>[];function F(n,t){if(n&1){let o=lC();ws(0,"agentos-ai-model-item",4),Rg("editRequested",function(e){If(o);let s=gC(2);return wf(s.onEdit(e))})("deleteRequested",function(e){If(o);let s=gC(2);return wf(s.deleteModel(e))}),pl();}n&2&&bg("model",t);}function O(n,t){if(n&1&&Jw(0,F,1,1,"agentos-ai-model-item",3),n&2){let o,i=t.$implicit,e=gC();eC((o=e.resolveModel(i.id))?0:-1,o);}}var S=class n{router=g(G);destroyRef=g(Ce);aiModelController=g($);aiProviderController=g(U);refresh$=new Tr(void 0);isLoading=Gi(true);data$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),Ly([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))));modelItems$=this.data$.pipe(re(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(U$1(this.destroyRef)).subscribe({next:([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"]);}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-platform-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return i.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return i.goBack()}),pl()(),Eg(3,O,1,1,"ng-template",null,0,fT)),o&2){let e=CC(4);bg("items",uT(1,4,i.modelItems$)??rT(6,V))("loading",i.isLoading())("showCreate",true)("itemTemplate",e);}},dependencies:[Wn,I,Se,xb],styles:[".platform-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{S as PlatformAiModelsComponent};
@@ -1,4 +1,4 @@
1
- import {b as Qe}from'./chunk-BPkyqr-f.js';import {D as D$1,i as y}from'./chunk-CZmNdEYy.js';import {g,H as py,bU as Od,Y as x,aL as wo,aM as Zn,aO as wt,az as Xt,bw as St,bs as Tl,aW as C,aS as K,al as vt,aX as D,bx as on,by as um,aT as Ut,e as xw,bz as Oi,aC as Tu,a_ as QT,bA as yC,k as ws,q as Rg,S as Sg,o as pl,J as Jw,bB as vC,u as CC,v as bg,X as XE,A as Ug,T as Tg,y as eC,b5 as nT,bC as Si,c8 as KT,c0 as xg,b$ as kC,D as Pg,E as EC,I as IC,c9 as kf}from'./main-2EYBZUJC.js';var ae=["switch"],ie=["*"];function ne(a,s){a&1&&(ws(0,"span",11),kf(),ws(1,"svg",13),Sg(2,"path",14),pl(),ws(3,"svg",15),Sg(4,"path",16),pl()());}var ce=new C("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:false,hideIcon:false,disabledInteractive:false})}),b=class{source;checked;constructor(s,e){this.source=s,this.checked=e;}},se=(()=>{class a{_elementRef=g(Xt);_focusMonitor=g(St);_changeDetectorRef=g(Tl);defaults=g(ce);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=false;_createChangeEvent(e){return new b(this,e)}_labelId;get buttonId(){return `${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus();}_noopAnimations=K();_focused=false;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required=false;color;disabled=false;disableRipple=false;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck();}hideIcon;disabledInteractive;change=new vt;toggleChange=new vt;get inputId(){return `${this.id||this._uniqueId}-input`}constructor(){g(D).load(on);let e=g(new um("tabindex"),{optional:true}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=g(Ut).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??false,this.disabledInteractive=i.disabledInteractive??false,this._labelId=this._uniqueId+"-label";}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,true).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=true,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=false,this._onTouched(),this._changeDetectorRef.markForCheck();});});}ngOnChanges(e){e.required&&this._validatorOnChange();}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef);}writeValue(e){this.checked=!!e;}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorOnChange=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck();}toggle(){this.checked=!this.checked,this._onChange(this.checked);}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked));}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new b(this,this.checked))));}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=xw({type:a,selectors:[["mat-slide-toggle"]],viewQuery:function(i,t){if(i&1&&Pg(ae,5),i&2){let r;EC(r=IC())&&(t._switchElement=r.first);}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,t){i&2&&(xg("id",t.id),Tg("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),kC(t.color?"mat-"+t.color:""),Ug("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations));},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",QT],color:"color",disabled:[2,"disabled","disabled",QT],disableRipple:[2,"disableRipple","disableRipple",QT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:KT(e)],checked:[2,"checked","checked",QT],hideIcon:[2,"hideIcon","hideIcon",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[nT([{provide:D$1,useExisting:Si(()=>a),multi:true},{provide:y,useExisting:a,multi:true}]),Tu],ngContentSelectors:ie,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,t){if(i&1&&(yC(),ws(0,"div",1)(1,"button",2,0),Rg("click",function(){return t._handleClick()}),Sg(3,"div",3)(4,"span",4),ws(5,"span",5)(6,"span",6)(7,"span",7),Sg(8,"span",8),pl(),ws(9,"span",9),Sg(10,"span",10),pl(),Jw(11,ne,5,0,"span",11),pl()()(),ws(12,"label",12),Rg("click",function(ee){return ee.stopPropagation()}),vC(13),pl()()),i&2){let r=CC(2);bg("labelPosition",t.labelPosition),XE(),Ug("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),bg("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),Tg("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),XE(9),bg("matRippleTrigger",r)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",true),XE(),eC(t.hideIcon?-1:11),XE(),bg("for",t.buttonId),Tg("id",t._labelId);}},dependencies:[Oi,Qe],styles:[`.mdc-switch {
1
+ import {b as Qe}from'./chunk-CaZu6-ik.js';import {D as D$1,i as y}from'./chunk-Bb0cfZpR.js';import {g,H as py,bU as Od,Y as x,aL as wo,aM as Zn,aO as wt,az as Xt,bw as St,bs as Tl,aW as C,aS as K,al as vt,aX as D,bx as on,by as um,aT as Ut,e as xw,bz as Oi,aC as Tu,a_ as QT,bA as yC,k as ws,q as Rg,S as Sg,o as pl,J as Jw,bB as vC,u as CC,v as bg,X as XE,A as Ug,T as Tg,y as eC,b5 as nT,bC as Si,c8 as KT,c0 as xg,b$ as kC,D as Pg,E as EC,I as IC,c9 as kf}from'./main-COD2LZKB.js';var ae=["switch"],ie=["*"];function ne(a,s){a&1&&(ws(0,"span",11),kf(),ws(1,"svg",13),Sg(2,"path",14),pl(),ws(3,"svg",15),Sg(4,"path",16),pl()());}var ce=new C("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:false,hideIcon:false,disabledInteractive:false})}),b=class{source;checked;constructor(s,e){this.source=s,this.checked=e;}},se=(()=>{class a{_elementRef=g(Xt);_focusMonitor=g(St);_changeDetectorRef=g(Tl);defaults=g(ce);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=false;_createChangeEvent(e){return new b(this,e)}_labelId;get buttonId(){return `${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus();}_noopAnimations=K();_focused=false;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required=false;color;disabled=false;disableRipple=false;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck();}hideIcon;disabledInteractive;change=new vt;toggleChange=new vt;get inputId(){return `${this.id||this._uniqueId}-input`}constructor(){g(D).load(on);let e=g(new um("tabindex"),{optional:true}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=g(Ut).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??false,this.disabledInteractive=i.disabledInteractive??false,this._labelId=this._uniqueId+"-label";}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,true).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=true,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=false,this._onTouched(),this._changeDetectorRef.markForCheck();});});}ngOnChanges(e){e.required&&this._validatorOnChange();}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef);}writeValue(e){this.checked=!!e;}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorOnChange=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck();}toggle(){this.checked=!this.checked,this._onChange(this.checked);}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked));}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new b(this,this.checked))));}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=xw({type:a,selectors:[["mat-slide-toggle"]],viewQuery:function(i,t){if(i&1&&Pg(ae,5),i&2){let r;EC(r=IC())&&(t._switchElement=r.first);}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,t){i&2&&(xg("id",t.id),Tg("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),kC(t.color?"mat-"+t.color:""),Ug("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations));},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",QT],color:"color",disabled:[2,"disabled","disabled",QT],disableRipple:[2,"disableRipple","disableRipple",QT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:KT(e)],checked:[2,"checked","checked",QT],hideIcon:[2,"hideIcon","hideIcon",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[nT([{provide:D$1,useExisting:Si(()=>a),multi:true},{provide:y,useExisting:a,multi:true}]),Tu],ngContentSelectors:ie,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,t){if(i&1&&(yC(),ws(0,"div",1)(1,"button",2,0),Rg("click",function(){return t._handleClick()}),Sg(3,"div",3)(4,"span",4),ws(5,"span",5)(6,"span",6)(7,"span",7),Sg(8,"span",8),pl(),ws(9,"span",9),Sg(10,"span",10),pl(),Jw(11,ne,5,0,"span",11),pl()()(),ws(12,"label",12),Rg("click",function(ee){return ee.stopPropagation()}),vC(13),pl()()),i&2){let r=CC(2);bg("labelPosition",t.labelPosition),XE(),Ug("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),bg("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),Tg("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),XE(9),bg("matRippleTrigger",r)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",true),XE(),eC(t.hideIcon?-1:11),XE(),bg("for",t.buttonId),Tg("id",t._labelId);}},dependencies:[Oi,Qe],styles:[`.mdc-switch {
2
2
  align-items: center;
3
3
  background: none;
4
4
  border: none;
@@ -0,0 +1 @@
1
+ import {O}from'./chunk-DoBiZHJP.js';import {N as N$1}from'./chunk-2e1XJLC3.js';import {g,G,C as Ce,d9 as N$2,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import'./chunk-BvidtKG2.js';import {W as Wn,S as Se}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';import'./chunk-JXiqGD2F.js';import'./chunk-KJgXoqSt.js';var F=()=>[];function N(i,t){if(i&1){let e=lC();ws(0,"agentos-integration-config-item",4),Rg("editRequested",function(n){If(e);let f=gC(2);return wf(f.onEdit(n))})("deleteRequested",function(n){If(e);let f=gC(2);return wf(f.deleteConfig(n))}),pl();}i&2&&bg("config",t);}function j(i,t){if(i&1&&Jw(0,N,1,1,"agentos-integration-config-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveConfig(o.id))?0:-1,e);}}var V=class i{router=g(G);destroyRef=g(Ce);state=g(N$1);integrationConfigController=g(N$2);refresh$=new Tr(void 0);isLoading=Gi(true);configs$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())));configItems$=this.configs$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.configsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}deleteConfig(t){this.integrationConfigController.deleteIntegrationConfig(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){this.router.navigate(["/agentos","admin","integration-configs",t.id??"","edit"]);}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:7,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(3,j,1,1,"ng-template",null,0,fT)),e&2){let n=CC(4);bg("items",uT(1,4,o.configItems$)??rT(6,F))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,Se,xb],styles:[".platform-integration-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-integration-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{V as PlatformIntegrationConfigsComponent};
@@ -1,2 +1,2 @@
1
- import {v}from'./chunk-AB2V4DzP.js';import {R,q,J}from'./chunk-B_gHVcU6.js';import {g,ao as V,G,C as Ce$1,a as Gi,F,m as mT,cd as Hf,b as U,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,a9 as lC,t as rC,a4 as nC,a3 as VI,S as Sg,ac as gC,v as bg,a6 as UI,z as oC,a5 as vl,cH as Kw,aa as If,ab as wf,b$ as kC,T as Tg}from'./main-2EYBZUJC.js';import'./chunk-kFOHrPbJ.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-CZmNdEYy.js';import'./chunk-BWcVMw4T.js';import'./chunk-DqzTsn7a.js';import'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';function se(i,t){i&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ce(i,t){if(i&1&&(ws(0,"label",23),Sg(1,"input",24),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,o=gC(3);XE(),bg("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),UI(),XE(2),Yg(e.label);}}function de(i,t){if(i&1&&(ws(0,"fieldset",8)(1,"legend",22),GC(2,"Configuration scope"),pl(),rC(3,ce,4,4,"label",23,Kw().trackByScope,true),pl()),i&2){let e=gC(2);bg("disabled",e.isEditMode()),XE(3),oC(e.scopeOptions);}}function ue(i,t){if(i&1&&(ws(0,"option",13),GC(1),pl()),i&2){let e=t.$implicit,o=gC(2);bg("value",e),XE(),Yg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&GC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(ws(0,"span",11),GC(1,"*"),pl());}function me(i,t){if(i&1&&(ws(0,"p",28),GC(1),pl()),i&2){let e=gC(2).$implicit;bg("id","as-hint-"+e.key),XE(),Yg(e.hint);}}function ge(i,t){if(i&1&&(Sg(0,"input",27),VI(),Jw(1,me,2,2,"p",28)),i&2){let e=gC().$implicit;kC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),bg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Tg("aria-describedby",e.hint?"as-hint-"+e.key:null),UI(),XE(),eC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(ws(0,"div",9)(1,"label",26),GC(2),Jw(3,he,2,0,"span",11),pl(),Jw(4,ge,2,9),pl()),i&2){let e,o=t.$implicit,l=gC(3);XE(),bg("for","as-cred-"+o.key),XE(),vl(" ",o.label," "),XE(),eC(o.required?3:-1),XE(),eC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(ws(0,"fieldset",18)(1,"legend",22),GC(2,"Credentials"),pl(),ws(3,"p",25),GC(4," Values are stored encrypted and masked on read. "),Jw(5,pe,1,0),pl(),rC(6,Ce,5,4,"div",9,Kw().trackByField,true),pl()),i&2){let e=gC(2);XE(5),eC(e.isEditMode()?5:-1),XE(),oC(e.credentialFields());}}function ye(i,t){if(i&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let l=gC();return wf(l.submit())}),Jw(1,de,5,1,"fieldset",8),ws(2,"div",9)(3,"label",10),GC(4,"Auth type "),ws(5,"span",11),GC(6,"*"),pl()(),ws(7,"select",12),rC(8,ue,2,2,"option",13,nC),pl(),VI(),pl(),ws(10,"div",9)(11,"label",14),GC(12,"Name "),ws(13,"span",11),GC(14,"*"),pl()(),Sg(15,"input",15),VI(),pl(),ws(16,"div",9)(17,"label",16),GC(18,"Description"),pl(),Sg(19,"input",17),VI(),pl(),Jw(20,fe,8,1,"fieldset",18),ws(21,"div",19)(22,"button",20),GC(23),pl(),ws(24,"button",21),Rg("click",function(){If(e);let l=gC();return wf(l.cancel())}),GC(25,"Cancel"),pl()()();}if(i&2){let e=gC();bg("formGroup",e.form),XE(),eC(e.isPlatformMode?-1:1),XE(6),bg("formControl",e.authTypeControl),UI(),XE(),oC(e.authTypeOptions),XE(7),bg("formControl",e.nameControl),UI(),XE(4),bg("formControl",e.descriptionControl),UI(),XE(),eC(e.credentialFields().length>0?20:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Gi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>Se[this.selectedAuthType()]);isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return o.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Auth Settings "),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,se,2,0,"p",5)(9,ye,26,8,"form",6),pl()),e&2&&(XE(7),Yg(o.isEditMode()?"Edit auth setting":"New auth setting"),XE(),eC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
1
+ import {v}from'./chunk-CrDpiJQ_.js';import {R,q,J}from'./chunk-qnkDdlfN.js';import {g,ao as V,G,C as Ce$1,a as Gi,F,m as mT,cd as Hf,b as U,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,a9 as lC,t as rC,a4 as nC,a3 as VI,S as Sg,ac as gC,v as bg,a6 as UI,z as oC,a5 as vl,cH as Kw,aa as If,ab as wf,b$ as kC,T as Tg}from'./main-COD2LZKB.js';import'./chunk-BvidtKG2.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-Bb0cfZpR.js';import'./chunk-JXiqGD2F.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';function se(i,t){i&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ce(i,t){if(i&1&&(ws(0,"label",23),Sg(1,"input",24),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,o=gC(3);XE(),bg("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),UI(),XE(2),Yg(e.label);}}function de(i,t){if(i&1&&(ws(0,"fieldset",8)(1,"legend",22),GC(2,"Configuration scope"),pl(),rC(3,ce,4,4,"label",23,Kw().trackByScope,true),pl()),i&2){let e=gC(2);bg("disabled",e.isEditMode()),XE(3),oC(e.scopeOptions);}}function ue(i,t){if(i&1&&(ws(0,"option",13),GC(1),pl()),i&2){let e=t.$implicit,o=gC(2);bg("value",e),XE(),Yg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&GC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(ws(0,"span",11),GC(1,"*"),pl());}function me(i,t){if(i&1&&(ws(0,"p",28),GC(1),pl()),i&2){let e=gC(2).$implicit;bg("id","as-hint-"+e.key),XE(),Yg(e.hint);}}function ge(i,t){if(i&1&&(Sg(0,"input",27),VI(),Jw(1,me,2,2,"p",28)),i&2){let e=gC().$implicit;kC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),bg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Tg("aria-describedby",e.hint?"as-hint-"+e.key:null),UI(),XE(),eC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(ws(0,"div",9)(1,"label",26),GC(2),Jw(3,he,2,0,"span",11),pl(),Jw(4,ge,2,9),pl()),i&2){let e,o=t.$implicit,l=gC(3);XE(),bg("for","as-cred-"+o.key),XE(),vl(" ",o.label," "),XE(),eC(o.required?3:-1),XE(),eC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(ws(0,"fieldset",18)(1,"legend",22),GC(2,"Credentials"),pl(),ws(3,"p",25),GC(4," Values are stored encrypted and masked on read. "),Jw(5,pe,1,0),pl(),rC(6,Ce,5,4,"div",9,Kw().trackByField,true),pl()),i&2){let e=gC(2);XE(5),eC(e.isEditMode()?5:-1),XE(),oC(e.credentialFields());}}function ye(i,t){if(i&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let l=gC();return wf(l.submit())}),Jw(1,de,5,1,"fieldset",8),ws(2,"div",9)(3,"label",10),GC(4,"Auth type "),ws(5,"span",11),GC(6,"*"),pl()(),ws(7,"select",12),rC(8,ue,2,2,"option",13,nC),pl(),VI(),pl(),ws(10,"div",9)(11,"label",14),GC(12,"Name "),ws(13,"span",11),GC(14,"*"),pl()(),Sg(15,"input",15),VI(),pl(),ws(16,"div",9)(17,"label",16),GC(18,"Description"),pl(),Sg(19,"input",17),VI(),pl(),Jw(20,fe,8,1,"fieldset",18),ws(21,"div",19)(22,"button",20),GC(23),pl(),ws(24,"button",21),Rg("click",function(){If(e);let l=gC();return wf(l.cancel())}),GC(25,"Cancel"),pl()()();}if(i&2){let e=gC();bg("formGroup",e.form),XE(),eC(e.isPlatformMode?-1:1),XE(6),bg("formControl",e.authTypeControl),UI(),XE(),oC(e.authTypeOptions),XE(7),bg("formControl",e.nameControl),UI(),XE(4),bg("formControl",e.descriptionControl),UI(),XE(),eC(e.credentialFields().length>0?20:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Gi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>Se[this.selectedAuthType()]);isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return o.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Auth Settings "),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,se,2,0,"p",5)(9,ye,26,8,"form",6),pl()),e&2&&(XE(7),Yg(o.isEditMode()?"Edit auth setting":"New auth setting"),XE(),eC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
2
2
  export{le as AuthSettingFormComponent};
@@ -1 +1 @@
1
- import {I}from'./chunk-CglVp4ZH.js';import {g,ao as V$1,G as G$1,C as Ce,dm as $,df as U$1,aJ as Tr,a as Gi,bS as va,Q as By,a7 as ya,W as br,r as re,b as U$2,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-2EYBZUJC.js';import {W as Wn,S as Se}from'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';var K=()=>[];function U(n,o){if(n&1){let i=lC();ws(0,"agentos-ai-model-item",4),Rg("deleteRequested",function(a){If(i);let t=gC(2);return wf(t.deleteModel(a))})("editRequested",function(a){If(i);let t=gC(2);return wf(t.editModel(a))}),pl();}if(n&2){let i=gC().$implicit,e=gC();bg("model",o)("namespaceId",e.namespaceId)("readOnly",e.isPlatformModel(i.id));}}function j(n,o){if(n&1&&Jw(0,U,1,3,"agentos-ai-model-item",3),n&2){let i,e=o.$implicit,a=gC();eC((i=a.resolveModel(e.id))?0:-1,i);}}var G="__platform__",J="Platform (read-only)",V=class n{route=g(V$1);router=g(G$1);destroyRef=g(Ce);aiModelController=g($);aiProviderController=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);data$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),By({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ya(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}))));modelItems$=this.data$.pipe(re(({namespace:o,platform:i,providers:e})=>{let a=new Map(e.map(t=>[t.id??"",t.name]));return [...i.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:G,groupLabel:J})),...o.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:t.aiProviderId,groupLabel:a.get(t.aiProviderId)??t.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:o,platform:i})=>{this.namespaceModelsById=new Map(o.map(e=>[e.id??"",e])),this.platformModelsById=new Map(i.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}editModel(o){this.router.navigate(["/agentos",this.namespaceId,"ai-models",o.id,"edit"]);}deleteModel(o){this.aiModelController.deleteAiModel(o.id??"").pipe(U$2(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveModel(o){return this.namespaceModelsById.get(o)??this.platformModelsById.get(o)??null}isPlatformModel(o){return this.platformModelsById.has(o)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,e){if(i&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return e.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return e.goBack()}),pl()(),Eg(3,j,1,1,"ng-template",null,0,fT)),i&2){let a=CC(4);bg("items",uT(1,4,e.modelItems$)??rT(6,K))("loading",e.isLoading())("showCreate",true)("itemTemplate",a);}},dependencies:[Wn,I,Se,xb],encapsulation:2})};export{V as NamespaceAiModelsComponent};
1
+ import {I}from'./chunk-tpkg6uRN.js';import {g,ao as V$1,G as G$1,C as Ce,dm as $,df as U$1,aJ as Tr,a as Gi,bS as va,Q as By,a7 as ya,W as br,r as re,b as U$2,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import {W as Wn,S as Se}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';var K=()=>[];function U(n,o){if(n&1){let i=lC();ws(0,"agentos-ai-model-item",4),Rg("deleteRequested",function(a){If(i);let t=gC(2);return wf(t.deleteModel(a))})("editRequested",function(a){If(i);let t=gC(2);return wf(t.editModel(a))}),pl();}if(n&2){let i=gC().$implicit,e=gC();bg("model",o)("namespaceId",e.namespaceId)("readOnly",e.isPlatformModel(i.id));}}function j(n,o){if(n&1&&Jw(0,U,1,3,"agentos-ai-model-item",3),n&2){let i,e=o.$implicit,a=gC();eC((i=a.resolveModel(e.id))?0:-1,i);}}var G="__platform__",J="Platform (read-only)",V=class n{route=g(V$1);router=g(G$1);destroyRef=g(Ce);aiModelController=g($);aiProviderController=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);data$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),By({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ya(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}))));modelItems$=this.data$.pipe(re(({namespace:o,platform:i,providers:e})=>{let a=new Map(e.map(t=>[t.id??"",t.name]));return [...i.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:G,groupLabel:J})),...o.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:t.aiProviderId,groupLabel:a.get(t.aiProviderId)??t.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:o,platform:i})=>{this.namespaceModelsById=new Map(o.map(e=>[e.id??"",e])),this.platformModelsById=new Map(i.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}editModel(o){this.router.navigate(["/agentos",this.namespaceId,"ai-models",o.id,"edit"]);}deleteModel(o){this.aiModelController.deleteAiModel(o.id??"").pipe(U$2(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveModel(o){return this.namespaceModelsById.get(o)??this.platformModelsById.get(o)??null}isPlatformModel(o){return this.platformModelsById.has(o)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,e){if(i&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return e.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return e.goBack()}),pl()(),Eg(3,j,1,1,"ng-template",null,0,fT)),i&2){let a=CC(4);bg("items",uT(1,4,e.modelItems$)??rT(6,K))("loading",e.isLoading())("showCreate",true)("itemTemplate",a);}},dependencies:[Wn,I,Se,xb],encapsulation:2})};export{V as NamespaceAiModelsComponent};
@@ -1 +1 @@
1
- import {O}from'./chunk-D3gurhpR.js';import {R}from'./chunk-B_gHVcU6.js';import {g,G,C as Ce,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-2EYBZUJC.js';import'./chunk-kFOHrPbJ.js';import {W as Wn}from'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';import'./chunk-BWcVMw4T.js';import'./chunk-DqzTsn7a.js';var k=()=>[];function V(i,t){if(i&1){let e=lC();ws(0,"agentos-auth-setting-item",4),Rg("editRequested",function(n){If(e);let p=gC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=gC(2);return wf(p.onDelete(n))}),pl();}i&2&&bg("config",t)("showBadge",false);}function F(i,t){if(i&1&&Jw(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(Ce);state=g(R);refresh$=new Tr(void 0);isLoading=Gi(true);settings$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return o.goBack()}),GC(3,"\u2190 Admin"),pl()(),Eg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=CC(5);bg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,xb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
1
+ import {O}from'./chunk-BVHP3O1y.js';import {R}from'./chunk-qnkDdlfN.js';import {g,G,C as Ce,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import'./chunk-BvidtKG2.js';import {W as Wn}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';import'./chunk-JXiqGD2F.js';import'./chunk-KJgXoqSt.js';var k=()=>[];function V(i,t){if(i&1){let e=lC();ws(0,"agentos-auth-setting-item",4),Rg("editRequested",function(n){If(e);let p=gC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=gC(2);return wf(p.onDelete(n))}),pl();}i&2&&bg("config",t)("showBadge",false);}function F(i,t){if(i&1&&Jw(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(Ce);state=g(R);refresh$=new Tr(void 0);isLoading=Gi(true);settings$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return o.goBack()}),GC(3,"\u2190 Admin"),pl()(),Eg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=CC(5);bg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,xb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
@@ -1,4 +1,4 @@
1
- import {ct as vi,e as xw,T as Tg,A as Ug,aL as wo,aM as Zn,bE as vt,aO as wt,cZ as fn,cT as Gp,c_ as he$1,cV as vg,bA as yC,k as ws,bB as vC,o as pl,b5 as nT,ad as Hg,J as Jw,y as eC,X as XE,aW as C,bv as Fg,E as EC,I as IC,g,az as Xt$1,c$ as kn,bw as St,bG as p,aP as G,aR as Fs,aU as Ue,aV as U,a as Gi,an as ue,al as vt$1,ae as kt,r as re$1,d0 as Ea,bL as pe,bs as Tl,ap as wd,bu as Ve$1,c2 as ME,aA as an,D as Pg,bt as Qn,aS as K,cO as us,bN as F,bR as Id,cL as vd,bP as Wy,a9 as lC,q as Rg,ac as gC,bV as Zy,aN as Nn,bD as ge,aQ as $a,bM as mr,d1 as lt,d2 as wt$1,d3 as I,b_ as xt,bX as Pt,w,aZ as js,aw as hl,cJ as Og,n as GC,ax as gl,b$ as kC,a8 as Yg,c3 as kt$1,cD as Te,cz as to,aa as If,ab as wf}from'./main-2EYBZUJC.js';var Xt=["tooltip"],Ut=20;var qt=new C("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt$1(n,{scrollThrottle:Ut})}}),$t=new C("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Xt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(Fs);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ue;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(wd(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Xt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(wd(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(wd(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(wd(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(w(w({},i.main),r.main)),this._addOffset(w(w({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=js({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Ug("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ue;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Pg(Xt,7),e&2){let r;EC(r=IC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Rg("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(hl(0,"div",1,0),Og("animationend",function(a){return i._handleAnimationEnd(a)}),hl(2,"div",2),GC(3),gl()()),e&2&&(kC(i.tooltipClass),Ug("mdc-tooltip--multiline",i._isMultiline),XE(3),Yg(i.message));},styles:[`.mat-mdc-tooltip {
1
+ import {ct as vi,e as xw,T as Tg,A as Ug,aL as wo,aM as Zn,bE as vt,aO as wt,cZ as fn,cT as Gp,c_ as he$1,cV as vg,bA as yC,k as ws,bB as vC,o as pl,b5 as nT,ad as Hg,J as Jw,y as eC,X as XE,aW as C,bv as Fg,E as EC,I as IC,g,az as Xt$1,c$ as kn,bw as St,bG as p,aP as G,aR as Fs,aU as Ue,aV as U,a as Gi,an as ue,al as vt$1,ae as kt,r as re$1,d0 as Ea,bL as pe,bs as Tl,ap as wd,bu as Ve$1,c2 as ME,aA as an,D as Pg,bt as Qn,aS as K,cO as us,bN as F,bR as Id,cL as vd,bP as Wy,a9 as lC,q as Rg,ac as gC,bV as Zy,aN as Nn,bD as ge,aQ as $a,bM as mr,d1 as lt,d2 as wt$1,d3 as I,b_ as xt,bX as Pt,w,aZ as js,aw as hl,cJ as Og,n as GC,ax as gl,b$ as kC,a8 as Yg,c3 as kt$1,cD as Te,cz as to,aa as If,ab as wf}from'./main-COD2LZKB.js';var Xt=["tooltip"],Ut=20;var qt=new C("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt$1(n,{scrollThrottle:Ut})}}),$t=new C("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Xt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(Fs);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ue;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(wd(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Xt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(wd(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(wd(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(wd(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(w(w({},i.main),r.main)),this._addOffset(w(w({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=js({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Ug("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ue;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Pg(Xt,7),e&2){let r;EC(r=IC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Rg("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(hl(0,"div",1,0),Og("animationend",function(a){return i._handleAnimationEnd(a)}),hl(2,"div",2),GC(3),gl()()),e&2&&(kC(i.tooltipClass),Ug("mdc-tooltip--multiline",i._isMultiline),XE(3),Yg(i.message));},styles:[`.mat-mdc-tooltip {
2
2
  position: relative;
3
3
  transform: scale(0);
4
4
  display: inline-flex;
@@ -1 +1 @@
1
- import {P}from'./chunk-CJGzYd_S.js';import {g,ao as V$1,G as G$1,C as Ce,da as M,aJ as Tr,a as Gi,bS as va,Q as By,a7 as ya,W as br,r as re,b as U$1,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-2EYBZUJC.js';import {W as Wn}from'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';var U=()=>[];function V(i,t){if(i&1){let n=lC();ws(0,"agentos-agent-config-item",4),Rg("deleteRequested",function(o){If(n);let F=gC(2);return wf(F.deleteConfig(o))}),pl();}if(i&2){let n=gC().$implicit,e=gC();bg("config",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformConfig(n.id));}}function j(i,t){if(i&1&&Jw(0,V,1,3,"agentos-agent-config-item",3),i&2){let n,e=t.$implicit,o=gC();eC((n=o.resolveConfig(e.id))?0:-1,n);}}var G="namespace",K="platform",q=class i{route=g(V$1);router=g(G$1);destroyRef=g(Ce);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);allConfigs$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),By({namespace:this.agentConfigController.listByParentAgentConfig(this.namespaceId),platform:this.agentConfigController.listPlatformAgentsAgentConfig().pipe(ya(()=>br([])))}))));configItems$=this.allConfigs$.pipe(re(({namespace:t,platform:n})=>[...n.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:K,groupLabel:"Platform (read-only)"})),...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Namespace"}))]));namespaceConfigsById=new Map;platformConfigsById=new Map;constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:t,platform:n})=>{this.namespaceConfigsById=new Map(t.map(e=>[e.id??"",e])),this.platformConfigsById=new Map(n.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}deleteConfig(t){this.agentConfigController.deleteAgentConfig(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveConfig(t){return this.namespaceConfigsById.get(t)??this.platformConfigsById.get(t)??null}isPlatformConfig(t){return this.platformConfigsById.has(t)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-namespace-agent-configs"]],decls:6,vars:7,consts:[["agentConfigItemTpl",""],["title","Agent Configs","emptyMessage","No agent configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-agent-configs__back",3,"click"],[3,"config","namespaceId","readOnly"],[3,"deleteRequested","config","namespaceId","readOnly"]],template:function(n,e){if(n&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return e.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return e.goBack()}),GC(3," \u2190 Namespaces "),pl()(),Eg(4,j,1,1,"ng-template",null,0,fT)),n&2){let o=CC(5);bg("items",uT(1,4,e.configItems$)??rT(6,U))("loading",e.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[Wn,P,xb],styles:[".namespace-agent-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-agent-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{q as NamespaceAgentConfigsComponent};
1
+ import {P}from'./chunk-DSWc3xOX.js';import {g,ao as V$1,G as G$1,C as Ce,da as M,aJ as Tr,a as Gi,bS as va,Q as By,a7 as ya,W as br,r as re,b as U$1,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import {W as Wn}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';var U=()=>[];function V(i,t){if(i&1){let n=lC();ws(0,"agentos-agent-config-item",4),Rg("deleteRequested",function(o){If(n);let F=gC(2);return wf(F.deleteConfig(o))}),pl();}if(i&2){let n=gC().$implicit,e=gC();bg("config",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformConfig(n.id));}}function j(i,t){if(i&1&&Jw(0,V,1,3,"agentos-agent-config-item",3),i&2){let n,e=t.$implicit,o=gC();eC((n=o.resolveConfig(e.id))?0:-1,n);}}var G="namespace",K="platform",q=class i{route=g(V$1);router=g(G$1);destroyRef=g(Ce);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);allConfigs$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),By({namespace:this.agentConfigController.listByParentAgentConfig(this.namespaceId),platform:this.agentConfigController.listPlatformAgentsAgentConfig().pipe(ya(()=>br([])))}))));configItems$=this.allConfigs$.pipe(re(({namespace:t,platform:n})=>[...n.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:K,groupLabel:"Platform (read-only)"})),...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Namespace"}))]));namespaceConfigsById=new Map;platformConfigsById=new Map;constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:t,platform:n})=>{this.namespaceConfigsById=new Map(t.map(e=>[e.id??"",e])),this.platformConfigsById=new Map(n.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}deleteConfig(t){this.agentConfigController.deleteAgentConfig(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveConfig(t){return this.namespaceConfigsById.get(t)??this.platformConfigsById.get(t)??null}isPlatformConfig(t){return this.platformConfigsById.has(t)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-namespace-agent-configs"]],decls:6,vars:7,consts:[["agentConfigItemTpl",""],["title","Agent Configs","emptyMessage","No agent configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-agent-configs__back",3,"click"],[3,"config","namespaceId","readOnly"],[3,"deleteRequested","config","namespaceId","readOnly"]],template:function(n,e){if(n&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return e.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return e.goBack()}),GC(3," \u2190 Namespaces "),pl()(),Eg(4,j,1,1,"ng-template",null,0,fT)),n&2){let o=CC(5);bg("items",uT(1,4,e.configItems$)??rT(6,U))("loading",e.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[Wn,P,xb],styles:[".namespace-agent-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-agent-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{q as NamespaceAgentConfigsComponent};
@@ -1 +1 @@
1
- import {B}from'./chunk-kFOHrPbJ.js';import {g,G,e as xw,k as ws,n as GC,o as pl,t as rC,X as XE,z as oC,a9 as lC,q as Rg,v as bg,aa as If,ac as gC,ab as wf}from'./main-2EYBZUJC.js';import'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';import'./chunk-DqzTsn7a.js';var M=(a,n)=>n.key;function b(a,n){if(a&1){let e=lC();ws(0,"agentos-action-card",6),Rg("nameClicked",function(){let C=If(e).$implicit,x=gC();return wf(x.navigateTo(C.path))}),pl();}if(a&2){let e=n.$implicit;bg("name",e.name)("mark",e.mark)("markIsEmoji",true)("description",e.description)("clickable",true);}}var v=class a{router=g(G);sections=[{key:"users",mark:"\u{1F464}",name:"Users & Groups",description:"Manage platform users, their admin rights, and namespace user groups.",path:"/agentos/admin/users"},{key:"agents",mark:"\u{1F916}",name:"Platform agents",description:"Manage agent configs shared across all namespaces.",path:"/agentos/admin/agent-configs"},{key:"integrations",mark:"\u{1F517}",name:"Platform integrations",description:"Manage integration configs shared across all namespaces.",path:"/agentos/admin/integration-configs"},{key:"authSetting",mark:"\u{1F512}",name:"Auth settings",description:"Manage auth settings shared across all namespaces.",path:"/agentos/admin/auth-settings"},{key:"ai-providers",mark:"\u{1F9E0}",name:"Platform AI providers",description:"Manage AI provider configs shared across all namespaces.",path:"/agentos/admin/ai-providers"},{key:"ai-models",mark:"\u2728",name:"Platform AI models",description:"Manage AI model configs shared across all namespaces.",path:"/agentos/admin/ai-models"},{key:"prompts",mark:"\u{1F4C4}",name:"Platform prompts",description:"Manage prompts shared across all namespaces.",path:"/agentos/admin/prompts"},{key:"case-definitions",mark:"\u23F0",name:"Platform case definitions",description:"Manage scheduled case definitions shared across all namespaces.",path:"/agentos/admin/case-definitions"},{key:"tool-invoke",mark:"\u{1F9EA}",name:"Tool invoke",description:"Debug: execute any registered tool directly with a custom payload.",path:"/agentos/admin/tool-invoke"}];navigateTo(n){this.router.navigate([n]);}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["agentos-admin-home"]],decls:9,vars:0,consts:[[1,"admin-home"],[1,"admin-home__header"],[1,"admin-home__title"],[1,"admin-home__subtitle"],[1,"admin-home__sections"],[3,"name","mark","markIsEmoji","description","clickable"],[3,"nameClicked","name","mark","markIsEmoji","description","clickable"]],template:function(e,s){e&1&&(ws(0,"div",0)(1,"header",1)(2,"h1",2),GC(3,"Administration"),pl(),ws(4,"p",3),GC(5,"Platform-level settings, visible to super-admins only."),pl()(),ws(6,"nav",4),rC(7,b,1,5,"agentos-action-card",5,M),pl()()),e&2&&(XE(7),oC(s.sections));},dependencies:[B],styles:[".admin-home[_ngcontent-%COMP%]{max-width:860px;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:2rem}.admin-home__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.admin-home__title[_ngcontent-%COMP%]{margin:0;font-size:28px;font-weight:700;color:var(--color-text);font-family:var(--font-heading)}.admin-home__subtitle[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--color-neutral-600)}.admin-home__sections[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}"]})};export{v as AdminHomeComponent};
1
+ import {B}from'./chunk-BvidtKG2.js';import {g,G,e as xw,k as ws,n as GC,o as pl,t as rC,X as XE,z as oC,a9 as lC,q as Rg,v as bg,aa as If,ac as gC,ab as wf}from'./main-COD2LZKB.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';import'./chunk-KJgXoqSt.js';var M=(a,n)=>n.key;function b(a,n){if(a&1){let e=lC();ws(0,"agentos-action-card",6),Rg("nameClicked",function(){let C=If(e).$implicit,x=gC();return wf(x.navigateTo(C.path))}),pl();}if(a&2){let e=n.$implicit;bg("name",e.name)("mark",e.mark)("markIsEmoji",true)("description",e.description)("clickable",true);}}var v=class a{router=g(G);sections=[{key:"users",mark:"\u{1F464}",name:"Users & Groups",description:"Manage platform users, their admin rights, and namespace user groups.",path:"/agentos/admin/users"},{key:"agents",mark:"\u{1F916}",name:"Platform agents",description:"Manage agent configs shared across all namespaces.",path:"/agentos/admin/agent-configs"},{key:"integrations",mark:"\u{1F517}",name:"Platform integrations",description:"Manage integration configs shared across all namespaces.",path:"/agentos/admin/integration-configs"},{key:"authSetting",mark:"\u{1F512}",name:"Auth settings",description:"Manage auth settings shared across all namespaces.",path:"/agentos/admin/auth-settings"},{key:"ai-providers",mark:"\u{1F9E0}",name:"Platform AI providers",description:"Manage AI provider configs shared across all namespaces.",path:"/agentos/admin/ai-providers"},{key:"ai-models",mark:"\u2728",name:"Platform AI models",description:"Manage AI model configs shared across all namespaces.",path:"/agentos/admin/ai-models"},{key:"prompts",mark:"\u{1F4C4}",name:"Platform prompts",description:"Manage prompts shared across all namespaces.",path:"/agentos/admin/prompts"},{key:"case-definitions",mark:"\u23F0",name:"Platform case definitions",description:"Manage scheduled case definitions shared across all namespaces.",path:"/agentos/admin/case-definitions"},{key:"tool-invoke",mark:"\u{1F9EA}",name:"Tool invoke",description:"Debug: execute any registered tool directly with a custom payload.",path:"/agentos/admin/tool-invoke"}];navigateTo(n){this.router.navigate([n]);}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["agentos-admin-home"]],decls:9,vars:0,consts:[[1,"admin-home"],[1,"admin-home__header"],[1,"admin-home__title"],[1,"admin-home__subtitle"],[1,"admin-home__sections"],[3,"name","mark","markIsEmoji","description","clickable"],[3,"nameClicked","name","mark","markIsEmoji","description","clickable"]],template:function(e,s){e&1&&(ws(0,"div",0)(1,"header",1)(2,"h1",2),GC(3,"Administration"),pl(),ws(4,"p",3),GC(5,"Platform-level settings, visible to super-admins only."),pl()(),ws(6,"nav",4),rC(7,b,1,5,"agentos-action-card",5,M),pl()()),e&2&&(XE(7),oC(s.sections));},dependencies:[B],styles:[".admin-home[_ngcontent-%COMP%]{max-width:860px;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:2rem}.admin-home__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.admin-home__title[_ngcontent-%COMP%]{margin:0;font-size:28px;font-weight:700;color:var(--color-text);font-family:var(--font-heading)}.admin-home__subtitle[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--color-neutral-600)}.admin-home__sections[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}"]})};export{v as AdminHomeComponent};
@@ -1 +1 @@
1
- import {S as S$1}from'./chunk-CJxkwaxD.js';import {g,G,C as Ce,df as U,aJ as Tr,a as Gi,bS as va,r as re,b as U$1,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-2EYBZUJC.js';import {W as Wn,S as Se}from'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';var S=()=>[];function V(r,e){if(r&1){let t=lC();ws(0,"agentos-ai-provider-item",4),Rg("editRequested",function(i){If(t);let p=gC(2);return wf(p.onEdit(i))})("deleteRequested",function(i){If(t);let p=gC(2);return wf(p.onDelete(i))}),pl();}r&2&&bg("config",e)("showBadge",false);}function F(r,e){if(r&1&&Jw(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=gC();eC((t=i.resolveProvider(o.id))?0:-1,t);}}var E=class r{router=g(G);destroyRef=g(Ce);aiProviderController=g(U);refresh$=new Tr(void 0);isLoading=Gi(true);providers$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))));providerItems$=this.providers$.pipe(re(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.providersById=new Map(e.map(t=>[t.id??"",t])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(3,F,1,1,"ng-template",null,0,fT)),t&2){let i=CC(4);bg("items",uT(1,4,o.providerItems$)??rT(6,S))("loading",o.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,S$1,Se,xb],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{E as PlatformAiProvidersComponent};
1
+ import {S as S$1}from'./chunk-DYl74_xV.js';import {g,G,C as Ce,df as U,aJ as Tr,a as Gi,bS as va,r as re,b as U$1,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import {W as Wn,S as Se}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';var S=()=>[];function V(r,e){if(r&1){let t=lC();ws(0,"agentos-ai-provider-item",4),Rg("editRequested",function(i){If(t);let p=gC(2);return wf(p.onEdit(i))})("deleteRequested",function(i){If(t);let p=gC(2);return wf(p.onDelete(i))}),pl();}r&2&&bg("config",e)("showBadge",false);}function F(r,e){if(r&1&&Jw(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=gC();eC((t=i.resolveProvider(o.id))?0:-1,t);}}var E=class r{router=g(G);destroyRef=g(Ce);aiProviderController=g(U);refresh$=new Tr(void 0);isLoading=Gi(true);providers$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))));providerItems$=this.providers$.pipe(re(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.providersById=new Map(e.map(t=>[t.id??"",t])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(3,F,1,1,"ng-template",null,0,fT)),t&2){let i=CC(4);bg("items",uT(1,4,o.providerItems$)??rT(6,S))("loading",o.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,S$1,Se,xb],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{E as PlatformAiProvidersComponent};
@@ -1 +1 @@
1
- import {l}from'./chunk-kFOHrPbJ.js';import {g,dg as ee,dh as T,W as br,bS as va,r as re,a7 as ya,cE as Ad,Y as x}from'./main-2EYBZUJC.js';var v=class i{userState=g(l);membership=g(ee);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return br(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(va(a=>a?a.isAdmin?br(true):this.membership.getMembersNamespaceMembership(e).pipe(re(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),ya(()=>br(false))):br(false)),Ad({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
1
+ import {l}from'./chunk-BvidtKG2.js';import {g,dg as te,dh as T,W as br,bS as va,r as re,a7 as ya,cE as Ad,Y as x}from'./main-COD2LZKB.js';var v=class i{userState=g(l);membership=g(te);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return br(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(va(a=>a?a.isAdmin?br(true):this.membership.getMembersNamespaceMembership(e).pipe(re(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),ya(()=>br(false))):br(false)),Ad({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
@@ -1,4 +1,4 @@
1
- import {s as se}from'./chunk-DR5zNU0n.js';import {a as Dr,z as zi,F as Fn,H as Hi,h as ht,b as gr,_ as _r}from'./chunk-Bx_FH6m3.js';import {g,H as py,P,Y as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,D as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,W as br,r as re,bQ as Gy,bR as Id,bS as va,aF as R$1,bu as Ve$1,bT as pn,bU as Od,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,A as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-2EYBZUJC.js';import {D}from'./chunk-CZmNdEYy.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Hi,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:zi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
1
+ import {s as se}from'./chunk-Dg2L56ka.js';import {a as Dr,z as zi,F as Fn,H as Hi,h as ht,b as gr,_ as _r}from'./chunk-D1wn67qT.js';import {g,H as py,P,Y as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,D as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,W as br,r as re,bQ as Gy,bR as Id,bS as va,aF as R$1,bu as Ve$1,bT as pn,bU as Od,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,A as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-COD2LZKB.js';import {D}from'./chunk-Bb0cfZpR.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Hi,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:zi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
2
2
  width: 100%;
3
3
  max-height: 256px;
4
4
  visibility: hidden;
@@ -1 +1 @@
1
- import {R}from'./chunk-4NMdLPHF.js';import {c}from'./chunk-CkBh9-Fw.js';import {g,ao as V$1,G,C as Ce,a as Gi,m as mT,Q as By,a7 as ya,W as br,b as U,e as xw,k as ws,q as Rg,o as pl,af as Eg,u as CC,v as bg,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-2EYBZUJC.js';import {W as Wn,S as Se}from'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';function V(i,e){if(i&1){let t=lC();ws(0,"agentos-scheduled-prompt-item",4),Rg("enableRequested",function(n){If(t);let s=gC(2);return wf(s.enablePrompt(n))})("disableRequested",function(n){If(t);let s=gC(2);return wf(s.disablePrompt(n))})("deleteRequested",function(n){If(t);let s=gC(2);return wf(s.deletePrompt(n))}),pl();}if(i&2){let t=gC().$implicit,o=gC();bg("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id));}}function k(i,e){if(i&1&&Jw(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=gC();eC((t=n.resolvePrompt(o.id))?0:-1,t);}}var O="platform",B="namespace",M=class i{route=g(V$1);router=g(G);destroyRef=g(Ce);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=Gi([]);namespacePrompts=Gi([]);isLoading=Gi(true);promptItems=mT(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){By({platform:this.state.listPlatform().pipe(ya(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}enablePrompt(e){this.state.enable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}disablePrompt(e){this.state.disable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(U(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)));}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:4,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(ws(0,"ds-entity-list",1),Rg("createRequested",function(){return o.openCreateForm()}),ws(1,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(2,k,1,1,"ng-template",null,0,fT)),t&2){let n=CC(3);bg("items",o.promptItems())("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,R,Se],encapsulation:2})};export{M as ScheduledPromptListComponent};
1
+ import {R}from'./chunk-BA-NscEe.js';import {c}from'./chunk-ZI_RF6mJ.js';import {g,ao as V$1,G,C as Ce,a as Gi,m as mT,Q as By,a7 as ya,W as br,b as U,e as xw,k as ws,q as Rg,o as pl,af as Eg,u as CC,v as bg,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import {W as Wn,S as Se}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';function V(i,e){if(i&1){let t=lC();ws(0,"agentos-scheduled-prompt-item",4),Rg("enableRequested",function(n){If(t);let s=gC(2);return wf(s.enablePrompt(n))})("disableRequested",function(n){If(t);let s=gC(2);return wf(s.disablePrompt(n))})("deleteRequested",function(n){If(t);let s=gC(2);return wf(s.deletePrompt(n))}),pl();}if(i&2){let t=gC().$implicit,o=gC();bg("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id));}}function k(i,e){if(i&1&&Jw(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=gC();eC((t=n.resolvePrompt(o.id))?0:-1,t);}}var O="platform",B="namespace",M=class i{route=g(V$1);router=g(G);destroyRef=g(Ce);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=Gi([]);namespacePrompts=Gi([]);isLoading=Gi(true);promptItems=mT(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){By({platform:this.state.listPlatform().pipe(ya(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}enablePrompt(e){this.state.enable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}disablePrompt(e){this.state.disable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(U(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)));}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:4,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(ws(0,"ds-entity-list",1),Rg("createRequested",function(){return o.openCreateForm()}),ws(1,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(2,k,1,1,"ng-template",null,0,fT)),t&2){let n=CC(3);bg("items",o.promptItems())("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,R,Se],encapsulation:2})};export{M as ScheduledPromptListComponent};
@@ -1 +1 @@
1
- import {O as O$1}from'./chunk-kFOHrPbJ.js';import {g,ao as V,G,ds as N,da as M,C as Ce,a as Gi,b as U,av as B,dt as Ny,e as xw,aw as hl,cJ as Og,n as GC,ax as gl,b6 as _g,J as Jw,X as XE,c0 as xg,y as eC,a5 as vl,ac as gC}from'./main-2EYBZUJC.js';import'./chunk-DqzTsn7a.js';import'./chunk-Bx_FH6m3.js';import'./chunk-BPkyqr-f.js';import'./chunk-CZmNdEYy.js';function w(l,o){if(l&1&&(hl(0,"p",10),GC(1),gl()),l&2){let i=gC();XE(),vl(" ",i.launchError()," ");}}var O=class l{route=g(V);router=g(G);caseController=g(N);caseState=g(O$1);agentConfigController=g(M);destroyRef=g(Ce);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=Gi("");launchError=Gi(null);isLaunching=Gi(false);isLoading=Gi(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U(this.destroyRef)).subscribe({next:o=>{this.resolvedAgentConfig=o,o.loopConfig!=null&&this.payloadJson.set(JSON.stringify(o.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let o=this.resolvedAgentConfig??(yield Ny(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),i=yield Ny(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(i);let e=i.id??"",d={content:`@${o.name} start`};yield Ny(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(o){console.error("[AgentConfigLaunch] Failed to launch loop agent",o),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(i){return new(i||l)};static \u0275cmp=xw({type:l,selectors:[["agentos-agent-config-launch"]],decls:23,vars:6,consts:[[1,"agent-config-launch"],[1,"agent-config-launch__header"],["type","button","title","Back to agent config",1,"agent-config-launch__back",3,"click"],[1,"agent-config-launch__back-icon"],[1,"agent-config-launch__title"],[1,"agent-config-launch__intro"],[1,"agent-config-launch__code"],[1,"agent-config-launch__field"],["for","agent-loop-payload",1,"agent-config-launch__label"],["id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",1,"agent-config-launch__textarea",3,"value","disabled"],["role","alert",1,"agent-config-launch__error","agent-config-launch__error--banner"],[1,"agent-config-launch__actions"],["type","button",1,"agent-config-launch__btn","agent-config-launch__btn--primary",3,"click","disabled"],["type","button",1,"agent-config-launch__btn",3,"click","disabled"]],template:function(i,e){i&1&&(hl(0,"div",0)(1,"header",1)(2,"button",2),Og("click",function(){return e.back()}),hl(3,"span",3),GC(4,"\u2190"),gl(),GC(5," Edit agent config "),gl(),hl(6,"h1",4),GC(7,"Launch loop agent"),gl()(),hl(8,"p",5),GC(9," The loop configuration below is read from "),hl(10,"code",6),GC(11,"AgentConfig.loopConfig"),gl(),GC(12," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),gl(),hl(13,"div",7)(14,"label",8),GC(15,"Loop configuration (read-only)"),gl(),_g(16,"textarea",9),gl(),Jw(17,w,2,1,"p",10),hl(18,"div",11)(19,"button",12),Og("click",function(){return e.launch()}),GC(20),gl(),hl(21,"button",13),Og("click",function(){return e.back()}),GC(22,"Cancel"),gl()()()),i&2&&(XE(16),xg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),XE(),eC(e.launchError()?17:-1),XE(2),xg("disabled",e.isLaunching()),XE(),vl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),XE(),xg("disabled",e.isLaunching()));},styles:[".agent-config-launch[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.75rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-launch__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-launch__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;font-family:inherit;color:var(--color-accent, #2563eb)}.agent-config-launch__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-launch__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-launch__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-launch__intro[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary);line-height:1.5}.agent-config-launch__code[_ngcontent-%COMP%]{font-family:var(--font-heading, monospace);font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .35em}.agent-config-launch__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-launch__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-launch__textarea[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;border:1px solid var(--color-divider);background:var(--color-surface-muted, rgba(0, 0, 0, .03));color:var(--color-text-secondary);font-family:var(--font-heading, monospace);font-size:.8125rem;line-height:1.6;resize:vertical;outline:none;box-sizing:border-box;cursor:default}.agent-config-launch__textarea[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.agent-config-launch__error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8125rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-launch__error--banner[_ngcontent-%COMP%]{padding:.75rem 1rem;background:color-mix(in srgb,var(--color-error, #dc2626) 8%,transparent);border:1px solid color-mix(in srgb,var(--color-error, #dc2626) 25%,transparent);border-left:3px solid var(--color-error, #dc2626)}.agent-config-launch__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem}.agent-config-launch__btn[_ngcontent-%COMP%]{padding:.6rem 1.5rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-launch__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-launch__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-launch__btn--primary[_ngcontent-%COMP%]{background:var(--color-warning, #f59e0b);border-color:var(--color-warning, #f59e0b);color:#fff}.agent-config-launch__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--color-warning, #f59e0b) 80%,black);border-color:color-mix(in srgb,var(--color-warning, #f59e0b) 80%,black)}"]})};export{O as AgentConfigLaunchComponent};
1
+ import {O as O$1}from'./chunk-BvidtKG2.js';import {g,ao as V,G,ds as k,da as M,C as Ce,a as Gi,b as U,av as B,dt as Ny,e as xw,aw as hl,cJ as Og,n as GC,ax as gl,b6 as _g,J as Jw,X as XE,c0 as xg,y as eC,a5 as vl,ac as gC}from'./main-COD2LZKB.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';function w(l,o){if(l&1&&(hl(0,"p",10),GC(1),gl()),l&2){let i=gC();XE(),vl(" ",i.launchError()," ");}}var O=class l{route=g(V);router=g(G);caseController=g(k);caseState=g(O$1);agentConfigController=g(M);destroyRef=g(Ce);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=Gi("");launchError=Gi(null);isLaunching=Gi(false);isLoading=Gi(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U(this.destroyRef)).subscribe({next:o=>{this.resolvedAgentConfig=o,o.loopConfig!=null&&this.payloadJson.set(JSON.stringify(o.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let o=this.resolvedAgentConfig??(yield Ny(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),i=yield Ny(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(i);let e=i.id??"",d={content:`@${o.name} start`};yield Ny(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(o){console.error("[AgentConfigLaunch] Failed to launch loop agent",o),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(i){return new(i||l)};static \u0275cmp=xw({type:l,selectors:[["agentos-agent-config-launch"]],decls:23,vars:6,consts:[[1,"agent-config-launch"],[1,"agent-config-launch__header"],["type","button","title","Back to agent config",1,"agent-config-launch__back",3,"click"],[1,"agent-config-launch__back-icon"],[1,"agent-config-launch__title"],[1,"agent-config-launch__intro"],[1,"agent-config-launch__code"],[1,"agent-config-launch__field"],["for","agent-loop-payload",1,"agent-config-launch__label"],["id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",1,"agent-config-launch__textarea",3,"value","disabled"],["role","alert",1,"agent-config-launch__error","agent-config-launch__error--banner"],[1,"agent-config-launch__actions"],["type","button",1,"agent-config-launch__btn","agent-config-launch__btn--primary",3,"click","disabled"],["type","button",1,"agent-config-launch__btn",3,"click","disabled"]],template:function(i,e){i&1&&(hl(0,"div",0)(1,"header",1)(2,"button",2),Og("click",function(){return e.back()}),hl(3,"span",3),GC(4,"\u2190"),gl(),GC(5," Edit agent config "),gl(),hl(6,"h1",4),GC(7,"Launch loop agent"),gl()(),hl(8,"p",5),GC(9," The loop configuration below is read from "),hl(10,"code",6),GC(11,"AgentConfig.loopConfig"),gl(),GC(12," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),gl(),hl(13,"div",7)(14,"label",8),GC(15,"Loop configuration (read-only)"),gl(),_g(16,"textarea",9),gl(),Jw(17,w,2,1,"p",10),hl(18,"div",11)(19,"button",12),Og("click",function(){return e.launch()}),GC(20),gl(),hl(21,"button",13),Og("click",function(){return e.back()}),GC(22,"Cancel"),gl()()()),i&2&&(XE(16),xg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),XE(),eC(e.launchError()?17:-1),XE(2),xg("disabled",e.isLaunching()),XE(),vl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),XE(),xg("disabled",e.isLaunching()));},styles:[".agent-config-launch[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.75rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-launch__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-launch__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;font-family:inherit;color:var(--color-accent, #2563eb)}.agent-config-launch__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-launch__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-launch__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-launch__intro[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary);line-height:1.5}.agent-config-launch__code[_ngcontent-%COMP%]{font-family:var(--font-heading, monospace);font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .35em}.agent-config-launch__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-launch__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-launch__textarea[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;border:1px solid var(--color-divider);background:var(--color-surface-muted, rgba(0, 0, 0, .03));color:var(--color-text-secondary);font-family:var(--font-heading, monospace);font-size:.8125rem;line-height:1.6;resize:vertical;outline:none;box-sizing:border-box;cursor:default}.agent-config-launch__textarea[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.agent-config-launch__error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8125rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-launch__error--banner[_ngcontent-%COMP%]{padding:.75rem 1rem;background:color-mix(in srgb,var(--color-error, #dc2626) 8%,transparent);border:1px solid color-mix(in srgb,var(--color-error, #dc2626) 25%,transparent);border-left:3px solid var(--color-error, #dc2626)}.agent-config-launch__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem}.agent-config-launch__btn[_ngcontent-%COMP%]{padding:.6rem 1.5rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-launch__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-launch__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-launch__btn--primary[_ngcontent-%COMP%]{background:var(--color-warning, #f59e0b);border-color:var(--color-warning, #f59e0b);color:#fff}.agent-config-launch__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--color-warning, #f59e0b) 80%,black);border-color:color-mix(in srgb,var(--color-warning, #f59e0b) 80%,black)}"]})};export{O as AgentConfigLaunchComponent};