@whoz-oss/coday-client 0.0.0-workstream-forge.159 → 0.0.0-workstream-forge.161

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 (62) hide show
  1. package/browser/{chunk-CcHF3ZPx.js → chunk-3WTfpQBB.js} +1 -1
  2. package/browser/chunk-6I6iGMI5.js +1 -0
  3. package/browser/{chunk-Cc_OXK2g.js → chunk-B-2JHDoj.js} +1 -1
  4. package/browser/chunk-BRsEbvq8.js +1 -0
  5. package/browser/{chunk-DHgv1cy0.js → chunk-BU-llEzO.js} +1 -1
  6. package/browser/chunk-BW8fM0ue.js +1 -0
  7. package/browser/{chunk-C6l-ubPp.js → chunk-B_xyOXZs.js} +1 -1
  8. package/browser/{chunk-DWxo88Hh.js → chunk-BgXa8VvY.js} +1 -1
  9. package/browser/{chunk-BKPUzOao.js → chunk-BkbZAmXX.js} +1 -1
  10. package/browser/{chunk-BHB3p2wV.js → chunk-Bqm3Baon.js} +1 -1
  11. package/browser/{chunk-Ft41O2oO.js → chunk-BuBFIFse.js} +1 -1
  12. package/browser/{chunk-BnPmoh3z.js → chunk-BvtDVbRn.js} +1 -1
  13. package/browser/{chunk-BLas18US.js → chunk-C-CSiiPO.js} +1 -1
  14. package/browser/{chunk-6lzxK4MR.js → chunk-C2Ysz4lE.js} +1 -1
  15. package/browser/{chunk-Cta1xCgm.js → chunk-CW_HgUJv.js} +1 -1
  16. package/browser/{chunk-Cm-B0Bk2.js → chunk-CZJC16qo.js} +1 -1
  17. package/browser/{chunk-kgmv2Up_.js → chunk-CpMZ7Npg.js} +1 -1
  18. package/browser/{chunk-giF-MCzQ.js → chunk-Cs6CLQoM.js} +1 -1
  19. package/browser/chunk-CyaG7zAT.js +2 -0
  20. package/browser/chunk-D2HLDbQg.js +1 -0
  21. package/browser/{chunk-GZDFcyNO.js → chunk-D2s9ksqW.js} +1 -1
  22. package/browser/{chunk-CNj1cQTl.js → chunk-D4yRqSei.js} +1 -1
  23. package/browser/{chunk-Db9YjUfz.js → chunk-DBXVlo1t.js} +1 -1
  24. package/browser/{chunk-CGcYoQNb.js → chunk-DS5OuYg2.js} +1 -1
  25. package/browser/chunk-D_SLwB5o.js +1 -0
  26. package/browser/{chunk-nYdCEVqA.js → chunk-DaoRhmfh.js} +1 -1
  27. package/browser/{chunk-BtPUYR0A.js → chunk-DbMNQNwa.js} +1 -1
  28. package/browser/chunk-Dge-j7OI.js +1 -0
  29. package/browser/{chunk-CD-gr1_W.js → chunk-DksUPXSW.js} +1 -1
  30. package/browser/{chunk-CgKiDm6z.js → chunk-DmcUxfMI.js} +1 -1
  31. package/browser/{chunk-CYIDbqSE.js → chunk-DrZAIHqG.js} +1 -1
  32. package/browser/{chunk-Cw7AdCyF.js → chunk-DrzCxadB.js} +1 -1
  33. package/browser/{chunk-BQRV2aXM.js → chunk-DsW6-MGu.js} +1 -1
  34. package/browser/chunk-Rokta00i.js +1 -0
  35. package/browser/chunk-Xo4jxdGx.js +2 -0
  36. package/browser/chunk-fLWaVOVo.js +1027 -0
  37. package/browser/{chunk-BP4bg_R6.js → chunk-gpCPAAXl.js} +1 -1
  38. package/browser/{chunk-D2ibs68b.js → chunk-hJmMWaWI.js} +1 -1
  39. package/browser/chunk-i6V9cgAY.js +1 -0
  40. package/browser/{chunk-PgOtzhjh.js → chunk-llAhFIMA.js} +1 -1
  41. package/browser/{chunk-CdClH7mi.js → chunk-lwErdMBY.js} +1 -1
  42. package/browser/{chunk-DuzRIIcw.js → chunk-sNekP8KG.js} +1 -1
  43. package/browser/chunk-vtj56A7g.js +1 -0
  44. package/browser/chunk-xZ2GmpSF.js +2 -0
  45. package/browser/chunk-yUomgNv9.js +1 -0
  46. package/browser/index.html +1 -1
  47. package/browser/{main-3WVIQAKF.js → main-OQRNUTKI.js} +13 -13
  48. package/package.json +1 -1
  49. package/browser/chunk-BN5SgIBg.js +0 -1027
  50. package/browser/chunk-CFyS8cBR.js +0 -1
  51. package/browser/chunk-CRkvWY5s.js +0 -1
  52. package/browser/chunk-Cgri6mja.js +0 -1
  53. package/browser/chunk-Cp__Ucb0.js +0 -2
  54. package/browser/chunk-CwR1is0O.js +0 -1
  55. package/browser/chunk-DRPc0mfI.js +0 -2
  56. package/browser/chunk-DVFj7gx9.js +0 -1
  57. package/browser/chunk-DZgJFN1U.js +0 -1
  58. package/browser/chunk-Dx61Sbit.js +0 -1
  59. package/browser/chunk-LrMK9YKu.js +0 -1
  60. package/browser/chunk-PLFrDqWd.js +0 -1
  61. package/browser/chunk-fnvTjcS-.js +0 -1
  62. package/browser/chunk-oG_KGFYC.js +0 -2
@@ -1 +0,0 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-giF-MCzQ.js';import {O}from'./chunk-BHB3p2wV.js';import {p,y as $t,o as It,M as Me,G,g as ie$1,U as U$1,aA as j,a8 as Ae,D as Df,a3 as _,$ as $a,K as lc,b as bf,t as t_,d as dT,N as tv,m as mb,f as fT,_ as _T,I as Iv,j as gT,k as mT,A as Af,r as IT,s as ig,v as sg}from'./main-3WVIQAKF.js';import {i,O as O$1,h as vi,x as xi,C as Ci,P,M}from'./chunk-BN5SgIBg.js';import'./chunk-CRkvWY5s.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&($a(0,"p",3),t_(1),bf()),n&2){let t=_T();mb(),Iv(t.deletion.error());}}function Q(n,e){n&1&&($a(0,"p",4),t_(1,"Loading integrations\u2026"),bf());}function W(n,e){n&1&&($a(0,"p",5),t_(1,"No integrations available."),bf());}function X(n,e){n&1&&($a(0,"p",4),t_(1,"No integrations match the current filter."),bf());}function Z(n,e){n&1&&($a(0,"ds-tag",19),t_(1,"YAML"),bf(),$a(2,"ds-tag",20),t_(3,"Read-only"),bf());}function ee(n,e){if(n&1){let t=IT();$a(0,"button",21),lc("click",function(){ig(t);let s=_T().$implicit,c=_T(2);return sg(c.view(s))}),t_(1,"View"),bf();}}function te(n,e){if(n&1){let t=IT();$a(0,"button",21),lc("click",function(){ig(t);let s=_T(2).$implicit,c=_T(2);return sg(c.edit(s))}),t_(1,"Edit"),bf();}}function ne(n,e){if(n&1){let t=IT();$a(0,"agentos-row-delete-action",24),lc("deleteRequested",function(){ig(t);let s=_T(2).$implicit,c=_T(2);return sg(c.deletion.request(s.key))})("deleteConfirmed",function(){ig(t);let s=_T(2).$implicit,c=_T(2);return sg(c.confirmDelete(s))})("deleteCancelled",function(){ig(t);let s=_T(4);return sg(s.deletion.cancel())}),bf();}if(n&2){let t=_T(2).$implicit,a=_T(2);tv("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function oe(n,e){n&1&&($a(0,"button",23),t_(1,"Inherited"),bf());}function ie(n,e){if(n&1){let t=IT();$a(0,"button",21),lc("click",function(){ig(t);let s=_T().$implicit,c=_T(2);return sg(c.duplicate(s))}),t_(1,"Duplicate"),bf(),dT(2,te,2,0,"button",18),dT(3,ne,1,3,"agentos-row-delete-action",22),dT(4,oe,2,0,"button",23);}if(n&2){let t=_T().$implicit;mb(2),fT(t.canEdit?2:-1),mb(),fT(t.canDelete?3:-1),mb(),fT(!t.canEdit&&!t.canDelete?4:-1);}}function ae(n,e){if(n&1&&($a(0,"tr",9)(1,"td",12),t_(2),bf(),$a(3,"td",13),t_(4),bf(),$a(5,"td",14)(6,"div",15)(7,"ds-tag",16),t_(8),bf(),dT(9,Z,4,0),bf()(),$a(10,"td",17),dT(11,ee,2,0,"button",18)(12,ie,5,3),bf()()),n&2){let t=e.$implicit;mb(2),Iv(t.config.name),mb(2),Iv(t.config.integrationType),mb(3),tv("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),mb(),Af(" ",t.scopeLabel," "),mb(),fT(t.source==="FILESYSTEM"?9:-1),mb(2),fT(t.source==="FILESYSTEM"?11:12);}}function re(n,e){if(n&1&&($a(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),t_(5,"Name"),bf(),$a(6,"th",10),t_(7,"Type"),bf(),$a(8,"th",10),t_(9,"Scope"),bf(),$a(10,"th",10)(11,"span",11),t_(12,"Actions"),bf()()()(),$a(13,"tbody",8),gT(14,ae,13,6,"tr",9,J),bf()()()),n&2){let t=_T();mb(14),mT(t.rowFilter.filteredRows());}}var B=class n$1{route=p($t);router=p(It);destroyRef=p(Me);state=p(O);namespaceRole=p(v);namespaceApi=p(G);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=ie$1("this namespace");isAdmin=ie$1(false);isLoading=ie$1(true);rows=ie$1([]);deletion=i();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(j(e=>e.get("namespaceId")??""),Ae(e=>e?this.namespaceRole.isAdminOfNamespace$(e):_(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,H)=>{let v=e(c),w=v==="NEO4J"&&!s;return {key:`${t}:${c.id??H}`,config:c,scope:t,scopeLabel:a,source:v,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=Df({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["type","button",1,"integrations__new",3,"click"],["role","alert",1,"integrations__error"],["role","status",1,"integrations__status"],[1,"integrations__status"],[1,"integrations__table-wrap"],["dsTable","","role","table","aria-label","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"integrations__name"],["role","cell","data-label","Type",1,"integrations__type"],["role","cell","data-label","Scope"],[1,"integrations__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions","",1,"integrations__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","integrations__delete",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","integrations__delete",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&($a(0,"ds-section-header",0)(1,"agentos-table-filter",1),lc("queryChange",function(c){return a.rowFilter.query.set(c)}),bf(),$a(2,"button",2),lc("click",function(){return a.openCreateForm()}),t_(3,"New integration"),bf()(),dT(4,U,2,1,"p",3),dT(5,Q,2,0,"p",4)(6,W,2,0,"p",5)(7,X,2,0,"p",4)(8,re,16,0,"div",6)),t&2&&(tv("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),mb(),tv("query",a.rowFilter.query()),mb(3),fT(a.deletion.error()?4:-1),mb(),fT(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,Ci,P,M],styles:['.integrations__new[_ngcontent-%COMP%]{white-space:nowrap;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__error[_ngcontent-%COMP%]{margin:0 0 .75rem;color:var(--color-error)}.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}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}']})};export{B as IntegrationsAllScopesComponent};
@@ -1 +0,0 @@
1
- import {a8 as Ae,aE as pw,af as Wn,a3 as _}from'./main-3WVIQAKF.js';function i(t,o,p){return t.pipe(Ae(()=>o().pipe(Wn(()=>_(p)))),pw({bufferSize:1,refCount:true}))}export{i};
@@ -1 +0,0 @@
1
- import {O}from'./chunk-6lzxK4MR.js';import {v}from'./chunk-giF-MCzQ.js';import {p,y as $t,o as It,M as Me,g as ie,a2 as F$1,ai as Te,q as Sg,U,D as Df,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,r as IT,j as gT,a5 as pT,L as oS,u as uc,ah as hT,_ as _T,N as tv,O as sS,k as mT,A as Af,a4 as uT,s as ig,v as sg}from'./main-3WVIQAKF.js';import {$,j as ze,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn,y as yn,k as yt,n as Ct}from'./chunk-BN5SgIBg.js';import'./chunk-CRkvWY5s.js';function ce(a,r){a&1&&($a(0,"p",5),t_(1,"Loading\u2026"),bf());}function me(a,r){if(a&1&&($a(0,"label",30),uc(1,"input",31),oS(),$a(2,"span"),t_(3),bf()()),a&2){let e=r.$implicit,l=_T(3);mb(),tv("formControl",l.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!l.isAdmin()),sS(),mb(2),Iv(e.label);}}function ue(a,r){if(a&1&&($a(0,"fieldset",8)(1,"legend",24),t_(2,"Port\xE9e de la configuration"),bf(),gT(3,me,4,4,"label",30,uT().trackByScope,true),bf()),a&2){let e=_T(2);tv("disabled",e.isEditMode()),mb(3),mT(e.scopeOptions);}}function ve(a,r){if(a&1&&($a(0,"option",13),t_(1),bf()),a&2){let e=r.$implicit;tv("value",e),mb(),Iv(e);}}function fe(a,r){if(a&1){let e=IT();$a(0,"div",26),uc(1,"input",32),oS(),uc(2,"input",33),oS(),$a(3,"button",34),lc("click",function(){let s=ig(e).$index,f=_T(2);return sg(f.removeHeader(s))}),t_(4," \xD7 "),bf()();}if(a&2){let e=r.$index;tv("formGroupName",e),mb(),sS(),mb(),sS();}}function _e(a,r){if(a&1){let e=IT();$a(0,"form",7),lc("ngSubmit",function(){ig(e);let s=_T();return sg(s.submit())}),dT(1,ue,5,1,"fieldset",8),$a(2,"div",9)(3,"label",10),t_(4,"API type "),$a(5,"span",11),t_(6,"*"),bf()(),$a(7,"select",12),gT(8,ve,2,2,"option",13,pT),bf(),oS(),bf(),$a(10,"div",9)(11,"label",14),t_(12,"Name "),$a(13,"span",11),t_(14,"*"),bf()(),uc(15,"input",15),oS(),bf(),$a(16,"div",9)(17,"label",16),t_(18,"Description"),bf(),uc(19,"input",17),oS(),bf(),$a(20,"div",9)(21,"label",18),t_(22,"Base URL"),bf(),uc(23,"input",19),oS(),bf(),$a(24,"div",9)(25,"label",20),t_(26,"API key"),bf(),uc(27,"input",21),oS(),bf(),$a(28,"div",22)(29,"div",23)(30,"span",24),t_(31,"Custom headers"),bf(),$a(32,"button",25),lc("click",function(){ig(e);let s=_T();return sg(s.addHeader())}),t_(33,"+ Add header"),bf()(),gT(34,fe,5,1,"div",26,hT),bf(),$a(36,"div",27)(37,"button",28),t_(38),bf(),$a(39,"button",29),lc("click",function(){ig(e);let s=_T();return sg(s.cancel())}),t_(40,"Cancel"),bf()()();}if(a&2){let e=_T();tv("formGroup",e.form),mb(),fT(e.isPlatformMode?-1:1),mb(6),tv("formControl",e.apiTypeControl),sS(),mb(),mT(e.apiTypeOptions),mb(7),tv("formControl",e.nameControl),sS(),mb(4),tv("formControl",e.descriptionControl),sS(),mb(4),tv("formControl",e.baseUrlControl),sS(),mb(4),tv("formControl",e.apiKeyControl),sS(),mb(),tv("formArrayName","headers"),mb(6),mT(e.headersArray.controls),mb(3),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ge=new Set(["namespace","userOnNs","userGlobal"]),F=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),se=class a{route=p($t);router=p(It);destroyRef=p(Me);state=p(O);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?ie(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});apiTypeOptions=Object.values(Te);scopeOptions=[{value:"namespace",label:F.namespace},{value:"userOnNs",label:F.userOnNs},{value:"userGlobal",label:F.userGlobal}];form=new $({name:new vt("",{nonNullable:true,validators:[ve$1.required,ve$1.minLength(1)]}),description:new vt(null),apiType:new vt("OpenAI",{nonNullable:true,validators:[ve$1.required]}),baseUrl:new vt("",{nonNullable:true}),apiKey:new vt("",{nonNullable:true}),scope:new vt("namespace",{nonNullable:true}),headers:new ze([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new $({key:new vt("",{nonNullable:true,validators:[ve$1.required]}),value:new vt("",{nonNullable:true})}));}removeHeader(r){this.headersArray.removeAt(r);}isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||Sg(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let r=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,l=r.get("aiProviderId"),s=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(l){this.isEditMode.set(true),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(l);return}this.scopeControl.setValue(s);let f=e.get("template");f&&this.hydrateFromTemplate(f);}parseScope(r){return r&&ge.has(r)?r:"namespace"}deriveScopeFromConfig(r){return !r.userId?"namespace":r.namespaceId?"userOnNs":"userGlobal"}loadConfig(r){this.isLoading.set(true),this.state.getById(r).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AiProviderForm] Could not load provider '${r}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(r){this.isLoading.set(true),this.state.getById(r).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${r}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(r){this.nameControl.setValue(r.name),this.descriptionControl.setValue(r.description??null),this.apiTypeControl.setValue(r.apiType),this.baseUrlControl.setValue(r.baseUrl??"");let e=r.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[l,s]of Object.entries(r.headers??{}))this.headersArray.push(new $({key:new vt(l,{nonNullable:true,validators:[ve$1.required]}),value:new vt(s,{nonNullable:true})}));}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let r=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),l=this.apiKeyControl.value,s=this.isEditMode()&&l===this.initialApiKey?null:l,f=this.headersArray.controls.filter(x=>x.controls.key.value.trim()).map(x=>[x.controls.key.value.trim(),x.controls.value.value]),de=f.length>0?Object.fromEntries(f):null,N={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:r||null,baseUrl:e||null,apiKey:s,headers:de},T=this.form.getRawValue().scope,pe=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,N,T,this.existingConfig):this.state.create(N,T,pe)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"]);}trackByScope(r,e){return e.value}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=Df({type:a,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__scope",3,"disabled"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__headers",3,"formArrayName"],[1,"ai-provider-form__headers-title"],[1,"ai-provider-form__label"],["type","button",1,"ai-provider-form__headers-add",3,"click"],[1,"ai-provider-form__header-row",3,"formGroupName"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"],[1,"ai-provider-form__scope-option"],["type","radio",3,"formControl","value","disabled"],["type","text","placeholder","Header name","formControlName","key","autocomplete","off",1,"ai-provider-form__input"],["type","text","placeholder","Value","formControlName","value","autocomplete","off",1,"ai-provider-form__input"],["type","button","title","Remove header","aria-label","Remove header",1,"ai-provider-form__header-remove",3,"click"]],template:function(e,l){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return l.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," AI Providers "),bf(),$a(6,"h1",4),t_(7),bf()(),dT(8,ce,2,0,"p",5)(9,_e,41,10,"form",6),bf()),e&2&&(mb(7),Iv(l.isEditMode()?"Edit AI provider":"New AI provider"),mb(),fT(l.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn,yn,yt,Ct],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;margin:0}.ai-provider-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.ai-provider-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--color-text);cursor:pointer}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-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-accent)}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__headers[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__headers-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.ai-provider-form__headers-add[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.8125rem;color:var(--color-accent)}.ai-provider-form__headers-add[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}.ai-provider-form__header-remove[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;background:none;border:1px solid transparent;border-radius:0;cursor:pointer;font-size:1rem;color:var(--color-neutral-500);transition:background .15s ease,color .15s ease,border-color .15s ease;flex-shrink:0}.ai-provider-form__header-remove[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{se as AiProviderFormComponent};
@@ -1,2 +0,0 @@
1
- import {R}from'./chunk-Cw7AdCyF.js';import {p,y as $t,aW as _,M as Me,g as ie$1,h as Si,aX as Ie,ae as hw,U,af as Wn,D as Df,a3 as _$1,$ as $a,t as t_,b as bf,d as dT,m as mb,f as fT,r as IT,K as lc,L as oS,j as gT,_ as _T,N as tv,O as sS,k as mT,A as Af,I as Iv,w as gv,ar as Cv,s as ig,v as sg}from'./main-3WVIQAKF.js';import {A as Yn,Z as Zn,X as Xn,Y as Ye,F as Ft,c as bt,L as Ln,E as ln}from'./chunk-BN5SgIBg.js';import'./chunk-CRkvWY5s.js';var q=(a,t)=>t.id;function $(a,t){a&1&&($a(0,"p",3),t_(1,"Loading\u2026"),bf());}function J(a,t){if(a&1&&($a(0,"p",6),t_(1),bf()),a&2){let e=_T(2);mb(),Iv(e.errorMessage());}}function Q(a,t){if(a&1){let e=IT();$a(0,"button",26),lc("click",function(){ig(e);let s=_T(2);return sg(s.retryLoad())}),t_(1,"Retry loading"),bf();}}function X(a,t){if(a&1&&($a(0,"span",28),t_(1),bf()),a&2){let e=_T(3);mb(),Iv(e.association()?.checkoutFailureReason);}}function Z(a,t){if(a&1&&($a(0,"p",27),t_(1),dT(2,X,2,1,"span",28),bf()),a&2){let e=_T(2);gv("namespace-git__status--failed",e.checkoutStatus()===e.CheckoutStatus.FAILED)("namespace-git__status--ready",e.checkoutStatus()===e.CheckoutStatus.READY),mb(),Af(" Repository: ",e.checkoutStatus()," "),mb(),fT(e.association()?.checkoutFailureReason?2:-1);}}function ee(a,t){if(a&1&&($a(0,"option",18),t_(1),bf()),a&2){let e=t.$implicit,d=_T(2);tv("value",e.id),mb(),Cv("",e.name," (",d.authTypeLabel(e.authType),")");}}function te(a,t){a&1&&($a(0,"span",19),t_(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),bf());}function ne(a,t){if(a&1){let e=IT();$a(0,"button",29),lc("click",function(){ig(e);let s=_T(2);return sg(s.remove())}),t_(1," Remove association "),bf();}if(a&2){let e=_T(2);tv("disabled",!e.associationLoaded()||e.isSaving());}}function ie(a,t){if(a&1){let e=IT();$a(0,"div",4)(1,"p",5),t_(2," Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows. "),bf(),dT(3,J,2,1,"p",6),dT(4,Q,2,0,"button",7),dT(5,Z,3,6,"p",8),$a(6,"fieldset",9)(7,"legend",10),t_(8,"Repository"),bf(),$a(9,"label",11)(10,"span",12),t_(11,"Repository URL"),bf(),$a(12,"input",13),lc("ngModelChange",function(s){ig(e);let p=_T();return sg(p.repositoryUrl.set(s))}),bf(),oS(),$a(13,"span",14),t_(14,"HTTPS only, without credentials in the URL."),bf()(),$a(15,"label",11)(16,"span",12),t_(17,"Main branch"),bf(),$a(18,"input",15),lc("ngModelChange",function(s){ig(e);let p=_T();return sg(p.mainBranch.set(s))}),bf(),oS(),$a(19,"span",14),t_(20,"New worktrees start at this branch\u2019s commit, without creating a branch."),bf()(),$a(21,"label",11)(22,"span",12),t_(23,"Service account"),bf(),$a(24,"select",16),lc("ngModelChange",function(s){ig(e);let p=_T();return sg(p.serviceAuthSettingId.set(s))}),$a(25,"option",17),t_(26,"Select an auth setting\u2026"),bf(),gT(27,ee,2,3,"option",18,q),bf(),oS(),$a(29,"span",14),t_(30," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),bf(),dT(31,te,2,0,"span",19),bf()(),$a(32,"fieldset",9)(33,"legend",10),t_(34,"Automation"),bf(),$a(35,"label",20)(36,"input",21),lc("ngModelChange",function(s){ig(e);let p=_T();return sg(p.autoWorktree.set(s))}),bf(),oS(),$a(37,"span"),t_(38,"Offer a worktree to every new top-level case"),bf()(),$a(39,"span",14),t_(40," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),bf(),$a(41,"label",11)(42,"span",12),t_(43,"Setup command (optional)"),bf(),$a(44,"input",22),lc("ngModelChange",function(s){ig(e);let p=_T();return sg(p.setupCommand.set(s))}),bf(),oS(),$a(45,"span",19),t_(46," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),bf()()(),$a(47,"div",23)(48,"button",24),lc("click",function(){ig(e);let s=_T();return sg(s.save())}),t_(49),bf(),dT(50,ne,2,1,"button",25),bf()();}if(a&2){let e=_T();mb(3),fT(e.errorMessage()?3:-1),mb(),fT(e.associationLoaded()?-1:4),mb(),fT(e.isAssociated()&&e.checkoutStatus()?5:-1),mb(),tv("disabled",!e.associationLoaded()||e.isSaving()),mb(6),tv("ngModel",e.repositoryUrl()),sS(),mb(6),tv("ngModel",e.mainBranch()),sS(),mb(6),tv("ngModel",e.serviceAuthSettingId()),sS(),mb(3),mT(e.eligibleAuthSettings()),mb(4),fT(e.eligibleAuthSettings().length===0?31:-1),mb(),tv("disabled",!e.associationLoaded()||e.isSaving()),mb(4),tv("ngModel",e.autoWorktree()),sS(),mb(8),tv("ngModel",e.setupCommand()),sS(),mb(4),tv("disabled",!e.canSave()),mb(),Af(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),mb(),fT(e.isAssociated()?50:-1);}}var ae=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],oe={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},j=class a{route=p($t);gitApi=p(_);authSettingState=p(R);destroyRef=p(Me);isLoading=ie$1(true);isSaving=ie$1(false);associationLoaded=ie$1(false);errorMessage=ie$1(null);association=ie$1(null);authSettings=ie$1([]);repositoryUrl=ie$1("");mainBranch=ie$1("main");serviceAuthSettingId=ie$1("");autoWorktree=ie$1(false);setupCommand=ie$1("");namespaceId="";isAssociated=Si(()=>this.association()?.associated===true);eligibleAuthSettings=Si(()=>this.authSettings().filter(t=>ae.includes(t.authType)));authTypeLabel(t){return oe[t??""]??t??"unknown"}canSave=Si(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=Si(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ie;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),hw({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),Wn(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_$1(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||confirm("Remove the repository association? Existing workspaces keep their worktree.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),Wn(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_$1(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=Df({type:a,selectors:[["agentos-namespace-git"]],decls:6,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],["type","button",1,"namespace-git__retry"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section",3,"disabled"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__checkbox"],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],["type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__retry",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(e,d){e&1&&($a(0,"div",0)(1,"header",1)(2,"h1",2),t_(3,"Git repository"),bf()(),dT(4,$,2,0,"p",3)(5,ie,51,14,"div",4),bf()),e&2&&(mb(4),fT(d.isLoading()?4:5));},dependencies:[Yn,Zn,Xn,Ye,Ft,bt,Ln,ln],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__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}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__checkbox[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;cursor:pointer}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__retry[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
2
- export{j as NamespaceGitComponent};
@@ -1 +0,0 @@
1
- import {w as On}from'./chunk-BN5SgIBg.js';import {p,y as $t,o as It,M as Me,a9 as $$1,g as ie$1,h as Si,U as U$1,D as Df,at as pu,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,N as tv,f as fT,_ as _T,I as Iv,w as gv,A as Af,r as IT,e as cc,j as gT,k as mT,u as uc,au as g_,av as y_,s as ig,v as sg,aw as MC}from'./main-3WVIQAKF.js';var $=(n,o)=>o.id,B=(n,o)=>o.name;function j(n,o){n&1&&($a(0,"p",6),t_(1,"Loading\u2026"),bf());}function H(n,o){n&1&&($a(0,"p",7),t_(1,"Failed to load agent definition."),bf());}function J(n,o){if(n&1&&($a(0,"dt",12),t_(1,"User context"),bf(),$a(2,"dd",14),t_(3),bf()),n&2){let e=_T();mb(3),Iv(e.userId);}}function U(n,o){if(n&1&&($a(0,"pre",22),t_(1),bf()),n&2){let e=_T(2);mb(),Iv(e.systemPrompt);}}function G(n,o){if(n&1){let e=IT();$a(0,"section",9)(1,"button",20),lc("click",function(){ig(e);let p=_T(2);return sg(p.toggleSystemPrompt())}),$a(2,"h2",10),t_(3,"System Prompt"),bf(),$a(4,"span",21),t_(5," \u25BC "),bf()(),dT(6,U,2,1,"pre",22),bf();}if(n&2){let e=_T(2);mb(),cc("aria-expanded",!e.systemPromptCollapsed()),mb(3),gv("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),mb(2),fT(e.systemPromptCollapsed()?-1:6);}}function K(n,o){if(n&1&&($a(0,"pre",22),t_(1),bf()),n&2){let e=_T(2);mb(),Iv(e.instructions);}}function q(n,o){if(n&1){let e=IT();$a(0,"section",9)(1,"button",20),lc("click",function(){ig(e);let p=_T(2);return sg(p.toggleInstructions())}),$a(2,"h2",10),t_(3,"Instructions"),bf(),$a(4,"span",21),t_(5," \u25BC "),bf()(),dT(6,K,2,1,"pre",22),bf();}if(n&2){let e=_T(2);mb(),cc("aria-expanded",!e.instructionsCollapsed()),mb(3),gv("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),mb(2),fT(e.instructionsCollapsed()?-1:6);}}function Q(n,o){n&1&&($a(0,"p",17),t_(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),bf());}function W(n,o){n&1&&($a(0,"span",25),t_(1,"platform"),bf());}function X(n,o){n&1&&($a(0,"span",25),t_(1,"SKILL.md"),bf());}function Y(n,o){if(n&1&&($a(0,"li",23)(1,"span",24),t_(2),bf(),dT(3,W,2,0,"span",25),dT(4,X,2,0,"span",25),$a(5,"p",26),t_(6),bf()()),n&2){let e=o.$implicit;mb(2),Iv(e.name),mb(),fT(e.namespaceId?-1:3),mb(),fT(e.readOnly?4:-1),mb(2),Iv(e.description);}}function Z(n,o){if(n&1&&($a(0,"ul",18),gT(1,Y,7,4,"li",23,$),bf()),n&2){let e=_T(2);mb(),mT(e.resolvedSkills());}}function ee(n,o){n&1&&($a(0,"p",17),t_(1,"No tools available for this agent."),bf());}function ne(n,o){if(n&1&&(uc(0,"div",31),g_(1,"agentosMarkdown")),n&2){let e=_T(2).$implicit;tv("innerHTML",y_(1,1,e.description),MC);}}function te(n,o){if(n&1&&($a(0,"div",30),dT(1,ne,2,3,"div",31),$a(2,"pre",32),t_(3),bf()()),n&2){let e=_T().$implicit,c=_T(3);mb(),fT(e.description?1:-1),mb(2),Iv(c.formatSchema(e.inputSchema));}}function ie(n,o){if(n&1){let e=IT();$a(0,"li",27)(1,"button",28),lc("click",function(){let p=ig(e).$implicit,V=_T(3);return sg(V.toggleTool(p))}),$a(2,"span",29),t_(3),bf(),$a(4,"span",21),t_(5," \u25BC "),bf()(),dT(6,te,4,2,"div",30),bf();}if(n&2){let e=o.$implicit,c=_T(3);mb(),cc("aria-expanded",c.isToolExpanded(e)),mb(2),Iv(e.name),mb(),gv("agent-config-inspect__chevron--open",c.isToolExpanded(e)),mb(2),fT(c.isToolExpanded(e)?6:-1);}}function oe(n,o){if(n&1&&($a(0,"ul",19),gT(1,ie,7,5,"li",27,B),bf()),n&2){let e=_T();mb(),mT(e.tools);}}function ae(n,o){if(n&1&&($a(0,"div",8)(1,"section",9)(2,"h2",10),t_(3,"General"),bf(),$a(4,"dl",11)(5,"dt",12),t_(6,"Name"),bf(),$a(7,"dd",13),t_(8),bf(),$a(9,"dt",12),t_(10,"Resolved model"),bf(),$a(11,"dd",14),t_(12),bf(),$a(13,"dt",12),t_(14,"Provider"),bf(),$a(15,"dd",13),t_(16),bf(),$a(17,"dt",12),t_(18,"Execution mode"),bf(),$a(19,"dd",13)(20,"span",15),t_(21),bf()(),dT(22,J,4,1),bf()(),dT(23,G,7,4,"section",9),dT(24,q,7,4,"section",9),$a(25,"section",9)(26,"h2",10),t_(27," Skills "),$a(28,"span",16),t_(29),bf()(),dT(30,Q,2,0,"p",17)(31,Z,3,0,"ul",18),bf(),$a(32,"section",9)(33,"h2",10),t_(34," Tools "),$a(35,"span",16),t_(36),bf()(),dT(37,ee,2,0,"p",17)(38,oe,3,0,"ul",19),bf()()),n&2){let e=o,c=_T();mb(8),Iv(e.name),mb(4),Iv(e.resolvedModelApiName),mb(4),Iv(e.resolvedProviderName),mb(4),gv("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),mb(),Af(" ",e.executionMode," "),mb(),fT(e.userId?22:-1),mb(),fT(e.systemPrompt?23:-1),mb(),fT(e.instructions?24:-1),mb(5),Af("(",c.resolvedSkills().length,")"),mb(),fT(c.resolvedSkills().length===0?30:31),mb(6),Af("(",e.tools.length,")"),mb(),fT(e.tools.length===0?37:38);}}var R=class n{route=p($t);router=p(It);destroyRef=p(Me);agentConfigController=p($$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=ie$1(true);hasError=ie$1(false);definition=ie$1(null);expandedTools=ie$1(new Set);resolvedSkills=Si(()=>this.definition()?.skills??[]);systemPromptCollapsed=ie$1(true);instructionsCollapsed=ie$1(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=Df({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&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return c.back()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," Agent Configs "),bf(),$a(6,"h1",4),t_(7,"Agent definition"),bf(),$a(8,"a",5),t_(9,"Edit config \u2192"),bf()(),dT(10,j,2,0,"p",6)(11,H,2,0,"p",7)(12,ae,39,13,"div",8),bf()),e&2){let p;mb(8),tv("routerLink",c.editRoute()),mb(2),fT(c.isLoading()?10:c.hasError()?11:(p=c.definition())?12:-1,p);}},dependencies:[pu,On],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,2 +0,0 @@
1
- import {O as O$1}from'./chunk-6lzxK4MR.js';import {R}from'./chunk-Cw7AdCyF.js';import {O}from'./chunk-BHB3p2wV.js';import {p,o as It,aB as Pn,M as Me$1,g as ie,h as Si,a2 as F,as as Ss,aA as j,U,D as Df,$ as $a,K as lc,b as bf,t as t_,d as dT,m as mb,f as fT,j as gT,_ as _T,k as mT,r as IT,w as gv,e as cc,I as Iv,A as Af,u as uc,L as oS,N as tv,O as sS,s as ig,v as sg,a4 as uT}from'./main-3WVIQAKF.js';import {l,I,B,$,v as vt,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,L as Ln,W as Wn,V as Vn,y as yn,r as qe}from'./chunk-BN5SgIBg.js';import'./chunk-CRkvWY5s.js';var D=(r,i)=>i.value,se=(r,i)=>i.label;function de(r,i){r&1&&($a(0,"p",4),t_(1,"Loading\u2026"),bf());}function _e(r,i){if(r&1){let e=IT();$a(0,"button",19),lc("click",function(){let d=ig(e).$implicit,_=_T(2);return sg(_.setThemeVariant(d.value))}),$a(1,"span",20),t_(2),bf(),$a(3,"span",21),t_(4),bf()();}if(r&2){let e=i.$implicit,a=_T(2);gv("user-profile__theme-variant--active",a.themeVariant()===e.value),cc("aria-pressed",a.themeVariant()===e.value),mb(2),Iv(e.label),mb(2),Iv(e.description);}}function ce(r,i){if(r&1){let e=IT();$a(0,"button",22),lc("click",function(){let d=ig(e).$implicit,_=_T(2);return sg(_.setTheme(d.value))}),t_(1),bf();}if(r&2){let e=i.$implicit,a=_T(2);gv("user-profile__segmented-option--active",a.themeMode()===e.value),cc("aria-pressed",a.themeMode()===e.value),mb(),Af(" ",e.label," ");}}function pe(r,i){if(r&1){let e=IT();$a(0,"button",22),lc("click",function(){let d=ig(e).$implicit,_=_T(2);return sg(_.setEnterKeyBehavior(d.value))}),t_(1),bf();}if(r&2){let e=i.$implicit,a=_T(2);gv("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),cc("aria-pressed",a.enterKeyBehavior()===e.value),mb(),Af(" ",e.label," ");}}function me(r,i){if(r&1){let e=IT();$a(0,"button",22),lc("click",function(){let d=ig(e).$implicit,_=_T(2);return sg(_.setShowTechnical(d.value))}),t_(1),bf();}if(r&2){let e=i.$implicit,a=_T(2);gv("user-profile__segmented-option--active",a.showTechnical()===e.value),cc("aria-pressed",a.showTechnical()===e.value),mb(),Af(" ",e.label," ");}}function ue(r,i){if(r&1&&($a(0,"option",33),t_(1),bf()),r&2){let e=i.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function fe(r,i){if(r&1){let e=IT();$a(0,"form",23),lc("ngSubmit",function(){ig(e);let d=_T(2);return sg(d.save())}),$a(1,"div",5)(2,"h2",6),t_(3,"Identity"),bf(),$a(4,"div",7)(5,"span",8),t_(6,"Email"),bf(),$a(7,"span",24),t_(8),bf()(),$a(9,"div",7)(10,"span",8),t_(11,"External ID"),bf(),$a(12,"span",24),t_(13),bf()()(),$a(14,"div",5)(15,"h2",6),t_(16,"Profile"),bf(),$a(17,"div",7)(18,"label",25),t_(19,"First name"),bf(),uc(20,"input",26),oS(),bf(),$a(21,"div",7)(22,"label",27),t_(23,"Last name"),bf(),uc(24,"input",28),oS(),bf(),$a(25,"div",7)(26,"label",29),t_(27,"Bio"),bf(),uc(28,"textarea",30),oS(),bf(),$a(29,"div",7)(30,"label",31),t_(31,"Language"),bf(),$a(32,"select",32),gT(33,ue,2,2,"option",33,D),bf(),oS(),bf()(),$a(35,"div",34)(36,"button",35),t_(37),bf(),$a(38,"button",36),lc("click",function(){ig(e);let d=_T(2);return sg(d.cancelEditing())}),t_(39,"Cancel"),bf()()();}if(r&2){let e=_T(),a=_T();tv("formGroup",a.form),mb(8),Iv(e.email),mb(5),Iv(e.externalId),mb(7),sS(),mb(4),sS(),mb(4),sS(),mb(4),sS(),mb(),mT(a.languageOptions),mb(3),tv("disabled",a.isSaving()),mb(),Af(" ",a.isSaving()?"Saving\u2026":"Save changes"," ");}}function ge(r,i){r&1&&($a(0,"p",44),t_(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),bf());}function Ce(r,i){if(r&1){let e=IT();$a(0,"span",51),t_(1,"Delete?"),bf(),$a(2,"button",52),lc("click",function(){ig(e);let d=_T().$implicit,_=_T(6);return sg(_.confirmDelete(d))}),t_(3," Confirm "),bf(),$a(4,"button",53),lc("click",function(){ig(e);let d=_T(7);return sg(d.cancelDelete())}),t_(5," Cancel "),bf();}}function ve(r,i){if(r&1){let e=IT();$a(0,"button",53),lc("click",function(){ig(e);let d=_T().$implicit,_=_T(6);return sg(_.armDelete(d))}),t_(1," Delete "),bf();}}function xe(r,i){if(r&1&&($a(0,"li",47)(1,"span",48),t_(2),bf(),$a(3,"span",49),t_(4),bf(),dT(5,Ce,6,0)(6,ve,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=_T(6);mb(2),Iv(e.name),mb(2),Iv(e.subtitle),mb(),fT(a.isPendingDelete(e)?5:6);}}function be(r,i){if(r&1&&($a(0,"h3",45),t_(1,"Integrations"),bf(),$a(2,"ul",46),gT(3,xe,7,3,"li",47,uT().trackEntry,true),bf()),r&2){let e=_T(5);mb(3),mT(e.recap().integrations);}}function ye(r,i){if(r&1){let e=IT();$a(0,"span",51),t_(1,"Delete?"),bf(),$a(2,"button",52),lc("click",function(){ig(e);let d=_T().$implicit,_=_T(6);return sg(_.confirmDelete(d))}),t_(3," Confirm "),bf(),$a(4,"button",53),lc("click",function(){ig(e);let d=_T(7);return sg(d.cancelDelete())}),t_(5," Cancel "),bf();}}function he(r,i){if(r&1){let e=IT();$a(0,"button",53),lc("click",function(){ig(e);let d=_T().$implicit,_=_T(6);return sg(_.armDelete(d))}),t_(1," Delete "),bf();}}function Se(r,i){if(r&1&&($a(0,"li",47)(1,"span",48),t_(2),bf(),$a(3,"span",49),t_(4),bf(),dT(5,ye,6,0)(6,he,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=_T(6);mb(2),Iv(e.name),mb(2),Iv(e.subtitle),mb(),fT(a.isPendingDelete(e)?5:6);}}function Ee(r,i){if(r&1&&($a(0,"h3",45),t_(1,"AI Providers"),bf(),$a(2,"ul",46),gT(3,Se,7,3,"li",47,uT().trackEntry,true),bf()),r&2){let e=_T(5);mb(3),mT(e.recap().aiProviders);}}function Pe(r,i){if(r&1){let e=IT();$a(0,"span",51),t_(1,"Delete?"),bf(),$a(2,"button",52),lc("click",function(){ig(e);let d=_T().$implicit,_=_T(6);return sg(_.confirmDelete(d))}),t_(3," Confirm "),bf(),$a(4,"button",53),lc("click",function(){ig(e);let d=_T(7);return sg(d.cancelDelete())}),t_(5," Cancel "),bf();}}function we(r,i){if(r&1){let e=IT();$a(0,"button",53),lc("click",function(){ig(e);let d=_T().$implicit,_=_T(6);return sg(_.armDelete(d))}),t_(1," Delete "),bf();}}function ke(r,i){if(r&1&&($a(0,"li",47)(1,"span",48),t_(2),bf(),$a(3,"span",49),t_(4),bf(),dT(5,Pe,6,0)(6,we,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=_T(6);mb(2),Iv(e.name),mb(2),Iv(e.subtitle),mb(),fT(a.isPendingDelete(e)?5:6);}}function Me(r,i){if(r&1&&($a(0,"h3",45),t_(1,"My global auth settings"),bf(),$a(2,"ul",46),gT(3,ke,7,3,"li",47,uT().trackEntry,true),bf()),r&2){let e=_T(5);mb(3),mT(e.recap().authSettings);}}function Oe(r,i){if(r&1&&(dT(0,be,5,0),dT(1,Ee,5,0),dT(2,Me,5,0)),r&2){let e=_T(4);fT(e.recap().integrations.length>0?0:-1),mb(),fT(e.recap().aiProviders.length>0?1:-1),mb(),fT(e.recap().authSettings.length>0?2:-1);}}function Te(r,i){if(r&1&&dT(0,ge,2,0,"p",44)(1,Oe,3,3),r&2){let e=_T(3);fT(e.recap().total===0?0:1);}}function Ue(r,i){if(r&1){let e=IT();$a(0,"div",18)(1,"div",5)(2,"h2",6),t_(3,"Identity"),bf(),$a(4,"div",7)(5,"span",8),t_(6,"Email"),bf(),$a(7,"span",37),t_(8),bf()(),$a(9,"div",7)(10,"span",8),t_(11,"External ID"),bf(),$a(12,"span",37),t_(13),bf()()(),$a(14,"div",5)(15,"h2",6),t_(16,"Profile"),bf(),$a(17,"div",7)(18,"span",8),t_(19,"First name"),bf(),$a(20,"span",37),t_(21),bf()(),$a(22,"div",7)(23,"span",8),t_(24,"Last name"),bf(),$a(25,"span",37),t_(26),bf()(),$a(27,"div",38)(28,"span",8),t_(29,"Bio"),bf(),$a(30,"span",37),t_(31),bf()(),$a(32,"div",7)(33,"span",8),t_(34,"Language"),bf(),$a(35,"span",37),t_(36),bf()()(),$a(37,"div",34)(38,"button",39),lc("click",function(){ig(e);let d=_T(2);return sg(d.startEditing())}),t_(39," Edit profile "),bf()(),$a(40,"div",40)(41,"button",41),lc("click",function(){ig(e);let d=_T(2);return sg(d.toggleOverrides())}),$a(42,"span",42),t_(43,"\u25B6"),bf(),t_(44," My global user configurations "),$a(45,"span",43),t_(46),bf()(),dT(47,Te,2,1),bf()();}if(r&2){let e=_T(),a=_T();mb(8),Iv(e.email),mb(5),Iv(e.externalId),mb(8),Iv(e.firstname||"\u2014"),mb(5),Iv(e.lastname||"\u2014"),mb(5),Iv(e.bio||"\u2014"),mb(5),Iv(e.preferredLanguage||"\u2014"),mb(5),cc("aria-expanded",a.isOverridesExpanded()),mb(),gv("user-profile__overrides-arrow--open",a.isOverridesExpanded()),mb(4),Af("(",a.recap().total,")"),mb(),fT(a.isOverridesExpanded()?47:-1);}}function Ve(r,i){if(r&1&&($a(0,"div",5)(1,"h2",6),t_(2,"Appearance"),bf(),$a(3,"div",7)(4,"span",8),t_(5,"Skin"),bf(),$a(6,"div",9),gT(7,_e,5,5,"button",10,D),bf()(),$a(9,"div",7)(10,"span",8),t_(11,"Mode"),bf(),$a(12,"div",11),gT(13,ce,2,4,"button",12,D),bf()()(),$a(15,"div",5)(16,"h2",6),t_(17,"Composer"),bf(),$a(18,"div",7)(19,"span",8),t_(20,"Enter key"),bf(),$a(21,"div",13)(22,"div",14),gT(23,pe,2,4,"button",12,D),bf(),$a(25,"p",15),t_(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),bf()()()(),$a(27,"div",5)(28,"h2",6),t_(29,"Case chat"),bf(),$a(30,"div",7)(31,"span",8),t_(32,"Technical logs"),bf(),$a(33,"div",13)(34,"div",16),gT(35,me,2,4,"button",12,se),bf(),$a(37,"p",15),t_(38,"Show system log lines (agent status, tool selection...) in the case chat."),bf()()()(),dT(39,fe,40,5,"form",17)(40,Ue,48,11,"div",18)),r&2){let e=_T();mb(7),mT(e.themeVariantOptions),mb(6),mT(e.themeOptions),mb(10),mT(e.enterKeyOptions),mb(12),mT(e.showTechnicalOptions),mb(4),fT(e.isEditing()?39:40);}}function De(r,i){r&1&&($a(0,"p",4),t_(1,"Unable to load profile."),bf());}var le=class r{userState=p(l);router=p(It);location=p(Pn);destroyRef=p(Me$1);integrationState=p(O);providerState=p(O$1);authSettingState=p(R);themePort=p(I);preferencesPort=p(B);isEditing=ie(false);isLoading=ie(false);isSaving=ie(false);isOverridesExpanded=ie(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=Si(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=Si(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new $({firstname:new vt("",{nonNullable:true}),lastname:new vt("",{nonNullable:true}),bio:new vt("",{nonNullable:true}),preferredLanguage:new vt("",{nonNullable:true})});recap=F(Ss([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(j(([i,e,a])=>{let d=i.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),_=e.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=a.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:d,aiProviders:_,authSettings:I,total:d.length+_.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i});}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode});}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i);}setShowTechnical(i){this.preferencesPort.setShowTechnical(i);}save(){if(this.isSaving())return;this.isSaving.set(true);let i=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:i||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null);}pendingDeleteKey=ie(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a);}});}entryKey(i){return `${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"]);}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??"",preferredLanguage:i.preferredLanguage??""});}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Df({type:r,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],["role","group","aria-label","Technical logs",1,"user-profile__segmented"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],["for","up-preferredLanguage",1,"user-profile__label"],["id","up-preferredLanguage","formControlName","preferredLanguage",1,"user-profile__input","user-profile__select"],[3,"value"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&($a(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),lc("action",function(){return a.goBack()}),bf(),$a(3,"h1",3),t_(4,"My profile"),bf()(),dT(5,de,2,0,"p",4)(6,Ve,41,1)(7,De,2,0,"p",4),bf()),e&2){let d;mb(5),fT(a.isLoading()?5:(d=a.currentUser())?6:7,d);}},dependencies:[Kn,zn,Zn,Xn,Ye,bt,Ln,Wn,Vn,yn,qe],styles:[`.user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__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-accent)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__select[_ngcontent-%COMP%]{appearance:none;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .75rem center;padding-right:2.25rem}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}`]})};
2
- export{le as UserProfileComponent};
@@ -1 +0,0 @@
1
- import {v}from'./chunk-giF-MCzQ.js';import {R}from'./chunk-Cw7AdCyF.js';import {O}from'./chunk-BHB3p2wV.js';import {p,y as $t,o as It,M as Me,a1 as W,a2 as F,a3 as _,g as ie,h as Si,q as Sg,U,D as Df,$ as $a,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,r as IT,K as lc,j as gT,a4 as uT,L as oS,u as uc,a5 as pT,_ as _T,N as tv,k as mT,O as sS,A as Af,s as ig,v as sg}from'./main-3WVIQAKF.js';import {$,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,F as Ft,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn,g as St}from'./chunk-BN5SgIBg.js';import'./chunk-CRkvWY5s.js';function le(i,t){i&1&&($a(0,"p",3),t_(1,"Loading\u2026"),bf());}function se(i,t){if(i&1&&($a(0,"label",8),uc(1,"input",27),oS(),$a(2,"span"),t_(3),bf()()),i&2){let e=t.$implicit,n=_T(2);mb(),tv("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),sS(),mb(2),Iv(e.label);}}function ce(i,t){if(i&1&&($a(0,"option",14),t_(1),bf()),i&2){let e=t.$implicit;tv("value",e.type),mb(),Iv(e.displayName);}}function me(i,t){if(i&1&&($a(0,"option",14),t_(1),bf()),i&2){let e=t.$implicit;tv("value",e),mb(),Iv(e);}}function pe(i,t){if(i&1&&($a(0,"div",9)(1,"label",28),uc(2,"input",29),oS(),$a(3,"span",7),t_(4,"Grant automatically"),bf()(),$a(5,"p",30),t_(6),bf()()),i&2){let e=_T(2);mb(2),tv("formControl",e.autoGrantControl),sS(),mb(4),Af(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(i,t){if(i&1){let e=IT();$a(0,"div",22)(1,"ds-json-schema-form",31),lc("valueChange",function(s){ig(e);let m=_T(2);return sg(m.onParamsChange(s))}),bf()();}if(i&2){let e=_T(2);mb(),tv("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=IT();$a(0,"button",32),lc("click",function(){ig(e);let s=_T(2);return sg(s.exportYaml())}),t_(1),bf();}if(i&2){let e=_T(2);tv("disabled",e.isExporting()),mb(),Af(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=IT();$a(0,"form",5),lc("ngSubmit",function(){ig(e);let s=_T();return sg(s.submit())}),$a(1,"fieldset",6)(2,"legend",7),t_(3,"Scope"),bf(),gT(4,se,4,4,"label",8,uT().trackByScope,true),bf(),$a(6,"div",9)(7,"label",10),t_(8,"Type "),$a(9,"span",11),t_(10,"*"),bf()(),$a(11,"select",12)(12,"option",13),t_(13,"Select type"),bf(),gT(14,ce,2,2,"option",14,uT().trackByType,true),bf(),oS(),bf(),$a(16,"div",9)(17,"label",15),t_(18,"Name "),$a(19,"span",11),t_(20,"*"),bf()(),uc(21,"input",16),oS(),bf(),$a(22,"div",9)(23,"label",17),t_(24,"Description"),bf(),uc(25,"textarea",18),oS(),bf(),$a(26,"div",9)(27,"label",19),t_(28,"Auth Setting"),bf(),$a(29,"select",20)(30,"option",21),t_(31,"None"),bf(),gT(32,me,2,2,"option",14,pT),bf(),oS(),bf(),dT(34,pe,7,2,"div",9),dT(35,de,2,2,"div",22),$a(36,"div",23)(37,"button",24),t_(38),bf(),dT(39,ge,2,2,"button",25),$a(40,"button",26),lc("click",function(){ig(e);let s=_T();return sg(s.cancel())}),t_(41,"Cancel"),bf()()();}if(i&2){let e,n=_T();tv("formGroup",n.form),mb(),tv("disabled",n.isEditMode()),mb(3),mT(n.scopeOptions),mb(7),tv("formControl",n.typeControl),sS(),mb(3),mT(n.integrationTypes()),mb(7),tv("formControl",n.nameControl),sS(),mb(4),tv("formControl",n.descriptionControl),sS(),mb(4),tv("formControl",n.authSettingNameControl),sS(),mb(),tv("ngValue",null),mb(2),mT(n.availableAuthSettings()),mb(2),fT(n.isAutoGrantable()?34:-1),mb(),fT((e=n.schema())?35:-1,e),mb(2),tv("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),mb(),Af(" ",n.isEditMode()?"Save changes":"Create"," "),mb(),fT(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(O);integrationTypeController=p(W);authSettingState=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?_(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),type:new vt("",{nonNullable:true,validators:[ve.required]}),scope:new vt("namespace",{nonNullable:true}),autoGrant:new vt(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);isExporting=ie(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new vt(null);availableAuthSettings=ie([]);paramsValue=ie(null);initialParams=ie(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=Si(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=Si(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=Si(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Sg(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Df({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&($a(0,"div",0)(1,"header",1)(2,"h1",2),t_(3),bf()(),dT(4,le,2,0,"p",3)(5,ue,42,12,"form",4),bf()),e&2&&(mb(3),Iv(n.isEditMode()?"Edit integration":"New integration"),mb(),fT(n.isLoading()?4:5));},dependencies:[Kn,zn,Zn,Xn,Ye,Ft,bt,fn,Ln,Wn,pn,Vn,St],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
@@ -1 +0,0 @@
1
- import {f,A as Yn,z as zn,Y as Ye,L as Ln,W as Wn$1,D as ft,E as ln,G as rn,H as m}from'./chunk-BN5SgIBg.js';import {p,y as $t,aJ as J,g as ie$1,aK as ne$1,q as Sg,D as Df,ad as Rs,a8 as Ae,aL as fe$1,ae as hw,af as Wn,aM as FM,$ as $a,t as t_,b as bf,d as dT,m as mb,f as fT,r as IT,K as lc,aN as _v,L as oS,_ as _T,aO as Tv,O as sS,I as Iv,j as gT,k as mT,aP as p_,aQ as h_,au as g_,av as y_,ar as Cv,A as Af,aR as v_,s as ig,v as sg,aS as s_}from'./main-3WVIQAKF.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&($a(0,"p",1),t_(1,"Loading usage settings\u2026"),bf());}function le(e,o){if(e&1){let t=IT();$a(0,"p",2),t_(1,"Could not load usage settings. Please try again."),bf(),$a(2,"button",3),lc("click",function(){ig(t);let s=_T();return sg(s.configuration.retry())}),t_(3,"Retry usage settings"),bf();}}function me(e,o){e&1&&($a(0,"p",1),t_(1,"Usage tracking is disabled."),bf());}function de(e,o){e&1&&($a(0,"p",2),t_(1),bf()),e&2&&(mb(),Iv(o));}function ce(e,o){e&1&&($a(0,"p",1),t_(1,"Loading usage\u2026"),bf());}function pe(e,o){e&1&&($a(0,"p"),t_(1,"No recorded usage for this period."),bf());}function ge(e,o){if(e&1&&($a(0,"small"),t_(1),bf()),e&2){let t=_T().$implicit;mb(),Af("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&($a(0,"tr")(1,"th",10),t_(2),bf(),$a(3,"td"),t_(4),g_(5,"number"),bf(),$a(6,"td"),t_(7),g_(8,"number"),g_(9,"number"),bf(),$a(10,"td"),t_(11),g_(12,"number"),g_(13,"number"),bf(),$a(14,"td"),t_(15),g_(16,"agentosCost"),dT(17,ge,2,1,"small"),bf()()),e&2){let t=o.$implicit;mb(2),Iv(t.key),mb(2),Iv(y_(5,8,t.aggregate.totalTokens)),mb(3),Cv("",y_(8,10,t.aggregate.inputTokens)," / ",y_(9,12,t.aggregate.outputTokens)),mb(4),Cv(" ",y_(12,14,t.aggregate.cacheReadTokens)," / ",y_(13,16,t.aggregate.cacheWriteTokens)," "),mb(4),Af(" ",v_(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),mb(2),fT(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&($a(0,"div",8)(1,"table")(2,"thead")(3,"tr")(4,"th",9),t_(5,"Name"),bf(),$a(6,"th",9),t_(7,"Tokens"),bf(),$a(8,"th",9),t_(9,"Input / output"),bf(),$a(10,"th",9),t_(11,"Cache read / write"),bf(),$a(12,"th",9),t_(13,"Estimated cost"),bf()()(),$a(14,"tbody"),gT(15,ue,18,21,"tr",null,re),bf()()()),e&2){let t=_T().$implicit;mb(15),mT(t.rows);}}function Ce(e,o){if(e&1&&($a(0,"h2"),t_(1),bf(),dT(2,pe,2,0,"p")(3,_e,17,0,"div",8)),e&2){let t=o.$implicit;mb(),Iv(t.title),mb(),fT(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(gT(0,Ce,4,2,null,null,oe),$a(2,"p"),t_(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),bf()),e&2){let t=_T(2);mT(p_(4,ae,h_(0,ne,t.agents()),h_(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=IT();$a(0,"p"),t_(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),bf(),$a(2,"form",4),lc("ngSubmit",function(){ig(t);let s=_T();return sg(s.load())}),$a(3,"label"),t_(4,"From (UTC)"),$a(5,"input",5),_v("ngModelChange",function(s){ig(t);let d=_T();return s_(d.from,s)||(d.from=s),sg(s)}),bf(),oS(),bf(),$a(6,"label"),t_(7,"To (UTC)"),$a(8,"input",6),_v("ngModelChange",function(s){ig(t);let d=_T();return s_(d.to,s)||(d.to=s),sg(s)}),bf(),oS(),bf(),$a(9,"button",7),t_(10,"Refresh"),bf()(),dT(11,de,2,1,"p",2),dT(12,ce,2,0,"p",1)(13,fe,4,7);}if(e&2){let t,r=_T();mb(5),Tv("ngModel",r.from),sS(),mb(3),Tv("ngModel",r.to),sS(),mb(3),fT((t=r.error())?11:-1,t),mb(),fT(r.loading()?12:r.error()?-1:13);}}var te=class e{route=p($t);api=p(J);configuration=p(f);namespaceId=this.route.snapshot.params.namespaceId;agents=ie$1([]);models=ie$1([]);error=ie$1(null);loading=ie$1(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ne$1;constructor(){Sg(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Rs(void 0),Ae(()=>{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),fe$1):(this.loading.set(true),hw({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(Wn(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."),fe$1))))})).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=Df({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&&($a(0,"section",0)(1,"h1"),t_(2,"Usage and costs"),bf(),dT(3,se,2,0,"p",1)(4,le,4,0)(5,me,2,0,"p",1)(6,ye,14,4),bf()),t&2&&(mb(3),fT(r.configuration.state()==="loading"?3:r.configuration.state()==="error"?4:r.configuration.state()==="disabled"?5:6));},dependencies:[Yn,zn,Ye,Ln,Wn$1,ft,ln,rn,FM,m],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{te as NamespaceUsageComponent};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-CNj1cQTl.js';import {$ as $$1,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,b as pn,V as Vn}from'./chunk-BN5SgIBg.js';import {p,y as $t,o as It,M as Me$1,a9 as $,aa as Oe$1,ab as Ee$1,g as ie,ac as Ve$1,a2 as F,ad as Rs,h as Si,ae as hw,U,af as Wn,J as x,H as w,D as Df,a3 as _,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,A as Af,f as fT,r as IT,u as uc,L as oS,j as gT,_ as _T,N as tv,w as gv,O as sS,k as mT,I as Iv,s as ig,v as sg,X as Xm}from'./main-3WVIQAKF.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&($a(0,"p",5),t_(1,"Loading\u2026"),bf());}function ue(n,t){n&1&&($a(0,"span",12),t_(1," Name is required. "),bf());}function fe(n,t){if(n&1&&($a(0,"p",42),t_(1),bf(),$a(2,"span",13),t_(3,"Agent Config cannot be changed after creation."),bf()),n&2){let e=_T(2);mb(),Iv(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&($a(0,"a",43),t_(1,"Add an agent config"),bf(),t_(2," first. ")),n&2){let e=_T(3);tv("href","/agentos/"+e.namespaceId+"/agent-configs/new",Xm);}}function he(n,t){if(n&1&&($a(0,"p",13),t_(1," No agent configs available in this scope yet. "),dT(2,_e,3,1),bf()),n&2){let e=_T(2);mb(2),fT(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.id),mb(),Iv(e.name);}}function Ce(n,t){n&1&&($a(0,"span",12),t_(1,"Agent Config is required."),bf());}function ve(n,t){if(n&1&&($a(0,"select",44)(1,"option",45),t_(2,"Select an agent config\u2026"),bf(),gT(3,ge,2,2,"option",23,me),bf(),oS(),dT(5,Ce,2,0,"span",12),$a(6,"span",13),t_(7,"Immutable after creation."),bf()),n&2){let e=_T(2);tv("formControl",e.agentConfigIdControl),sS(),mb(3),mT(e.availableAgentConfigs()),mb(2),fT(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&($a(0,"span",12),t_(1,"Opening message is required."),bf());}function ye(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function be(n,t){if(n&1){let e=IT();$a(0,"label",48)(1,"input",49),lc("change",function(){let g=ig(e).$implicit,v=_T(3);return sg(v.toggleDay(g.value))}),bf(),$a(2,"span",50),t_(3),bf()();}if(n&2){let e=t.$implicit,d=_T(3);mb(),tv("checked",d.isDaySelected(e.value)),mb(2),Iv(e.label);}}function Se(n,t){if(n&1&&($a(0,"div",8)(1,"span",46),t_(2,"Days of week"),bf(),$a(3,"div",47),gT(4,be,4,2,"label",48,A),bf(),$a(6,"span",13),t_(7,"Leave empty to run every day of the week."),bf()()),n&2){let e=_T(2);mb(4),mT(e.dayOptions);}}function Ee(n,t){n&1&&($a(0,"span",12),t_(1,"Valid time is required (HH:mm)."),bf());}function Pe(n,t){n&1&&($a(0,"span",12),t_(1,"Start date is required."),bf());}function Me(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function Oe(n,t){n&1&&($a(0,"span",12),t_(1,"End date is required."),bf());}function De(n,t){if(n&1&&($a(0,"div",8)(1,"label",51),t_(2," End date "),$a(3,"span",10),t_(4,"*"),bf()(),uc(5,"input",52),oS(),dT(6,Oe,2,0,"span",12),bf()),n&2){let e=_T(2);mb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),tv("formControl",e.endDateControl),sS(),mb(),fT(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&($a(0,"span",12),t_(1,"Must be at least 1."),bf());}function we(n,t){if(n&1&&($a(0,"div",8)(1,"label",53),t_(2," Number of occurrences "),$a(3,"span",10),t_(4,"*"),bf()(),uc(5,"input",54),oS(),dT(6,Te,2,0,"span",12),bf()),n&2){let e=_T(2);mb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),tv("formControl",e.occurrenceCountControl),sS(),mb(),fT(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&($a(0,"span",12),t_(1,"Invalid JSON."),bf());}function Ne(n,t){if(n&1&&($a(0,"p",38),t_(1),bf()),n&2){let e=_T(2);mb(),Iv(e.errorMessage());}}function Fe(n,t){if(n&1){let e=IT();$a(0,"form",7),lc("ngSubmit",function(){ig(e);let g=_T();return sg(g.submit())}),$a(1,"div",8)(2,"label",9),t_(3," Name "),$a(4,"span",10),t_(5,"*"),bf()(),uc(6,"input",11),oS(),dT(7,ue,2,0,"span",12),$a(8,"span",13),t_(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),bf()(),$a(10,"div",8)(11,"label",14),t_(12,"Description"),bf(),uc(13,"input",15),oS(),bf(),$a(14,"div",8)(15,"label",16),t_(16," Agent Config "),$a(17,"span",10),t_(18,"*"),bf()(),dT(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),bf(),$a(22,"div",8)(23,"label",17),t_(24," Opening message "),$a(25,"span",10),t_(26,"*"),bf()(),uc(27,"textarea",18),oS(),dT(28,xe,2,0,"span",12),$a(29,"span",13),t_(30," The message sent to the agent when the scheduled prompt fires. "),bf()(),$a(31,"fieldset",19)(32,"legend",20),t_(33,"Recurrence"),bf(),$a(34,"div",8)(35,"label",21),t_(36," Unit "),$a(37,"span",10),t_(38,"*"),bf()(),$a(39,"select",22),gT(40,ye,2,2,"option",23,A),bf(),oS(),bf(),dT(42,Se,8,0,"div",8),$a(43,"div",8)(44,"label",24),t_(45," Time (UTC) "),$a(46,"span",10),t_(47,"*"),bf()(),$a(48,"div",25),uc(49,"input",26),oS(),$a(50,"span",27),t_(51,"UTC"),bf()(),dT(52,Ee,2,0,"span",12),bf()(),$a(53,"fieldset",19)(54,"legend",20),t_(55,"Planning"),bf(),$a(56,"div",8)(57,"label",28),t_(58," Start date "),$a(59,"span",10),t_(60,"*"),bf()(),uc(61,"input",29),oS(),dT(62,Pe,2,0,"span",12),bf(),$a(63,"div",8)(64,"label",30),t_(65," Ends "),$a(66,"span",10),t_(67,"*"),bf()(),$a(68,"select",31),gT(69,Me,2,2,"option",23,A),bf(),oS(),bf(),dT(71,De,7,4,"div",8),dT(72,we,7,4,"div",8),bf(),$a(73,"div",8)(74,"label",32),uc(75,"input",33),oS(),$a(76,"span",34),t_(77,"Enabled"),bf()(),$a(78,"p",35),t_(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),bf()(),$a(80,"div",8)(81,"label",36),t_(82,"External Metadata"),bf(),uc(83,"textarea",37),oS(),dT(84,ke,2,0,"span",12),$a(85,"span",13),t_(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),bf()(),dT(87,Ne,2,1,"p",38),$a(88,"div",39)(89,"button",40),t_(90),bf(),$a(91,"button",41),lc("click",function(){ig(e);let g=_T();return sg(g.cancel())}),t_(92,"Cancel"),bf()()();}if(n&2){let e=_T();tv("formGroup",e.form),mb(6),gv("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),tv("formControl",e.nameControl),sS(),mb(),fT(e.nameControl.invalid&&e.nameControl.touched?7:-1),mb(6),tv("formControl",e.descriptionControl),sS(),mb(6),fT(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),mb(8),gv("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),tv("formControl",e.promptContentControl),sS(),mb(),fT(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),mb(11),tv("formControl",e.unitControl),sS(),mb(),mT(e.schedulerUnits),mb(2),fT(e.showDayFilter()?42:-1),mb(7),tv("formControl",e.timeUtcControl),sS(),mb(3),fT(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),mb(9),gv("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),tv("formControl",e.startDateControl),sS(),mb(),fT(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),mb(6),tv("formControl",e.endTypeControl),sS(),mb(),mT(e.endTypes),mb(2),fT(e.showEndDate()?71:-1),mb(),fT(e.showOccurrenceCount()?72:-1),mb(3),tv("formControl",e.enabledControl),sS(),mb(8),tv("formControl",e.externalMetadataJsonControl),sS(),mb(),fT(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),mb(3),fT(e.errorMessage()?87:-1),mb(2),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=p($t);router=p(It);destroyRef=p(Me$1);state=p(c);agentConfigController=p($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve$1.required]}),description:new vt(null),agentConfigId:new vt("",{nonNullable:true,validators:[ve$1.required]}),promptContent:new vt("",{nonNullable:true,validators:[ve$1.required]}),unit:new vt(Ee$1.WEEK,{nonNullable:true,validators:[ve$1.required]}),days:new vt([],{nonNullable:true}),timeUtc:new vt("09:00",{nonNullable:true,validators:[ve$1.required,ve$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new vt("",{nonNullable:true,validators:[ve$1.required]}),endType:new vt(Oe$1.NEVER,{nonNullable:true,validators:[ve$1.required]}),endDate:new vt(null),occurrenceCount:new vt(null),enabled:new vt(true,{nonNullable:true}),externalMetadataJson:new vt("",{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=ie(false);isSubmitting=ie(false);isLoading=ie(false);errorMessage=ie(null);SchedulerUnit=Ee$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ee$1.WEEK,label:"Week(s)"},{value:Ee$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(this.unitControl.valueChanges.pipe(Rs(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Rs(this.endTypeControl.value)));showDayFilter=Si(()=>this.unitSignal()===Ee$1.WEEK);showEndDate=Si(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=Si(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=ie([]);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),hw({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(Wn(()=>_([])))}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=Df({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&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return d.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5),bf(),$a(6,"h1",4),t_(7),bf()(),dT(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),bf()),e&2&&(mb(5),Af(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),mb(2),Af(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),mb(),fT(d.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn$1,qt,pn,Vn],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 +0,0 @@
1
- import {f,l,$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,d as dn,L as Ln,W as Wn,q as qt,b as pn,V as Vn}from'./chunk-BN5SgIBg.js';import {p,y as $t,o as It,G,M as Me,h as Si,g as ie$1,q as Sg,U,H as w,J as x,D as Df,$ as $a,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,r as IT,K as lc,u as uc,L as oS,_ as _T,N as tv,O as sS,e as cc,A as Af,s as ig,v as sg}from'./main-3WVIQAKF.js';var W=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function Y(r){return W.test(r)}function J(r=()=>true){return t=>{let e=(t.value??"").trim();return !r()||e===""||Y(e)?null:{absolutePath:true}}}function ee(r,t){r&1&&($a(0,"p",3),t_(1,"Loading\u2026"),bf());}function te(r,t){r&1&&t_(0," Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location. ");}function ne(r,t){r&1&&t_(0," Only a super-admin can change this folder. ");}function oe(r,t){r&1&&($a(0,"span",21),t_(1," Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty. "),bf());}function ae(r,t){r&1&&($a(0,"span",28),t_(1," Enter a whole number of at least 1, or leave the field empty. "),bf());}function re(r,t){if(r&1){let e=IT();$a(0,"form",5),lc("ngSubmit",function(){ig(e);let f=_T();return sg(f.submit())}),$a(1,"div",6)(2,"label",7),t_(3,"Name "),$a(4,"span",8),t_(5,"*"),bf()(),uc(6,"input",9),oS(),bf(),$a(7,"div",6)(8,"label",10),t_(9,"Description"),bf(),uc(10,"textarea",11),oS(),bf(),$a(11,"div",6)(12,"label",12),t_(13,"External ID"),bf(),uc(14,"input",13),oS(),bf(),$a(15,"div",6)(16,"label",14),t_(17,"Default agent"),bf(),uc(18,"input",15),oS(),bf(),$a(19,"div",6)(20,"label",16),t_(21,"Config path"),bf(),uc(22,"input",17),oS(),bf(),$a(23,"div",6)(24,"label",18),t_(25,"Shared files folder"),bf(),uc(26,"input",19),oS(),$a(27,"span",20),dT(28,te,1,0)(29,ne,1,0),bf(),dT(30,oe,2,0,"span",21),bf(),$a(31,"div",6)(32,"label",22),t_(33,"Run cost threshold"),bf(),uc(34,"input",23),oS(),$a(35,"span",24),t_(36),bf()(),$a(37,"div",6)(38,"label",25),t_(39,"Maximum tool rounds"),bf(),$a(40,"input",26),lc("input",function(f){ig(e);let Q=_T();return sg(Q.onMaxToolRoundsInput(f))}),bf(),oS(),$a(41,"span",27),t_(42," Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run. "),bf(),dT(43,ae,2,0,"span",28),bf(),$a(44,"div",29)(45,"button",30),t_(46),bf(),$a(47,"button",31),lc("click",function(){ig(e);let f=_T();return sg(f.cancel())}),t_(48,"Cancel"),bf()()();}if(r&2){let e=_T();tv("formGroup",e.form),mb(6),tv("formControl",e.nameControl),sS(),mb(4),tv("formControl",e.descriptionControl),sS(),mb(4),tv("formControl",e.externalIdControl),sS(),mb(4),tv("formControl",e.defaultAgentNameControl),sS(),mb(4),tv("formControl",e.configPathControl),sS(),mb(4),tv("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cc("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),sS(),mb(2),fT(e.canEditSharedExchangePath()?28:29),mb(2),fT(e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?30:-1),mb(4),tv("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),sS(),mb(2),Iv(e.runCostThresholdHint()),mb(4),tv("formControl",e.maxToolRoundsControl),cc("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),sS(),mb(3),fT(e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?43:-1),mb(2),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ie=1,le=2147483647,K=class r{route=p($t);router=p(It);namespaceController=p(G);destroyRef=p(Me);usageConfiguration=p(f);userState=p(l);canEditSharedExchangePath=Si(()=>this.userState.currentUser()?.isAdmin===true);runCostThresholdPlaceholder=Si(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=Si(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt("",{nonNullable:true}),configPath:new vt("",{nonNullable:true}),sharedExchangePath:new vt("",{nonNullable:true,validators:[J(()=>this.canEditSharedExchangePath())]}),externalId:new vt("",{nonNullable:true}),defaultAgentName:new vt("",{nonNullable:true}),runCostThreshold:new vt(null),maxToolRounds:new vt(null,{validators:[ve.min(ie),ve.max(le),ve.pattern(/^\d+$/)]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}maxToolRoundsUnparsable=ie$1(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=ie$1(false);isSubmitting=ie$1(false);isLoading=ie$1(false);existingNamespace=null;constructor(){Sg(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Df({type:r,selectors:[["agentos-namespace-form"]],decls:6,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","rows","4","placeholder","Optional description",1,"namespace-form__textarea",3,"formControl"],["for","ns-external-id",1,"namespace-form__label"],["id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-default-agent",1,"namespace-form__label"],["id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-shared-exchange-path",1,"namespace-form__label"],["id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",1,"namespace-form__input",3,"readOnly","formControl"],["id","ns-shared-exchange-path-hint",1,"namespace-form__hint"],["id","ns-shared-exchange-path-error","role","alert",1,"namespace-form__error"],["for","ns-run-cost-threshold",1,"namespace-form__label"],["id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",1,"namespace-form__input",3,"placeholder","formControl"],["id","ns-run-cost-threshold-hint",1,"namespace-form__hint"],["for","ns-max-tool-rounds",1,"namespace-form__label"],["id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",1,"namespace-form__input",3,"input","formControl"],["id","ns-max-tool-rounds-hint",1,"namespace-form__hint"],["id","ns-max-tool-rounds-error","role","alert",1,"namespace-form__error"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,h){e&1&&($a(0,"div",0)(1,"header",1)(2,"h1",2),t_(3),bf()(),dT(4,ee,2,0,"p",3)(5,re,49,19,"form",4),bf()),e&2&&(mb(3),Iv(h.isEditMode()?"Edit namespace":"New namespace"),mb(),fT(h.isLoading()?4:5));},dependencies:[Kn,zn,Ye,dn,Ln,Wn,qt,pn,Vn],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-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-accent)}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.namespace-form__input[_ngcontent-%COMP%], .namespace-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus, .namespace-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.namespace-form__input[_ngcontent-%COMP%]::placeholder, .namespace-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.namespace-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:96px;line-height:1.5}.namespace-form__hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.namespace-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #dc2626)}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{K as NamespaceFormComponent};
@@ -1 +0,0 @@
1
- import {$,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,t as Lt,b as pn,V as Vn,y as yn}from'./chunk-BN5SgIBg.js';import {p,y as $t,o as It,M as Me,ap as N,aj as k,a2 as F,af as Wn,aq as Re,h as Si,g as ie,q as Sg,U,J as x,H as w,D as Df,a3 as _,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,r as IT,u as uc,L as oS,j as gT,a5 as pT,_ as _T,N as tv,O as sS,k as mT,A as Af,a4 as uT,ar as Cv,s as ig,v as sg}from'./main-3WVIQAKF.js';function ce(l,t){l&1&&($a(0,"p",5),t_(1,"Loading\u2026"),bf());}function se(l,t){if(l&1&&uc(0,"input",11),l&2){let e=_T(2);tv("value",e.selectedProviderLabel());}}function pe(l,t){if(l&1&&($a(0,"option",52),t_(1),bf()),l&2){let e=t.$implicit;tv("value",e.id),mb(),Cv("",e.name," (",e.apiType,")");}}function ue(l,t){if(l&1&&($a(0,"select",12)(1,"option",51),t_(2,"Select provider"),bf(),gT(3,pe,2,3,"option",52,uT().trackByProvider,true),bf(),oS()),l&2){let e=_T(2);tv("formControl",e.aiProviderIdControl),sS(),mb(3),mT(e.providers());}}function fe(l,t){if(l&1&&($a(0,"option",30),t_(1),bf()),l&2){let e=t.$implicit;tv("ngValue",e),mb(),Iv(e.toLowerCase());}}function _e(l,t){l&1&&($a(0,"span",31),t_(1,"Not supported yet for Anthropic and Gemini providers."),bf());}function ge(l,t){l&1&&($a(0,"span",31),t_(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),bf());}function Ce(l,t){l&1&&($a(0,"span",32),t_(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),bf());}function ve(l,t){if(l&1){let e=IT();$a(0,"form",7),lc("ngSubmit",function(){ig(e);let u=_T();return sg(u.submit())}),$a(1,"div",8)(2,"label",9),t_(3," Provider "),$a(4,"span",10),t_(5,"*"),bf()(),dT(6,se,1,1,"input",11)(7,ue,5,1,"select",12),bf(),$a(8,"div",8)(9,"label",13),t_(10," API name "),$a(11,"span",10),t_(12,"*"),bf()(),uc(13,"input",14),oS(),bf(),$a(14,"div",8)(15,"label",15),t_(16,"Description"),bf(),uc(17,"input",16),oS(),bf(),$a(18,"div",8)(19,"label",17),t_(20,"Alias"),bf(),uc(21,"input",18),oS(),bf(),$a(22,"div",8)(23,"label",19),t_(24,"Priority"),bf(),uc(25,"input",20),oS(),bf(),$a(26,"div",21)(27,"div",8)(28,"label",22),t_(29,"Temperature"),bf(),uc(30,"input",23),oS(),bf(),$a(31,"div",8)(32,"label",24),t_(33,"Context window"),bf(),uc(34,"input",25),oS(),bf()(),$a(35,"div",8)(36,"label",26),t_(37,"Max completion tokens"),bf(),uc(38,"input",27),oS(),bf(),$a(39,"div",8)(40,"label",28),t_(41,"Reasoning effort"),bf(),$a(42,"select",29)(43,"option",30),t_(44,"Provider default"),bf(),gT(45,fe,2,2,"option",30,pT),bf(),oS(),dT(47,_e,2,0,"span",31)(48,ge,2,0,"span",31),dT(49,Ce,2,0,"span",32),bf(),$a(50,"div",8)(51,"label",33),uc(52,"input",34),oS(),$a(53,"span",35),t_(54,"Supports advanced execution"),bf()(),$a(55,"p",36),t_(56," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),bf()(),$a(57,"fieldset",37)(58,"legend",38),t_(59," Pricing "),$a(60,"span",39),t_(61,"(per million tokens \u2014 leave blank to skip cost monitoring)"),bf()(),$a(62,"div",21)(63,"div",8)(64,"label",40),t_(65,"Input"),bf(),uc(66,"input",41),oS(),bf(),$a(67,"div",8)(68,"label",42),t_(69,"Output"),bf(),uc(70,"input",43),oS(),bf()(),$a(71,"div",21)(72,"div",8)(73,"label",44),t_(74,"Cache write"),bf(),uc(75,"input",45),oS(),bf(),$a(76,"div",8)(77,"label",46),t_(78,"Cache read"),bf(),uc(79,"input",47),oS(),bf()()(),$a(80,"div",48)(81,"button",49),t_(82),bf(),$a(83,"button",50),lc("click",function(){ig(e);let u=_T();return sg(u.cancel())}),t_(84,"Cancel"),bf()()();}if(l&2){let e=_T();tv("formGroup",e.form),mb(6),fT(e.isEditMode()?6:7),mb(7),tv("formControl",e.apiModelNameControl),sS(),mb(4),tv("formControl",e.descriptionControl),sS(),mb(4),tv("formControl",e.aliasControl),sS(),mb(4),tv("formControl",e.priorityControl),sS(),mb(5),tv("formControl",e.temperatureControl),sS(),mb(4),tv("formControl",e.contextWindowControl),sS(),mb(4),tv("formControl",e.maxCompletionTokensControl),sS(),mb(4),tv("formControl",e.reasoningEffortControl),sS(),mb(),tv("ngValue",null),mb(2),mT(e.reasoningEffortOptions),mb(2),fT(e.reasoningEffortUnsupported()?47:48),mb(2),fT(e.temperatureMayConflictWithEffort()?49:-1),mb(3),tv("formControl",e.supportsAdvancedExecutionControl),sS(),mb(5),tv("formGroup",e.pricingGroup),mb(9),sS(),mb(4),sS(),mb(5),sS(),mb(4),sS(),mb(2),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create"," ");}}var he=["Anthropic","Gemini"],me=class l{route=p($t);router=p(It);destroyRef=p(Me);aiModelController=p(N);aiProviderController=p(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(Wn(()=>_([]))),{initialValue:[]});form=new $({aiProviderId:new vt("",{nonNullable:true,validators:[ve$1.required]}),apiModelName:new vt("",{nonNullable:true,validators:[ve$1.required,ve$1.minLength(1)]}),description:new vt(null),alias:new vt("",{nonNullable:true}),priority:new vt(0,{nonNullable:true}),temperature:new vt(null),contextWindow:new vt(null),maxCompletionTokens:new vt(null),reasoningEffort:new vt(null),supportsAdvancedExecution:new vt(false,{nonNullable:true}),pricing:new $({inputMTokens:new vt(null),outputMTokens:new vt(null),cacheWrite:new vt(null),cacheRead:new vt(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Re);selectedProviderId=F(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=Si(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&he.includes(t)});temperatureValue=F(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=Si(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);selectedProviderLabel=Si(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(p=>p.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Sg(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,O=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",O):this.aiModelController.createAiModel(O)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=Df({type:l,selectors:[["agentos-ai-model-form"]],decls:10,vars:2,consts:[[1,"ai-model-form"],[1,"ai-model-form__header"],["type","button","title","Back to AI models",1,"ai-model-form__back",3,"click"],[1,"ai-model-form__back-icon"],[1,"ai-model-form__title"],[1,"ai-model-form__loading"],[1,"ai-model-form__form",3,"formGroup"],[1,"ai-model-form__form",3,"ngSubmit","formGroup"],[1,"ai-model-form__field"],["for","model-provider",1,"ai-model-form__label"],["aria-hidden","true"],["id","model-provider","type","text","readonly","","tabindex","-1",1,"ai-model-form__input","ai-model-form__input--readonly",3,"value"],["id","model-provider",1,"ai-model-form__select",3,"formControl"],["for","model-api-name",1,"ai-model-form__label"],["id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",1,"ai-model-form__input","ai-model-form__input--mono",3,"formControl"],["for","model-description",1,"ai-model-form__label"],["id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-alias",1,"ai-model-form__label"],["id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-priority",1,"ai-model-form__label"],["id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__row"],["for","model-temperature",1,"ai-model-form__label"],["id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",1,"ai-model-form__input",3,"formControl"],["for","model-context-window",1,"ai-model-form__label"],["id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",1,"ai-model-form__input",3,"formControl"],["for","model-max-completion-tokens",1,"ai-model-form__label"],["id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",1,"ai-model-form__input",3,"formControl"],["for","model-reasoning-effort",1,"ai-model-form__label"],["id","model-reasoning-effort",1,"ai-model-form__select",3,"formControl"],[3,"ngValue"],[1,"ai-model-form__hint"],[1,"ai-model-form__hint","ai-model-form__hint--warning"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],[1,"ai-model-form__section",3,"formGroup"],[1,"ai-model-form__section-title"],[1,"ai-model-form__section-hint"],["for","pricing-input",1,"ai-model-form__label"],["id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens",1,"ai-model-form__input"],["for","pricing-output",1,"ai-model-form__label"],["id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens",1,"ai-model-form__input"],["for","pricing-cache-write",1,"ai-model-form__label"],["id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite",1,"ai-model-form__input"],["for","pricing-cache-read",1,"ai-model-form__label"],["id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead",1,"ai-model-form__input"],[1,"ai-model-form__actions"],["type","submit",1,"ai-model-form__btn","ai-model-form__btn--primary",3,"disabled"],["type","button",1,"ai-model-form__btn",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,p){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return p.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," AI models "),bf(),$a(6,"h1",4),t_(7),bf()(),dT(8,ce,2,0,"p",5)(9,ve,85,17,"form",6),bf()),e&2&&(mb(7),Iv(p.isEditMode()?"Edit AI model":"New AI model"),mb(),fT(p.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn$1,qt,Lt,pn,Vn,yn],styles:[".ai-model-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-model-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-model-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-accent)}.ai-model-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-model-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-model-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-model-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-model-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-model-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.ai-model-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-model-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-model-form__input[_ngcontent-%COMP%], .ai-model-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-model-form__input[_ngcontent-%COMP%]:focus, .ai-model-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-model-form__input[_ngcontent-%COMP%]::placeholder, .ai-model-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-model-form__input--mono[_ngcontent-%COMP%]{font-family:monospace}.ai-model-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.ai-model-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.ai-model-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.ai-model-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.ai-model-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:1rem}.ai-model-form__section-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);padding:0 .25rem}.ai-model-form__section-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);font-size:.8125rem}.ai-model-form__hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.8125rem}.ai-model-form__hint--warning[_ngcontent-%COMP%]{color:var(--color-warning)}.ai-model-form__input--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);cursor:default;background:var(--color-surface-muted, rgba(0, 0, 0, .03))}.ai-model-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-model-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-model-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-model-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-model-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-model-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{me as AiModelFormComponent};
@@ -1 +0,0 @@
1
- import {l,$,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,L as Ln,W as Wn,V as Vn,y as yn}from'./chunk-BN5SgIBg.js';import {p,M as Me,y as $t,G,g as ie$1,U,D as Df,V as Ae,Y as Le,Z as R,a0 as Er,$ as $a,t as t_,b as bf,d as dT,K as lc,u as uc,L as oS,m as mb,f as fT,N as tv,O as sS,_ as _T,A as Af,r as IT,I as Iv,w as gv,s as ig,v as sg,j as gT,k as mT}from'./main-3WVIQAKF.js';var h=class e{api=p(Ae);isLoading=ie$1(false);result=ie$1(null);errorMessage=ie$1(null);invoke(t,o,a,s){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:o||void 0,toolName:a,payload:s||void 0}).pipe(Le({next:f=>{this.result.set(f),this.isLoading.set(false);},error:f=>{this.errorMessage.set(ee(f)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(o){return new(o||e)};static \u0275prov=R({token:e,factory:e.\u0275fac,providedIn:"root"})};function ee(e){if(e instanceof Er){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var te=(e,t)=>t.id;function oe(e,t){e&1&&t_(0," Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins. ");}function ne(e,t){e&1&&t_(0," Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline. ");}function ie(e,t){e&1&&($a(0,"p",14),t_(1,"Loading namespaces\u2026"),bf());}function re(e,t){if(e&1&&($a(0,"option",24),t_(1),bf()),e&2){let o=t.$implicit;tv("value",o.id),mb(),Iv(o.name);}}function ae(e,t){if(e&1&&($a(0,"select",22)(1,"option",23),t_(2,"Select a namespace"),bf(),gT(3,re,2,2,"option",24,te),bf(),oS()),e&2){let o=_T(2);sS(),mb(3),mT(o.namespaces());}}function le(e,t){if(e&1&&dT(0,ie,2,0,"p",14)(1,ae,5,0,"select",22),e&2){let o=_T();fT(o.namespacesLoading()?0:1);}}function se(e,t){if(e&1&&($a(0,"p",8),t_(1),bf()),e&2){let o=_T();mb(),Af(" ",o.namespaceName()??o.namespaceId," ");}}function de(e,t){e&1&&t_(0," Running\u2026 ");}function ce(e,t){e&1&&t_(0," Run tool ");}function me(e,t){if(e&1){let o=IT();$a(0,"button",25),lc("click",function(){ig(o);let s=_T();return sg(s.reset())}),t_(1,"Clear result"),bf();}}function pe(e,t){e&1&&($a(0,"section",20)(1,"h2",26),t_(2,"Error"),bf(),$a(3,"pre",27),t_(4),bf()()),e&2&&(mb(4),Iv(t));}function _e(e,t){e&1&&($a(0,"h3",31),t_(1,"Metadata"),bf(),$a(2,"pre",27),t_(3),bf()),e&2&&(mb(3),Iv(t));}function ue(e,t){if(e&1&&($a(0,"dt",33),t_(1,"Type"),bf(),$a(2,"dd",34),t_(3),bf()),e&2){let o=_T(2);mb(3),Iv(o.errorType);}}function fe(e,t){if(e&1&&($a(0,"dt",33),t_(1,"Message"),bf(),$a(2,"dd",35),t_(3),bf()),e&2){let o=_T(2);mb(3),Iv(o.errorMessage);}}function ve(e,t){if(e&1&&($a(0,"h3",31),t_(1,"Tool error details"),bf(),$a(2,"dl",32),dT(3,ue,4,1),dT(4,fe,4,1),bf()),e&2){let o=_T();mb(3),fT(o.errorType?3:-1),mb(),fT(o.errorMessage?4:-1);}}function ge(e,t){if(e&1&&($a(0,"section",28)(1,"header",29)(2,"h2",26),t_(3),bf(),$a(4,"span",30),t_(5),bf()(),$a(6,"h3",31),t_(7,"Output"),bf(),$a(8,"pre",27),t_(9),bf(),dT(10,_e,4,1),$a(11,"h3",31),t_(12,"Structured output"),bf(),$a(13,"pre",27),t_(14),bf(),dT(15,ve,5,2),bf()),e&2){let o,a=t,s=_T();gv("tool-invoke__result--failure",!a.success),mb(3),Af("Result \u2014 ",a.toolName),mb(),gv("tool-invoke__badge--success",a.success)("tool-invoke__badge--failure",!a.success),mb(),Af(" ",a.success?"Success":"Tool error"," "),mb(4),Iv(a.output),mb(),fT((o=s.formatMetadata(a.metadata))?10:-1,o),mb(4),Iv(s.formatStructuredOutput(a.structuredOutput)??"null"),mb(),fT(a.errorType||a.errorMessage?15:-1);}}var X=class e{destroyRef=p(Me);route=p($t);namespaceController=p(G);userState=p(l);state=p(h);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=ie$1([]);namespacesLoading=ie$1(true);namespaceName=ie$1(null);form=new $({namespaceId:new vt("",{nonNullable:true,validators:[ve$1.required]}),userId:new vt("",{nonNullable:true}),toolName:new vt("",{nonNullable:true,validators:[ve$1.required]}),payload:new vt("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:o=>{o.id&&this.form.controls.userId.patchValue(o.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:o=>{this.namespaces.set(o.map(a=>({id:a.id,name:a.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:o=>this.namespaceName.set(o.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:o,toolName:a,payload:s}=this.form.getRawValue();this.state.invoke(t,o.trim()||void 0,a.trim(),s.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Df({type:e,selectors:[["agentos-tool-invoke"]],decls:42,vars:8,consts:[[1,"tool-invoke"],[1,"tool-invoke__header"],[1,"tool-invoke__title"],[1,"tool-invoke__subtitle"],[1,"tool-invoke__form",3,"ngSubmit","formGroup"],[1,"tool-invoke__field"],["for","ti-namespace",1,"tool-invoke__label"],[1,"tool-invoke__required"],["id","ti-namespace",1,"tool-invoke__namespace-static"],["for","ti-user",1,"tool-invoke__label"],[1,"tool-invoke__optional"],["id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off",1,"tool-invoke__input"],["for","ti-tool",1,"tool-invoke__label"],["id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false",1,"tool-invoke__input","tool-invoke__input--mono"],[1,"tool-invoke__hint"],["for","ti-payload",1,"tool-invoke__label"],["id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"}\\nLeave empty for tools with no input.',"spellcheck","false",1,"tool-invoke__textarea","tool-invoke__input--mono"],[1,"tool-invoke__actions"],["type","submit",1,"tool-invoke__submit",3,"disabled"],["type","button",1,"tool-invoke__reset"],[1,"tool-invoke__result","tool-invoke__result--error"],[1,"tool-invoke__result",3,"tool-invoke__result--failure"],["id","ti-namespace","formControlName","namespaceId",1,"tool-invoke__select"],["value","","disabled",""],[3,"value"],["type","button",1,"tool-invoke__reset",3,"click"],[1,"tool-invoke__result-title"],[1,"tool-invoke__output"],[1,"tool-invoke__result"],[1,"tool-invoke__result-header"],[1,"tool-invoke__badge"],[1,"tool-invoke__section-label"],[1,"tool-invoke__dl"],[1,"tool-invoke__dt"],[1,"tool-invoke__dd","tool-invoke__dd--mono"],[1,"tool-invoke__dd"]],template:function(o,a){if(o&1&&($a(0,"div",0)(1,"header",1)(2,"h1",2),t_(3,"Tool invoke"),bf(),$a(4,"p",3),dT(5,oe,1,0)(6,ne,1,0),bf()(),$a(7,"form",4),lc("ngSubmit",function(){return a.submit()}),$a(8,"div",5)(9,"label",6),t_(10,"Namespace "),$a(11,"span",7),t_(12,"*"),bf()(),dT(13,le,2,1)(14,se,2,1,"p",8),bf(),$a(15,"div",5)(16,"label",9),t_(17,"User ID "),$a(18,"span",10),t_(19,"(optional)"),bf()(),uc(20,"input",11),oS(),bf(),$a(21,"div",5)(22,"label",12),t_(23,"Tool name "),$a(24,"span",7),t_(25,"*"),bf()(),uc(26,"input",13),oS(),$a(27,"p",14),t_(28," Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace. "),bf()(),$a(29,"div",5)(30,"label",15),t_(31,"Payload "),$a(32,"span",10),t_(33,"(optional)"),bf()(),uc(34,"textarea",16),oS(),bf(),$a(35,"div",17)(36,"button",18),dT(37,de,1,0)(38,ce,1,0),bf(),dT(39,me,2,0,"button",19),bf()(),dT(40,pe,5,1,"section",20),dT(41,ge,16,12,"section",21),bf()),o&2){let s,f;mb(5),fT(a.isPlatformMode?5:6),mb(2),tv("formGroup",a.form),mb(6),fT(a.isPlatformMode?13:14),mb(7),sS(),mb(6),sS(),mb(8),sS(),mb(2),tv("disabled",a.form.invalid||a.state.isLoading()),mb(),fT(a.state.isLoading()?37:38),mb(2),fT(a.state.result()||a.state.errorMessage()?39:-1),mb(),fT((s=a.state.errorMessage())?40:-1,s),mb(),fT((f=a.state.result())?41:-1,f);}},dependencies:[Kn,zn,Zn,Xn,Ye,bt,Ln,Wn,Vn,yn],styles:[".tool-invoke[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.tool-invoke__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.tool-invoke__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;padding:0;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer;align-self:flex-start}.tool-invoke__back[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.tool-invoke__namespace-static[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface-muted, rgba(0, 0, 0, .04));color:var(--color-text, #1d1d1f);font-size:.9375rem}.tool-invoke__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.tool-invoke__subtitle[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);line-height:1.5}.tool-invoke__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem;padding:1.5rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem}.tool-invoke__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.tool-invoke__required[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);margin-left:.1em}.tool-invoke__optional[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.75rem}.tool-invoke__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.tool-invoke__input[_ngcontent-%COMP%], .tool-invoke__select[_ngcontent-%COMP%], .tool-invoke__textarea[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;transition:border-color .15s ease}.tool-invoke__input[_ngcontent-%COMP%]:focus, .tool-invoke__select[_ngcontent-%COMP%]:focus, .tool-invoke__textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.tool-invoke__input--mono[_ngcontent-%COMP%], .tool-invoke__select--mono[_ngcontent-%COMP%], .tool-invoke__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.tool-invoke__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px}.tool-invoke__select[_ngcontent-%COMP%]{cursor:pointer}.tool-invoke__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;padding-top:.25rem}.tool-invoke__submit[_ngcontent-%COMP%]{padding:.55rem 1.25rem;border-radius:8px;border:none;background:var(--color-primary, #007aff);color:#fff;font-size:.9375rem;font-weight:500;font-family:inherit;cursor:pointer;transition:opacity .15s ease}.tool-invoke__submit[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.tool-invoke__submit[_ngcontent-%COMP%]:not(:disabled):hover{opacity:.88}.tool-invoke__reset[_ngcontent-%COMP%]{padding:.55rem 1rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer}.tool-invoke__reset[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.tool-invoke__result[_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:12px}.tool-invoke__result--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30);background:var(--color-error-bg, #fff5f5)}.tool-invoke__result--failure[_ngcontent-%COMP%]{border-color:var(--color-warning, #ff9500);background:var(--color-warning-bg, #fffaf0)}.tool-invoke__result-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.tool-invoke__result-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.tool-invoke__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500}.tool-invoke__badge--success[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.tool-invoke__badge--failure[_ngcontent-%COMP%]{background:var(--color-warning-bg, #fff3cd);color:var(--color-warning, #ff9500)}.tool-invoke__section-label[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);text-transform:uppercase;letter-spacing:.04em}.tool-invoke__output[_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:monospace;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:500px;overflow-y:auto}.tool-invoke__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.4rem 1rem;margin:0}.tool-invoke__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:start}.tool-invoke__dd[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text, #1d1d1f);word-break:break-word}.tool-invoke__dd--mono[_ngcontent-%COMP%]{font-family:monospace}"]})};export{X as ToolInvokeComponent};
@@ -1,2 +0,0 @@
1
- import {v}from'./chunk-giF-MCzQ.js';import {R,q,J}from'./chunk-Cw7AdCyF.js';import {p,y as $t,o as It,M as Me,g as ie,a2 as F,h as Si,q as Sg,U,J as x,H as w,D as Df,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,r as IT,j as gT,a5 as pT,L as oS,u as uc,_ as _T,N as tv,O as sS,k as mT,A as Af,a4 as uT,s as ig,v as sg,z as zT,e as cc}from'./main-3WVIQAKF.js';import {v as vt,a as ve,$,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-BN5SgIBg.js';import'./chunk-CRkvWY5s.js';function se(i,t){i&1&&($a(0,"p",5),t_(1,"Loading\u2026"),bf());}function ce(i,t){if(i&1&&($a(0,"label",23),uc(1,"input",24),oS(),$a(2,"span"),t_(3),bf()()),i&2){let e=t.$implicit,o=_T(3);mb(),tv("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),sS(),mb(2),Iv(e.label);}}function de(i,t){if(i&1&&($a(0,"fieldset",8)(1,"legend",22),t_(2,"Configuration scope"),bf(),gT(3,ce,4,4,"label",23,uT().trackByScope,true),bf()),i&2){let e=_T(2);tv("disabled",e.isEditMode()),mb(3),mT(e.scopeOptions);}}function ue(i,t){if(i&1&&($a(0,"option",13),t_(1),bf()),i&2){let e=t.$implicit,o=_T(2);tv("value",e),mb(),Iv(o.authTypeLabel[e]);}}function pe(i,t){i&1&&t_(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&($a(0,"span",11),t_(1,"*"),bf());}function me(i,t){if(i&1&&($a(0,"p",28),t_(1),bf()),i&2){let e=_T(2).$implicit;tv("id","as-hint-"+e.key),mb(),Iv(e.hint);}}function ge(i,t){if(i&1&&(uc(0,"input",27),oS(),dT(1,me,2,2,"p",28)),i&2){let e=_T().$implicit;zT("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),tv("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),cc("aria-describedby",e.hint?"as-hint-"+e.key:null),sS(),mb(),fT(e.hint?1:-1);}}function Ce(i,t){if(i&1&&($a(0,"div",9)(1,"label",26),t_(2),dT(3,he,2,0,"span",11),bf(),dT(4,ge,2,9),bf()),i&2){let e,o=t.$implicit,l=_T(3);mb(),tv("for","as-cred-"+o.key),mb(),Af(" ",o.label," "),mb(),fT(o.required?3:-1),mb(),fT((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&($a(0,"fieldset",18)(1,"legend",22),t_(2,"Credentials"),bf(),$a(3,"p",25),t_(4," Values are stored encrypted and masked on read. "),dT(5,pe,1,0),bf(),gT(6,Ce,5,4,"div",9,uT().trackByField,true),bf()),i&2){let e=_T(2);mb(5),fT(e.isEditMode()?5:-1),mb(),mT(e.credentialFields());}}function ye(i,t){if(i&1){let e=IT();$a(0,"form",7),lc("ngSubmit",function(){ig(e);let l=_T();return sg(l.submit())}),dT(1,de,5,1,"fieldset",8),$a(2,"div",9)(3,"label",10),t_(4,"Auth type "),$a(5,"span",11),t_(6,"*"),bf()(),$a(7,"select",12),gT(8,ue,2,2,"option",13,pT),bf(),oS(),bf(),$a(10,"div",9)(11,"label",14),t_(12,"Name "),$a(13,"span",11),t_(14,"*"),bf()(),uc(15,"input",15),oS(),bf(),$a(16,"div",9)(17,"label",16),t_(18,"Description"),bf(),uc(19,"input",17),oS(),bf(),dT(20,fe,8,1,"fieldset",18),$a(21,"div",19)(22,"button",20),t_(23),bf(),$a(24,"button",21),lc("click",function(){ig(e);let l=_T();return sg(l.cancel())}),t_(25,"Cancel"),bf()()();}if(i&2){let e=_T();tv("formGroup",e.form),mb(),fT(e.isPlatformMode?-1:1),mb(6),tv("formControl",e.authTypeControl),sS(),mb(),mT(e.authTypeOptions),mb(7),tv("formControl",e.nameControl),sS(),mb(4),tv("formControl",e.descriptionControl),sS(),mb(),fT(e.credentialFields().length>0?20:-1),mb(2),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?ie(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=Si(()=>Se[this.selectedAuthType()]);isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Sg(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Df({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return o.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," Auth Settings "),bf(),$a(6,"h1",4),t_(7),bf()(),dT(8,se,2,0,"p",5)(9,ye,26,8,"form",6),bf()),e&2&&(mb(7),Iv(o.isEditMode()?"Edit auth setting":"New auth setting"),mb(),fT(o.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
2
- export{le as AuthSettingFormComponent};