@whoz-oss/coday-client 0.0.0-workstream-forge.107 → 0.0.0-workstream-forge.109

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 (79) hide show
  1. package/browser/{chunk-waGtT2fH.js → chunk--Eu5GmLU.js} +1 -1
  2. package/browser/{chunk-DoJEGSbs.js → chunk-3EpdNB3J.js} +1 -1
  3. package/browser/{chunk-ORbAjzgA.js → chunk-5PKS0_6W.js} +1 -1
  4. package/browser/{chunk-MZ4wRIEo.js → chunk-9KYYyWcX.js} +1 -1
  5. package/browser/{chunk-DJTNjd3B.js → chunk-B0ReGfih.js} +1 -1
  6. package/browser/chunk-B795cm8m.js +1 -0
  7. package/browser/{chunk-Cvyvj0DZ.js → chunk-B7ljVpTq.js} +1 -1
  8. package/browser/{chunk-DUxFDQE0.js → chunk-BBCKCbsh.js} +1 -1
  9. package/browser/{chunk-DnszH38I.js → chunk-BKGnYAUR.js} +1 -1
  10. package/browser/{chunk-B6OZW8wN.js → chunk-BVUL4WL8.js} +1 -1
  11. package/browser/{chunk-C3o3QVhs.js → chunk-BXkjrXYC.js} +1 -1
  12. package/browser/chunk-BYHhP0yu.js +1 -0
  13. package/browser/{chunk-CEizRT71.js → chunk-BcA63-_2.js} +1 -1
  14. package/browser/{chunk-By7YGzD4.js → chunk-BdQKJNji.js} +1 -1
  15. package/browser/{chunk-DIrez99x.js → chunk-Blhg03I2.js} +1 -1
  16. package/browser/chunk-BmMgSm-g.js +10 -0
  17. package/browser/{chunk-DhCn0LVf.js → chunk-BnG-axva.js} +1 -1
  18. package/browser/{chunk-Btndt-0_.js → chunk-BpWyUurX.js} +1 -1
  19. package/browser/chunk-Br_9kXu2.js +1 -0
  20. package/browser/{chunk-DYyjYklW.js → chunk-BxXupFfW.js} +1 -1
  21. package/browser/{chunk-CjeED1ew.js → chunk-C1zqP1Uj.js} +1 -1
  22. package/browser/{chunk-BxK6jZXt.js → chunk-C3O2iLZp.js} +1 -1
  23. package/browser/{chunk-DqnU1y0y.js → chunk-C4ia1JEu.js} +1 -1
  24. package/browser/{chunk-BDCAzL3z.js → chunk-C5W7lxy-.js} +1 -1
  25. package/browser/{chunk-BatX6vs0.js → chunk-CB_qwIx0.js} +1 -1
  26. package/browser/{chunk-CYC-I1Mg.js → chunk-CBwHOIH1.js} +1 -1
  27. package/browser/{chunk-DLoICesN.js → chunk-CD3vX-2T.js} +1 -1
  28. package/browser/{chunk-BqZAHySB.js → chunk-CDF2ahRh.js} +1 -1
  29. package/browser/{chunk-B4imwkV0.js → chunk-CIaHSdWa.js} +1 -1
  30. package/browser/{chunk-C0d355eD.js → chunk-CJ6SoRyx.js} +1 -1
  31. package/browser/{chunk-BoMAQeIx.js → chunk-CLTDviw6.js} +1 -1
  32. package/browser/{chunk-HRUxEFNV.js → chunk-CM-uNjXT.js} +1 -1
  33. package/browser/{chunk-BD1J-qMV.js → chunk-CMwalRI_.js} +1 -1
  34. package/browser/{chunk-CIRByaMA.js → chunk-CP75LAfM.js} +1 -1
  35. package/browser/{chunk-eeMC5EPB.js → chunk-CR7v_FrX.js} +1 -1
  36. package/browser/{chunk-DqLrAE6M.js → chunk-CSHtn539.js} +1 -1
  37. package/browser/{chunk-FV8LaU7e.js → chunk-CWmsDCbt.js} +1 -1
  38. package/browser/{chunk-BSRWEUf3.js → chunk-CcdN6Tiq.js} +1 -1
  39. package/browser/{chunk-BmZ9yw5t.js → chunk-ClPtCPiU.js} +1 -1
  40. package/browser/{chunk-C0C_xi5w.js → chunk-CmgjgUX8.js} +1 -1
  41. package/browser/{chunk-C8UVOyhT.js → chunk-CwWxGIXx.js} +1 -1
  42. package/browser/{chunk-lkQw5eQ_.js → chunk-CzWPw7Kb.js} +1 -1
  43. package/browser/chunk-D-2ArFBU.js +1 -0
  44. package/browser/{chunk-C-oYJ39L.js → chunk-D17xD-6E.js} +1 -1
  45. package/browser/{chunk-gFrPRGkc.js → chunk-D6BS5d3G.js} +1 -1
  46. package/browser/{chunk-9t0dGUuC.js → chunk-DHJGYvts.js} +1 -1
  47. package/browser/{chunk-DF1nf97L.js → chunk-DKICVSt6.js} +1 -1
  48. package/browser/{chunk-BOdSBH-Z.js → chunk-DKQJQhx7.js} +1 -1
  49. package/browser/{chunk-C5_Zcy7N.js → chunk-DLAfy6Py.js} +1 -1
  50. package/browser/{chunk-BTwVcLbP.js → chunk-DLpqoFoy.js} +1 -1
  51. package/browser/{chunk-CKO-l3V9.js → chunk-DMmhpxI3.js} +1 -1
  52. package/browser/{chunk-DNUoJb9d.js → chunk-DY7-eNON.js} +1 -1
  53. package/browser/{chunk-Bp63FVq7.js → chunk-DZCghMTL.js} +1 -1
  54. package/browser/{chunk-DAtwHi5G.js → chunk-DeRTJ-9X.js} +1 -1
  55. package/browser/{chunk-sqGaEvm9.js → chunk-Dsr6qG6r.js} +1 -1
  56. package/browser/{chunk-BuSX6FVc.js → chunk-DvQwbSrE.js} +1 -1
  57. package/browser/{chunk-D4POvHTC.js → chunk-Dvz7tu-b.js} +1 -1
  58. package/browser/{chunk-CmObLvei.js → chunk-DzdoNEBA.js} +1 -1
  59. package/browser/{chunk-B4GToBYG.js → chunk-HheDGx6T.js} +1 -1
  60. package/browser/{chunk-CjKuOoYl.js → chunk-K1tWWGkU.js} +1 -1
  61. package/browser/{chunk-CHFfpyIc.js → chunk-OBbxFJ82.js} +1 -1
  62. package/browser/{chunk-BF54SE4Z.js → chunk-SwIRUtfv.js} +1 -1
  63. package/browser/{chunk-m-t8eFzj.js → chunk-U5qyTaf4.js} +1 -1
  64. package/browser/{chunk-LtCKJR0U.js → chunk-YAQ8o8gd.js} +1 -1
  65. package/browser/{chunk-Bk-0cIam.js → chunk-_FxtcKKL.js} +1 -1
  66. package/browser/{chunk-CQnXbo49.js → chunk-cHrt7cAU.js} +1 -1
  67. package/browser/{chunk-BrWe3Tc0.js → chunk-iH0_1Kk3.js} +1 -1
  68. package/browser/{chunk-Dl8oDumK.js → chunk-oC3AJs9n.js} +1 -1
  69. package/browser/{chunk-prOpH6CY.js → chunk-xhgNTdQH.js} +1 -1
  70. package/browser/{chunk-CJaI0n6Y.js → chunk-yS_3qnfr.js} +1 -1
  71. package/browser/{chunk-DlGT7b2J.js → chunk-zoENz5pL.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-EVOOW2CG.js → main-ZIS64A7B.js} +3 -3
  74. package/package.json +1 -1
  75. package/browser/chunk-Cfby0A0V.js +0 -1
  76. package/browser/chunk-CiGypT43.js +0 -1
  77. package/browser/chunk-DSh1tjBw.js +0 -1
  78. package/browser/chunk-Diew0ikf.js +0 -1
  79. package/browser/chunk-pkNoeD9f.js +0 -10
@@ -1 +1 @@
1
- import {N}from'./chunk-9t0dGUuC.js';import {g,F,C as Ce,d9 as D,aJ as Tr,G as Gi,bS as Ea,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,t as CC,u as bg,bg as uT,ah as rT,cb as ZB,cc as qB,m as mT,n as GC,J as Jw,X as XE,a8 as Yg,T as Tg,a5 as vl,v as eC,ac as gC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-EVOOW2CG.js';import'./chunk-pkNoeD9f.js';import {$ as $n,S as Se,G as Gn}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';import'./chunk-Cfby0A0V.js';import'./chunk-DAtwHi5G.js';function K(o,t){if(o&1){let e=lC();ws(0,"span",7),GC(1,"Delete?"),pl(),ws(2,"ds-icon-button",8),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteConfirmed())}),pl(),ws(3,"ds-icon-button",9),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteCancelled())}),pl();}}function Q(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",11),Rg("action",function(){If(e);let i=gC(2);return wf(i.onEdit())}),pl(),ws(1,"ds-icon-button",12),Rg("action",function(){If(e);let i=gC(2);return wf(i.onDeleteArmed())}),pl();}}function X(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",10),Rg("action",function(){If(e);let i=gC();return wf(i.onDuplicate())}),pl(),Jw(1,Q,2,0);}if(o&2){let e=gC();XE(),eC(e.readOnly()?-1:1);}}var Y=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration partag\xE9e plateforme",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),h=class o{config=ZB.required();scope=ZB.required();readOnly=ZB(false);editRequested=qB();deleteRequested=qB();duplicateRequested=qB();pendingDelete=Gi(false);badge=mT(()=>Y[this.scope()]);onEdit(){this.editRequested.emit(this.config());}onDuplicate(){this.duplicateRequested.emit(this.config());}onDeleteArmed(){this.pendingDelete.set(true);}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-integration-config-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:6,consts:[["role","listitem","dsBlueprint","",1,"integration-config-item"],[1,"integration-config-item__body"],[1,"integration-config-item__heading"],[1,"integration-config-item__name"],[1,"integration-config-item__badge"],[1,"integration-config-item__type"],[1,"integration-config-item__actions"],[1,"integration-config-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this configuration",3,"action"],["icon","edit","title","Edit integration",3,"action"],["icon","delete","variant","danger","title","Delete integration",3,"action"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),GC(4),pl(),ws(5,"span",4),GC(6),pl()(),ws(7,"span",5),GC(8),pl()(),ws(9,"div",6),Jw(10,K,4,0)(11,X,2,1),pl()()),e&2&&(XE(4),Yg(n.config().name),XE(),Tg("data-variant",n.badge().variant)("aria-label",n.badge().ariaLabel),XE(),vl(" ",n.badge().label," "),XE(2),Yg(n.config().integrationType),XE(2),eC(n.pendingDelete()?10:11));},dependencies:[Gn,Se],styles:[".integration-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.integration-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.integration-config-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.integration-config-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.integration-config-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:0;padding:.15rem .5rem;white-space:nowrap}.integration-config-item__badge[data-variant=neutral][_ngcontent-%COMP%]{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent}.integration-config-item__badge[data-variant=info][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-info) 40%,transparent);color:var(--color-info);background:color-mix(in srgb,var(--color-info) 10%,transparent)}.integration-config-item__badge[data-variant=warning][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent);color:var(--color-warning);background:color-mix(in srgb,var(--color-warning) 10%,transparent)}.integration-config-item__type[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover .integration-config-item__actions[_ngcontent-%COMP%], .integration-config-item[_ngcontent-%COMP%]:focus-within .integration-config-item__actions[_ngcontent-%COMP%]{opacity:1}.integration-config-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};var Z=()=>[];function ee(o,t){if(o&1){let e=lC();ws(0,"agentos-integration-config-item",4),Rg("editRequested",function(i){If(e);let x=gC(2);return wf(x.onEdit(i))})("deleteRequested",function(i){If(e);let x=gC(2);return wf(x.deleteConfig(i))}),pl();}o&2&&bg("config",t);}function te(o,t){if(o&1&&Jw(0,ee,1,1,"agentos-integration-config-item",3),o&2){let e,n=t.$implicit,i=gC();eC((e=i.resolveConfig(n.id))?0:-1,e);}}var W=class o{router=g(F);destroyRef=g(Ce);state=g(N);integrationConfigController=g(D);refresh$=new Tr(void 0);isLoading=Gi(true);configs$=this.refresh$.pipe(Ea(()=>(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||o)};static \u0275cmp=xw({type:o,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,n){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return n.goBack()}),pl()(),Eg(3,te,1,1,"ng-template",null,0,fT)),e&2){let i=CC(4);bg("items",uT(1,4,n.configItems$)??rT(6,Z))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[$n,h,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{W as PlatformIntegrationConfigsComponent};
1
+ import {N}from'./chunk-DHJGYvts.js';import {g,F,C as Ce,d9 as D,aJ as Tr,G as Gi,bS as Ea,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,t as CC,u as bg,bg as uT,ah as rT,cb as ZB,cc as qB,m as mT,n as GC,J as Jw,X as XE,a8 as Yg,T as Tg,a5 as vl,v as eC,ac as gC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-ZIS64A7B.js';import'./chunk-BmMgSm-g.js';import {$ as $n,S as Se,G as Gn}from'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';import'./chunk-CWmsDCbt.js';import'./chunk-D-2ArFBU.js';import'./chunk-DeRTJ-9X.js';function K(o,t){if(o&1){let e=lC();ws(0,"span",7),GC(1,"Delete?"),pl(),ws(2,"ds-icon-button",8),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteConfirmed())}),pl(),ws(3,"ds-icon-button",9),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteCancelled())}),pl();}}function Q(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",11),Rg("action",function(){If(e);let i=gC(2);return wf(i.onEdit())}),pl(),ws(1,"ds-icon-button",12),Rg("action",function(){If(e);let i=gC(2);return wf(i.onDeleteArmed())}),pl();}}function X(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",10),Rg("action",function(){If(e);let i=gC();return wf(i.onDuplicate())}),pl(),Jw(1,Q,2,0);}if(o&2){let e=gC();XE(),eC(e.readOnly()?-1:1);}}var Y=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration partag\xE9e plateforme",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),h=class o{config=ZB.required();scope=ZB.required();readOnly=ZB(false);editRequested=qB();deleteRequested=qB();duplicateRequested=qB();pendingDelete=Gi(false);badge=mT(()=>Y[this.scope()]);onEdit(){this.editRequested.emit(this.config());}onDuplicate(){this.duplicateRequested.emit(this.config());}onDeleteArmed(){this.pendingDelete.set(true);}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-integration-config-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:6,consts:[["role","listitem","dsBlueprint","",1,"integration-config-item"],[1,"integration-config-item__body"],[1,"integration-config-item__heading"],[1,"integration-config-item__name"],[1,"integration-config-item__badge"],[1,"integration-config-item__type"],[1,"integration-config-item__actions"],[1,"integration-config-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this configuration",3,"action"],["icon","edit","title","Edit integration",3,"action"],["icon","delete","variant","danger","title","Delete integration",3,"action"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),GC(4),pl(),ws(5,"span",4),GC(6),pl()(),ws(7,"span",5),GC(8),pl()(),ws(9,"div",6),Jw(10,K,4,0)(11,X,2,1),pl()()),e&2&&(XE(4),Yg(n.config().name),XE(),Tg("data-variant",n.badge().variant)("aria-label",n.badge().ariaLabel),XE(),vl(" ",n.badge().label," "),XE(2),Yg(n.config().integrationType),XE(2),eC(n.pendingDelete()?10:11));},dependencies:[Gn,Se],styles:[".integration-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.integration-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.integration-config-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.integration-config-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.integration-config-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:0;padding:.15rem .5rem;white-space:nowrap}.integration-config-item__badge[data-variant=neutral][_ngcontent-%COMP%]{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent}.integration-config-item__badge[data-variant=info][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-info) 40%,transparent);color:var(--color-info);background:color-mix(in srgb,var(--color-info) 10%,transparent)}.integration-config-item__badge[data-variant=warning][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent);color:var(--color-warning);background:color-mix(in srgb,var(--color-warning) 10%,transparent)}.integration-config-item__type[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover .integration-config-item__actions[_ngcontent-%COMP%], .integration-config-item[_ngcontent-%COMP%]:focus-within .integration-config-item__actions[_ngcontent-%COMP%]{opacity:1}.integration-config-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};var Z=()=>[];function ee(o,t){if(o&1){let e=lC();ws(0,"agentos-integration-config-item",4),Rg("editRequested",function(i){If(e);let x=gC(2);return wf(x.onEdit(i))})("deleteRequested",function(i){If(e);let x=gC(2);return wf(x.deleteConfig(i))}),pl();}o&2&&bg("config",t);}function te(o,t){if(o&1&&Jw(0,ee,1,1,"agentos-integration-config-item",3),o&2){let e,n=t.$implicit,i=gC();eC((e=i.resolveConfig(n.id))?0:-1,e);}}var W=class o{router=g(F);destroyRef=g(Ce);state=g(N);integrationConfigController=g(D);refresh$=new Tr(void 0);isLoading=Gi(true);configs$=this.refresh$.pipe(Ea(()=>(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||o)};static \u0275cmp=xw({type:o,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,n){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return n.goBack()}),pl()(),Eg(3,te,1,1,"ng-template",null,0,fT)),e&2){let i=CC(4);bg("items",uT(1,4,n.configItems$)??rT(6,Z))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[$n,h,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{W as PlatformIntegrationConfigsComponent};
@@ -1,4 +1,4 @@
1
- import {b as Qe}from'./chunk-DJTNjd3B.js';import {D as D$1,i as y}from'./chunk-FV8LaU7e.js';import {g,D as py,bU as Td,W 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,t as CC,u as bg,X as XE,z as Ug,T as Tg,v as eC,b5 as nT,bC as Si,c8 as KT,c0 as xg,b$ as kC,B as Pg,E as EC,I as IC,c9 as kf}from'./main-EVOOW2CG.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-B0ReGfih.js';import {D as D$1,i as y}from'./chunk-CWmsDCbt.js';import {g,D as py,bU as Td,W 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,t as CC,u as bg,X as XE,z as Ug,T as Tg,v as eC,b5 as nT,bC as Si,c8 as KT,c0 as xg,b$ as kC,B as Pg,E as EC,I as IC,c9 as kf}from'./main-ZIS64A7B.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;
@@ -1 +1 @@
1
- import {c}from'./chunk-pkNoeD9f.js';import {g,ao as W,ds as _,G as Gi,an as ue$1,cd as Hf,e as xw,cF as Pb,k as ws,n as GC,o as pl,J as Jw,X as XE,v as eC,bR as wd,bS as Ea,cB as on,M as By,a7 as ya,a9 as lC,q as Rg,ai as tm,a3 as VI,ac as gC,ak as em,a6 as UI,a8 as Yg,s as rC,y as oC,cg as iT,b4 as oT,bf as aT,bg as uT,b0 as Qg,bi as lT,aa as If,ab as wf,aj as KC,a5 as vl}from'./main-EVOOW2CG.js';import {t as ti,J as Jn,Y as Ye,Z as Zn,l as Xn,g as gt,c as cn,d as an}from'./chunk-FV8LaU7e.js';import'./chunk-DAtwHi5G.js';import'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';var te=e=>({title:"By agent",rows:e}),ne=e=>({title:"By model",rows:e}),ie=(e,o)=>[e,o],ae=(e,o)=>o.title,oe=(e,o)=>o.key;function re(e,o){e&1&&(ws(0,"p",1),GC(1,"Loading usage settings\u2026"),pl());}function se(e,o){if(e&1){let t=lC();ws(0,"p",2),GC(1,"Could not load usage settings. Please try again."),pl(),ws(2,"button",3),Rg("click",function(){If(t);let s=gC();return wf(s.configuration.retry())}),GC(3,"Retry usage settings"),pl();}}function le(e,o){e&1&&(ws(0,"p",1),GC(1,"Usage tracking is disabled."),pl());}function me(e,o){e&1&&(ws(0,"p",2),GC(1),pl()),e&2&&(XE(),Yg(o));}function de(e,o){e&1&&(ws(0,"p",1),GC(1,"Loading usage\u2026"),pl());}function ce(e,o){e&1&&(ws(0,"p"),GC(1,"No recorded usage for this period."),pl());}function pe(e,o){if(e&1&&(ws(0,"small"),GC(1),pl()),e&2){let t=gC().$implicit;XE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ge(e,o){if(e&1&&(ws(0,"tr")(1,"th",10),GC(2),pl(),ws(3,"td"),GC(4),aT(5,"number"),pl(),ws(6,"td"),GC(7),aT(8,"number"),aT(9,"number"),pl(),ws(10,"td"),GC(11),aT(12,"number"),aT(13,"number"),pl(),ws(14,"td"),GC(15),aT(16,"number"),Jw(17,pe,2,1,"small"),pl()()),e&2){let t=o.$implicit;XE(2),Yg(t.key),XE(2),Yg(uT(5,9,t.aggregate.totalTokens)),XE(3),Qg("",uT(8,11,t.aggregate.inputTokens)," / ",uT(9,13,t.aggregate.outputTokens)),XE(4),Qg(" ",uT(12,15,t.aggregate.cacheReadTokens)," / ",uT(13,17,t.aggregate.cacheWriteTokens)," "),XE(4),Qg(" ",t.aggregate.unknownCostCount>0?"At least ":"","",lT(16,19,t.aggregate.cost,"1.2-6")," "),XE(2),eC(t.aggregate.unknownCostCount>0?17:-1);}}function ue(e,o){if(e&1&&(ws(0,"div",8)(1,"table")(2,"thead")(3,"tr")(4,"th",9),GC(5,"Name"),pl(),ws(6,"th",9),GC(7,"Tokens"),pl(),ws(8,"th",9),GC(9,"Input / output"),pl(),ws(10,"th",9),GC(11,"Cache read / write"),pl(),ws(12,"th",9),GC(13,"Estimated cost"),pl()()(),ws(14,"tbody"),rC(15,ge,18,22,"tr",null,oe),pl()()()),e&2){let t=gC().$implicit;XE(15),oC(t.rows);}}function _e(e,o){if(e&1&&(ws(0,"h2"),GC(1),pl(),Jw(2,ce,2,0,"p")(3,ue,17,0,"div",8)),e&2){let t=o.$implicit;XE(),Yg(t.title),XE(),eC(t.rows.length===0?2:3);}}function Ce(e,o){if(e&1&&(rC(0,_e,4,2,null,null,ae),ws(2,"p"),GC(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),pl()),e&2){let t=gC(2);oC(iT(4,ie,oT(0,te,t.agents()),oT(2,ne,t.models())));}}function fe(e,o){if(e&1){let t=lC();ws(0,"p"),GC(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),pl(),ws(2,"form",4),Rg("ngSubmit",function(){If(t);let s=gC();return wf(s.load())}),ws(3,"label"),GC(4,"From (UTC)"),ws(5,"input",5),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.from,s)||(d.from=s),wf(s)}),pl(),VI(),pl(),ws(6,"label"),GC(7,"To (UTC)"),ws(8,"input",6),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.to,s)||(d.to=s),wf(s)}),pl(),VI(),pl(),ws(9,"button",7),GC(10,"Refresh"),pl()(),Jw(11,me,2,1,"p",2),Jw(12,de,2,0,"p",1)(13,Ce,4,7);}if(e&2){let t,r=gC();XE(5),em("ngModel",r.from),UI(),XE(3),em("ngModel",r.to),UI(),XE(3),eC((t=r.error())?11:-1,t),XE(),eC(r.loading()?12:r.error()?-1:13);}}var ee=class e{route=g(W);api=g(_);configuration=g(c);namespaceId=this.route.snapshot.params.namespaceId;agents=Gi([]);models=Gi([]);error=Gi(null);loading=Gi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Hf(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(wd(void 0),Ea(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),on):(this.loading.set(true),By({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ya(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),on))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:7,vars:1,consts:[[1,"report"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(ws(0,"section",0)(1,"h1"),GC(2,"Usage and costs"),pl(),Jw(3,re,2,0,"p",1)(4,se,4,0)(5,le,2,0,"p",1)(6,fe,14,4),pl()),t&2&&(XE(3),eC(r.configuration.state()==="loading"?3:r.configuration.state()==="error"?4:r.configuration.state()==="disabled"?5:6));},dependencies:[ti,Jn,Ye,Zn,Xn,gt,cn,an,Pb],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{ee as NamespaceUsageComponent};
1
+ import {c}from'./chunk-BmMgSm-g.js';import {g,ao as W,dt as _,G as Gi,an as ue$1,cd as Hf,e as xw,cF as Pb,k as ws,n as GC,o as pl,J as Jw,X as XE,v as eC,bR as wd,bS as Ea,cB as on,M as By,a7 as ya,a9 as lC,q as Rg,ai as tm,a3 as VI,ac as gC,ak as em,a6 as UI,a8 as Yg,s as rC,y as oC,cg as iT,b4 as oT,bf as aT,bg as uT,b0 as Qg,bi as lT,aa as If,ab as wf,aj as KC,a5 as vl}from'./main-ZIS64A7B.js';import {t as ti,J as Jn,Y as Ye,Z as Zn,l as Xn,g as gt,c as cn,d as an}from'./chunk-CWmsDCbt.js';import'./chunk-DeRTJ-9X.js';import'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';var te=e=>({title:"By agent",rows:e}),ne=e=>({title:"By model",rows:e}),ie=(e,o)=>[e,o],ae=(e,o)=>o.title,oe=(e,o)=>o.key;function re(e,o){e&1&&(ws(0,"p",1),GC(1,"Loading usage settings\u2026"),pl());}function se(e,o){if(e&1){let t=lC();ws(0,"p",2),GC(1,"Could not load usage settings. Please try again."),pl(),ws(2,"button",3),Rg("click",function(){If(t);let s=gC();return wf(s.configuration.retry())}),GC(3,"Retry usage settings"),pl();}}function le(e,o){e&1&&(ws(0,"p",1),GC(1,"Usage tracking is disabled."),pl());}function me(e,o){e&1&&(ws(0,"p",2),GC(1),pl()),e&2&&(XE(),Yg(o));}function de(e,o){e&1&&(ws(0,"p",1),GC(1,"Loading usage\u2026"),pl());}function ce(e,o){e&1&&(ws(0,"p"),GC(1,"No recorded usage for this period."),pl());}function pe(e,o){if(e&1&&(ws(0,"small"),GC(1),pl()),e&2){let t=gC().$implicit;XE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ge(e,o){if(e&1&&(ws(0,"tr")(1,"th",10),GC(2),pl(),ws(3,"td"),GC(4),aT(5,"number"),pl(),ws(6,"td"),GC(7),aT(8,"number"),aT(9,"number"),pl(),ws(10,"td"),GC(11),aT(12,"number"),aT(13,"number"),pl(),ws(14,"td"),GC(15),aT(16,"number"),Jw(17,pe,2,1,"small"),pl()()),e&2){let t=o.$implicit;XE(2),Yg(t.key),XE(2),Yg(uT(5,9,t.aggregate.totalTokens)),XE(3),Qg("",uT(8,11,t.aggregate.inputTokens)," / ",uT(9,13,t.aggregate.outputTokens)),XE(4),Qg(" ",uT(12,15,t.aggregate.cacheReadTokens)," / ",uT(13,17,t.aggregate.cacheWriteTokens)," "),XE(4),Qg(" ",t.aggregate.unknownCostCount>0?"At least ":"","",lT(16,19,t.aggregate.cost,"1.2-6")," "),XE(2),eC(t.aggregate.unknownCostCount>0?17:-1);}}function ue(e,o){if(e&1&&(ws(0,"div",8)(1,"table")(2,"thead")(3,"tr")(4,"th",9),GC(5,"Name"),pl(),ws(6,"th",9),GC(7,"Tokens"),pl(),ws(8,"th",9),GC(9,"Input / output"),pl(),ws(10,"th",9),GC(11,"Cache read / write"),pl(),ws(12,"th",9),GC(13,"Estimated cost"),pl()()(),ws(14,"tbody"),rC(15,ge,18,22,"tr",null,oe),pl()()()),e&2){let t=gC().$implicit;XE(15),oC(t.rows);}}function _e(e,o){if(e&1&&(ws(0,"h2"),GC(1),pl(),Jw(2,ce,2,0,"p")(3,ue,17,0,"div",8)),e&2){let t=o.$implicit;XE(),Yg(t.title),XE(),eC(t.rows.length===0?2:3);}}function Ce(e,o){if(e&1&&(rC(0,_e,4,2,null,null,ae),ws(2,"p"),GC(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),pl()),e&2){let t=gC(2);oC(iT(4,ie,oT(0,te,t.agents()),oT(2,ne,t.models())));}}function fe(e,o){if(e&1){let t=lC();ws(0,"p"),GC(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),pl(),ws(2,"form",4),Rg("ngSubmit",function(){If(t);let s=gC();return wf(s.load())}),ws(3,"label"),GC(4,"From (UTC)"),ws(5,"input",5),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.from,s)||(d.from=s),wf(s)}),pl(),VI(),pl(),ws(6,"label"),GC(7,"To (UTC)"),ws(8,"input",6),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.to,s)||(d.to=s),wf(s)}),pl(),VI(),pl(),ws(9,"button",7),GC(10,"Refresh"),pl()(),Jw(11,me,2,1,"p",2),Jw(12,de,2,0,"p",1)(13,Ce,4,7);}if(e&2){let t,r=gC();XE(5),em("ngModel",r.from),UI(),XE(3),em("ngModel",r.to),UI(),XE(3),eC((t=r.error())?11:-1,t),XE(),eC(r.loading()?12:r.error()?-1:13);}}var ee=class e{route=g(W);api=g(_);configuration=g(c);namespaceId=this.route.snapshot.params.namespaceId;agents=Gi([]);models=Gi([]);error=Gi(null);loading=Gi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Hf(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(wd(void 0),Ea(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),on):(this.loading.set(true),By({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ya(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),on))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:7,vars:1,consts:[[1,"report"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(ws(0,"section",0)(1,"h1"),GC(2,"Usage and costs"),pl(),Jw(3,re,2,0,"p",1)(4,se,4,0)(5,le,2,0,"p",1)(6,fe,14,4),pl()),t&2&&(XE(3),eC(r.configuration.state()==="loading"?3:r.configuration.state()==="error"?4:r.configuration.state()==="disabled"?5:6));},dependencies:[ti,Jn,Ye,Zn,Xn,gt,cn,an,Pb],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{ee as NamespaceUsageComponent};
@@ -1 +1 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {F as F$1,E}from'./chunk-pkNoeD9f.js';import {v}from'./chunk-LtCKJR0U.js';import {R}from'./chunk-BmZ9yw5t.js';import {g,ao as W,F,C as Ce,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,s as rC,ac as gC,u as bg,y as oC,a8 as Yg,aa as If,ab as wf}from'./main-EVOOW2CG.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';import'./chunk-DAtwHi5G.js';import'./chunk-Cfby0A0V.js';var j=(i,t)=>t.key;function z(i,t){i&1&&(ws(0,"p",2),GC(1,"Loading auth settings\u2026"),pl());}function G(i,t){i&1&&(ws(0,"p",3),GC(1,"No auth settings available."),pl());}function H(i,t){i&1&&(ws(0,"ds-tag",12),GC(1,"Read-only"),pl());}function U(i,t){if(i&1){let e=lC();ws(0,"button",14),Rg("click",function(){If(e);let s=gC().$implicit,r=gC(2);return wf(r.edit(s))}),GC(1,"Edit"),pl(),ws(2,"button",16),Rg("click",function(){If(e);let s=gC().$implicit,r=gC(2);return wf(r.delete(s))}),GC(3,"Delete"),pl();}}function B(i,t){i&1&&(ws(0,"button",15),GC(1,"Inherited"),pl());}function J(i,t){if(i&1){let e=lC();ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td")(6,"div",10)(7,"ds-tag",11),GC(8),pl(),Jw(9,H,2,0,"ds-tag",12),pl()(),ws(10,"td",13)(11,"button",14),Rg("click",function(){let s=If(e).$implicit,r=gC(2);return wf(r.duplicate(s))}),GC(12,"Duplicate"),pl(),Jw(13,U,4,0)(14,B,2,0,"button",15),pl()();}if(i&2){let e=t.$implicit;XE(2),Yg(e.config.name),XE(2),Yg(e.config.authType),XE(3),bg("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),XE(),Yg(e.scopeLabel),XE(),eC(e.canMutate?-1:9),XE(4),eC(e.canMutate?13:14);}}function K(i,t){if(i&1){let e=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(s){If(e);let r=gC();return wf(r.rowFilter.query.set(s))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"Authentication type"),pl(),ws(9,"th"),GC(10,"Scope"),pl(),ws(11,"th")(12,"span",7),GC(13,"Actions"),pl()()()(),ws(14,"tbody"),rC(15,J,15,6,"tr",null,j),pl()()();}if(i&2){let e=gC();bg("query",e.rowFilter.query()),XE(15),oC(e.rowFilter.filteredRows());}}var q=class i{route=g(W);router=g(F);destroyRef=g(Ce);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(re(t=>t.get("namespaceId")??""),Ea(t=>t?this.namespaceRole.isAdminOfNamespace$(t):br(false)),U$1(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}delete(t){!t.canMutate||!t.config.id||!confirm(`Delete auth setting \u201C${t.config.name}\u201D?`)||this.state.delete(t.config.id,t.scope).pipe(U$1(this.destroyRef)).subscribe();}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,l,s){return t.map((r,$)=>({key:`${e}:${r.id??$}`,config:r,scope:e,scopeLabel:l,canMutate:s}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:6,vars:1,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["type","button",1,"auth-settings__new",3,"click"],["role","status",1,"auth-settings__status"],[1,"auth-settings__status"],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],[1,"auth-settings__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"auth-settings__name"],[1,"auth-settings__type"],[1,"auth-settings__tags"],[3,"variant"],["variant","outline"],[1,"auth-settings__actions"],["type","button",3,"click"],["type","button","disabled",""],["type","button",1,"auth-settings__delete",3,"click"]],template:function(e,l){e&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return l.openCreateForm()}),GC(2,"New auth setting"),pl()(),Jw(3,z,2,0,"p",2)(4,G,2,0,"p",3)(5,K,17,1)),e&2&&(XE(3),eC(l.isLoading()?3:l.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".auth-settings__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.auth-settings__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.auth-settings__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.auth-settings__name[_ngcontent-%COMP%]{font-weight:500}.auth-settings__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.auth-settings__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.auth-settings__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.auth-settings__actions[_ngcontent-%COMP%] .auth-settings__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{q as AuthSettingsAllScopesComponent};
1
+ import {n}from'./chunk-CfgXrte_.js';import {F as F$1,E}from'./chunk-BmMgSm-g.js';import {v}from'./chunk-YAQ8o8gd.js';import {R}from'./chunk-ClPtCPiU.js';import {g,ao as W,F,C as Ce,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,s as rC,ac as gC,u as bg,y as oC,a8 as Yg,aa as If,ab as wf}from'./main-ZIS64A7B.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';import'./chunk-CWmsDCbt.js';import'./chunk-DeRTJ-9X.js';import'./chunk-D-2ArFBU.js';var j=(i,t)=>t.key;function z(i,t){i&1&&(ws(0,"p",2),GC(1,"Loading auth settings\u2026"),pl());}function G(i,t){i&1&&(ws(0,"p",3),GC(1,"No auth settings available."),pl());}function H(i,t){i&1&&(ws(0,"ds-tag",12),GC(1,"Read-only"),pl());}function U(i,t){if(i&1){let e=lC();ws(0,"button",14),Rg("click",function(){If(e);let s=gC().$implicit,r=gC(2);return wf(r.edit(s))}),GC(1,"Edit"),pl(),ws(2,"button",16),Rg("click",function(){If(e);let s=gC().$implicit,r=gC(2);return wf(r.delete(s))}),GC(3,"Delete"),pl();}}function B(i,t){i&1&&(ws(0,"button",15),GC(1,"Inherited"),pl());}function J(i,t){if(i&1){let e=lC();ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td")(6,"div",10)(7,"ds-tag",11),GC(8),pl(),Jw(9,H,2,0,"ds-tag",12),pl()(),ws(10,"td",13)(11,"button",14),Rg("click",function(){let s=If(e).$implicit,r=gC(2);return wf(r.duplicate(s))}),GC(12,"Duplicate"),pl(),Jw(13,U,4,0)(14,B,2,0,"button",15),pl()();}if(i&2){let e=t.$implicit;XE(2),Yg(e.config.name),XE(2),Yg(e.config.authType),XE(3),bg("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),XE(),Yg(e.scopeLabel),XE(),eC(e.canMutate?-1:9),XE(4),eC(e.canMutate?13:14);}}function K(i,t){if(i&1){let e=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(s){If(e);let r=gC();return wf(r.rowFilter.query.set(s))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"Authentication type"),pl(),ws(9,"th"),GC(10,"Scope"),pl(),ws(11,"th")(12,"span",7),GC(13,"Actions"),pl()()()(),ws(14,"tbody"),rC(15,J,15,6,"tr",null,j),pl()()();}if(i&2){let e=gC();bg("query",e.rowFilter.query()),XE(15),oC(e.rowFilter.filteredRows());}}var q=class i{route=g(W);router=g(F);destroyRef=g(Ce);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(re(t=>t.get("namespaceId")??""),Ea(t=>t?this.namespaceRole.isAdminOfNamespace$(t):br(false)),U$1(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}delete(t){!t.canMutate||!t.config.id||!confirm(`Delete auth setting \u201C${t.config.name}\u201D?`)||this.state.delete(t.config.id,t.scope).pipe(U$1(this.destroyRef)).subscribe();}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,l,s){return t.map((r,$)=>({key:`${e}:${r.id??$}`,config:r,scope:e,scopeLabel:l,canMutate:s}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:6,vars:1,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["type","button",1,"auth-settings__new",3,"click"],["role","status",1,"auth-settings__status"],[1,"auth-settings__status"],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],[1,"auth-settings__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"auth-settings__name"],[1,"auth-settings__type"],[1,"auth-settings__tags"],[3,"variant"],["variant","outline"],[1,"auth-settings__actions"],["type","button",3,"click"],["type","button","disabled",""],["type","button",1,"auth-settings__delete",3,"click"]],template:function(e,l){e&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return l.openCreateForm()}),GC(2,"New auth setting"),pl()(),Jw(3,z,2,0,"p",2)(4,G,2,0,"p",3)(5,K,17,1)),e&2&&(XE(3),eC(l.isLoading()?3:l.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".auth-settings__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.auth-settings__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.auth-settings__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.auth-settings__name[_ngcontent-%COMP%]{font-weight:500}.auth-settings__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.auth-settings__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.auth-settings__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.auth-settings__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.auth-settings__actions[_ngcontent-%COMP%] .auth-settings__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{q as AuthSettingsAllScopesComponent};
@@ -1 +1 @@
1
- import {g,D as py,P,Q as br,r as re,W as x}from'./main-EVOOW2CG.js';var d=class i{http=g(py);projectState=g(P);promptsCache=new Map;getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?br(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(re(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear();}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(re(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(re(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(re(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d};
1
+ import {g,D as py,P,Q as br,r as re,W as x}from'./main-ZIS64A7B.js';var d=class i{http=g(py);projectState=g(P);promptsCache=new Map;getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?br(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(re(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear();}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(re(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(re(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(re(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d};
@@ -1 +1 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {F as F$1,E}from'./chunk-pkNoeD9f.js';import {O}from'./chunk-MZ4wRIEo.js';import {v}from'./chunk-LtCKJR0U.js';import {g,ao as W,F,C as Ce,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,s as rC,ac as gC,u as bg,y as oC,a8 as Yg,aa as If,ab as wf}from'./main-EVOOW2CG.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';import'./chunk-DAtwHi5G.js';import'./chunk-Cfby0A0V.js';var j=(n,e)=>e.key;function z(n,e){n&1&&(ws(0,"p",2),GC(1,"Loading AI providers\u2026"),pl());}function G(n,e){n&1&&(ws(0,"p",3),GC(1,"No AI providers available."),pl());}function H(n,e){n&1&&(ws(0,"ds-tag",12),GC(1,"Read-only"),pl());}function U(n,e){if(n&1){let t=lC();ws(0,"button",14),Rg("click",function(){If(t);let a=gC().$implicit,s=gC(2);return wf(s.edit(a))}),GC(1,"Edit"),pl(),ws(2,"button",16),Rg("click",function(){If(t);let a=gC().$implicit,s=gC(2);return wf(s.delete(a))}),GC(3,"Delete"),pl();}}function B(n,e){n&1&&(ws(0,"button",15),GC(1,"Inherited"),pl());}function J(n,e){if(n&1){let t=lC();ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td")(6,"div",10)(7,"ds-tag",11),GC(8),pl(),Jw(9,H,2,0,"ds-tag",12),pl()(),ws(10,"td",13)(11,"button",14),Rg("click",function(){let a=If(t).$implicit,s=gC(2);return wf(s.duplicate(a))}),GC(12,"Duplicate"),pl(),Jw(13,U,4,0)(14,B,2,0,"button",15),pl()();}if(n&2){let t=e.$implicit;XE(2),Yg(t.config.name),XE(2),Yg(t.config.apiType),XE(3),bg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),XE(),Yg(t.scopeLabel),XE(),eC(t.canMutate?-1:9),XE(4),eC(t.canMutate?13:14);}}function K(n,e){if(n&1){let t=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(a){If(t);let s=gC();return wf(s.rowFilter.query.set(a))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"API type"),pl(),ws(9,"th"),GC(10,"Scope"),pl(),ws(11,"th")(12,"span",7),GC(13,"Actions"),pl()()()(),ws(14,"tbody"),rC(15,J,15,6,"tr",null,j),pl()()();}if(n&2){let t=gC();bg("query",t.rowFilter.query()),XE(15),oC(t.rowFilter.filteredRows());}}var q=class n$1{route=g(W);router=g(F);destroyRef=g(Ce);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.apiType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),Ea(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}delete(e){!e.canMutate||!e.config.id||!confirm(`Delete AI provider \u201C${e.config.name}\u201D?`)||this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)).subscribe();}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,l,a){return e.map((s,$)=>({key:`${t}:${s.id??$}`,config:s,scope:t,scopeLabel:l,canMutate:a}))}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=xw({type:n$1,selectors:[["agentos-ai-providers-all-scopes"]],decls:6,vars:1,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["type","button",1,"ai-providers__new",3,"click"],["role","status",1,"ai-providers__status"],[1,"ai-providers__status"],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],[1,"ai-providers__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"ai-providers__name"],[1,"ai-providers__type"],[1,"ai-providers__tags"],[3,"variant"],["variant","outline"],[1,"ai-providers__actions"],["type","button",3,"click"],["type","button","disabled",""],["type","button",1,"ai-providers__delete",3,"click"]],template:function(t,l){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return l.openCreateForm()}),GC(2," New AI provider "),pl()(),Jw(3,z,2,0,"p",2)(4,G,2,0,"p",3)(5,K,17,1)),t&2&&(XE(3),eC(l.isLoading()?3:l.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".ai-providers__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.ai-providers__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.ai-providers__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.ai-providers__name[_ngcontent-%COMP%]{font-weight:500}.ai-providers__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.ai-providers__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.ai-providers__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.ai-providers__actions[_ngcontent-%COMP%] .ai-providers__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{q as AiProvidersAllScopesComponent};
1
+ import {n}from'./chunk-CfgXrte_.js';import {F as F$1,E}from'./chunk-BmMgSm-g.js';import {O}from'./chunk-9KYYyWcX.js';import {v}from'./chunk-YAQ8o8gd.js';import {g,ao as W,F,C as Ce,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,s as rC,ac as gC,u as bg,y as oC,a8 as Yg,aa as If,ab as wf}from'./main-ZIS64A7B.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';import'./chunk-CWmsDCbt.js';import'./chunk-DeRTJ-9X.js';import'./chunk-D-2ArFBU.js';var j=(n,e)=>e.key;function z(n,e){n&1&&(ws(0,"p",2),GC(1,"Loading AI providers\u2026"),pl());}function G(n,e){n&1&&(ws(0,"p",3),GC(1,"No AI providers available."),pl());}function H(n,e){n&1&&(ws(0,"ds-tag",12),GC(1,"Read-only"),pl());}function U(n,e){if(n&1){let t=lC();ws(0,"button",14),Rg("click",function(){If(t);let a=gC().$implicit,s=gC(2);return wf(s.edit(a))}),GC(1,"Edit"),pl(),ws(2,"button",16),Rg("click",function(){If(t);let a=gC().$implicit,s=gC(2);return wf(s.delete(a))}),GC(3,"Delete"),pl();}}function B(n,e){n&1&&(ws(0,"button",15),GC(1,"Inherited"),pl());}function J(n,e){if(n&1){let t=lC();ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td")(6,"div",10)(7,"ds-tag",11),GC(8),pl(),Jw(9,H,2,0,"ds-tag",12),pl()(),ws(10,"td",13)(11,"button",14),Rg("click",function(){let a=If(t).$implicit,s=gC(2);return wf(s.duplicate(a))}),GC(12,"Duplicate"),pl(),Jw(13,U,4,0)(14,B,2,0,"button",15),pl()();}if(n&2){let t=e.$implicit;XE(2),Yg(t.config.name),XE(2),Yg(t.config.apiType),XE(3),bg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),XE(),Yg(t.scopeLabel),XE(),eC(t.canMutate?-1:9),XE(4),eC(t.canMutate?13:14);}}function K(n,e){if(n&1){let t=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(a){If(t);let s=gC();return wf(s.rowFilter.query.set(a))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"API type"),pl(),ws(9,"th"),GC(10,"Scope"),pl(),ws(11,"th")(12,"span",7),GC(13,"Actions"),pl()()()(),ws(14,"tbody"),rC(15,J,15,6,"tr",null,j),pl()()();}if(n&2){let t=gC();bg("query",t.rowFilter.query()),XE(15),oC(t.rowFilter.filteredRows());}}var q=class n$1{route=g(W);router=g(F);destroyRef=g(Ce);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.apiType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),Ea(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}delete(e){!e.canMutate||!e.config.id||!confirm(`Delete AI provider \u201C${e.config.name}\u201D?`)||this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)).subscribe();}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,l,a){return e.map((s,$)=>({key:`${t}:${s.id??$}`,config:s,scope:t,scopeLabel:l,canMutate:a}))}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=xw({type:n$1,selectors:[["agentos-ai-providers-all-scopes"]],decls:6,vars:1,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["type","button",1,"ai-providers__new",3,"click"],["role","status",1,"ai-providers__status"],[1,"ai-providers__status"],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],[1,"ai-providers__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"ai-providers__name"],[1,"ai-providers__type"],[1,"ai-providers__tags"],[3,"variant"],["variant","outline"],[1,"ai-providers__actions"],["type","button",3,"click"],["type","button","disabled",""],["type","button",1,"ai-providers__delete",3,"click"]],template:function(t,l){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return l.openCreateForm()}),GC(2," New AI provider "),pl()(),Jw(3,z,2,0,"p",2)(4,G,2,0,"p",3)(5,K,17,1)),t&2&&(XE(3),eC(l.isLoading()?3:l.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".ai-providers__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.ai-providers__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.ai-providers__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.ai-providers__name[_ngcontent-%COMP%]{font-weight:500}.ai-providers__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.ai-providers__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.ai-providers__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.ai-providers__actions[_ngcontent-%COMP%] .ai-providers__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{q as AiProvidersAllScopesComponent};
@@ -1 +1 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {F as F$1,E}from'./chunk-pkNoeD9f.js';import {v}from'./chunk-LtCKJR0U.js';import {N}from'./chunk-9t0dGUuC.js';import {g,ao as W$1,F,C as Ce,d5 as G$1,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,u as bg,X as XE,v as eC,a9 as lC,s as rC,ac as gC,y as oC,a8 as Yg,a5 as vl,aa as If,ab as wf}from'./main-EVOOW2CG.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';import'./chunk-DAtwHi5G.js';import'./chunk-Cfby0A0V.js';var G=(n,e)=>e.key;function B(n,e){n&1&&(ws(0,"p",2),GC(1,"Loading integrations\u2026"),pl());}function H(n,e){n&1&&(ws(0,"p",3),GC(1,"No integrations available."),pl());}function U(n,e){n&1&&(ws(0,"ds-tag",14),GC(1,"YAML"),pl(),ws(2,"ds-tag",15),GC(3,"Read-only"),pl());}function K(n,e){if(n&1){let t=lC();ws(0,"button",16),Rg("click",function(){If(t);let l=gC().$implicit,s=gC(2);return wf(s.view(l))}),GC(1,"View"),pl();}}function Q(n,e){if(n&1){let t=lC();ws(0,"button",16),Rg("click",function(){If(t);let l=gC(2).$implicit,s=gC(2);return wf(s.edit(l))}),GC(1,"Edit"),pl();}}function W(n,e){if(n&1){let t=lC();ws(0,"button",19),Rg("click",function(){If(t);let l=gC(2).$implicit,s=gC(2);return wf(s.delete(l))}),GC(1,"Delete"),pl();}}function X(n,e){n&1&&(ws(0,"button",18),GC(1,"Inherited"),pl());}function Z(n,e){if(n&1){let t=lC();ws(0,"button",16),Rg("click",function(){If(t);let l=gC().$implicit,s=gC(2);return wf(s.duplicate(l))}),GC(1,"Duplicate"),pl(),Jw(2,Q,2,0,"button",13),Jw(3,W,2,0,"button",17),Jw(4,X,2,0,"button",18);}if(n&2){let t=gC().$implicit;XE(2),eC(t.canEdit?2:-1),XE(),eC(t.canDelete?3:-1),XE(),eC(!t.canEdit&&!t.canDelete?4:-1);}}function ee(n,e){if(n&1&&(ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td")(6,"div",10)(7,"ds-tag",11),GC(8),pl(),Jw(9,U,4,0),pl()(),ws(10,"td",12),Jw(11,K,2,0,"button",13)(12,Z,5,3),pl()()),n&2){let t=e.$implicit;XE(2),Yg(t.config.name),XE(2),Yg(t.config.integrationType),XE(3),bg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),XE(),vl(" ",t.scopeLabel," "),XE(),eC(t.source==="FILESYSTEM"?9:-1),XE(2),eC(t.source==="FILESYSTEM"?11:12);}}function te(n,e){if(n&1){let t=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(l){If(t);let s=gC();return wf(s.rowFilter.query.set(l))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"Type"),pl(),ws(9,"th"),GC(10,"Scope"),pl(),ws(11,"th")(12,"span",7),GC(13,"Actions"),pl()()()(),ws(14,"tbody"),rC(15,ee,13,6,"tr",null,G),pl()()();}if(n&2){let t=gC();bg("query",t.rowFilter.query()),XE(15),oC(t.rowFilter.filteredRows());}}var z=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ce);state=g(N);namespaceRole=g(v);namespaceApi=g(G$1);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=Gi("this namespace");isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),Ea(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let r=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:r,template:e.config.id,templateScope:e.scope}});}delete(e){!e.canDelete||!e.config.id||!confirm(`Delete integration \u201C${e.config.name}\u201D?`)||this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)).subscribe();}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e,t,r,l){return e.map((s,J)=>{let h=this.sourceOf(s),S=h==="NEO4J"&&!l;return {key:`${t}:${s.id??J}`,config:s,scope:t,scopeLabel:r,source:h,canEdit:S,canDelete:S}})}sourceOf(e){return e.source??"NEO4J"}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=xw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:6,vars:2,consts:[["title","Integrations",3,"description"],["type","button",1,"integrations__new",3,"click"],["role","status",1,"integrations__status"],[1,"integrations__status"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],[1,"integrations__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"integrations__name"],[1,"integrations__type"],[1,"integrations__tags"],[3,"variant"],[1,"integrations__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["type","button",1,"integrations__delete"],["type","button","disabled",""],["type","button",1,"integrations__delete",3,"click"]],template:function(t,r){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return r.openCreateForm()}),GC(2,"New integration"),pl()(),Jw(3,B,2,0,"p",2)(4,H,2,0,"p",3)(5,te,17,1)),t&2&&(bg("description","Integrations for "+r.namespaceName()+", including entries inherited from the platform."),XE(3),eC(r.isLoading()?3:r.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".integrations__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.integrations__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.integrations__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.integrations__name[_ngcontent-%COMP%]{font-weight:500}.integrations__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integrations__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.integrations__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.integrations__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.integrations__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.integrations__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.integrations__actions[_ngcontent-%COMP%] .integrations__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{z as IntegrationsAllScopesComponent};
1
+ import {n}from'./chunk-CfgXrte_.js';import {F as F$1,E}from'./chunk-BmMgSm-g.js';import {v}from'./chunk-YAQ8o8gd.js';import {N}from'./chunk-DHJGYvts.js';import {g,ao as W$1,F,C as Ce,d5 as G$1,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,u as bg,X as XE,v as eC,a9 as lC,s as rC,ac as gC,y as oC,a8 as Yg,a5 as vl,aa as If,ab as wf}from'./main-ZIS64A7B.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';import'./chunk-CWmsDCbt.js';import'./chunk-DeRTJ-9X.js';import'./chunk-D-2ArFBU.js';var G=(n,e)=>e.key;function B(n,e){n&1&&(ws(0,"p",2),GC(1,"Loading integrations\u2026"),pl());}function H(n,e){n&1&&(ws(0,"p",3),GC(1,"No integrations available."),pl());}function U(n,e){n&1&&(ws(0,"ds-tag",14),GC(1,"YAML"),pl(),ws(2,"ds-tag",15),GC(3,"Read-only"),pl());}function K(n,e){if(n&1){let t=lC();ws(0,"button",16),Rg("click",function(){If(t);let l=gC().$implicit,s=gC(2);return wf(s.view(l))}),GC(1,"View"),pl();}}function Q(n,e){if(n&1){let t=lC();ws(0,"button",16),Rg("click",function(){If(t);let l=gC(2).$implicit,s=gC(2);return wf(s.edit(l))}),GC(1,"Edit"),pl();}}function W(n,e){if(n&1){let t=lC();ws(0,"button",19),Rg("click",function(){If(t);let l=gC(2).$implicit,s=gC(2);return wf(s.delete(l))}),GC(1,"Delete"),pl();}}function X(n,e){n&1&&(ws(0,"button",18),GC(1,"Inherited"),pl());}function Z(n,e){if(n&1){let t=lC();ws(0,"button",16),Rg("click",function(){If(t);let l=gC().$implicit,s=gC(2);return wf(s.duplicate(l))}),GC(1,"Duplicate"),pl(),Jw(2,Q,2,0,"button",13),Jw(3,W,2,0,"button",17),Jw(4,X,2,0,"button",18);}if(n&2){let t=gC().$implicit;XE(2),eC(t.canEdit?2:-1),XE(),eC(t.canDelete?3:-1),XE(),eC(!t.canEdit&&!t.canDelete?4:-1);}}function ee(n,e){if(n&1&&(ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td")(6,"div",10)(7,"ds-tag",11),GC(8),pl(),Jw(9,U,4,0),pl()(),ws(10,"td",12),Jw(11,K,2,0,"button",13)(12,Z,5,3),pl()()),n&2){let t=e.$implicit;XE(2),Yg(t.config.name),XE(2),Yg(t.config.integrationType),XE(3),bg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),XE(),vl(" ",t.scopeLabel," "),XE(),eC(t.source==="FILESYSTEM"?9:-1),XE(2),eC(t.source==="FILESYSTEM"?11:12);}}function te(n,e){if(n&1){let t=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(l){If(t);let s=gC();return wf(s.rowFilter.query.set(l))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"Type"),pl(),ws(9,"th"),GC(10,"Scope"),pl(),ws(11,"th")(12,"span",7),GC(13,"Actions"),pl()()()(),ws(14,"tbody"),rC(15,ee,13,6,"tr",null,G),pl()()();}if(n&2){let t=gC();bg("query",t.rowFilter.query()),XE(15),oC(t.rowFilter.filteredRows());}}var z=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ce);state=g(N);namespaceRole=g(v);namespaceApi=g(G$1);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=Gi("this namespace");isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),Ea(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let r=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:r,template:e.config.id,templateScope:e.scope}});}delete(e){!e.canDelete||!e.config.id||!confirm(`Delete integration \u201C${e.config.name}\u201D?`)||this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)).subscribe();}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e,t,r,l){return e.map((s,J)=>{let h=this.sourceOf(s),S=h==="NEO4J"&&!l;return {key:`${t}:${s.id??J}`,config:s,scope:t,scopeLabel:r,source:h,canEdit:S,canDelete:S}})}sourceOf(e){return e.source??"NEO4J"}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=xw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:6,vars:2,consts:[["title","Integrations",3,"description"],["type","button",1,"integrations__new",3,"click"],["role","status",1,"integrations__status"],[1,"integrations__status"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],[1,"integrations__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"integrations__name"],[1,"integrations__type"],[1,"integrations__tags"],[3,"variant"],[1,"integrations__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["type","button",1,"integrations__delete"],["type","button","disabled",""],["type","button",1,"integrations__delete",3,"click"]],template:function(t,r){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return r.openCreateForm()}),GC(2,"New integration"),pl()(),Jw(3,B,2,0,"p",2)(4,H,2,0,"p",3)(5,te,17,1)),t&2&&(bg("description","Integrations for "+r.namespaceName()+", including entries inherited from the platform."),XE(3),eC(r.isLoading()?3:r.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".integrations__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.integrations__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.integrations__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.integrations__name[_ngcontent-%COMP%]{font-weight:500}.integrations__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integrations__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.integrations__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.integrations__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.integrations__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.integrations__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.integrations__actions[_ngcontent-%COMP%] .integrations__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{z as IntegrationsAllScopesComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-BuSX6FVc.js';import {g,ao as W,F,C as Ce$1,da as $,db as Ie$1,dc as Re$1,G as Gi,dd as Oe$1,a as F$1,bR as wd,m as mT,M as By,b as U,a7 as ya,Q as br,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a5 as vl,v as eC,a9 as lC,S as Sg,a3 as VI,s as rC,ac as gC,u as bg,z as Ug,a6 as UI,y as oC,a8 as Yg,aa as If,ab as wf,bk as yh}from'./main-EVOOW2CG.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-FV8LaU7e.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ue(n,t){n&1&&(ws(0,"span",12),GC(1," Name is required. "),pl());}function fe(n,t){if(n&1&&(ws(0,"p",42),GC(1),pl(),ws(2,"span",13),GC(3,"Agent Config cannot be changed after creation."),pl()),n&2){let e=gC(2);XE(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(ws(0,"a",43),GC(1,"Add an agent config"),pl(),GC(2," first. ")),n&2){let e=gC(3);bg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(ws(0,"p",13),GC(1," No agent configs available in this scope yet. "),Jw(2,_e,3,1),pl()),n&2){let e=gC(2);XE(2),eC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.id),XE(),Yg(e.name);}}function Ce(n,t){n&1&&(ws(0,"span",12),GC(1,"Agent Config is required."),pl());}function ve(n,t){if(n&1&&(ws(0,"select",44)(1,"option",45),GC(2,"Select an agent config\u2026"),pl(),rC(3,ge,2,2,"option",23,me),pl(),VI(),Jw(5,Ce,2,0,"span",12),ws(6,"span",13),GC(7,"Immutable after creation."),pl()),n&2){let e=gC(2);bg("formControl",e.agentConfigIdControl),UI(),XE(3),oC(e.availableAgentConfigs()),XE(2),eC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(ws(0,"span",12),GC(1,"Opening message is required."),pl());}function ye(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function be(n,t){if(n&1){let e=lC();ws(0,"label",48)(1,"input",49),Rg("change",function(){let g=If(e).$implicit,v=gC(3);return wf(v.toggleDay(g.value))}),pl(),ws(2,"span",50),GC(3),pl()();}if(n&2){let e=t.$implicit,d=gC(3);XE(),bg("checked",d.isDaySelected(e.value)),XE(2),Yg(e.label);}}function Se(n,t){if(n&1&&(ws(0,"div",8)(1,"span",46),GC(2,"Days of week"),pl(),ws(3,"div",47),rC(4,be,4,2,"label",48,A),pl(),ws(6,"span",13),GC(7,"Leave empty to run every day of the week."),pl()()),n&2){let e=gC(2);XE(4),oC(e.dayOptions);}}function Ee(n,t){n&1&&(ws(0,"span",12),GC(1,"Valid time is required (HH:mm)."),pl());}function Pe(n,t){n&1&&(ws(0,"span",12),GC(1,"Start date is required."),pl());}function Me(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function Oe(n,t){n&1&&(ws(0,"span",12),GC(1,"End date is required."),pl());}function De(n,t){if(n&1&&(ws(0,"div",8)(1,"label",51),GC(2," End date "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",52),VI(),Jw(6,Oe,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),bg("formControl",e.endDateControl),UI(),XE(),eC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(ws(0,"span",12),GC(1,"Must be at least 1."),pl());}function we(n,t){if(n&1&&(ws(0,"div",8)(1,"label",53),GC(2," Number of occurrences "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",54),VI(),Jw(6,Te,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),bg("formControl",e.occurrenceCountControl),UI(),XE(),eC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(ws(0,"span",12),GC(1,"Invalid JSON."),pl());}function Ne(n,t){if(n&1&&(ws(0,"p",38),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let g=gC();return wf(g.submit())}),ws(1,"div",8)(2,"label",9),GC(3," Name "),ws(4,"span",10),GC(5,"*"),pl()(),Sg(6,"input",11),VI(),Jw(7,ue,2,0,"span",12),ws(8,"span",13),GC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),pl()(),ws(10,"div",8)(11,"label",14),GC(12,"Description"),pl(),Sg(13,"input",15),VI(),pl(),ws(14,"div",8)(15,"label",16),GC(16," Agent Config "),ws(17,"span",10),GC(18,"*"),pl()(),Jw(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),pl(),ws(22,"div",8)(23,"label",17),GC(24," Opening message "),ws(25,"span",10),GC(26,"*"),pl()(),Sg(27,"textarea",18),VI(),Jw(28,xe,2,0,"span",12),ws(29,"span",13),GC(30," The message sent to the agent when the scheduled prompt fires. "),pl()(),ws(31,"fieldset",19)(32,"legend",20),GC(33,"Recurrence"),pl(),ws(34,"div",8)(35,"label",21),GC(36," Unit "),ws(37,"span",10),GC(38,"*"),pl()(),ws(39,"select",22),rC(40,ye,2,2,"option",23,A),pl(),VI(),pl(),Jw(42,Se,8,0,"div",8),ws(43,"div",8)(44,"label",24),GC(45," Time (UTC) "),ws(46,"span",10),GC(47,"*"),pl()(),ws(48,"div",25),Sg(49,"input",26),VI(),ws(50,"span",27),GC(51,"UTC"),pl()(),Jw(52,Ee,2,0,"span",12),pl()(),ws(53,"fieldset",19)(54,"legend",20),GC(55,"Planning"),pl(),ws(56,"div",8)(57,"label",28),GC(58," Start date "),ws(59,"span",10),GC(60,"*"),pl()(),Sg(61,"input",29),VI(),Jw(62,Pe,2,0,"span",12),pl(),ws(63,"div",8)(64,"label",30),GC(65," Ends "),ws(66,"span",10),GC(67,"*"),pl()(),ws(68,"select",31),rC(69,Me,2,2,"option",23,A),pl(),VI(),pl(),Jw(71,De,7,4,"div",8),Jw(72,we,7,4,"div",8),pl(),ws(73,"div",8)(74,"label",32),Sg(75,"input",33),VI(),ws(76,"span",34),GC(77,"Enabled"),pl()(),ws(78,"p",35),GC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),pl()(),ws(80,"div",8)(81,"label",36),GC(82,"External Metadata"),pl(),Sg(83,"textarea",37),VI(),Jw(84,ke,2,0,"span",12),ws(85,"span",13),GC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),Jw(87,Ne,2,1,"p",38),ws(88,"div",39)(89,"button",40),GC(90),pl(),ws(91,"button",41),Rg("click",function(){If(e);let g=gC();return wf(g.cancel())}),GC(92,"Cancel"),pl()()();}if(n&2){let e=gC();bg("formGroup",e.form),XE(6),Ug("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),UI(),XE(),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),bg("formControl",e.descriptionControl),UI(),XE(6),eC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Ug("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),bg("formControl",e.promptContentControl),UI(),XE(),eC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),bg("formControl",e.unitControl),UI(),XE(),oC(e.schedulerUnits),XE(2),eC(e.showDayFilter()?42:-1),XE(7),bg("formControl",e.timeUtcControl),UI(),XE(3),eC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Ug("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),bg("formControl",e.startDateControl),UI(),XE(),eC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),bg("formControl",e.endTypeControl),UI(),XE(),oC(e.endTypes),XE(2),eC(e.showEndDate()?71:-1),XE(),eC(e.showOccurrenceCount()?72:-1),XE(3),bg("formControl",e.enabledControl),UI(),XE(8),bg("formControl",e.externalMetadataJsonControl),UI(),XE(),eC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),XE(3),eC(e.errorMessage()?87:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(W);router=g(F);destroyRef=g(Ce$1);state=g(c);agentConfigController=g($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(Re$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(Ie$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);errorMessage=Gi(null);SchedulerUnit=Re$1;SchedulerEndType=Ie$1;schedulerUnits=[{value:Re$1.WEEK,label:"Week(s)"},{value:Re$1.MONTH,label:"Month(s)"}];endTypes=[{value:Ie$1.NEVER,label:"Never"},{value:Ie$1.ON_DATE,label:"On date"},{value:Ie$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Oe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(wd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(wd(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===Re$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===Ie$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===Ie$1.OCCURRENCES);agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ya(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Ie$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Ie$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return d.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),pl()),e&2&&(XE(5),vl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),vl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),eC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Ie$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Ie$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
1
+ import {c}from'./chunk-DvQwbSrE.js';import {g,ao as W,F,C as Ce$1,da as $,db as Oe$1,dc as Ie$1,G as Gi,dd as Ve$1,a as F$1,bR as wd,m as mT,M as By,b as U,a7 as ya,Q as br,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a5 as vl,v as eC,a9 as lC,S as Sg,a3 as VI,s as rC,ac as gC,u as bg,z as Ug,a6 as UI,y as oC,a8 as Yg,aa as If,ab as wf,bk as yh}from'./main-ZIS64A7B.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-CWmsDCbt.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ue(n,t){n&1&&(ws(0,"span",12),GC(1," Name is required. "),pl());}function fe(n,t){if(n&1&&(ws(0,"p",42),GC(1),pl(),ws(2,"span",13),GC(3,"Agent Config cannot be changed after creation."),pl()),n&2){let e=gC(2);XE(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(ws(0,"a",43),GC(1,"Add an agent config"),pl(),GC(2," first. ")),n&2){let e=gC(3);bg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(ws(0,"p",13),GC(1," No agent configs available in this scope yet. "),Jw(2,_e,3,1),pl()),n&2){let e=gC(2);XE(2),eC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.id),XE(),Yg(e.name);}}function Ce(n,t){n&1&&(ws(0,"span",12),GC(1,"Agent Config is required."),pl());}function ve(n,t){if(n&1&&(ws(0,"select",44)(1,"option",45),GC(2,"Select an agent config\u2026"),pl(),rC(3,ge,2,2,"option",23,me),pl(),VI(),Jw(5,Ce,2,0,"span",12),ws(6,"span",13),GC(7,"Immutable after creation."),pl()),n&2){let e=gC(2);bg("formControl",e.agentConfigIdControl),UI(),XE(3),oC(e.availableAgentConfigs()),XE(2),eC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(ws(0,"span",12),GC(1,"Opening message is required."),pl());}function ye(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function be(n,t){if(n&1){let e=lC();ws(0,"label",48)(1,"input",49),Rg("change",function(){let g=If(e).$implicit,v=gC(3);return wf(v.toggleDay(g.value))}),pl(),ws(2,"span",50),GC(3),pl()();}if(n&2){let e=t.$implicit,d=gC(3);XE(),bg("checked",d.isDaySelected(e.value)),XE(2),Yg(e.label);}}function Se(n,t){if(n&1&&(ws(0,"div",8)(1,"span",46),GC(2,"Days of week"),pl(),ws(3,"div",47),rC(4,be,4,2,"label",48,A),pl(),ws(6,"span",13),GC(7,"Leave empty to run every day of the week."),pl()()),n&2){let e=gC(2);XE(4),oC(e.dayOptions);}}function Ee(n,t){n&1&&(ws(0,"span",12),GC(1,"Valid time is required (HH:mm)."),pl());}function Pe(n,t){n&1&&(ws(0,"span",12),GC(1,"Start date is required."),pl());}function Me(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function Oe(n,t){n&1&&(ws(0,"span",12),GC(1,"End date is required."),pl());}function De(n,t){if(n&1&&(ws(0,"div",8)(1,"label",51),GC(2," End date "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",52),VI(),Jw(6,Oe,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),bg("formControl",e.endDateControl),UI(),XE(),eC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(ws(0,"span",12),GC(1,"Must be at least 1."),pl());}function we(n,t){if(n&1&&(ws(0,"div",8)(1,"label",53),GC(2," Number of occurrences "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",54),VI(),Jw(6,Te,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),bg("formControl",e.occurrenceCountControl),UI(),XE(),eC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(ws(0,"span",12),GC(1,"Invalid JSON."),pl());}function Ne(n,t){if(n&1&&(ws(0,"p",38),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let g=gC();return wf(g.submit())}),ws(1,"div",8)(2,"label",9),GC(3," Name "),ws(4,"span",10),GC(5,"*"),pl()(),Sg(6,"input",11),VI(),Jw(7,ue,2,0,"span",12),ws(8,"span",13),GC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),pl()(),ws(10,"div",8)(11,"label",14),GC(12,"Description"),pl(),Sg(13,"input",15),VI(),pl(),ws(14,"div",8)(15,"label",16),GC(16," Agent Config "),ws(17,"span",10),GC(18,"*"),pl()(),Jw(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),pl(),ws(22,"div",8)(23,"label",17),GC(24," Opening message "),ws(25,"span",10),GC(26,"*"),pl()(),Sg(27,"textarea",18),VI(),Jw(28,xe,2,0,"span",12),ws(29,"span",13),GC(30," The message sent to the agent when the scheduled prompt fires. "),pl()(),ws(31,"fieldset",19)(32,"legend",20),GC(33,"Recurrence"),pl(),ws(34,"div",8)(35,"label",21),GC(36," Unit "),ws(37,"span",10),GC(38,"*"),pl()(),ws(39,"select",22),rC(40,ye,2,2,"option",23,A),pl(),VI(),pl(),Jw(42,Se,8,0,"div",8),ws(43,"div",8)(44,"label",24),GC(45," Time (UTC) "),ws(46,"span",10),GC(47,"*"),pl()(),ws(48,"div",25),Sg(49,"input",26),VI(),ws(50,"span",27),GC(51,"UTC"),pl()(),Jw(52,Ee,2,0,"span",12),pl()(),ws(53,"fieldset",19)(54,"legend",20),GC(55,"Planning"),pl(),ws(56,"div",8)(57,"label",28),GC(58," Start date "),ws(59,"span",10),GC(60,"*"),pl()(),Sg(61,"input",29),VI(),Jw(62,Pe,2,0,"span",12),pl(),ws(63,"div",8)(64,"label",30),GC(65," Ends "),ws(66,"span",10),GC(67,"*"),pl()(),ws(68,"select",31),rC(69,Me,2,2,"option",23,A),pl(),VI(),pl(),Jw(71,De,7,4,"div",8),Jw(72,we,7,4,"div",8),pl(),ws(73,"div",8)(74,"label",32),Sg(75,"input",33),VI(),ws(76,"span",34),GC(77,"Enabled"),pl()(),ws(78,"p",35),GC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),pl()(),ws(80,"div",8)(81,"label",36),GC(82,"External Metadata"),pl(),Sg(83,"textarea",37),VI(),Jw(84,ke,2,0,"span",12),ws(85,"span",13),GC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),Jw(87,Ne,2,1,"p",38),ws(88,"div",39)(89,"button",40),GC(90),pl(),ws(91,"button",41),Rg("click",function(){If(e);let g=gC();return wf(g.cancel())}),GC(92,"Cancel"),pl()()();}if(n&2){let e=gC();bg("formGroup",e.form),XE(6),Ug("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),UI(),XE(),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),bg("formControl",e.descriptionControl),UI(),XE(6),eC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Ug("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),bg("formControl",e.promptContentControl),UI(),XE(),eC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),bg("formControl",e.unitControl),UI(),XE(),oC(e.schedulerUnits),XE(2),eC(e.showDayFilter()?42:-1),XE(7),bg("formControl",e.timeUtcControl),UI(),XE(3),eC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Ug("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),bg("formControl",e.startDateControl),UI(),XE(),eC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),bg("formControl",e.endTypeControl),UI(),XE(),oC(e.endTypes),XE(2),eC(e.showEndDate()?71:-1),XE(),eC(e.showOccurrenceCount()?72:-1),XE(3),bg("formControl",e.enabledControl),UI(),XE(8),bg("formControl",e.externalMetadataJsonControl),UI(),XE(),eC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),XE(3),eC(e.errorMessage()?87:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(W);router=g(F);destroyRef=g(Ce$1);state=g(c);agentConfigController=g($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(Ie$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(Oe$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);errorMessage=Gi(null);SchedulerUnit=Ie$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ie$1.WEEK,label:"Week(s)"},{value:Ie$1.MONTH,label:"Month(s)"}];endTypes=[{value:Oe$1.NEVER,label:"Never"},{value:Oe$1.ON_DATE,label:"On date"},{value:Oe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(wd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(wd(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===Ie$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ya(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Oe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Oe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return d.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),pl()),e&2&&(XE(5),vl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),vl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),eC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Oe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Oe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
@@ -1 +1 @@
1
- import {D}from'./chunk-CmObLvei.js';import {o}from'./chunk-BSRWEUf3.js';import {g,F,C as Ce,aJ as Tr,G as Gi,bS as Ea,cE as Dd,r as re,b as U$1,e as xw,aK as xb,J as Jw,k as ws,bf as aT,q as Rg,o as pl,af as Eg,t as CC,v as eC,X as XE,u as bg,bg as uT,ah as rT,n as GC,ac as gC,a8 as Yg,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-EVOOW2CG.js';import {$ as $n,S as Se}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';var z=()=>[];function A(i,t){if(i&1&&(ws(0,"p",1),GC(1),pl()),i&2){let e=gC();XE(),Yg(e.errorMessage());}}function O(i,t){if(i&1){let e=lC();ws(0,"agentos-skill-item",5),Rg("deleteRequested",function(o){If(e);let j=gC(2);return wf(j.deleteSkill(o))}),pl();}i&2&&bg("skill",t)("platformMode",true);}function U(i,t){if(i&1&&Jw(0,O,1,2,"agentos-skill-item",4),i&2){let e,n=t.$implicit,o=gC();eC((e=o.resolveSkill(n.id))?0:-1,e);}}var V=class i{router=g(F);destroyRef=g(Ce);skillState=g(o);refresh$=new Tr(void 0);isLoading=Gi(true);errorMessage=Gi(null);skills$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),this.skillState.listPlatform())),Dd({bufferSize:1,refCount:true}));skillItems$=this.skills$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));skillsById=new Map;constructor(){this.skills$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.skillsById=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","skills","new"]);}deleteSkill(t){this.errorMessage.set(null),this.skillState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe({next:()=>this.refresh$.next(),error:e=>this.errorMessage.set(e.status===403?`Deleting "${t.name}" requires platform administrator rights.`:`Deleting "${t.name}" failed.`)});}resolveSkill(t){return this.skillsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-skills"]],decls:6,vars:8,consts:[["skillItemTpl",""],["role","alert",1,"platform-skills__error"],["title","Platform Skills","emptyMessage","No platform skills defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"skill","platformMode"],[3,"deleteRequested","skill","platformMode"]],template:function(e,n){if(e&1&&(Jw(0,A,2,1,"p",1),ws(1,"ds-entity-list",2),aT(2,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(3,"ds-icon-button",3),Rg("action",function(){return n.goBack()}),pl()(),Eg(4,U,1,1,"ng-template",null,0,fT)),e&2){let o=CC(5);eC(n.errorMessage()?0:-1),XE(),bg("items",uT(2,5,n.skillItems$)??rT(7,z))("loading",n.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[$n,D,Se,xb],styles:[".platform-skills[_ngcontent-%COMP%]{display:block}.platform-skills__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error, var(--red, #dc2626))}"]})};export{V as PlatformSkillsComponent};
1
+ import {D}from'./chunk-DzdoNEBA.js';import {o}from'./chunk-CcdN6Tiq.js';import {g,F,C as Ce,aJ as Tr,G as Gi,bS as Ea,cE as Dd,r as re,b as U$1,e as xw,aK as xb,J as Jw,k as ws,bf as aT,q as Rg,o as pl,af as Eg,t as CC,v as eC,X as XE,u as bg,bg as uT,ah as rT,n as GC,ac as gC,a8 as Yg,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-ZIS64A7B.js';import {$ as $n,S as Se}from'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';import'./chunk-CWmsDCbt.js';var z=()=>[];function A(i,t){if(i&1&&(ws(0,"p",1),GC(1),pl()),i&2){let e=gC();XE(),Yg(e.errorMessage());}}function O(i,t){if(i&1){let e=lC();ws(0,"agentos-skill-item",5),Rg("deleteRequested",function(o){If(e);let j=gC(2);return wf(j.deleteSkill(o))}),pl();}i&2&&bg("skill",t)("platformMode",true);}function U(i,t){if(i&1&&Jw(0,O,1,2,"agentos-skill-item",4),i&2){let e,n=t.$implicit,o=gC();eC((e=o.resolveSkill(n.id))?0:-1,e);}}var V=class i{router=g(F);destroyRef=g(Ce);skillState=g(o);refresh$=new Tr(void 0);isLoading=Gi(true);errorMessage=Gi(null);skills$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),this.skillState.listPlatform())),Dd({bufferSize:1,refCount:true}));skillItems$=this.skills$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));skillsById=new Map;constructor(){this.skills$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.skillsById=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","skills","new"]);}deleteSkill(t){this.errorMessage.set(null),this.skillState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe({next:()=>this.refresh$.next(),error:e=>this.errorMessage.set(e.status===403?`Deleting "${t.name}" requires platform administrator rights.`:`Deleting "${t.name}" failed.`)});}resolveSkill(t){return this.skillsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-skills"]],decls:6,vars:8,consts:[["skillItemTpl",""],["role","alert",1,"platform-skills__error"],["title","Platform Skills","emptyMessage","No platform skills defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"skill","platformMode"],[3,"deleteRequested","skill","platformMode"]],template:function(e,n){if(e&1&&(Jw(0,A,2,1,"p",1),ws(1,"ds-entity-list",2),aT(2,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(3,"ds-icon-button",3),Rg("action",function(){return n.goBack()}),pl()(),Eg(4,U,1,1,"ng-template",null,0,fT)),e&2){let o=CC(5);eC(n.errorMessage()?0:-1),XE(),bg("items",uT(2,5,n.skillItems$)??rT(7,z))("loading",n.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[$n,D,Se,xb],styles:[".platform-skills[_ngcontent-%COMP%]{display:block}.platform-skills__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error, var(--red, #dc2626))}"]})};export{V as PlatformSkillsComponent};
@@ -1 +1 @@
1
- import {d}from'./chunk-pkNoeD9f.js';import {g,ao as W$1,F,C as Ce,da as $$1,G as Gi,m as mT,b as U$1,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,u as bg,v as eC,ac as gC,a8 as Yg,z as Ug,a5 as vl,a9 as lC,T as Tg,s as rC,y as oC,S as Sg,bf as aT,bg as uT,aa as If,ab as wf,bj as aE}from'./main-EVOOW2CG.js';import'./chunk-DAtwHi5G.js';import'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';var $=(n,o)=>o.id,B=(n,o)=>o.name;function j(n,o){n&1&&(ws(0,"p",6),GC(1,"Loading\u2026"),pl());}function H(n,o){n&1&&(ws(0,"p",7),GC(1,"Failed to load agent definition."),pl());}function J(n,o){if(n&1&&(ws(0,"dt",12),GC(1,"User context"),pl(),ws(2,"dd",14),GC(3),pl()),n&2){let e=gC();XE(3),Yg(e.userId);}}function U(n,o){if(n&1&&(ws(0,"pre",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.systemPrompt);}}function G(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",20),Rg("click",function(){If(e);let p=gC(2);return wf(p.toggleSystemPrompt())}),ws(2,"h2",10),GC(3,"System Prompt"),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,U,2,1,"pre",22),pl();}if(n&2){let e=gC(2);XE(),Tg("aria-expanded",!e.systemPromptCollapsed()),XE(3),Ug("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),XE(2),eC(e.systemPromptCollapsed()?-1:6);}}function K(n,o){if(n&1&&(ws(0,"pre",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.instructions);}}function q(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",20),Rg("click",function(){If(e);let p=gC(2);return wf(p.toggleInstructions())}),ws(2,"h2",10),GC(3,"Instructions"),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,K,2,1,"pre",22),pl();}if(n&2){let e=gC(2);XE(),Tg("aria-expanded",!e.instructionsCollapsed()),XE(3),Ug("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),XE(2),eC(e.instructionsCollapsed()?-1:6);}}function Q(n,o){n&1&&(ws(0,"p",17),GC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function W(n,o){n&1&&(ws(0,"span",25),GC(1,"platform"),pl());}function X(n,o){n&1&&(ws(0,"span",25),GC(1,"SKILL.md"),pl());}function Y(n,o){if(n&1&&(ws(0,"li",23)(1,"span",24),GC(2),pl(),Jw(3,W,2,0,"span",25),Jw(4,X,2,0,"span",25),ws(5,"p",26),GC(6),pl()()),n&2){let e=o.$implicit;XE(2),Yg(e.name),XE(),eC(e.namespaceId?-1:3),XE(),eC(e.readOnly?4:-1),XE(2),Yg(e.description);}}function Z(n,o){if(n&1&&(ws(0,"ul",18),rC(1,Y,7,4,"li",23,$),pl()),n&2){let e=gC(2);XE(),oC(e.resolvedSkills());}}function ee(n,o){n&1&&(ws(0,"p",17),GC(1,"No tools available for this agent."),pl());}function ne(n,o){if(n&1&&(Sg(0,"div",31),aT(1,"agentosMarkdown")),n&2){let e=gC(2).$implicit;bg("innerHTML",uT(1,1,e.description),aE);}}function te(n,o){if(n&1&&(ws(0,"div",30),Jw(1,ne,2,3,"div",31),ws(2,"pre",32),GC(3),pl()()),n&2){let e=gC().$implicit,c=gC(3);XE(),eC(e.description?1:-1),XE(2),Yg(c.formatSchema(e.inputSchema));}}function ie(n,o){if(n&1){let e=lC();ws(0,"li",27)(1,"button",28),Rg("click",function(){let p=If(e).$implicit,V=gC(3);return wf(V.toggleTool(p))}),ws(2,"span",29),GC(3),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,te,4,2,"div",30),pl();}if(n&2){let e=o.$implicit,c=gC(3);XE(),Tg("aria-expanded",c.isToolExpanded(e)),XE(2),Yg(e.name),XE(),Ug("agent-config-inspect__chevron--open",c.isToolExpanded(e)),XE(2),eC(c.isToolExpanded(e)?6:-1);}}function oe(n,o){if(n&1&&(ws(0,"ul",19),rC(1,ie,7,5,"li",27,B),pl()),n&2){let e=gC();XE(),oC(e.tools);}}function ae(n,o){if(n&1&&(ws(0,"div",8)(1,"section",9)(2,"h2",10),GC(3,"General"),pl(),ws(4,"dl",11)(5,"dt",12),GC(6,"Name"),pl(),ws(7,"dd",13),GC(8),pl(),ws(9,"dt",12),GC(10,"Resolved model"),pl(),ws(11,"dd",14),GC(12),pl(),ws(13,"dt",12),GC(14,"Provider"),pl(),ws(15,"dd",13),GC(16),pl(),ws(17,"dt",12),GC(18,"Advanced execution"),pl(),ws(19,"dd",13)(20,"span",15),GC(21),pl()(),Jw(22,J,4,1),pl()(),Jw(23,G,7,4,"section",9),Jw(24,q,7,4,"section",9),ws(25,"section",9)(26,"h2",10),GC(27," Skills "),ws(28,"span",16),GC(29),pl()(),Jw(30,Q,2,0,"p",17)(31,Z,3,0,"ul",18),pl(),ws(32,"section",9)(33,"h2",10),GC(34," Tools "),ws(35,"span",16),GC(36),pl()(),Jw(37,ee,2,0,"p",17)(38,oe,3,0,"ul",19),pl()()),n&2){let e=o,c=gC();XE(8),Yg(e.name),XE(4),Yg(e.resolvedModelApiName),XE(4),Yg(e.resolvedProviderName),XE(4),Ug("agent-config-inspect__badge--active",e.advancedExecution),XE(),vl(" ",e.advancedExecution?"Enabled":"Disabled"," "),XE(),eC(e.userId?22:-1),XE(),eC(e.systemPrompt?23:-1),XE(),eC(e.instructions?24:-1),XE(5),vl("(",c.resolvedSkills().length,")"),XE(),eC(c.resolvedSkills().length===0?30:31),XE(6),vl("(",e.tools.length,")"),XE(),eC(e.tools.length===0?37:38);}}var R=class n{route=g(W$1);router=g(F);destroyRef=g(Ce);agentConfigController=g($$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);resolvedSkills=mT(()=>this.definition()?.skills??[]);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__skills"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__skill"],[1,"agent-config-inspect__skill-name"],[1,"agent-config-inspect__skill-badge"],[1,"agent-config-inspect__skill-desc"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Agent Configs "),pl(),ws(6,"h1",4),GC(7,"Agent definition"),pl(),ws(8,"a",5),GC(9,"Edit config \u2192"),pl()(),Jw(10,j,2,0,"p",6)(11,H,2,0,"p",7)(12,ae,39,13,"div",8),pl()),e&2){let p;XE(8),bg("routerLink",c.editRoute()),XE(2),eC(c.isLoading()?10:c.hasError()?11:(p=c.definition())?12:-1,p);}},dependencies:[$t,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%], .agent-config-inspect__skills[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__skill[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem}.agent-config-inspect__skill-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.agent-config-inspect__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__skill-desc[_ngcontent-%COMP%]{flex:1 1 100%;margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
1
+ import {d}from'./chunk-BmMgSm-g.js';import {g,ao as W$1,F,C as Ce,da as $$1,G as Gi,m as mT,b as U$1,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,u as bg,v as eC,ac as gC,a8 as Yg,z as Ug,a5 as vl,a9 as lC,T as Tg,s as rC,y as oC,S as Sg,bf as aT,bg as uT,aa as If,ab as wf,bj as aE}from'./main-ZIS64A7B.js';import'./chunk-DeRTJ-9X.js';import'./chunk-CwWxGIXx.js';import'./chunk-B0ReGfih.js';import'./chunk-CWmsDCbt.js';var $=(n,o)=>o.id,B=(n,o)=>o.name;function j(n,o){n&1&&(ws(0,"p",6),GC(1,"Loading\u2026"),pl());}function H(n,o){n&1&&(ws(0,"p",7),GC(1,"Failed to load agent definition."),pl());}function J(n,o){if(n&1&&(ws(0,"dt",12),GC(1,"User context"),pl(),ws(2,"dd",14),GC(3),pl()),n&2){let e=gC();XE(3),Yg(e.userId);}}function U(n,o){if(n&1&&(ws(0,"pre",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.systemPrompt);}}function G(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",20),Rg("click",function(){If(e);let p=gC(2);return wf(p.toggleSystemPrompt())}),ws(2,"h2",10),GC(3,"System Prompt"),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,U,2,1,"pre",22),pl();}if(n&2){let e=gC(2);XE(),Tg("aria-expanded",!e.systemPromptCollapsed()),XE(3),Ug("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),XE(2),eC(e.systemPromptCollapsed()?-1:6);}}function K(n,o){if(n&1&&(ws(0,"pre",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.instructions);}}function q(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",20),Rg("click",function(){If(e);let p=gC(2);return wf(p.toggleInstructions())}),ws(2,"h2",10),GC(3,"Instructions"),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,K,2,1,"pre",22),pl();}if(n&2){let e=gC(2);XE(),Tg("aria-expanded",!e.instructionsCollapsed()),XE(3),Ug("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),XE(2),eC(e.instructionsCollapsed()?-1:6);}}function Q(n,o){n&1&&(ws(0,"p",17),GC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function W(n,o){n&1&&(ws(0,"span",25),GC(1,"platform"),pl());}function X(n,o){n&1&&(ws(0,"span",25),GC(1,"SKILL.md"),pl());}function Y(n,o){if(n&1&&(ws(0,"li",23)(1,"span",24),GC(2),pl(),Jw(3,W,2,0,"span",25),Jw(4,X,2,0,"span",25),ws(5,"p",26),GC(6),pl()()),n&2){let e=o.$implicit;XE(2),Yg(e.name),XE(),eC(e.namespaceId?-1:3),XE(),eC(e.readOnly?4:-1),XE(2),Yg(e.description);}}function Z(n,o){if(n&1&&(ws(0,"ul",18),rC(1,Y,7,4,"li",23,$),pl()),n&2){let e=gC(2);XE(),oC(e.resolvedSkills());}}function ee(n,o){n&1&&(ws(0,"p",17),GC(1,"No tools available for this agent."),pl());}function ne(n,o){if(n&1&&(Sg(0,"div",31),aT(1,"agentosMarkdown")),n&2){let e=gC(2).$implicit;bg("innerHTML",uT(1,1,e.description),aE);}}function te(n,o){if(n&1&&(ws(0,"div",30),Jw(1,ne,2,3,"div",31),ws(2,"pre",32),GC(3),pl()()),n&2){let e=gC().$implicit,c=gC(3);XE(),eC(e.description?1:-1),XE(2),Yg(c.formatSchema(e.inputSchema));}}function ie(n,o){if(n&1){let e=lC();ws(0,"li",27)(1,"button",28),Rg("click",function(){let p=If(e).$implicit,V=gC(3);return wf(V.toggleTool(p))}),ws(2,"span",29),GC(3),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,te,4,2,"div",30),pl();}if(n&2){let e=o.$implicit,c=gC(3);XE(),Tg("aria-expanded",c.isToolExpanded(e)),XE(2),Yg(e.name),XE(),Ug("agent-config-inspect__chevron--open",c.isToolExpanded(e)),XE(2),eC(c.isToolExpanded(e)?6:-1);}}function oe(n,o){if(n&1&&(ws(0,"ul",19),rC(1,ie,7,5,"li",27,B),pl()),n&2){let e=gC();XE(),oC(e.tools);}}function ae(n,o){if(n&1&&(ws(0,"div",8)(1,"section",9)(2,"h2",10),GC(3,"General"),pl(),ws(4,"dl",11)(5,"dt",12),GC(6,"Name"),pl(),ws(7,"dd",13),GC(8),pl(),ws(9,"dt",12),GC(10,"Resolved model"),pl(),ws(11,"dd",14),GC(12),pl(),ws(13,"dt",12),GC(14,"Provider"),pl(),ws(15,"dd",13),GC(16),pl(),ws(17,"dt",12),GC(18,"Advanced execution"),pl(),ws(19,"dd",13)(20,"span",15),GC(21),pl()(),Jw(22,J,4,1),pl()(),Jw(23,G,7,4,"section",9),Jw(24,q,7,4,"section",9),ws(25,"section",9)(26,"h2",10),GC(27," Skills "),ws(28,"span",16),GC(29),pl()(),Jw(30,Q,2,0,"p",17)(31,Z,3,0,"ul",18),pl(),ws(32,"section",9)(33,"h2",10),GC(34," Tools "),ws(35,"span",16),GC(36),pl()(),Jw(37,ee,2,0,"p",17)(38,oe,3,0,"ul",19),pl()()),n&2){let e=o,c=gC();XE(8),Yg(e.name),XE(4),Yg(e.resolvedModelApiName),XE(4),Yg(e.resolvedProviderName),XE(4),Ug("agent-config-inspect__badge--active",e.advancedExecution),XE(),vl(" ",e.advancedExecution?"Enabled":"Disabled"," "),XE(),eC(e.userId?22:-1),XE(),eC(e.systemPrompt?23:-1),XE(),eC(e.instructions?24:-1),XE(5),vl("(",c.resolvedSkills().length,")"),XE(),eC(c.resolvedSkills().length===0?30:31),XE(6),vl("(",e.tools.length,")"),XE(),eC(e.tools.length===0?37:38);}}var R=class n{route=g(W$1);router=g(F);destroyRef=g(Ce);agentConfigController=g($$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);resolvedSkills=mT(()=>this.definition()?.skills??[]);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__skills"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__skill"],[1,"agent-config-inspect__skill-name"],[1,"agent-config-inspect__skill-badge"],[1,"agent-config-inspect__skill-desc"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Agent Configs "),pl(),ws(6,"h1",4),GC(7,"Agent definition"),pl(),ws(8,"a",5),GC(9,"Edit config \u2192"),pl()(),Jw(10,j,2,0,"p",6)(11,H,2,0,"p",7)(12,ae,39,13,"div",8),pl()),e&2){let p;XE(8),bg("routerLink",c.editRoute()),XE(2),eC(c.isLoading()?10:c.hasError()?11:(p=c.definition())?12:-1,p);}},dependencies:[$t,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%], .agent-config-inspect__skills[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__skill[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem}.agent-config-inspect__skill-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.agent-config-inspect__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__skill-desc[_ngcontent-%COMP%]{flex:1 1 100%;margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};