@whoz-oss/coday-client 0.0.0-workstream-forge.214 → 0.0.0-workstream-forge.216

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 (50) hide show
  1. package/browser/{chunk-DT_FEpZC.js → chunk-2YrL7HTZ.js} +1 -1
  2. package/browser/{chunk-CMEzRsR0.js → chunk-B5RsrYWK.js} +1 -1
  3. package/browser/{chunk-CS1YyKe0.js → chunk-B6aro_Gm.js} +1 -1
  4. package/browser/{chunk-uQx57zto.js → chunk-B6y4uwI0.js} +1 -1
  5. package/browser/{chunk-BbQlSsRB.js → chunk-BANKlygo.js} +1 -1
  6. package/browser/{chunk-DwdvZY7B.js → chunk-BBbt6kLE.js} +1 -1
  7. package/browser/{chunk-se1vMkpm.js → chunk-BBpQq4Ud.js} +1 -1
  8. package/browser/{chunk-CQN2AE4-.js → chunk-BPzMOcbJ.js} +1 -1
  9. package/browser/{chunk-CHNA5NAs.js → chunk-Bjsa3Q1_.js} +1 -1
  10. package/browser/{chunk-5WV6Pqw3.js → chunk-Btt4voiy.js} +1 -1
  11. package/browser/{chunk-CvBLjGBR.js → chunk-ByR0DUU7.js} +1 -1
  12. package/browser/{chunk-B-oMBbkF.js → chunk-C20Tq5VN.js} +15 -15
  13. package/browser/{chunk-eBosW0S7.js → chunk-C6umsgbZ.js} +1 -1
  14. package/browser/{chunk-By7Q5BoZ.js → chunk-CCU0x4vV.js} +1 -1
  15. package/browser/{chunk-ZLmMI5yx.js → chunk-CIRLs5BO.js} +1 -1
  16. package/browser/{chunk-mdplxTI3.js → chunk-CKz2arFC.js} +1 -1
  17. package/browser/{chunk-CaTZoMsw.js → chunk-CRz_ufIK.js} +1 -1
  18. package/browser/{chunk--JxBmZoL.js → chunk-CS7ZRkxO.js} +1 -1
  19. package/browser/{chunk-C4wYOlfO.js → chunk-CY3YlK6T.js} +1 -1
  20. package/browser/{chunk-BRtYmSVg.js → chunk-C_Avxpfs.js} +1 -1
  21. package/browser/{chunk-C3EiNg2T.js → chunk-C_H_042u.js} +1 -1
  22. package/browser/{chunk-BLqLGSs8.js → chunk-C_Iy_sl5.js} +1 -1
  23. package/browser/{chunk-BJjd4t8d.js → chunk-Cby-Xx9Q.js} +1 -1
  24. package/browser/{chunk-ChnEveTp.js → chunk-Cd2-t2uT.js} +1 -1
  25. package/browser/{chunk-VMR1gw-F.js → chunk-CfQHAGOy.js} +1 -1
  26. package/browser/chunk-CrCRSut7.js +1 -0
  27. package/browser/{chunk-Dpe32Q9r.js → chunk-CsuAvKcl.js} +1 -1
  28. package/browser/{chunk-DFrLxpgW.js → chunk-Cw6z8nOS.js} +1 -1
  29. package/browser/{chunk-0P39FnJT.js → chunk-CzIb1o-P.js} +1 -1
  30. package/browser/{chunk-DP8eWxTy.js → chunk-D-yZAfdg.js} +1 -1
  31. package/browser/{chunk-Br6figCZ.js → chunk-D0OTml7-.js} +1 -1
  32. package/browser/{chunk-CFggH0ii.js → chunk-D7iyozTh.js} +1 -1
  33. package/browser/{chunk-QvXtOSRZ.js → chunk-DJ76MYDz.js} +1 -1
  34. package/browser/{chunk-68HyAsyG.js → chunk-DY0qiEum.js} +1 -1
  35. package/browser/{chunk-BasRXBGz.js → chunk-DeaV_e6t.js} +1 -1
  36. package/browser/{chunk-BxUutyMH.js → chunk-DgOO5ylV.js} +1 -1
  37. package/browser/{chunk-tX4z7IC_.js → chunk-DpVPRmgg.js} +1 -1
  38. package/browser/{chunk-CUCFnjIk.js → chunk-Ds3Ed0sH.js} +1 -1
  39. package/browser/{chunk-C67oHByE.js → chunk-DzRPY88Q.js} +1 -1
  40. package/browser/{chunk-CKLSVj6a.js → chunk-DzpVd3Z4.js} +1 -1
  41. package/browser/{chunk-BuKRDhzj.js → chunk-EewxiDYN.js} +1 -1
  42. package/browser/{chunk-BBMehZmt.js → chunk-TpRPxdzH.js} +1 -1
  43. package/browser/{chunk-Bla7Hubx.js → chunk-U-HGjGAl.js} +1 -1
  44. package/browser/{chunk-IvQ1-5hq.js → chunk-Wxr20zwV.js} +1 -1
  45. package/browser/{chunk-CN8OFpmz.js → chunk-n9xUsBQE.js} +1 -1
  46. package/browser/{chunk-CJl7j-iH.js → chunk-v7C9eeiE.js} +1 -1
  47. package/browser/index.html +1 -1
  48. package/browser/{main-STOFVKFA.js → main-M62523CG.js} +6 -6
  49. package/package.json +1 -1
  50. package/browser/chunk-BzHmQRNM.js +0 -1
@@ -1 +1 @@
1
- import {O as O$1}from'./chunk-VMR1gw-F.js';import {g,F,I as Ie,af as G$1,$ as Cr,U as Ui,a1 as fa,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,k as cg,r as df,s as ff}from'./main-STOFVKFA.js';import {z as k,O as O$2,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-B-oMBbkF.js';import'./chunk-BzHmQRNM.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),NC(1),pl()),t&2){let n=Jw();BE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),NC(1,"Loading integrations\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),NC(1,"No platform integrations defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),NC(1,"No integrations match the current filter."),pl());}function z(t,e){if(t&1){let n=Zw();Ds(0,"button",18),mg("click",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.edit(d))}),NC(1,"Edit"),pl();}if(t&2){let n=Jw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Zw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(n);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(t&2){let n=Jw().$implicit,r=Jw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14)(6,"div",15),Lw(7,z,2,1,"button",16),Lw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Jw(2);BE(2),Og(n.name),BE(2),Og(n.integrationType),BE(3),jw(r.deletion.confirmingId()!==n.id?7:-1),BE(),jw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Type"),pl(),Ds(8,"th",10)(9,"span",11),NC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Hw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Jw();BE(12),Uw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);state=g(O$1);integrationConfigController=g(G$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();configs=Ui([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=yw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),NC(3,"New integration"),pl()(),Lw(4,A,2,1,"p",3),Lw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(BE(),ug("query",r.rowFilter.query()),BE(3),jw(r.deletion.error()?4:-1),BE(),jw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
1
+ import {O as O$1}from'./chunk-CfQHAGOy.js';import {g,F,I as Ie,af as G$1,$ as Cr,U as Ui,a1 as fa,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,k as cg,r as df,s as ff}from'./main-M62523CG.js';import {z as k,O as O$2,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-C20Tq5VN.js';import'./chunk-CrCRSut7.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),NC(1),pl()),t&2){let n=Jw();BE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),NC(1,"Loading integrations\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),NC(1,"No platform integrations defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),NC(1,"No integrations match the current filter."),pl());}function z(t,e){if(t&1){let n=Zw();Ds(0,"button",18),mg("click",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.edit(d))}),NC(1,"Edit"),pl();}if(t&2){let n=Jw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Zw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(n);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(t&2){let n=Jw().$implicit,r=Jw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14)(6,"div",15),Lw(7,z,2,1,"button",16),Lw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Jw(2);BE(2),Og(n.name),BE(2),Og(n.integrationType),BE(3),jw(r.deletion.confirmingId()!==n.id?7:-1),BE(),jw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Type"),pl(),Ds(8,"th",10)(9,"span",11),NC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Hw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Jw();BE(12),Uw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);state=g(O$1);integrationConfigController=g(G$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();configs=Ui([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=yw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),NC(3,"New integration"),pl()(),Lw(4,A,2,1,"p",3),Lw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(BE(),ug("query",r.rowFilter.query()),BE(3),jw(r.deletion.error()?4:-1),BE(),jw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
@@ -1 +1 @@
1
- import {i}from'./chunk-BzHmQRNM.js';import {y}from'./chunk-B-oMBbkF.js';import {g,aE as X,$ as Cr,at as wy,a1 as fa,a2 as da,aa as Tr,ad as ne,aD as $y,M as x,K as w$1,a5 as yd,aF as sn,aG as Ot,aH as an,a6 as x$1}from'./main-STOFVKFA.js';var nt=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],it={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},R="none",w="me",b=2e3,M=15e4,P=3,L={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},k={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function B(i){let t=L[i.authType];return t?x(w$1({},i),{authType:t}):i}function m(i){return U(i)}function f(i){return i.map(U)}function U(i){let t=i;if(typeof t.authType=="string"){let e=k[t.authType];if(e)return x(w$1({},t),{authType:e})}return i}function H(i,t){return t===null?true:i!==void 0&&Date.parse(i)>Date.parse(t)}var I=class i$1{controller=g(X);userState=g(y);refresh$=new Cr(void 0);namespaceId$=new Cr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([t])=>{let e=this.loadPlatformSettings().pipe(da(()=>Tr([])));return t?wy([e,this.loadNamespaceSettings(t).pipe(da(()=>Tr([]))),this.loadUserSettings(t).pipe(da(()=>Tr([]))),this.loadUserSettings("global").pipe(da(()=>Tr([])))]).pipe(ne(([n,o,r,h])=>({platform:n,namespace:o,userOnNs:r,userGlobal:h}))):wy([e,this.loadNamespaceSettings("").pipe(da(()=>Tr([]))),this.loadUserSettings("global").pipe(da(()=>Tr([])))]).pipe(ne(([n,o,r])=>({platform:n,namespace:o,userOnNs:[],userGlobal:r})))}),$y({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?R:t;return this.controller.listAuthSetting(e,w).pipe(ne(n=>f(n)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(R).pipe(ne(t=>f(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ne(e=>f(e))):Tr([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ne(n=>m(n)))}create(t,e,n){let r=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!r)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(n===void 0||n===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!n)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let h=B(x(w$1({},t),{namespaceId:e==="namespace"||e==="userOnNs"?n??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?r:void 0}));return this.controller.createAuthSetting(h).pipe(ne(A=>m(A)),yd(()=>this.refresh()))}update(t,e,n){let o=B(x(w$1({},e),{namespaceId:n.namespaceId,userId:n.userId,authType:n.authType}));return this.controller.updateAuthSetting(t,o).pipe(ne(r=>m(r)),yd(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(yd(()=>this.refresh()))}getConnection(t,e){return this.controller.getConnectionAuthSetting(t,e)}resetCredential(t,e){return this.controller.resetMyCredentialAuthSetting(t,e)}connect(t,e,n,o){return this.getConnection(t,e).pipe(fa(r=>this.controller.connectAuthSetting(t,e).pipe(yd(h=>n(h.authorizationUrl)),fa(()=>this.awaitNewConnection(t,e,r.connected?r.connectedAt??null:null,o)))))}awaitNewConnection(t,e,n,o){let r=0,h=0;return sn(b,b).pipe(fa(()=>this.getConnection(t,e).pipe(da(()=>Tr(null)))),ne(A=>(r++,A?.connected&&H(A.connectedAt,n)?"connected":r*b>=M?"timeout":o()&&++h>=P?"abandoned":null)),Ot(A=>A!==null),an(1))}static \u0275fac=function(e){return new(e||i$1)};static \u0275prov=x$1({token:i$1,factory:i$1.\u0275fac,providedIn:"root"})};export{I,it as i,nt as n};
1
+ import {i}from'./chunk-CrCRSut7.js';import {y}from'./chunk-C20Tq5VN.js';import {g,aE as X,$ as Cr,at as wy,a1 as fa,a2 as da,aa as Tr,ad as ne,aD as $y,M as x,K as w$1,a5 as yd,aF as sn,aG as Ot,aH as an,a6 as x$1}from'./main-M62523CG.js';var nt=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],it={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},R="none",w="me",b=2e3,M=15e4,P=3,L={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},k={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function B(i){let t=L[i.authType];return t?x(w$1({},i),{authType:t}):i}function m(i){return U(i)}function f(i){return i.map(U)}function U(i){let t=i;if(typeof t.authType=="string"){let e=k[t.authType];if(e)return x(w$1({},t),{authType:e})}return i}function H(i,t){return t===null?true:i!==void 0&&Date.parse(i)>Date.parse(t)}var I=class i$1{controller=g(X);userState=g(y);refresh$=new Cr(void 0);namespaceId$=new Cr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([t])=>{let e=this.loadPlatformSettings().pipe(da(()=>Tr([])));return t?wy([e,this.loadNamespaceSettings(t).pipe(da(()=>Tr([]))),this.loadUserSettings(t).pipe(da(()=>Tr([]))),this.loadUserSettings("global").pipe(da(()=>Tr([])))]).pipe(ne(([n,o,r,h])=>({platform:n,namespace:o,userOnNs:r,userGlobal:h}))):wy([e,this.loadNamespaceSettings("").pipe(da(()=>Tr([]))),this.loadUserSettings("global").pipe(da(()=>Tr([])))]).pipe(ne(([n,o,r])=>({platform:n,namespace:o,userOnNs:[],userGlobal:r})))}),$y({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?R:t;return this.controller.listAuthSetting(e,w).pipe(ne(n=>f(n)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(R).pipe(ne(t=>f(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ne(e=>f(e))):Tr([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ne(n=>m(n)))}create(t,e,n){let r=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!r)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(n===void 0||n===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!n)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let h=B(x(w$1({},t),{namespaceId:e==="namespace"||e==="userOnNs"?n??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?r:void 0}));return this.controller.createAuthSetting(h).pipe(ne(A=>m(A)),yd(()=>this.refresh()))}update(t,e,n){let o=B(x(w$1({},e),{namespaceId:n.namespaceId,userId:n.userId,authType:n.authType}));return this.controller.updateAuthSetting(t,o).pipe(ne(r=>m(r)),yd(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(yd(()=>this.refresh()))}getConnection(t,e){return this.controller.getConnectionAuthSetting(t,e)}resetCredential(t,e){return this.controller.resetMyCredentialAuthSetting(t,e)}connect(t,e,n,o){return this.getConnection(t,e).pipe(fa(r=>this.controller.connectAuthSetting(t,e).pipe(yd(h=>n(h.authorizationUrl)),fa(()=>this.awaitNewConnection(t,e,r.connected?r.connectedAt??null:null,o)))))}awaitNewConnection(t,e,n,o){let r=0,h=0;return sn(b,b).pipe(fa(()=>this.getConnection(t,e).pipe(da(()=>Tr(null)))),ne(A=>(r++,A?.connected&&H(A.connectedAt,n)?"connected":r*b>=M?"timeout":o()&&++h>=P?"abandoned":null)),Ot(A=>A!==null),an(1))}static \u0275fac=function(e){return new(e||i$1)};static \u0275prov=x$1({token:i$1,factory:i$1.\u0275fac,providedIn:"root"})};export{I,it as i,nt as n};
@@ -1 +1 @@
1
- import {z as k$1,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-B-oMBbkF.js';import {g,F,I as Ie,aq as k,ap as F$1,$ as Cr,U as Ui,a1 as fa,at as wy,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,r as df,s as ff,v as vl,k as cg}from'./main-STOFVKFA.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(Ds(0,"p",3),NC(1),pl()),o&2){let e=Jw();BE(),Og(e.deletion.error());}}function U(o,t){o&1&&(Ds(0,"p",4),NC(1,"Loading AI models\u2026"),pl());}function z(o,t){o&1&&(Ds(0,"p",5),NC(1,"No platform AI models defined yet."),pl());}function G(o,t){o&1&&(Ds(0,"p",4),NC(1,"No AI models match the current filter."),pl());}function J(o,t){if(o&1){let e=Zw();Ds(0,"button",21),mg("click",function(){df(e);let r=Jw().$implicit,m=Jw(2);return ff(m.edit(r))}),NC(1,"Edit"),pl();}if(o&2){let e=Jw().$implicit;cg("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=Zw();Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15),NC(8),pl(),Ds(9,"td",16),NC(10),pl(),Ds(11,"td",17)(12,"div",18),Lw(13,J,2,1,"button",19),Ds(14,"agentos-row-delete-action",20),mg("deleteRequested",function(){let r=df(e).$implicit,m=Jw(2);return ff(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=df(e).$implicit,m=Jw(2);return ff(m.confirmDelete(r))})("deleteCancelled",function(){df(e);let r=Jw(2);return ff(r.deletion.cancel())}),pl()()()();}if(o&2){let e=t.$implicit,a=Jw(2);BE(2),Og(e.title),BE(2),Og(e.providerName),BE(2),vl(" ",e.model.apiModelName," "),BE(2),Og(e.model.priority),BE(2),vl(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),BE(3),jw(a.deletion.confirmingId()!==e.key?13:-1),BE(),ug("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Provider"),pl(),Ds(8,"th",10),NC(9,"API model name"),pl(),Ds(10,"th",10),NC(11,"Priority"),pl(),Ds(12,"th",10),NC(13,"Reasoning effort"),pl(),Ds(14,"th",10)(15,"span",11),NC(16,"Actions"),pl()()()(),Ds(17,"tbody",8),Hw(18,O,15,9,"tr",9,K),pl()()()),o&2){let e=Jw();BE(18),Uw(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(Ie);aiModelController=g(k);aiProviderController=g(F$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k$1();rows=Ui([]);rowFilter=O$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),wy([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let a=new Map(e.map(r=>[r.id??"",r.name]));this.rows.set(t.map((r,m)=>({key:r.id??`model:${m}`,model:r,title:r.alias??r.apiModelName,providerName:a.get(r.aiProviderId)??r.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=yw({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,a){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New AI model"),pl()(),Lw(4,H,2,1,"p",3),Lw(5,U,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,Q,20,0,"div",6)),e&2&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{j as PlatformAiModelsComponent};
1
+ import {z as k$1,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-C20Tq5VN.js';import {g,F,I as Ie,aq as k,ap as F$1,$ as Cr,U as Ui,a1 as fa,at as wy,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,r as df,s as ff,v as vl,k as cg}from'./main-M62523CG.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(Ds(0,"p",3),NC(1),pl()),o&2){let e=Jw();BE(),Og(e.deletion.error());}}function U(o,t){o&1&&(Ds(0,"p",4),NC(1,"Loading AI models\u2026"),pl());}function z(o,t){o&1&&(Ds(0,"p",5),NC(1,"No platform AI models defined yet."),pl());}function G(o,t){o&1&&(Ds(0,"p",4),NC(1,"No AI models match the current filter."),pl());}function J(o,t){if(o&1){let e=Zw();Ds(0,"button",21),mg("click",function(){df(e);let r=Jw().$implicit,m=Jw(2);return ff(m.edit(r))}),NC(1,"Edit"),pl();}if(o&2){let e=Jw().$implicit;cg("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=Zw();Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15),NC(8),pl(),Ds(9,"td",16),NC(10),pl(),Ds(11,"td",17)(12,"div",18),Lw(13,J,2,1,"button",19),Ds(14,"agentos-row-delete-action",20),mg("deleteRequested",function(){let r=df(e).$implicit,m=Jw(2);return ff(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=df(e).$implicit,m=Jw(2);return ff(m.confirmDelete(r))})("deleteCancelled",function(){df(e);let r=Jw(2);return ff(r.deletion.cancel())}),pl()()()();}if(o&2){let e=t.$implicit,a=Jw(2);BE(2),Og(e.title),BE(2),Og(e.providerName),BE(2),vl(" ",e.model.apiModelName," "),BE(2),Og(e.model.priority),BE(2),vl(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),BE(3),jw(a.deletion.confirmingId()!==e.key?13:-1),BE(),ug("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Provider"),pl(),Ds(8,"th",10),NC(9,"API model name"),pl(),Ds(10,"th",10),NC(11,"Priority"),pl(),Ds(12,"th",10),NC(13,"Reasoning effort"),pl(),Ds(14,"th",10)(15,"span",11),NC(16,"Actions"),pl()()()(),Ds(17,"tbody",8),Hw(18,O,15,9,"tr",9,K),pl()()()),o&2){let e=Jw();BE(18),Uw(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(Ie);aiModelController=g(k);aiProviderController=g(F$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k$1();rows=Ui([]);rowFilter=O$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),wy([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let a=new Map(e.map(r=>[r.id??"",r.name]));this.rows.set(t.map((r,m)=>({key:r.id??`model:${m}`,model:r,title:r.alias??r.apiModelName,providerName:a.get(r.aiProviderId)??r.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=yw({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,a){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New AI model"),pl()(),Lw(4,H,2,1,"p",3),Lw(5,U,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,Q,20,0,"div",6)),e&2&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{j as PlatformAiModelsComponent};
@@ -1,4 +1,4 @@
1
- import {aY as A,aZ as z$1}from'./main-STOFVKFA.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
1
+ import {aY as A,aZ as z$1}from'./main-M62523CG.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
2
2
  `});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
3
3
  `?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
4
4
  `&&(E.last=l.length==0||l[0].tag==`
@@ -1 +1 @@
1
- import {z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-B-oMBbkF.js';import {g,F,I as Ie,ag as U$1,$ as Cr,U as Ui,a1 as fa,G as U$2,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,Z as Zw,r as df,s as ff,k as cg}from'./main-STOFVKFA.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let t=Jw();BE(),Og(t.deletion.error());}}function K(n,e){n&1&&(Ds(0,"p",4),NC(1,"Loading agent configs\u2026"),pl());}function H(n,e){n&1&&(Ds(0,"p",5),NC(1,"No platform agent configs defined yet."),pl());}function U(n,e){n&1&&(Ds(0,"p",4),NC(1,"No agent configs match the current filter."),pl());}function z(n,e){if(n&1){let t=Zw();Ds(0,"button",19),mg("click",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.inspect(d))}),NC(1," Inspect "),pl(),Ds(2,"button",19),mg("click",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.edit(d))}),NC(3,"Edit"),pl();}if(n&2){let t=Jw().$implicit;cg("aria-label","Inspect "+t.name),BE(2),cg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Zw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.deletion.request(d.id))})("deleteConfirmed",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Jw().$implicit,a=Jw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15),NC(8),pl(),Ds(9,"td",16)(10,"div",17),Lw(11,z,4,2),Lw(12,G,1,3,"agentos-row-delete-action",18),pl()()()),n&2){let t=e.$implicit,a=Jw(2);BE(2),Og(t.name),BE(2),vl(" ",t.description||"\u2014"," "),BE(2),Og(t.modelName||"\u2014"),BE(2),Og(a.mode(t)),BE(3),jw(a.deletion.confirmingId()!==t.id?11:-1),BE(),jw(t.id?12:-1);}}function O(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Description"),pl(),Ds(8,"th",10),NC(9,"Model"),pl(),Ds(10,"th",10),NC(11,"Execution mode"),pl(),Ds(12,"th",10)(13,"span",11),NC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Hw(16,J,13,6,"tr",9,B),pl()()()),n&2){let t=Jw();BE(16),Uw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(Ie);agentConfigController=g(U$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();configs=Ui([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New agent config"),pl()(),Lw(4,j,2,1,"p",3),Lw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
1
+ import {z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-C20Tq5VN.js';import {g,F,I as Ie,ag as U$1,$ as Cr,U as Ui,a1 as fa,G as U$2,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,Z as Zw,r as df,s as ff,k as cg}from'./main-M62523CG.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let t=Jw();BE(),Og(t.deletion.error());}}function K(n,e){n&1&&(Ds(0,"p",4),NC(1,"Loading agent configs\u2026"),pl());}function H(n,e){n&1&&(Ds(0,"p",5),NC(1,"No platform agent configs defined yet."),pl());}function U(n,e){n&1&&(Ds(0,"p",4),NC(1,"No agent configs match the current filter."),pl());}function z(n,e){if(n&1){let t=Zw();Ds(0,"button",19),mg("click",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.inspect(d))}),NC(1," Inspect "),pl(),Ds(2,"button",19),mg("click",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.edit(d))}),NC(3,"Edit"),pl();}if(n&2){let t=Jw().$implicit;cg("aria-label","Inspect "+t.name),BE(2),cg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Zw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.deletion.request(d.id))})("deleteConfirmed",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Jw().$implicit,a=Jw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15),NC(8),pl(),Ds(9,"td",16)(10,"div",17),Lw(11,z,4,2),Lw(12,G,1,3,"agentos-row-delete-action",18),pl()()()),n&2){let t=e.$implicit,a=Jw(2);BE(2),Og(t.name),BE(2),vl(" ",t.description||"\u2014"," "),BE(2),Og(t.modelName||"\u2014"),BE(2),Og(a.mode(t)),BE(3),jw(a.deletion.confirmingId()!==t.id?11:-1),BE(),jw(t.id?12:-1);}}function O(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Description"),pl(),Ds(8,"th",10),NC(9,"Model"),pl(),Ds(10,"th",10),NC(11,"Execution mode"),pl(),Ds(12,"th",10)(13,"span",11),NC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Hw(16,J,13,6,"tr",9,B),pl()()()),n&2){let t=Jw();BE(16),Uw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(Ie);agentConfigController=g(U$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();configs=Ui([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New agent config"),pl()(),Lw(4,j,2,1,"p",3),Lw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-BuKRDhzj.js';import {p as pt,T as Te,a as fn,U as Ut,n as nd,L as Lt,m as mo,b as po,V as Vn,A as An,c as pn,h as hn,d as cn,e as dn,C as mn,g as at,i as an,j as ko}from'./chunk-B-oMBbkF.js';import {g,W,F,I as Ie,U as Ui,G as U,M as x,K as w,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,Z as Zw,l as lg,_ as _I,H as Hw,am as Bw,R as NI,m as Uw,v as vl,r as df,s as ff,O as Og}from'./main-STOFVKFA.js';function ie(i,t){if(i&1&&(Ds(0,"a",2),NC(1,"View skill \u2192"),pl()),i&2){let e=Jw();ug("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function ne(i,t){i&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function re(i,t){if(i&1){let e=Zw();Ds(0,"div",15)(1,"div",19),lg(2,"input",20),_I(),Ds(3,"button",21),mg("click",function(){let l=df(e).$implicit,te=Jw(2);return ff(te.removeResource(l))}),NC(4," \xD7 "),pl()(),lg(5,"textarea",22),_I(),pl();}if(i&2){let e=t.$implicit;BE(2),ug("formControl",e.path),NI(),BE(3),ug("formControl",e.content),NI();}}function ae(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function se(i,t){if(i&1){let e=Zw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let l=Jw();return ff(l.submit())}),Ds(1,"ds-form-field",7),lg(2,"input",8),_I(),pl(),Ds(3,"ds-form-field",9),lg(4,"textarea",10),_I(),pl(),Ds(5,"ds-form-field",11),lg(6,"textarea",12),_I(),pl(),Ds(7,"ds-form-field",13)(8,"div",14),Hw(9,re,6,2,"div",15,Bw),Ds(11,"div")(12,"button",16),mg("click",function(){df(e);let l=Jw();return ff(l.addResource())}),NC(13,"+ Add resource"),pl()()()(),Lw(14,ae,2,1,"ds-notice"),Ds(15,"ds-form-actions")(16,"button",17),NC(17),pl(),Ds(18,"button",18),mg("click",function(){df(e);let l=Jw();return ff(l.cancel())}),NC(19,"Cancel"),pl()()();}if(i&2){let e=Jw();ug("formGroup",e.form),BE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),BE(),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.bodyControl),NI(),BE(3),Uw(e.resourceRows()),BE(5),jw(e.errorMessage()?14:-1),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Ui(false);isLoading=Ui(false);isSubmitting=Ui(false);errorMessage=Ui(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(100),fn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(500),fn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})});resourceRows=Ui([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),NC(3,"\u2190 Skills"),pl(),Lw(4,ie,2,1,"a",2),Lw(5,oe,2,0,"ds-tag",3),pl(),Lw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),pl()),e&2&&(BE(),ug("title",o.isEditMode()?"Edit skill":"New skill"),BE(3),jw(o.isEditMode()?4:-1),BE(),jw(o.isPlatformMode?5:-1),BE(),jw(o.isLoading()?6:7));},dependencies:[Ut,nd,Lt,mo,po,Vn,An,$t,pn,hn,cn,dn,mn,at,an,ko],encapsulation:2})};export{ee as SkillFormComponent};
1
+ import {o}from'./chunk-EewxiDYN.js';import {p as pt,T as Te,a as fn,U as Ut,n as nd,L as Lt,m as mo,b as po,V as Vn,A as An,c as pn,h as hn,d as cn,e as dn,C as mn,g as at,i as an,j as ko}from'./chunk-C20Tq5VN.js';import {g,W,F,I as Ie,U as Ui,G as U,M as x,K as w,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,Z as Zw,l as lg,_ as _I,H as Hw,am as Bw,R as NI,m as Uw,v as vl,r as df,s as ff,O as Og}from'./main-M62523CG.js';function ie(i,t){if(i&1&&(Ds(0,"a",2),NC(1,"View skill \u2192"),pl()),i&2){let e=Jw();ug("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function ne(i,t){i&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function re(i,t){if(i&1){let e=Zw();Ds(0,"div",15)(1,"div",19),lg(2,"input",20),_I(),Ds(3,"button",21),mg("click",function(){let l=df(e).$implicit,te=Jw(2);return ff(te.removeResource(l))}),NC(4," \xD7 "),pl()(),lg(5,"textarea",22),_I(),pl();}if(i&2){let e=t.$implicit;BE(2),ug("formControl",e.path),NI(),BE(3),ug("formControl",e.content),NI();}}function ae(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function se(i,t){if(i&1){let e=Zw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let l=Jw();return ff(l.submit())}),Ds(1,"ds-form-field",7),lg(2,"input",8),_I(),pl(),Ds(3,"ds-form-field",9),lg(4,"textarea",10),_I(),pl(),Ds(5,"ds-form-field",11),lg(6,"textarea",12),_I(),pl(),Ds(7,"ds-form-field",13)(8,"div",14),Hw(9,re,6,2,"div",15,Bw),Ds(11,"div")(12,"button",16),mg("click",function(){df(e);let l=Jw();return ff(l.addResource())}),NC(13,"+ Add resource"),pl()()()(),Lw(14,ae,2,1,"ds-notice"),Ds(15,"ds-form-actions")(16,"button",17),NC(17),pl(),Ds(18,"button",18),mg("click",function(){df(e);let l=Jw();return ff(l.cancel())}),NC(19,"Cancel"),pl()()();}if(i&2){let e=Jw();ug("formGroup",e.form),BE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),BE(),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.bodyControl),NI(),BE(3),Uw(e.resourceRows()),BE(5),jw(e.errorMessage()?14:-1),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Ui(false);isLoading=Ui(false);isSubmitting=Ui(false);errorMessage=Ui(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(100),fn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(500),fn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})});resourceRows=Ui([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),NC(3,"\u2190 Skills"),pl(),Lw(4,ie,2,1,"a",2),Lw(5,oe,2,0,"ds-tag",3),pl(),Lw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),pl()),e&2&&(BE(),ug("title",o.isEditMode()?"Edit skill":"New skill"),BE(3),jw(o.isEditMode()?4:-1),BE(),jw(o.isPlatformMode?5:-1),BE(),jw(o.isLoading()?6:7));},dependencies:[Ut,nd,Lt,mo,po,Vn,An,$t,pn,hn,cn,dn,mn,at,an,ko],encapsulation:2})};export{ee as SkillFormComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-Dpe32Q9r.js';import {z as k,O as O$1,g as at,h as hn,I as Io,j as ko,P,B as P$1}from'./chunk-B-oMBbkF.js';import {g,F,I as Ie,U as Ui,G as U$1,ai as Ue,al as Fe,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,r as df,s as ff,k as cg}from'./main-STOFVKFA.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let e=Jw();BE(),Og(e.deletion.error());}}function B(n,t){n&1&&(Ds(0,"p",4),NC(1,"Loading scheduled prompts\u2026"),pl());}function j(n,t){n&1&&(Ds(0,"p",5),NC(1,"No platform scheduled prompts defined yet."),pl());}function W(n,t){n&1&&(Ds(0,"p",4),NC(1,"No scheduled prompts match the current filter."),pl());}function H(n,t){if(n&1&&(Ds(0,"span",14),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.description);}}function O(n,t){if(n&1){let e=Zw();Ds(0,"button",21),mg("click",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.toggle(s))}),NC(1),pl(),Ds(2,"button",21),mg("click",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.edit(s))}),NC(3,"Edit"),pl();}if(n&2){let e=Jw().$implicit;BE(),Og(e.enabled?"Disable":"Enable"),BE(),cg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=Zw();Ds(0,"agentos-row-delete-action",22),mg("deleteRequested",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.deletion.request(s.id))})("deleteConfirmed",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.confirmDelete(s))})("deleteCancelled",function(){df(e);let s=Jw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let e=Jw().$implicit,i=Jw(2);ug("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),NC(3),pl(),Lw(4,H,2,1,"span",14),pl(),Ds(5,"td",15),NC(6),pl(),Ds(7,"td",16)(8,"ds-tag",17),NC(9),pl()(),Ds(10,"td",18)(11,"div",19),Lw(12,O,4,2),Lw(13,Y,1,3,"agentos-row-delete-action",20),pl()()()),n&2){let e=t.$implicit,i=Jw(2);BE(3),Og(e.name),BE(),jw(e.description?4:-1),BE(2),Og(i.scheduleLabel(e)),BE(2),ug("variant",e.enabled?"accent":"outline"),BE(),Og(e.enabled?"Enabled":"Disabled"),BE(3),jw(i.deletion.confirmingId()!==e.id?12:-1),BE(),jw(e.id?13:-1);}}function G(n,t){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Schedule"),pl(),Ds(8,"th",10),NC(9,"Status"),pl(),Ds(10,"th",10)(11,"span",11),NC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Hw(14,z,14,7,"tr",9,M),pl()()()),n&2){let e=Jw();BE(14),Uw(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(Ie);state=g(c);prompts=Ui([]);isLoading=Ui(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Ue.WEEK?"week":"month",s=e.unit===Ue.WEEK&&e.days?.length?` (${e.days.map(c=>Fe[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return i.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),NC(3,"New scheduled prompt"),pl()(),Lw(4,U,2,1,"p",3),Lw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(BE(),ug("query",i.rowFilter.query()),BE(3),jw(i.deletion.error()?4:-1),BE(),jw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
1
+ import {c}from'./chunk-CsuAvKcl.js';import {z as k,O as O$1,g as at,h as hn,I as Io,j as ko,P,B as P$1}from'./chunk-C20Tq5VN.js';import {g,F,I as Ie,U as Ui,G as U$1,ai as Ue,al as Fe,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,r as df,s as ff,k as cg}from'./main-M62523CG.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let e=Jw();BE(),Og(e.deletion.error());}}function B(n,t){n&1&&(Ds(0,"p",4),NC(1,"Loading scheduled prompts\u2026"),pl());}function j(n,t){n&1&&(Ds(0,"p",5),NC(1,"No platform scheduled prompts defined yet."),pl());}function W(n,t){n&1&&(Ds(0,"p",4),NC(1,"No scheduled prompts match the current filter."),pl());}function H(n,t){if(n&1&&(Ds(0,"span",14),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.description);}}function O(n,t){if(n&1){let e=Zw();Ds(0,"button",21),mg("click",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.toggle(s))}),NC(1),pl(),Ds(2,"button",21),mg("click",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.edit(s))}),NC(3,"Edit"),pl();}if(n&2){let e=Jw().$implicit;BE(),Og(e.enabled?"Disable":"Enable"),BE(),cg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=Zw();Ds(0,"agentos-row-delete-action",22),mg("deleteRequested",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.deletion.request(s.id))})("deleteConfirmed",function(){df(e);let s=Jw().$implicit,c=Jw(2);return ff(c.confirmDelete(s))})("deleteCancelled",function(){df(e);let s=Jw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let e=Jw().$implicit,i=Jw(2);ug("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),NC(3),pl(),Lw(4,H,2,1,"span",14),pl(),Ds(5,"td",15),NC(6),pl(),Ds(7,"td",16)(8,"ds-tag",17),NC(9),pl()(),Ds(10,"td",18)(11,"div",19),Lw(12,O,4,2),Lw(13,Y,1,3,"agentos-row-delete-action",20),pl()()()),n&2){let e=t.$implicit,i=Jw(2);BE(3),Og(e.name),BE(),jw(e.description?4:-1),BE(2),Og(i.scheduleLabel(e)),BE(2),ug("variant",e.enabled?"accent":"outline"),BE(),Og(e.enabled?"Enabled":"Disabled"),BE(3),jw(i.deletion.confirmingId()!==e.id?12:-1),BE(),jw(e.id?13:-1);}}function G(n,t){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Schedule"),pl(),Ds(8,"th",10),NC(9,"Status"),pl(),Ds(10,"th",10)(11,"span",11),NC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Hw(14,z,14,7,"tr",9,M),pl()()()),n&2){let e=Jw();BE(14),Uw(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(Ie);state=g(c);prompts=Ui([]);isLoading=Ui(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Ue.WEEK?"week":"month",s=e.unit===Ue.WEEK&&e.days?.length?` (${e.days.map(c=>Fe[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return i.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),NC(3,"New scheduled prompt"),pl()(),Lw(4,U,2,1,"p",3),Lw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(BE(),ug("query",i.rowFilter.query()),BE(3),jw(i.deletion.error()?4:-1),BE(),jw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
@@ -1 +1 @@
1
- import {O as O$1}from'./chunk-BLqLGSs8.js';import {I}from'./chunk-CMEzRsR0.js';import {O}from'./chunk-VMR1gw-F.js';import {g,I as Ie$1,U as Ui,X as XC,a9 as F,at as wy,ad as ne,G as U,y as yw,D as Ds,l as lg,L as Lw,p as pl,a as BE,j as jw,N as NC,Z as Zw,Q as mg,J as Jw,P as ug,_ as _I,H as Hw,O as Og,R as NI,m as Uw,v as vl,ae as Fw,r as df,s as ff,M as x,K as w}from'./main-STOFVKFA.js';import {y,N as D,Q as B,R as a,p as pt,T as Te$1,X as f,Y as A,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,b as po,A as An,v as va,c as pn,h as hn,d as cn,Z as un,e as dn,g as at,i as an,q as sn,a0 as Ti,K as Oi,a1 as d,a2 as v}from'./chunk-B-oMBbkF.js';import'./chunk-BzHmQRNM.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function xe(o,e){if(o&1&&(Ds(0,"option",27),NC(1),pl()),o&2){let t=e.$implicit;ug("value",t.value),BE(),Og(t.label);}}function Se(o,e){if(o&1){let t=Zw();Ds(0,"form",15),mg("ngSubmit",function(){df(t);let s=Jw(2);return ff(s.save())}),Ds(1,"ds-group",16)(2,"dl",17)(3,"dt"),NC(4,"Email"),pl(),Ds(5,"dd"),NC(6),pl(),Ds(7,"dt"),NC(8,"External ID"),pl(),Ds(9,"dd"),NC(10),pl()()(),Ds(11,"ds-group",18)(12,"ds-form-field",19),lg(13,"input",20),_I(),pl(),Ds(14,"ds-form-field",21),lg(15,"input",22),_I(),pl(),Ds(16,"ds-form-field",23),lg(17,"textarea",24),_I(),pl(),Ds(18,"ds-form-field",25)(19,"select",26),Hw(20,xe,2,2,"option",27,ye),pl(),_I(),pl()(),Ds(22,"ds-form-actions")(23,"button",28),NC(24),pl(),Ds(25,"button",29),mg("click",function(){df(t);let s=Jw(2);return ff(s.cancelEditing())}),NC(26,"Cancel"),pl()()();}if(o&2){let t=Jw(),l=Jw();ug("formGroup",l.form),BE(6),Og(t.email),BE(4),Og(t.externalId),BE(3),NI(),BE(2),NI(),BE(2),NI(),BE(2),NI(),BE(),Uw(l.languageOptions),BE(3),ug("disabled",l.isSaving()),BE(),vl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Ds(0,"p",2),NC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),pl());}function Pe(o,e){if(o&1){let t=Zw();Ds(0,"span",38),NC(1,"Delete?"),pl(),Ds(2,"button",39),mg("click",function(){df(t);let s=Jw().$implicit,m=Jw(5);return ff(m.confirmDelete(s))}),NC(3,"Confirm"),pl(),Ds(4,"button",40),mg("click",function(){df(t);let s=Jw(6);return ff(s.cancelDelete())}),NC(5,"Cancel"),pl();}}function Te(o,e){if(o&1){let t=Zw();Ds(0,"button",40),mg("click",function(){df(t);let s=Jw().$implicit,m=Jw(5);return ff(m.armDelete(s))}),NC(1,"Delete"),pl();}}function De(o,e){if(o&1&&(Ds(0,"li",34)(1,"span",35),NC(2),pl(),Ds(3,"span",36),NC(4),pl(),Lw(5,Pe,6,0)(6,Te,2,0,"button",37),pl()),o&2){let t=e.$implicit,l=Jw(5);BE(2),Og(t.name),BE(2),Og(t.subtitle),BE(),jw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Ds(0,"span",32),NC(1),pl(),Ds(2,"ul",33),Hw(3,De,7,3,"li",34,Fw().trackEntry,true),pl()),o&2){let t=e.$implicit;BE(),Og(t.title),BE(2),Uw(t.entries);}}function Ve(o,e){if(o&1&&Hw(0,we,5,1,null,null,Ce),o&2){let t=Jw(3);Uw(t.recapSections());}}function Ue(o,e){if(o&1){let t=Zw();Ds(0,"ds-group",16)(1,"dl",17)(2,"dt"),NC(3,"Email"),pl(),Ds(4,"dd"),NC(5),pl(),Ds(6,"dt"),NC(7,"External ID"),pl(),Ds(8,"dd"),NC(9),pl()()(),Ds(10,"ds-group",18)(11,"dl",17)(12,"dt"),NC(13,"First name"),pl(),Ds(14,"dd"),NC(15),pl(),Ds(16,"dt"),NC(17,"Last name"),pl(),Ds(18,"dd"),NC(19),pl(),Ds(20,"dt"),NC(21,"Bio"),pl(),Ds(22,"dd"),NC(23),pl(),Ds(24,"dt"),NC(25,"Language"),pl(),Ds(26,"dd"),NC(27),pl()()(),Ds(28,"ds-form-actions")(29,"button",30),mg("click",function(){df(t);let s=Jw(2);return ff(s.startEditing())}),NC(30,"Edit profile"),pl()(),Ds(31,"ds-disclosure",31),mg("toggled",function(){df(t);let s=Jw(2);return ff(s.toggleOverrides())}),Lw(32,Ee,2,0,"p",2)(33,Ve,2,0),pl();}if(o&2){let t=Jw(),l=Jw();BE(5),Og(t.email),BE(4),Og(t.externalId),BE(6),Og(t.firstname||"\u2014"),BE(4),Og(t.lastname||"\u2014"),BE(4),Og(t.bio||"\u2014"),BE(4),Og(t.preferredLanguage||"\u2014"),BE(4),ug("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),BE(),jw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=Zw();Ds(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setThemeVariant(s))}),pl()(),Ds(3,"ds-form-field",6)(4,"ds-segmented",7),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setTheme(s))}),pl()()(),Ds(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setEnterKeyBehavior(s))}),pl()()(),Ds(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setShowTechnical(s))}),pl()()(),Lw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=Jw();BE(),ug("hint",t.activeVariantDescription()),BE(),ug("options",t.themeVariantOptions)("value",t.themeVariant()),BE(),ug("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),BE(),ug("options",t.modeOptions())("value",t.shownMode()),BE(3),ug("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),BE(3),ug("options",t.showTechnicalOptions)("value",t.showTechnical()),BE(),jw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Ds(0,"p",2),NC(1,"Unable to load profile."),pl());}var ve=class o{userState=g(y);destroyRef=g(Ie$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(D);preferencesPort=g(B);isEditing=Ui(false);isLoading=Ui(false);isSaving=Ui(false);isOverridesExpanded=Ui(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=XC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=XC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=XC(()=>!A(this.themeVariant(),this.themeMode()));activeVariantLabel=XC(()=>d(this.themeVariant()).label);activeVariantDescription=XC(()=>d(this.themeVariant()).description);modeOptions=XC(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=XC(()=>this.modeOverridden()?v(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(wy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=XC(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){f(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !A(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=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:e||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(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=Ui(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=yw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Lw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),pl()),t&2){let s;BE(2),jw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,un,dn,at,an,sn,Ti,Oi],encapsulation:2})};export{ve as UserProfileComponent};
1
+ import {O as O$1}from'./chunk-C_Iy_sl5.js';import {I}from'./chunk-B5RsrYWK.js';import {O}from'./chunk-CfQHAGOy.js';import {g,I as Ie$1,U as Ui,X as XC,a9 as F,at as wy,ad as ne,G as U,y as yw,D as Ds,l as lg,L as Lw,p as pl,a as BE,j as jw,N as NC,Z as Zw,Q as mg,J as Jw,P as ug,_ as _I,H as Hw,O as Og,R as NI,m as Uw,v as vl,ae as Fw,r as df,s as ff,M as x,K as w}from'./main-M62523CG.js';import {y,N as D,Q as B,R as a,p as pt,T as Te$1,X as f,Y as A,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,b as po,A as An,v as va,c as pn,h as hn,d as cn,Z as un,e as dn,g as at,i as an,q as sn,a0 as Ti,K as Oi,a1 as d,a2 as v}from'./chunk-C20Tq5VN.js';import'./chunk-CrCRSut7.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function xe(o,e){if(o&1&&(Ds(0,"option",27),NC(1),pl()),o&2){let t=e.$implicit;ug("value",t.value),BE(),Og(t.label);}}function Se(o,e){if(o&1){let t=Zw();Ds(0,"form",15),mg("ngSubmit",function(){df(t);let s=Jw(2);return ff(s.save())}),Ds(1,"ds-group",16)(2,"dl",17)(3,"dt"),NC(4,"Email"),pl(),Ds(5,"dd"),NC(6),pl(),Ds(7,"dt"),NC(8,"External ID"),pl(),Ds(9,"dd"),NC(10),pl()()(),Ds(11,"ds-group",18)(12,"ds-form-field",19),lg(13,"input",20),_I(),pl(),Ds(14,"ds-form-field",21),lg(15,"input",22),_I(),pl(),Ds(16,"ds-form-field",23),lg(17,"textarea",24),_I(),pl(),Ds(18,"ds-form-field",25)(19,"select",26),Hw(20,xe,2,2,"option",27,ye),pl(),_I(),pl()(),Ds(22,"ds-form-actions")(23,"button",28),NC(24),pl(),Ds(25,"button",29),mg("click",function(){df(t);let s=Jw(2);return ff(s.cancelEditing())}),NC(26,"Cancel"),pl()()();}if(o&2){let t=Jw(),l=Jw();ug("formGroup",l.form),BE(6),Og(t.email),BE(4),Og(t.externalId),BE(3),NI(),BE(2),NI(),BE(2),NI(),BE(2),NI(),BE(),Uw(l.languageOptions),BE(3),ug("disabled",l.isSaving()),BE(),vl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Ds(0,"p",2),NC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),pl());}function Pe(o,e){if(o&1){let t=Zw();Ds(0,"span",38),NC(1,"Delete?"),pl(),Ds(2,"button",39),mg("click",function(){df(t);let s=Jw().$implicit,m=Jw(5);return ff(m.confirmDelete(s))}),NC(3,"Confirm"),pl(),Ds(4,"button",40),mg("click",function(){df(t);let s=Jw(6);return ff(s.cancelDelete())}),NC(5,"Cancel"),pl();}}function Te(o,e){if(o&1){let t=Zw();Ds(0,"button",40),mg("click",function(){df(t);let s=Jw().$implicit,m=Jw(5);return ff(m.armDelete(s))}),NC(1,"Delete"),pl();}}function De(o,e){if(o&1&&(Ds(0,"li",34)(1,"span",35),NC(2),pl(),Ds(3,"span",36),NC(4),pl(),Lw(5,Pe,6,0)(6,Te,2,0,"button",37),pl()),o&2){let t=e.$implicit,l=Jw(5);BE(2),Og(t.name),BE(2),Og(t.subtitle),BE(),jw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Ds(0,"span",32),NC(1),pl(),Ds(2,"ul",33),Hw(3,De,7,3,"li",34,Fw().trackEntry,true),pl()),o&2){let t=e.$implicit;BE(),Og(t.title),BE(2),Uw(t.entries);}}function Ve(o,e){if(o&1&&Hw(0,we,5,1,null,null,Ce),o&2){let t=Jw(3);Uw(t.recapSections());}}function Ue(o,e){if(o&1){let t=Zw();Ds(0,"ds-group",16)(1,"dl",17)(2,"dt"),NC(3,"Email"),pl(),Ds(4,"dd"),NC(5),pl(),Ds(6,"dt"),NC(7,"External ID"),pl(),Ds(8,"dd"),NC(9),pl()()(),Ds(10,"ds-group",18)(11,"dl",17)(12,"dt"),NC(13,"First name"),pl(),Ds(14,"dd"),NC(15),pl(),Ds(16,"dt"),NC(17,"Last name"),pl(),Ds(18,"dd"),NC(19),pl(),Ds(20,"dt"),NC(21,"Bio"),pl(),Ds(22,"dd"),NC(23),pl(),Ds(24,"dt"),NC(25,"Language"),pl(),Ds(26,"dd"),NC(27),pl()()(),Ds(28,"ds-form-actions")(29,"button",30),mg("click",function(){df(t);let s=Jw(2);return ff(s.startEditing())}),NC(30,"Edit profile"),pl()(),Ds(31,"ds-disclosure",31),mg("toggled",function(){df(t);let s=Jw(2);return ff(s.toggleOverrides())}),Lw(32,Ee,2,0,"p",2)(33,Ve,2,0),pl();}if(o&2){let t=Jw(),l=Jw();BE(5),Og(t.email),BE(4),Og(t.externalId),BE(6),Og(t.firstname||"\u2014"),BE(4),Og(t.lastname||"\u2014"),BE(4),Og(t.bio||"\u2014"),BE(4),Og(t.preferredLanguage||"\u2014"),BE(4),ug("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),BE(),jw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=Zw();Ds(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setThemeVariant(s))}),pl()(),Ds(3,"ds-form-field",6)(4,"ds-segmented",7),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setTheme(s))}),pl()()(),Ds(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setEnterKeyBehavior(s))}),pl()()(),Ds(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),mg("valueChange",function(s){df(t);let m=Jw();return ff(m.setShowTechnical(s))}),pl()()(),Lw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=Jw();BE(),ug("hint",t.activeVariantDescription()),BE(),ug("options",t.themeVariantOptions)("value",t.themeVariant()),BE(),ug("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),BE(),ug("options",t.modeOptions())("value",t.shownMode()),BE(3),ug("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),BE(3),ug("options",t.showTechnicalOptions)("value",t.showTechnical()),BE(),jw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Ds(0,"p",2),NC(1,"Unable to load profile."),pl());}var ve=class o{userState=g(y);destroyRef=g(Ie$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(D);preferencesPort=g(B);isEditing=Ui(false);isLoading=Ui(false);isSaving=Ui(false);isOverridesExpanded=Ui(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=XC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=XC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=XC(()=>!A(this.themeVariant(),this.themeMode()));activeVariantLabel=XC(()=>d(this.themeVariant()).label);activeVariantDescription=XC(()=>d(this.themeVariant()).description);modeOptions=XC(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=XC(()=>this.modeOverridden()?v(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(wy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=XC(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){f(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !A(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=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:e||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(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=Ui(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=yw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Lw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),pl()),t&2){let s;BE(2),jw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,un,dn,at,an,sn,Ti,Oi],encapsulation:2})};export{ve as UserProfileComponent};
@@ -1 +1 @@
1
- import {p as pt,T as Te,a as fn,c as pn,h as hn,d as cn,r as ln,e as dn,g as at,i as an,U as Ut,n as nd,l as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,b as po,$ as $r,H as qr,V as Vn,A as An,v as va}from'./chunk-B-oMBbkF.js';import {g,W,F,I as Ie$1,aq as k,ap as F$1,a9 as F$2,a2 as da,aa as Tr,ar as Be,X as XC,U as Ui,q as Af,G as U,M as x,K as w,y as yw,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,Z as Zw,l as lg,_ as _I,H as Hw,ao as Vw,J as Jw,R as NI,m as Uw,v as vl,ae as Fw,O as Og,as as kg,r as df,s as ff}from'./main-STOFVKFA.js';function he(r,t){r&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function ve(r,t){if(r&1&&lg(0,"input",6),r&2){let e=Jw(2);ug("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Ds(0,"option",44),NC(1),pl()),r&2){let e=t.$implicit;ug("value",e.id),BE(),kg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Ds(0,"select",7)(1,"option",43),NC(2,"Select provider"),pl(),Hw(3,ye,2,3,"option",44,Fw().trackByProvider,true),pl(),_I()),r&2){let e=Jw(2);ug("formControl",e.aiProviderIdControl),NI(),BE(3),Uw(e.providers());}}function xe(r,t){if(r&1&&(Ds(0,"option",25),NC(1),pl()),r&2){let e=t.$implicit;ug("ngValue",e),BE(),Og(e.toLowerCase());}}function _e(r,t){r&1&&(Ds(0,"p",2),NC(1,"Not supported yet for Anthropic and Gemini providers."),pl());}function Me(r,t){r&1&&(Ds(0,"p",2),NC(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. "),pl());}function Ee(r,t){r&1&&(Ds(0,"p",26),NC(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. "),pl());}function Ae(r,t){if(r&1){let e=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let u=Jw();return ff(u.submit())}),Ds(1,"ds-form-field",5),Lw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),pl(),Ds(4,"ds-form-field",8),lg(5,"input",9),_I(),pl(),Ds(6,"ds-form-field",10),lg(7,"input",11),_I(),pl(),Ds(8,"ds-form-field",12),lg(9,"input",13),_I(),pl(),Ds(10,"ds-form-field",14),lg(11,"input",15),_I(),pl(),Ds(12,"div",16)(13,"ds-form-field",17),lg(14,"input",18),_I(),pl(),Ds(15,"ds-form-field",19),lg(16,"input",20),_I(),pl()(),Ds(17,"ds-form-field",21),lg(18,"input",22),_I(),pl(),Ds(19,"ds-form-field",23)(20,"select",24)(21,"option",25),NC(22,"Provider default"),pl(),Hw(23,xe,2,2,"option",25,Vw),pl(),_I(),Lw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Lw(27,Ee,2,0,"p",26),pl(),Ds(28,"div",27)(29,"label",28),lg(30,"input",29),_I(),Ds(31,"span",30),NC(32,"Supports advanced execution"),pl()(),Ds(33,"p",31),NC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),pl()(),Ds(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),lg(38,"input",34),_I(),pl(),Ds(39,"ds-form-field",35),lg(40,"input",36),_I(),pl()(),Ds(41,"div",16)(42,"ds-form-field",37),lg(43,"input",38),_I(),pl(),Ds(44,"ds-form-field",39),lg(45,"input",40),_I(),pl()()(),Ds(46,"ds-form-actions")(47,"button",41),NC(48),pl(),Ds(49,"button",42),mg("click",function(){df(e);let u=Jw();return ff(u.cancel())}),NC(50,"Cancel"),pl()()();}if(r&2){let e=Jw();ug("formGroup",e.form),BE(2),jw(e.isEditMode()?2:3),BE(3),ug("formControl",e.apiModelNameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.aliasControl),NI(),BE(2),ug("formControl",e.priorityControl),NI(),BE(3),ug("formControl",e.temperatureControl),NI(),BE(2),ug("formControl",e.contextWindowControl),NI(),BE(2),ug("formControl",e.maxCompletionTokensControl),NI(),BE(2),ug("formControl",e.reasoningEffortControl),NI(),BE(),ug("ngValue",null),BE(2),Uw(e.reasoningEffortOptions),BE(2),jw(e.reasoningEffortUnsupported()?25:26),BE(2),jw(e.temperatureMayConflictWithEffort()?27:-1),BE(3),ug("formControl",e.supportsAdvancedExecutionControl),NI(),BE(5),ug("formGroup",e.pricingGroup),BE(3),NI(),BE(2),NI(),BE(3),NI(),BE(2),NI(),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(Ie$1);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(da(()=>Tr([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[fn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(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(Be);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=XC(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=XC(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);selectedProviderLabel=XC(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Af(()=>{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,w$1=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??"",w$1):this.aiModelController.createAiModel(w$1)).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||r)};static \u0275cmp=yw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[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"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return c.cancel()}),NC(3," \u2190 AI models "),pl()(),Lw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),pl()),e&2&&(BE(),ug("title",c.isEditMode()?"Edit AI model":"New AI model"),BE(3),jw(c.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,qr,Vn,An,va],encapsulation:2})};export{ge as AiModelFormComponent};
1
+ import {p as pt,T as Te,a as fn,c as pn,h as hn,d as cn,r as ln,e as dn,g as at,i as an,U as Ut,n as nd,l as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,b as po,$ as $r,H as qr,V as Vn,A as An,v as va}from'./chunk-C20Tq5VN.js';import {g,W,F,I as Ie$1,aq as k,ap as F$1,a9 as F$2,a2 as da,aa as Tr,ar as Be,X as XC,U as Ui,q as Af,G as U,M as x,K as w,y as yw,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,Z as Zw,l as lg,_ as _I,H as Hw,ao as Vw,J as Jw,R as NI,m as Uw,v as vl,ae as Fw,O as Og,as as kg,r as df,s as ff}from'./main-M62523CG.js';function he(r,t){r&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function ve(r,t){if(r&1&&lg(0,"input",6),r&2){let e=Jw(2);ug("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Ds(0,"option",44),NC(1),pl()),r&2){let e=t.$implicit;ug("value",e.id),BE(),kg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Ds(0,"select",7)(1,"option",43),NC(2,"Select provider"),pl(),Hw(3,ye,2,3,"option",44,Fw().trackByProvider,true),pl(),_I()),r&2){let e=Jw(2);ug("formControl",e.aiProviderIdControl),NI(),BE(3),Uw(e.providers());}}function xe(r,t){if(r&1&&(Ds(0,"option",25),NC(1),pl()),r&2){let e=t.$implicit;ug("ngValue",e),BE(),Og(e.toLowerCase());}}function _e(r,t){r&1&&(Ds(0,"p",2),NC(1,"Not supported yet for Anthropic and Gemini providers."),pl());}function Me(r,t){r&1&&(Ds(0,"p",2),NC(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. "),pl());}function Ee(r,t){r&1&&(Ds(0,"p",26),NC(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. "),pl());}function Ae(r,t){if(r&1){let e=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let u=Jw();return ff(u.submit())}),Ds(1,"ds-form-field",5),Lw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),pl(),Ds(4,"ds-form-field",8),lg(5,"input",9),_I(),pl(),Ds(6,"ds-form-field",10),lg(7,"input",11),_I(),pl(),Ds(8,"ds-form-field",12),lg(9,"input",13),_I(),pl(),Ds(10,"ds-form-field",14),lg(11,"input",15),_I(),pl(),Ds(12,"div",16)(13,"ds-form-field",17),lg(14,"input",18),_I(),pl(),Ds(15,"ds-form-field",19),lg(16,"input",20),_I(),pl()(),Ds(17,"ds-form-field",21),lg(18,"input",22),_I(),pl(),Ds(19,"ds-form-field",23)(20,"select",24)(21,"option",25),NC(22,"Provider default"),pl(),Hw(23,xe,2,2,"option",25,Vw),pl(),_I(),Lw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Lw(27,Ee,2,0,"p",26),pl(),Ds(28,"div",27)(29,"label",28),lg(30,"input",29),_I(),Ds(31,"span",30),NC(32,"Supports advanced execution"),pl()(),Ds(33,"p",31),NC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),pl()(),Ds(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),lg(38,"input",34),_I(),pl(),Ds(39,"ds-form-field",35),lg(40,"input",36),_I(),pl()(),Ds(41,"div",16)(42,"ds-form-field",37),lg(43,"input",38),_I(),pl(),Ds(44,"ds-form-field",39),lg(45,"input",40),_I(),pl()()(),Ds(46,"ds-form-actions")(47,"button",41),NC(48),pl(),Ds(49,"button",42),mg("click",function(){df(e);let u=Jw();return ff(u.cancel())}),NC(50,"Cancel"),pl()()();}if(r&2){let e=Jw();ug("formGroup",e.form),BE(2),jw(e.isEditMode()?2:3),BE(3),ug("formControl",e.apiModelNameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.aliasControl),NI(),BE(2),ug("formControl",e.priorityControl),NI(),BE(3),ug("formControl",e.temperatureControl),NI(),BE(2),ug("formControl",e.contextWindowControl),NI(),BE(2),ug("formControl",e.maxCompletionTokensControl),NI(),BE(2),ug("formControl",e.reasoningEffortControl),NI(),BE(),ug("ngValue",null),BE(2),Uw(e.reasoningEffortOptions),BE(2),jw(e.reasoningEffortUnsupported()?25:26),BE(2),jw(e.temperatureMayConflictWithEffort()?27:-1),BE(3),ug("formControl",e.supportsAdvancedExecutionControl),NI(),BE(5),ug("formGroup",e.pricingGroup),BE(3),NI(),BE(2),NI(),BE(3),NI(),BE(2),NI(),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(Ie$1);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(da(()=>Tr([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[fn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(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(Be);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=XC(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=XC(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);selectedProviderLabel=XC(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Af(()=>{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,w$1=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??"",w$1):this.aiModelController.createAiModel(w$1)).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||r)};static \u0275cmp=yw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[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"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return c.cancel()}),NC(3," \u2190 AI models "),pl()(),Lw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),pl()),e&2&&(BE(),ug("title",c.isEditMode()?"Edit AI model":"New AI model"),BE(3),jw(c.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,qr,Vn,An,va],encapsulation:2})};export{ge as AiModelFormComponent};
@@ -1,2 +1,2 @@
1
- import {I}from'./chunk-CMEzRsR0.js';import {g,W,aW as L,I as Ie,U as Ui,X as XC,aX as $e,ac as Ty,G as U,a2 as da,aa as Tr,y as yw,D as Ds,l as lg,L as Lw,p as pl,Q as mg,a as BE,j as jw,P as ug,N as NC,Z as Zw,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,v as vl,as as kg,r as df,s as ff,O as Og}from'./main-STOFVKFA.js';import {a4 as id,l as bo,x as xo,L as Lt,u as vn,G as Gt,m as mo,a6 as da$1,aa as Ni,c as pn,h as hn,d as cn,r as ln,e as dn,C as mn,g as at,i as an,t as rn}from'./chunk-B-oMBbkF.js';import'./chunk-BzHmQRNM.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Ds(0,"p",1),NC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function re(i,t){if(i&1){let e=Zw();Ds(0,"div")(1,"button",23),mg("click",function(){df(e);let s=Jw(2);return ff(s.retryLoad())}),NC(2,"Retry loading"),pl()();}}function ce(i,t){if(i&1&&(lg(0,"br"),NC(1)),i&2){let e=Jw(3);BE(),vl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Ds(0,"ds-notice",3),NC(1),Lw(2,ce,2,1),pl()),i&2){let e=Jw(2);ug("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),BE(),vl(" Repository: ",e.checkoutStatus()," "),BE(),jw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Ds(0,"option",12),NC(1),pl()),i&2){let e=t.$implicit,c=Jw(2);ug("value",e.id),BE(),kg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Ds(0,"p",13),NC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function pe(i,t){if(i&1){let e=Zw();Ds(0,"button",24),mg("click",function(){df(e);let s=Jw(2);return ff(s.remove())}),NC(1," Remove association "),pl();}if(i&2){let e=Jw(2);ug("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Zw();Lw(0,se,2,1,"ds-notice"),Lw(1,re,3,0,"div"),Lw(2,de,3,3,"ds-notice",3),Ds(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.repositoryUrl.set(s))}),pl(),_I(),pl(),Ds(6,"ds-form-field",7)(7,"input",8),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.mainBranch.set(s))}),pl(),_I(),pl(),Ds(8,"ds-form-field",9)(9,"select",10),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.serviceAuthSettingId.set(s))}),Ds(10,"option",11),NC(11,"Select an auth setting\u2026"),pl(),Hw(12,le,2,3,"option",12,oe),pl(),_I(),Lw(14,me,2,0,"p",13),pl()(),Ds(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.autoWorktree.set(s))}),pl(),_I(),NC(19," Offer a worktree to every new top-level case "),pl(),Ds(20,"p",18),NC(21," 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. "),pl()(),Ds(22,"ds-form-field",19)(23,"input",20),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.setupCommand.set(s))}),pl(),_I(),Ds(24,"p",13),NC(25," 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. "),pl()()(),Ds(26,"ds-form-actions")(27,"button",21),mg("click",function(){df(e);let s=Jw();return ff(s.save())}),NC(28),pl(),Lw(29,pe,2,1,"button",22),pl();}if(i&2){let e=Jw();jw(e.errorMessage()?0:-1),BE(),jw(e.associationLoaded()?-1:1),BE(),jw(e.isAssociated()&&e.checkoutStatus()?2:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(2),ug("ngModel",e.repositoryUrl()),NI(),BE(2),ug("ngModel",e.mainBranch()),NI(),BE(2),ug("ngModel",e.serviceAuthSettingId()),NI(),BE(3),Uw(e.eligibleAuthSettings()),BE(2),jw(e.eligibleAuthSettings().length===0?14:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(3),ug("ngModel",e.autoWorktree()),NI(),BE(5),ug("ngModel",e.setupCommand()),NI(),BE(4),ug("disabled",!e.canSave()),BE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),BE(),jw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(Ie);isLoading=Ui(true);isSaving=Ui(false);confirmingRemove=Ui(false);associationLoaded=Ui(false);errorMessage=Ui(null);association=Ui(null);authSettings=Ui([]);repositoryUrl=Ui("");mainBranch=Ui("main");serviceAuthSettingId=Ui("");autoWorktree=Ui(false);setupCommand=Ui("");namespaceId="";isAssociated=XC(()=>this.association()?.associated===true);eligibleAuthSettings=XC(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=XC(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=XC(()=>this.association()?.checkoutStatus??null);CheckoutStatus=$e;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),Ty({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),da(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),da(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(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||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","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."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Lw(2,ae,2,0,"p",1)(3,ue,30,14),pl(),Ds(4,"ds-confirm-dialog",2),mg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),pl()),e&2&&(BE(2),jw(c.isLoading()?2:3),BE(2),ug("open",c.confirmingRemove()));},dependencies:[id,bo,xo,Lt,vn,Gt,mo,da$1,Ni,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};
1
+ import {I}from'./chunk-B5RsrYWK.js';import {g,W,aW as L,I as Ie,U as Ui,X as XC,aX as $e,ac as Ty,G as U,a2 as da,aa as Tr,y as yw,D as Ds,l as lg,L as Lw,p as pl,Q as mg,a as BE,j as jw,P as ug,N as NC,Z as Zw,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,v as vl,as as kg,r as df,s as ff,O as Og}from'./main-M62523CG.js';import {a4 as id,l as bo,x as xo,L as Lt,u as vn,G as Gt,m as mo,a6 as da$1,aa as Ni,c as pn,h as hn,d as cn,r as ln,e as dn,C as mn,g as at,i as an,t as rn}from'./chunk-C20Tq5VN.js';import'./chunk-CrCRSut7.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Ds(0,"p",1),NC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function re(i,t){if(i&1){let e=Zw();Ds(0,"div")(1,"button",23),mg("click",function(){df(e);let s=Jw(2);return ff(s.retryLoad())}),NC(2,"Retry loading"),pl()();}}function ce(i,t){if(i&1&&(lg(0,"br"),NC(1)),i&2){let e=Jw(3);BE(),vl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Ds(0,"ds-notice",3),NC(1),Lw(2,ce,2,1),pl()),i&2){let e=Jw(2);ug("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),BE(),vl(" Repository: ",e.checkoutStatus()," "),BE(),jw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Ds(0,"option",12),NC(1),pl()),i&2){let e=t.$implicit,c=Jw(2);ug("value",e.id),BE(),kg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Ds(0,"p",13),NC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function pe(i,t){if(i&1){let e=Zw();Ds(0,"button",24),mg("click",function(){df(e);let s=Jw(2);return ff(s.remove())}),NC(1," Remove association "),pl();}if(i&2){let e=Jw(2);ug("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Zw();Lw(0,se,2,1,"ds-notice"),Lw(1,re,3,0,"div"),Lw(2,de,3,3,"ds-notice",3),Ds(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.repositoryUrl.set(s))}),pl(),_I(),pl(),Ds(6,"ds-form-field",7)(7,"input",8),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.mainBranch.set(s))}),pl(),_I(),pl(),Ds(8,"ds-form-field",9)(9,"select",10),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.serviceAuthSettingId.set(s))}),Ds(10,"option",11),NC(11,"Select an auth setting\u2026"),pl(),Hw(12,le,2,3,"option",12,oe),pl(),_I(),Lw(14,me,2,0,"p",13),pl()(),Ds(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.autoWorktree.set(s))}),pl(),_I(),NC(19," Offer a worktree to every new top-level case "),pl(),Ds(20,"p",18),NC(21," 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. "),pl()(),Ds(22,"ds-form-field",19)(23,"input",20),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.setupCommand.set(s))}),pl(),_I(),Ds(24,"p",13),NC(25," 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. "),pl()()(),Ds(26,"ds-form-actions")(27,"button",21),mg("click",function(){df(e);let s=Jw();return ff(s.save())}),NC(28),pl(),Lw(29,pe,2,1,"button",22),pl();}if(i&2){let e=Jw();jw(e.errorMessage()?0:-1),BE(),jw(e.associationLoaded()?-1:1),BE(),jw(e.isAssociated()&&e.checkoutStatus()?2:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(2),ug("ngModel",e.repositoryUrl()),NI(),BE(2),ug("ngModel",e.mainBranch()),NI(),BE(2),ug("ngModel",e.serviceAuthSettingId()),NI(),BE(3),Uw(e.eligibleAuthSettings()),BE(2),jw(e.eligibleAuthSettings().length===0?14:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(3),ug("ngModel",e.autoWorktree()),NI(),BE(5),ug("ngModel",e.setupCommand()),NI(),BE(4),ug("disabled",!e.canSave()),BE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),BE(),jw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(Ie);isLoading=Ui(true);isSaving=Ui(false);confirmingRemove=Ui(false);associationLoaded=Ui(false);errorMessage=Ui(null);association=Ui(null);authSettings=Ui([]);repositoryUrl=Ui("");mainBranch=Ui("main");serviceAuthSettingId=Ui("");autoWorktree=Ui(false);setupCommand=Ui("");namespaceId="";isAssociated=XC(()=>this.association()?.associated===true);eligibleAuthSettings=XC(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=XC(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=XC(()=>this.association()?.checkoutStatus??null);CheckoutStatus=$e;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),Ty({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),da(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),da(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(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||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","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."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Lw(2,ae,2,0,"p",1)(3,ue,30,14),pl(),Ds(4,"ds-confirm-dialog",2),mg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),pl()),e&2&&(BE(2),jw(c.isLoading()?2:3),BE(2),ug("open",c.confirmingRemove()));},dependencies:[id,bo,xo,Lt,vn,Gt,mo,da$1,Ni,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};
2
2
  export{ne as NamespaceGitComponent};
@@ -1 +1 @@
1
- import {z as k$1,O,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-B-oMBbkF.js';import {g,F,I as Ie,ap as F$1,$ as Cr,U as Ui,a1 as fa,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,k as cg,r as df,s as ff}from'./main-STOFVKFA.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Ds(0,"p",3),NC(1),pl()),i&2){let t=Jw();BE(),Og(t.deletion.error());}}function U(i,e){i&1&&(Ds(0,"p",4),NC(1,"Loading AI providers\u2026"),pl());}function j(i,e){i&1&&(Ds(0,"p",5),NC(1,"No platform AI providers defined yet."),pl());}function K(i,e){i&1&&(Ds(0,"p",4),NC(1,"No AI providers match the current filter."),pl());}function H(i,e){if(i&1){let t=Zw();Ds(0,"button",19),mg("click",function(){df(t);let s=Jw().$implicit,m=Jw(2);return ff(m.edit(s))}),NC(1," Edit "),pl();}if(i&2){let t=Jw().$implicit;cg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=Zw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let s=Jw().$implicit,m=Jw(2);return ff(m.deletion.request(s.id))})("deleteConfirmed",function(){df(t);let s=Jw().$implicit,m=Jw(2);return ff(m.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Jw(3);return ff(s.deletion.cancel())}),pl();}if(i&2){let t=Jw().$implicit,r=Jw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15)(8,"div",16),Lw(9,H,2,1,"button",17),Lw(10,z,1,3,"agentos-row-delete-action",18),pl()()()),i&2){let t=e.$implicit,r=Jw(2);BE(2),Og(t.name),BE(2),Og(t.apiType),BE(2),Og(t.baseUrl||"\u2014"),BE(3),jw(r.deletion.confirmingId()!==t.id?9:-1),BE(),jw(t.id?10:-1);}}function J(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"API type"),pl(),Ds(8,"th",10),NC(9,"Base URL"),pl(),Ds(10,"th",10)(11,"span",11),NC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Hw(14,G,11,5,"tr",9,B),pl()()()),i&2){let t=Jw();BE(14),Uw(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(Ie);aiProviderController=g(F$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k$1();providers=Ui([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),NC(3,"New AI provider"),pl()(),Lw(4,M,2,1,"p",3),Lw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(BE(),ug("query",r.rowFilter.query()),BE(3),jw(r.deletion.error()?4:-1),BE(),jw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
1
+ import {z as k$1,O,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-C20Tq5VN.js';import {g,F,I as Ie,ap as F$1,$ as Cr,U as Ui,a1 as fa,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,k as cg,r as df,s as ff}from'./main-M62523CG.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Ds(0,"p",3),NC(1),pl()),i&2){let t=Jw();BE(),Og(t.deletion.error());}}function U(i,e){i&1&&(Ds(0,"p",4),NC(1,"Loading AI providers\u2026"),pl());}function j(i,e){i&1&&(Ds(0,"p",5),NC(1,"No platform AI providers defined yet."),pl());}function K(i,e){i&1&&(Ds(0,"p",4),NC(1,"No AI providers match the current filter."),pl());}function H(i,e){if(i&1){let t=Zw();Ds(0,"button",19),mg("click",function(){df(t);let s=Jw().$implicit,m=Jw(2);return ff(m.edit(s))}),NC(1," Edit "),pl();}if(i&2){let t=Jw().$implicit;cg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=Zw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let s=Jw().$implicit,m=Jw(2);return ff(m.deletion.request(s.id))})("deleteConfirmed",function(){df(t);let s=Jw().$implicit,m=Jw(2);return ff(m.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Jw(3);return ff(s.deletion.cancel())}),pl();}if(i&2){let t=Jw().$implicit,r=Jw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15)(8,"div",16),Lw(9,H,2,1,"button",17),Lw(10,z,1,3,"agentos-row-delete-action",18),pl()()()),i&2){let t=e.$implicit,r=Jw(2);BE(2),Og(t.name),BE(2),Og(t.apiType),BE(2),Og(t.baseUrl||"\u2014"),BE(3),jw(r.deletion.confirmingId()!==t.id?9:-1),BE(),jw(t.id?10:-1);}}function J(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"API type"),pl(),Ds(8,"th",10),NC(9,"Base URL"),pl(),Ds(10,"th",10)(11,"span",11),NC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Hw(14,G,11,5,"tr",9,B),pl()()()),i&2){let t=Jw();BE(14),Uw(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(Ie);aiProviderController=g(F$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k$1();providers=Ui([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),NC(3,"New AI provider"),pl()(),Lw(4,M,2,1,"p",3),Lw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(BE(),ug("query",r.rowFilter.query()),BE(3),jw(r.deletion.error()?4:-1),BE(),jw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};