@whoz-oss/coday-client 0.0.0-workstream-forge.327 → 0.0.0-workstream-forge.329

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 (53) hide show
  1. package/browser/{chunk-e5qg27G2.js → chunk-4XyXLv7M.js} +1 -1
  2. package/browser/{chunk-CpC2V56W.js → chunk-55LWJGaA.js} +1 -1
  3. package/browser/{chunk-B6QDDnOW.js → chunk-9kt9Zpi9.js} +1 -1
  4. package/browser/{chunk-BNwyfYSr.js → chunk-B-eADh5Q.js} +1 -1
  5. package/browser/{chunk-CoPRV7_K.js → chunk-B3AHVGbg.js} +1 -1
  6. package/browser/{chunk-BJB2wYDC.js → chunk-BDLuQKQn.js} +1 -1
  7. package/browser/{chunk-CZPehjGB.js → chunk-BUczjq1y.js} +1 -1
  8. package/browser/{chunk-D6j56Kh6.js → chunk-BYaUEPYY.js} +1 -1
  9. package/browser/{chunk-DiQNvMeR.js → chunk-B_yQQni6.js} +1 -1
  10. package/browser/{chunk-ChwyhN7l.js → chunk-BhTrfE6J.js} +1 -1
  11. package/browser/{chunk-YwnuVV6j.js → chunk-Bpq2cxDs.js} +1 -1
  12. package/browser/{chunk-D0iMXAi6.js → chunk-BuhxCyTp.js} +1 -1
  13. package/browser/{chunk-DGvA9EMF.js → chunk-BxoAK56U.js} +1 -1
  14. package/browser/{chunk-Dt0eIaud.js → chunk-C1ehWUNM.js} +1 -1
  15. package/browser/{chunk-CjbU1hmS.js → chunk-C2_MZOh9.js} +1 -1
  16. package/browser/{chunk-B6sYf1j_.js → chunk-C4rthJME.js} +1 -1
  17. package/browser/{chunk-Bmt85b9e.js → chunk-CJ1G9ZZ4.js} +1 -1
  18. package/browser/{chunk-d7qpGlVe.js → chunk-CSCGguJE.js} +1 -1
  19. package/browser/{chunk-CzNxwmwF.js → chunk-CU9M40tK.js} +1 -1
  20. package/browser/{chunk-GWxavAtB.js → chunk-CgSo-dYR.js} +1 -1
  21. package/browser/{chunk-EZsHLrVl.js → chunk-ChZCgoPM.js} +1 -1
  22. package/browser/{chunk-Cdygrlhj.js → chunk-CkbvRYAk.js} +1 -1
  23. package/browser/{chunk-DZp724cW.js → chunk-Cqvh5zMj.js} +1 -1
  24. package/browser/{chunk-JrGCfHkP.js → chunk-D1CD3CQL.js} +1 -1
  25. package/browser/{chunk-V5vAYMRr.js → chunk-D2xcbQ3c.js} +1 -1
  26. package/browser/{chunk-B4QJcXnP.js → chunk-DBAtlRoH.js} +1 -1
  27. package/browser/{chunk-BzCl7uMh.js → chunk-DCdnLzkw.js} +1 -1
  28. package/browser/{chunk-NNFw4bVT.js → chunk-DNzk8sl-.js} +1 -1
  29. package/browser/{chunk-B_HwXrtQ.js → chunk-DVvBqlA6.js} +1 -1
  30. package/browser/{chunk-mVP550cv.js → chunk-DW1F1agi.js} +1 -1
  31. package/browser/chunk-DZ_uca7F.js +1 -0
  32. package/browser/{chunk-BX0TCJGF.js → chunk-DcwIvh2i.js} +1 -1
  33. package/browser/chunk-DeZZAjYs.js +1 -0
  34. package/browser/{chunk-D0BRxefp.js → chunk-DgytN0P6.js} +1 -1
  35. package/browser/{chunk-DHPXIsXJ.js → chunk-Dsekephn.js} +1 -1
  36. package/browser/{chunk-VbI0SYDI.js → chunk-Dyc2eHCz.js} +12 -12
  37. package/browser/{chunk-NSyXB8Tu.js → chunk-FgaKW7JT.js} +1 -1
  38. package/browser/{chunk-CDqiY5Rf.js → chunk-H55X8917.js} +1 -1
  39. package/browser/{chunk-Cp6XPrd_.js → chunk-IQzQsjXY.js} +1 -1
  40. package/browser/chunk-KoagtDeJ.js +1 -0
  41. package/browser/{chunk-C0Lw7VMt.js → chunk-QNrc6Dr5.js} +1 -1
  42. package/browser/{chunk-BKQaiiDm.js → chunk-QfQLJc6L.js} +1 -1
  43. package/browser/{chunk-rvd0XXmM.js → chunk-ZTrp2NAu.js} +1 -1
  44. package/browser/{chunk-BiC6IJLJ.js → chunk-_or-ZV6c.js} +1 -1
  45. package/browser/{chunk-BtllBdOZ.js → chunk-cTQHZeWw.js} +1 -1
  46. package/browser/{chunk-BQgwuEVI.js → chunk-fcRhoM7k.js} +1 -1
  47. package/browser/{chunk-C_tG-O6X.js → chunk-kV_5OY32.js} +1 -1
  48. package/browser/index.html +1 -1
  49. package/browser/{main-6TWWBEJW.js → main-KN7JT2CK.js} +13 -13
  50. package/package.json +1 -1
  51. package/browser/chunk-BNW_UB32.js +0 -1
  52. package/browser/chunk-CG27SgJm.js +0 -1
  53. package/browser/chunk-DQ809zoB.js +0 -1
@@ -1 +1 @@
1
- import {I as I$1}from'./chunk-DQ809zoB.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-6TWWBEJW.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-VbI0SYDI.js';import'./chunk-CG27SgJm.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Is(0,"p",3),UC(1),ml()),e&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading auth settings\u2026"),ml());}function H(e,t){e&1&&(Is(0,"p",5),UC(1,"No platform auth settings defined yet."),ml());}function U(e,t){e&1&&(Is(0,"p",4),UC(1,"No auth settings match the current filter."),ml());}function z(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onEdit(d))}),UC(1," Edit "),ml();}if(e&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(e&2){let n=fC().$implicit,a=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),e&2){let n=t.$implicit,a=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.authType," "),KE(3),Kw(a.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(e,t){if(e&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Authentication type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,B),ml()()()),e&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();settings=zi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","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,a){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return a.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New auth setting"),ml()(),Qw(4,j,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
1
+ import {I as I$1}from'./chunk-DeZZAjYs.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-KN7JT2CK.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import'./chunk-KoagtDeJ.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Is(0,"p",3),UC(1),ml()),e&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading auth settings\u2026"),ml());}function H(e,t){e&1&&(Is(0,"p",5),UC(1,"No platform auth settings defined yet."),ml());}function U(e,t){e&1&&(Is(0,"p",4),UC(1,"No auth settings match the current filter."),ml());}function z(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onEdit(d))}),UC(1," Edit "),ml();}if(e&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(e&2){let n=fC().$implicit,a=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),e&2){let n=t.$implicit,a=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.authType," "),KE(3),Kw(a.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(e,t){if(e&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Authentication type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,B),ml()()()),e&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();settings=zi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","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,a){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return a.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New auth setting"),ml()(),Qw(4,j,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -1 +1 @@
1
- import {s}from'./chunk-VbI0SYDI.js';import {g,W,E as ry,G as y,x as xw,y as yl,U as UC,v as vl,K as KE,L as Lg}from'./main-6TWWBEJW.js';var A=class r{route=g(W);http=g(ry);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(s,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(s,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(yl(0,"p",0),UC(1),vl()),t&2&&(KE(),Lg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
1
+ import {s}from'./chunk-Dyc2eHCz.js';import {g,W,E as ry,G as y,x as xw,y as yl,U as UC,v as vl,K as KE,L as Lg}from'./main-KN7JT2CK.js';var A=class r{route=g(W);http=g(ry);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(s,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(s,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(yl(0,"p",0),UC(1),vl()),t&2&&(KE(),Lg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
@@ -1 +1 @@
1
- import {v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,F as Ni,G as c}from'./chunk-VbI0SYDI.js';import {g,W as W$1,F,J as we,ai as U,z as zi,k as yT,M as U$1,x as xw,av as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,c as xg,q as Il,l as eC,t as tC,s as aC,a as hg,aw as uT,ax as dT,u as mf,w as yf,ay as iE}from'./main-6TWWBEJW.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Is(0,"p",3),UC(1,"Loading\u2026"),ml());}function Q(t,n){t&1&&(Is(0,"ds-notice"),UC(1,"Failed to load agent definition."),ml());}function W(t,n){if(t&1&&(Is(0,"dt"),UC(1,"User context"),ml(),Is(2,"dd",6),UC(3),ml()),t&2){let e=fC();KE(3),Lg(e.userId);}}function X(t,n){if(t&1){let e=aC();Is(0,"ds-card")(1,"ds-disclosure",12),Eg("toggled",function(){mf(e);let m=fC(2);return yf(m.toggleSystemPrompt())}),Is(2,"pre",13),UC(3),ml()()();}if(t&2){let e=fC(),r=fC();KE(),pg("open",!r.systemPromptCollapsed()),KE(2),Lg(e.systemPrompt);}}function Y(t,n){if(t&1){let e=aC();Is(0,"ds-card")(1,"ds-disclosure",14),Eg("toggled",function(){mf(e);let m=fC(2);return yf(m.toggleInstructions())}),Is(2,"pre",13),UC(3),ml()()();}if(t&2){let e=fC(),r=fC();KE(),pg("open",!r.instructionsCollapsed()),KE(2),Lg(e.instructions);}}function Z(t,n){t&1&&(Is(0,"p",3),UC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),ml());}function ee(t,n){t&1&&(Is(0,"span",17),UC(1,"platform"),ml());}function te(t,n){t&1&&(Is(0,"span",17),UC(1,"SKILL.md"),ml());}function ne(t,n){if(t&1&&(Is(0,"li",15)(1,"span")(2,"span",16),UC(3),ml(),Qw(4,ee,2,0,"span",17),Qw(5,te,2,0,"span",17),ml(),Is(6,"p",3),UC(7),ml()()),t&2){let e=n.$implicit;KE(3),Lg(e.name),KE(),Kw(e.namespaceId?-1:4),KE(),Kw(e.readOnly?5:-1),KE(2),Lg(e.description);}}function ie(t,n){if(t&1&&(Is(0,"ul",11),eC(1,ne,8,4,"li",15,j),ml()),t&2){let e=fC(2);KE(),tC(e.resolvedSkills());}}function oe(t,n){t&1&&(Is(0,"p",3),UC(1,"No tools available for this agent."),ml());}function ae(t,n){if(t&1&&(hg(0,"div",19),uT(1,"agentosMarkdown")),t&2){let e=fC().$implicit;pg("innerHTML",dT(1,1,e.description),iE);}}function de(t,n){if(t&1){let e=aC();Is(0,"li")(1,"ds-disclosure",18),Eg("toggled",function(){let m=mf(e).$implicit,U=fC(3);return yf(U.toggleTool(m))}),Qw(2,ae,2,3,"div",19),Is(3,"pre",20),UC(4),ml()()();}if(t&2){let e=n.$implicit,r=fC(3);KE(),pg("heading",e.name)("open",r.isToolExpanded(e)),KE(),Kw(e.description?2:-1),KE(2),Lg(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Is(0,"ul",11),eC(1,de,5,4,"li",null,z),ml()),t&2){let e=fC();KE(),tC(e.tools);}}function se(t,n){if(t&1&&(Is(0,"ds-card",4)(1,"dl",5)(2,"dt"),UC(3,"Name"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"Resolved model"),ml(),Is(8,"dd",6),UC(9),ml(),Is(10,"dt"),UC(11,"Provider"),ml(),Is(12,"dd"),UC(13),ml(),Is(14,"dt",7),UC(15,"Execution mode"),ml(),Is(16,"dd",8)(17,"span",9),UC(18),ml()(),Qw(19,W,4,1),ml()(),Qw(20,X,4,2,"ds-card"),Qw(21,Y,4,2,"ds-card"),Is(22,"ds-card",10),Qw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),ml(),Is(25,"ds-card",10),Qw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),ml()),t&2){let e=n,r=fC();KE(5),Lg(e.name),KE(4),Lg(e.resolvedModelApiName),KE(4),Lg(e.resolvedProviderName),KE(4),xg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),KE(),Il(" ",e.executionMode," "),KE(),Kw(e.userId?19:-1),KE(),Kw(e.systemPrompt?20:-1),KE(),Kw(e.instructions?21:-1),KE(),pg("heading","Skills ("+r.resolvedSkills().length+")"),KE(),Kw(r.resolvedSkills().length===0?23:24),KE(2),pg("heading","Tools ("+e.tools.length+")"),KE(),Kw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);definition=zi(null);expandedTools=zi(new Set);resolvedSkills=yT(()=>this.definition()?.skills??[]);systemPromptCollapsed=zi(true);instructionsCollapsed=zi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let r=new Set(e);return r.has(n.name)?r.delete(n.name):r.add(n.name),r});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=xw({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,r){if(e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return r.back()}),UC(3," \u2190 Agent configs "),ml(),Is(4,"a",2),UC(5,"Edit config \u2192"),ml()(),Qw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),ml()),e&2){let m;KE(4),pg("routerLink",r.editRoute()),KE(2),Kw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ni,c],encapsulation:2})};export{K as AgentConfigInspectComponent};
1
+ import {v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,F as Ni,G as c}from'./chunk-Dyc2eHCz.js';import {g,W as W$1,F,J as we,ai as U,z as zi,k as yT,M as U$1,x as xw,aw as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,c as xg,q as Il,l as eC,t as tC,s as aC,a as hg,ax as uT,ay as dT,u as mf,w as yf,az as iE}from'./main-KN7JT2CK.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Is(0,"p",3),UC(1,"Loading\u2026"),ml());}function Q(t,n){t&1&&(Is(0,"ds-notice"),UC(1,"Failed to load agent definition."),ml());}function W(t,n){if(t&1&&(Is(0,"dt"),UC(1,"User context"),ml(),Is(2,"dd",6),UC(3),ml()),t&2){let e=fC();KE(3),Lg(e.userId);}}function X(t,n){if(t&1){let e=aC();Is(0,"ds-card")(1,"ds-disclosure",12),Eg("toggled",function(){mf(e);let m=fC(2);return yf(m.toggleSystemPrompt())}),Is(2,"pre",13),UC(3),ml()()();}if(t&2){let e=fC(),r=fC();KE(),pg("open",!r.systemPromptCollapsed()),KE(2),Lg(e.systemPrompt);}}function Y(t,n){if(t&1){let e=aC();Is(0,"ds-card")(1,"ds-disclosure",14),Eg("toggled",function(){mf(e);let m=fC(2);return yf(m.toggleInstructions())}),Is(2,"pre",13),UC(3),ml()()();}if(t&2){let e=fC(),r=fC();KE(),pg("open",!r.instructionsCollapsed()),KE(2),Lg(e.instructions);}}function Z(t,n){t&1&&(Is(0,"p",3),UC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),ml());}function ee(t,n){t&1&&(Is(0,"span",17),UC(1,"platform"),ml());}function te(t,n){t&1&&(Is(0,"span",17),UC(1,"SKILL.md"),ml());}function ne(t,n){if(t&1&&(Is(0,"li",15)(1,"span")(2,"span",16),UC(3),ml(),Qw(4,ee,2,0,"span",17),Qw(5,te,2,0,"span",17),ml(),Is(6,"p",3),UC(7),ml()()),t&2){let e=n.$implicit;KE(3),Lg(e.name),KE(),Kw(e.namespaceId?-1:4),KE(),Kw(e.readOnly?5:-1),KE(2),Lg(e.description);}}function ie(t,n){if(t&1&&(Is(0,"ul",11),eC(1,ne,8,4,"li",15,j),ml()),t&2){let e=fC(2);KE(),tC(e.resolvedSkills());}}function oe(t,n){t&1&&(Is(0,"p",3),UC(1,"No tools available for this agent."),ml());}function ae(t,n){if(t&1&&(hg(0,"div",19),uT(1,"agentosMarkdown")),t&2){let e=fC().$implicit;pg("innerHTML",dT(1,1,e.description),iE);}}function de(t,n){if(t&1){let e=aC();Is(0,"li")(1,"ds-disclosure",18),Eg("toggled",function(){let m=mf(e).$implicit,U=fC(3);return yf(U.toggleTool(m))}),Qw(2,ae,2,3,"div",19),Is(3,"pre",20),UC(4),ml()()();}if(t&2){let e=n.$implicit,r=fC(3);KE(),pg("heading",e.name)("open",r.isToolExpanded(e)),KE(),Kw(e.description?2:-1),KE(2),Lg(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Is(0,"ul",11),eC(1,de,5,4,"li",null,z),ml()),t&2){let e=fC();KE(),tC(e.tools);}}function se(t,n){if(t&1&&(Is(0,"ds-card",4)(1,"dl",5)(2,"dt"),UC(3,"Name"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"Resolved model"),ml(),Is(8,"dd",6),UC(9),ml(),Is(10,"dt"),UC(11,"Provider"),ml(),Is(12,"dd"),UC(13),ml(),Is(14,"dt",7),UC(15,"Execution mode"),ml(),Is(16,"dd",8)(17,"span",9),UC(18),ml()(),Qw(19,W,4,1),ml()(),Qw(20,X,4,2,"ds-card"),Qw(21,Y,4,2,"ds-card"),Is(22,"ds-card",10),Qw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),ml(),Is(25,"ds-card",10),Qw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),ml()),t&2){let e=n,r=fC();KE(5),Lg(e.name),KE(4),Lg(e.resolvedModelApiName),KE(4),Lg(e.resolvedProviderName),KE(4),xg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),KE(),Il(" ",e.executionMode," "),KE(),Kw(e.userId?19:-1),KE(),Kw(e.systemPrompt?20:-1),KE(),Kw(e.instructions?21:-1),KE(),pg("heading","Skills ("+r.resolvedSkills().length+")"),KE(),Kw(r.resolvedSkills().length===0?23:24),KE(2),pg("heading","Tools ("+e.tools.length+")"),KE(),Kw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);definition=zi(null);expandedTools=zi(new Set);resolvedSkills=yT(()=>this.definition()?.skills??[]);systemPromptCollapsed=zi(true);instructionsCollapsed=zi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let r=new Set(e);return r.has(n.name)?r.delete(n.name):r.add(n.name),r});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=xw({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,r){if(e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return r.back()}),UC(3," \u2190 Agent configs "),ml(),Is(4,"a",2),UC(5,"Edit config \u2192"),ml()(),Qw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),ml()),e&2){let m;KE(4),pg("routerLink",r.editRoute()),KE(2),Kw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ni,c],encapsulation:2})};export{K as AgentConfigInspectComponent};
@@ -1 +1 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-YwnuVV6j.js';import {g,W,J as we,z as zi,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,r as fC,L as Lg}from'./main-6TWWBEJW.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-VbI0SYDI.js';import'./chunk-CG27SgJm.js';function O(r,e){r&1&&(Is(0,"p",1),UC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),UC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),UC(2,"YAML"),ml(),Is(3,"ds-tag",10),UC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Qw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),UC(4,"Name"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"Type"),ml(),Is(9,"dd",5),UC(10),ml(),Is(11,"dt"),UC(12,"Description"),ml(),Is(13,"dd"),UC(14),ml(),Is(15,"dt"),UC(16,"Scope"),ml(),Is(17,"dd"),UC(18),ml(),Is(19,"dt"),UC(20,"Source"),ml(),Is(21,"dd"),UC(22),ml(),Is(23,"dt"),UC(24,"Auto grant"),ml(),Is(25,"dd"),UC(26),ml(),Is(27,"dt"),UC(28,"Auth setting"),ml(),Is(29,"dd"),UC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),UC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),UC(35),ml()()),r&2){let o=e,a=fC();KE(),Kw(a.source()==="FILESYSTEM"?1:-1),KE(5),Lg(o.name),KE(4),Lg(o.integrationType),KE(4),Lg(o.description||"\u2014"),KE(4),Lg(a.scopeOf(o)),KE(4),Lg(a.source()),KE(4),Lg(o.autoGrant?"Enabled":"Disabled"),KE(4),Lg(o.authSettingName||"None"),KE(5),Lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Qw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;KE(2),Kw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
1
+ import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-Bpq2cxDs.js';import {g,W,J as we,z as zi,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,r as fC,L as Lg}from'./main-KN7JT2CK.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-Dyc2eHCz.js';import'./chunk-KoagtDeJ.js';function O(r,e){r&1&&(Is(0,"p",1),UC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),UC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),UC(2,"YAML"),ml(),Is(3,"ds-tag",10),UC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Qw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),UC(4,"Name"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"Type"),ml(),Is(9,"dd",5),UC(10),ml(),Is(11,"dt"),UC(12,"Description"),ml(),Is(13,"dd"),UC(14),ml(),Is(15,"dt"),UC(16,"Scope"),ml(),Is(17,"dd"),UC(18),ml(),Is(19,"dt"),UC(20,"Source"),ml(),Is(21,"dd"),UC(22),ml(),Is(23,"dt"),UC(24,"Auto grant"),ml(),Is(25,"dd"),UC(26),ml(),Is(27,"dt"),UC(28,"Auth setting"),ml(),Is(29,"dd"),UC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),UC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),UC(35),ml()()),r&2){let o=e,a=fC();KE(),Kw(a.source()==="FILESYSTEM"?1:-1),KE(5),Lg(o.name),KE(4),Lg(o.integrationType),KE(4),Lg(o.description||"\u2014"),KE(4),Lg(a.scopeOf(o)),KE(4),Lg(a.source()),KE(4),Lg(o.autoGrant?"Enabled":"Disabled"),KE(4),Lg(o.authSettingName||"None"),KE(5),Lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Qw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;KE(2),Kw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -1 +1 @@
1
- import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-VbI0SYDI.js';import {g,W,F,J as we,as as F$1,ar as k,ab as F$2,a2 as ga,ac as _r,at as De,k as yT,z as zi,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,a as hg,T as VI,l as eC,aq as Jw,r as fC,X as UI,t as tC,q as Il,ag as Zw,L as Lg,a5 as jg,u as mf,w as yf}from'./main-6TWWBEJW.js';function he(r,t){r&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=fC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),UC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),KE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),UC(2,"Select provider"),ml(),eC(3,ye,2,3,"option",44,Zw().trackByProvider,true),ml(),VI()),r&2){let e=fC(2);pg("formControl",e.aiProviderIdControl),UI(),KE(3),tC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),UC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),KE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),UC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),UC(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. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),UC(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. "),ml());}function Ae(r,t){if(r&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=fC();return yf(u.submit())}),Is(1,"ds-form-field",5),Qw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),VI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),VI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),VI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),VI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),VI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),VI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),UC(22,"Provider default"),ml(),eC(23,xe,2,2,"option",25,Jw),ml(),VI(),Qw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Qw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),VI(),Is(31,"span",30),UC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),UC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),VI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),VI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),VI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),VI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),UC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=fC();return yf(u.cancel())}),UC(50,"Cancel"),ml()()();}if(r&2){let e=fC();pg("formGroup",e.form),KE(2),Kw(e.isEditMode()?2:3),KE(3),pg("formControl",e.apiModelNameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.aliasControl),UI(),KE(2),pg("formControl",e.priorityControl),UI(),KE(3),pg("formControl",e.temperatureControl),UI(),KE(2),pg("formControl",e.contextWindowControl),UI(),KE(2),pg("formControl",e.maxCompletionTokensControl),UI(),KE(2),pg("formControl",e.reasoningEffortControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.reasoningEffortOptions),KE(2),Kw(e.reasoningEffortUnsupported()?25:26),KE(2),Kw(e.temperatureMayConflictWithEffort()?27:-1),KE(3),pg("formControl",e.supportsAdvancedExecutionControl),UI(),KE(5),pg("formGroup",e.pricingGroup),KE(3),UI(),KE(2),UI(),KE(3),UI(),KE(2),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.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(De);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=yT(()=>{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=yT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=yT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),UC(3," \u2190 AI models "),ml()(),Qw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(KE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),KE(3),Kw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
1
+ import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-Dyc2eHCz.js';import {g,W,F,J as we,at as F$1,as as k,ab as F$2,a2 as ga,ac as _r,au as We,k as yT,z as zi,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,a as hg,T as VI,l as eC,ar as Jw,r as fC,X as UI,t as tC,q as Il,ag as Zw,L as Lg,a5 as jg,u as mf,w as yf}from'./main-KN7JT2CK.js';function he(r,t){r&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=fC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),UC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),KE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),UC(2,"Select provider"),ml(),eC(3,ye,2,3,"option",44,Zw().trackByProvider,true),ml(),VI()),r&2){let e=fC(2);pg("formControl",e.aiProviderIdControl),UI(),KE(3),tC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),UC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),KE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),UC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),UC(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. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),UC(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. "),ml());}function Ae(r,t){if(r&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=fC();return yf(u.submit())}),Is(1,"ds-form-field",5),Qw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),VI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),VI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),VI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),VI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),VI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),VI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),UC(22,"Provider default"),ml(),eC(23,xe,2,2,"option",25,Jw),ml(),VI(),Qw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Qw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),VI(),Is(31,"span",30),UC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),UC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),VI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),VI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),VI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),VI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),UC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=fC();return yf(u.cancel())}),UC(50,"Cancel"),ml()()();}if(r&2){let e=fC();pg("formGroup",e.form),KE(2),Kw(e.isEditMode()?2:3),KE(3),pg("formControl",e.apiModelNameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.aliasControl),UI(),KE(2),pg("formControl",e.priorityControl),UI(),KE(3),pg("formControl",e.temperatureControl),UI(),KE(2),pg("formControl",e.contextWindowControl),UI(),KE(2),pg("formControl",e.maxCompletionTokensControl),UI(),KE(2),pg("formControl",e.reasoningEffortControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.reasoningEffortOptions),KE(2),Kw(e.reasoningEffortUnsupported()?25:26),KE(2),Kw(e.temperatureMayConflictWithEffort()?27:-1),KE(3),pg("formControl",e.supportsAdvancedExecutionControl),UI(),KE(5),pg("formGroup",e.pricingGroup),KE(3),UI(),KE(2),UI(),KE(3),UI(),KE(2),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.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(We);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=yT(()=>{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=yT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=yT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),UC(3," \u2190 AI models "),ml()(),Qw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(KE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),KE(3),Kw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-mVP550cv.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-VbI0SYDI.js';import {g,W,F,J as we,z as zi,ae as Ny,a2 as ga,ac as _r,M as U,P as x,O as w,ak as We,an as Je,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-6TWWBEJW.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function Y(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function z(n,t){n&1&&(Is(0,"p",5),UC(1,"No scheduled prompts available."),ml());}function G(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function Q(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.prompt.description);}}function X(n,t){n&1&&(Is(0,"ds-tag",20),UC(1,"Read-only"),ml());}function Z(n,t){if(n&1){let e=aC();Is(0,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.toggle(l))}),UC(1),ml(),Is(2,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.edit(l))}),UC(3," Edit "),ml();}if(n&2){let e=fC(2).$implicit;KE(),Lg(e.prompt.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=aC();Qw(0,Z,4,2),Is(1,"agentos-row-delete-action",24),Eg("deleteRequested",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.deletion.request(l.key))})("deleteConfirmed",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.confirmDelete(l))})("deleteCancelled",function(){mf(e);let l=fC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);Kw(i.deletion.confirmingId()!==e.key?0:-1),KE(),pg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Is(0,"button",23),UC(1,"Inherited"),ml());}function ne(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,Q,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19)(12,"ds-tag",17),UC(13),ml(),Qw(14,X,2,0,"ds-tag",20),ml()(),Is(15,"td",21)(16,"div",22),Qw(17,ee,2,4)(18,te,2,0,"button",23),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.prompt.name),KE(),Kw(e.prompt.description?4:-1),KE(2),Lg(i.scheduleLabel(e.prompt)),KE(2),pg("variant",e.prompt.enabled?"accent":"outline"),KE(),Lg(e.prompt.enabled?"Enabled":"Disabled"),KE(3),pg("variant",e.scope==="platform"?"neutral":"accent"),KE(),Lg(e.scope==="platform"?"Platform":"Namespace"),KE(),Kw(e.scope==="platform"?14:-1),KE(3),Kw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10),UC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,ne,19,9,"tr",9,J),ml()()()),n&2){let e=fC();KE(16),tC(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ny({platform:this.state.listPlatform().pipe(ga(()=>_r([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===We.WEEK?"week":"month",l=e.unit===We.WEEK&&e.days?.length?` (${e.days.map(p=>Je[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return i.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,O,2,1,"p",3),Qw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
1
+ import {c}from'./chunk-DW1F1agi.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import {g,W,F,J as we,z as zi,ae as Ny,a2 as ga,ac as _r,M as U,P as x,O as w,ak as Ge,ao as Ye,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-KN7JT2CK.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function Y(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function z(n,t){n&1&&(Is(0,"p",5),UC(1,"No scheduled prompts available."),ml());}function G(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function Q(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.prompt.description);}}function X(n,t){n&1&&(Is(0,"ds-tag",20),UC(1,"Read-only"),ml());}function Z(n,t){if(n&1){let e=aC();Is(0,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.toggle(l))}),UC(1),ml(),Is(2,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.edit(l))}),UC(3," Edit "),ml();}if(n&2){let e=fC(2).$implicit;KE(),Lg(e.prompt.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=aC();Qw(0,Z,4,2),Is(1,"agentos-row-delete-action",24),Eg("deleteRequested",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.deletion.request(l.key))})("deleteConfirmed",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.confirmDelete(l))})("deleteCancelled",function(){mf(e);let l=fC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);Kw(i.deletion.confirmingId()!==e.key?0:-1),KE(),pg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Is(0,"button",23),UC(1,"Inherited"),ml());}function ne(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,Q,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19)(12,"ds-tag",17),UC(13),ml(),Qw(14,X,2,0,"ds-tag",20),ml()(),Is(15,"td",21)(16,"div",22),Qw(17,ee,2,4)(18,te,2,0,"button",23),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.prompt.name),KE(),Kw(e.prompt.description?4:-1),KE(2),Lg(i.scheduleLabel(e.prompt)),KE(2),pg("variant",e.prompt.enabled?"accent":"outline"),KE(),Lg(e.prompt.enabled?"Enabled":"Disabled"),KE(3),pg("variant",e.scope==="platform"?"neutral":"accent"),KE(),Lg(e.scope==="platform"?"Platform":"Namespace"),KE(),Kw(e.scope==="platform"?14:-1),KE(3),Kw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10),UC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,ne,19,9,"tr",9,J),ml()()()),n&2){let e=fC();KE(16),tC(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ny({platform:this.state.listPlatform().pipe(ga(()=>_r([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===Ge.WEEK?"week":"month",l=e.unit===Ge.WEEK&&e.days?.length?` (${e.days.map(p=>Ye[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return i.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,O,2,1,"p",3),Qw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
@@ -1 +1 @@
1
- import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-VbI0SYDI.js';import {g,W,aQ as Q,z as zi,ad as le,p as Ff,x as xw,aR as Ob,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,am as Dd,a1 as ma,a3 as rn,ae as Ny,a2 as ga,U as UC,s as aC,S as Eg,aS as $g,T as VI,r as fC,aT as Ug,X as UI,l as eC,t as tC,aU as oT,aV as rT,L as Lg,j as fg,aw as uT,ax as dT,a5 as jg,q as Il,aW as fT,u as mf,w as yf,aX as ZC}from'./main-6TWWBEJW.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Is(0,"p",2),UC(1,"Loading usage settings\u2026"),ml());}function fe(e,a){if(e&1){let t=aC();Is(0,"ds-notice"),UC(1,"Could not load usage settings. Please try again."),ml(),Is(2,"div")(3,"button",3),Eg("click",function(){mf(t);let s=fC();return yf(s.configuration.retry())}),UC(4,"Retry usage settings"),ml()();}}function ye(e,a){e&1&&(Is(0,"p",2),UC(1,"Usage tracking is disabled."),ml());}function be(e,a){e&1&&(Is(0,"ds-notice"),UC(1),ml()),e&2&&(KE(),Lg(a));}function xe(e,a){e&1&&(Is(0,"p",2),UC(1,"Loading usage\u2026"),ml());}function he(e,a){e&1&&(Is(0,"p",12),UC(1,"No recorded usage for this period."),ml());}function Se(e,a){if(e&1&&(Is(0,"p",10),UC(1),ml()),e&2){let t=fC().$implicit;KE(),Il("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Is(0,"tr",16)(1,"td",18),UC(2),ml(),Is(3,"td",19),UC(4),uT(5,"number"),ml(),Is(6,"td",20),UC(7),uT(8,"number"),uT(9,"number"),ml(),Is(10,"td",21),UC(11),uT(12,"number"),uT(13,"number"),ml(),Is(14,"td",22),UC(15),uT(16,"agentosCost"),Qw(17,Se,2,1,"p",10),ml()()),e&2){let t=a.$implicit;KE(2),Lg(t.key),KE(2),Lg(dT(5,8,t.aggregate.totalTokens)),KE(3),jg(" ",dT(8,10,t.aggregate.inputTokens)," / ",dT(9,12,t.aggregate.outputTokens)," "),KE(4),jg(" ",dT(12,14,t.aggregate.cacheReadTokens)," / ",dT(13,16,t.aggregate.cacheWriteTokens)," "),KE(4),Il(" ",fT(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),KE(2),Kw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),UC(5,"Name"),ml(),Is(6,"th",17),UC(7,"Tokens"),ml(),Is(8,"th",17),UC(9,"Input / output"),ml(),Is(10,"th",17),UC(11,"Cache read / write"),ml(),Is(12,"th",17),UC(13,"Estimated cost"),ml()()(),Is(14,"tbody",15),eC(15,we,18,21,"tr",16,_e),ml()()()),e&2){let t=fC().$implicit;KE(),fg("aria-label","Usage "+t.title.toLowerCase()),KE(14),tC(t.rows);}}function Ne(e,a){if(e&1&&(Is(0,"h3",11),UC(1),ml(),Qw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;KE(),Lg(t.title),KE(),Kw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(eC(0,Ne,4,2,null,null,ue),Is(2,"p",10),UC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),ml()),e&2){let t=fC(2);tC(oT(4,ge,rT(0,ce,t.agents()),rT(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let s=fC();return yf(s.load())}),Is(1,"ds-form-field",5)(2,"input",6),$g("ngModelChange",function(s){mf(t);let m=fC();return ZC(m.from,s)||(m.from=s),yf(s)}),ml(),VI(),ml(),Is(3,"ds-form-field",7)(4,"input",8),$g("ngModelChange",function(s){mf(t);let m=fC();return ZC(m.to,s)||(m.to=s),yf(s)}),ml(),VI(),ml(),Is(5,"button",9),UC(6,"Refresh"),ml()(),Qw(7,be,2,1,"ds-notice"),Qw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=fC();KE(2),Ug("ngModel",r.from),UI(),KE(2),Ug("ngModel",r.to),UI(),KE(3),Kw((t=r.error())?7:-1,t),KE(),Kw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Q);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=zi([]);models=zi([]);error=zi(null);loading=zi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Ff(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Dd(void 0),ma(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),rn):(this.loading.set(true),Ny({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ga(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),rn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Qw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),ml()),t&2&&(KE(2),Kw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Ob,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
1
+ import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-Dyc2eHCz.js';import {g,W,aR as Q,z as zi,ad as le,p as Ff,x as xw,aS as Ob,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,am as Dd,a1 as ma,a3 as rn,ae as Ny,a2 as ga,U as UC,s as aC,S as Eg,aT as $g,T as VI,r as fC,aU as Ug,X as UI,l as eC,t as tC,aV as oT,aW as rT,L as Lg,j as fg,ax as uT,ay as dT,a5 as jg,q as Il,aX as fT,u as mf,w as yf,aY as ZC}from'./main-KN7JT2CK.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Is(0,"p",2),UC(1,"Loading usage settings\u2026"),ml());}function fe(e,a){if(e&1){let t=aC();Is(0,"ds-notice"),UC(1,"Could not load usage settings. Please try again."),ml(),Is(2,"div")(3,"button",3),Eg("click",function(){mf(t);let s=fC();return yf(s.configuration.retry())}),UC(4,"Retry usage settings"),ml()();}}function ye(e,a){e&1&&(Is(0,"p",2),UC(1,"Usage tracking is disabled."),ml());}function be(e,a){e&1&&(Is(0,"ds-notice"),UC(1),ml()),e&2&&(KE(),Lg(a));}function xe(e,a){e&1&&(Is(0,"p",2),UC(1,"Loading usage\u2026"),ml());}function he(e,a){e&1&&(Is(0,"p",12),UC(1,"No recorded usage for this period."),ml());}function Se(e,a){if(e&1&&(Is(0,"p",10),UC(1),ml()),e&2){let t=fC().$implicit;KE(),Il("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Is(0,"tr",16)(1,"td",18),UC(2),ml(),Is(3,"td",19),UC(4),uT(5,"number"),ml(),Is(6,"td",20),UC(7),uT(8,"number"),uT(9,"number"),ml(),Is(10,"td",21),UC(11),uT(12,"number"),uT(13,"number"),ml(),Is(14,"td",22),UC(15),uT(16,"agentosCost"),Qw(17,Se,2,1,"p",10),ml()()),e&2){let t=a.$implicit;KE(2),Lg(t.key),KE(2),Lg(dT(5,8,t.aggregate.totalTokens)),KE(3),jg(" ",dT(8,10,t.aggregate.inputTokens)," / ",dT(9,12,t.aggregate.outputTokens)," "),KE(4),jg(" ",dT(12,14,t.aggregate.cacheReadTokens)," / ",dT(13,16,t.aggregate.cacheWriteTokens)," "),KE(4),Il(" ",fT(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),KE(2),Kw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),UC(5,"Name"),ml(),Is(6,"th",17),UC(7,"Tokens"),ml(),Is(8,"th",17),UC(9,"Input / output"),ml(),Is(10,"th",17),UC(11,"Cache read / write"),ml(),Is(12,"th",17),UC(13,"Estimated cost"),ml()()(),Is(14,"tbody",15),eC(15,we,18,21,"tr",16,_e),ml()()()),e&2){let t=fC().$implicit;KE(),fg("aria-label","Usage "+t.title.toLowerCase()),KE(14),tC(t.rows);}}function Ne(e,a){if(e&1&&(Is(0,"h3",11),UC(1),ml(),Qw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;KE(),Lg(t.title),KE(),Kw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(eC(0,Ne,4,2,null,null,ue),Is(2,"p",10),UC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),ml()),e&2){let t=fC(2);tC(oT(4,ge,rT(0,ce,t.agents()),rT(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let s=fC();return yf(s.load())}),Is(1,"ds-form-field",5)(2,"input",6),$g("ngModelChange",function(s){mf(t);let m=fC();return ZC(m.from,s)||(m.from=s),yf(s)}),ml(),VI(),ml(),Is(3,"ds-form-field",7)(4,"input",8),$g("ngModelChange",function(s){mf(t);let m=fC();return ZC(m.to,s)||(m.to=s),yf(s)}),ml(),VI(),ml(),Is(5,"button",9),UC(6,"Refresh"),ml()(),Qw(7,be,2,1,"ds-notice"),Qw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=fC();KE(2),Ug("ngModel",r.from),UI(),KE(2),Ug("ngModel",r.to),UI(),KE(3),Kw((t=r.error())?7:-1,t),KE(),Kw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Q);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=zi([]);models=zi([]);error=zi(null);loading=zi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Ff(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Dd(void 0),ma(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),rn):(this.loading.set(true),Ny({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ga(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),rn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Qw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),ml()),t&2&&(KE(2),Kw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Ob,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
@@ -1 +1 @@
1
- import {I}from'./chunk-DQ809zoB.js';import {O}from'./chunk-YwnuVV6j.js';import {v}from'./chunk-B6sYf1j_.js';import {g,W,F,J as we,aa as J,ab as F$1,ac as _r,z as zi,ad as le,k as yT,a1 as ma,M as U,p as Ff,ae as Ny,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,a2 as ga,af as ne,s as aC,l as eC,ag as Zw,T as VI,a as hg,r as fC,t as tC,X as UI,q as Il,L as Lg,u as mf,w as yf}from'./main-6TWWBEJW.js';import {p as pt,T as Te$1,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,k as dn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn,Y as Yt}from'./chunk-VbI0SYDI.js';import'./chunk-CG27SgJm.js';var be=(i,e)=>e.value;function _e(i,e){i&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function xe(i,e){if(i&1&&(Is(0,"label",6),hg(1,"input",22),VI(),UC(2),ml()),i&2){let t=e.$implicit,n=fC(2);KE(),pg("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),UI(),KE(),Il(" ",t.label," ");}}function Ie(i,e){if(i&1&&(Is(0,"option",10),UC(1),ml()),i&2){let t=e.$implicit;pg("value",t.type),KE(),Lg(t.displayName);}}function Ne(i,e){if(i&1&&(Is(0,"option",10),UC(1),ml()),i&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Ae(i,e){if(i&1&&(Is(0,"div",18)(1,"label",6),hg(2,"input",23),VI(),UC(3," Grant automatically "),ml(),Is(4,"p",2),UC(5),ml()()),i&2){let t=fC(2);KE(2),pg("formControl",t.autoGrantControl),UI(),KE(3),Il(" Give this integration to ",t.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Ee(i,e){if(i&1){let t=aC();Is(0,"ds-card")(1,"ds-json-schema-form",24),Eg("valueChange",function(a){mf(t);let p=fC(2);return yf(p.onParamsChange(a))}),ml()();}if(i&2){let t=fC(2);KE(),pg("schema",e)("value",t.initialParams());}}function Fe(i,e){if(i&1){let t=aC();Is(0,"button",25),Eg("click",function(){mf(t);let a=fC(2);return yf(a.exportYaml())}),UC(1),ml();}if(i&2){let t=fC(2);pg("disabled",t.isExporting()),KE(),Il(" ",t.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Te(i,e){if(i&1){let t=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let a=fC();return yf(a.submit())}),Is(1,"ds-fieldset",5),eC(2,xe,3,4,"label",6,Zw().trackByScope,true),ml(),Is(4,"ds-form-field",7)(5,"select",8)(6,"option",9),UC(7,"Select type"),ml(),eC(8,Ie,2,2,"option",10,Zw().trackByType,true),ml(),VI(),ml(),Is(10,"ds-form-field",11),hg(11,"input",12),VI(),ml(),Is(12,"ds-form-field",13),hg(13,"textarea",14),VI(),ml(),Is(14,"ds-form-field",15)(15,"select",16)(16,"option",17),UC(17,"None"),ml(),eC(18,Ne,2,2,"option",10,be),ml(),VI(),ml(),Qw(20,Ae,6,2,"div",18),Qw(21,Ee,2,2,"ds-card"),Is(22,"ds-form-actions")(23,"button",19),UC(24),ml(),Qw(25,Fe,2,2,"button",20),Is(26,"button",21),Eg("click",function(){mf(t);let a=fC();return yf(a.cancel())}),UC(27,"Cancel"),ml()()();}if(i&2){let t,n=fC();pg("formGroup",n.form),KE(),pg("disabled",n.isEditMode()),KE(),tC(n.scopeOptions),KE(3),pg("formControl",n.typeControl),UI(),KE(3),tC(n.integrationTypes()),KE(3),pg("formControl",n.nameControl),UI(),KE(2),pg("formControl",n.descriptionControl),UI(),KE(2),pg("formControl",n.authSettingNameControl),UI(),KE(),pg("ngValue",null),KE(2),tC(n.authSettingOptions()),KE(2),Kw(n.isAutoGrantable()?20:-1),KE(),Kw((t=n.schema())?21:-1,t),KE(2),pg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),KE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),KE(),Kw(n.isEditMode()?25:-1);}}var Ve=new Set(["platform","namespace","userOnNs","userGlobal"]),w=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ve=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(O);integrationTypeController=g(J);authSettingState=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?_r(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te$1(null),type:new Te$1("",{nonNullable:true,validators:[bn.required]}),scope:new Te$1("namespace",{nonNullable:true}),autoGrant:new Te$1(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);scopeOptions=[{value:"platform",label:w.platform},{value:"namespace",label:w.namespace},{value:"userOnNs",label:w.userOnNs},{value:"userGlobal",label:w.userGlobal}];authSettingNameControl=new Te$1(null);loadedAuthSettings=zi([]);authSettingsLoaded=zi(false);savedAuthSettingName=zi(null);authSettingsScope$=new le;authSettingOptions=yT(()=>{let e=this.loadedAuthSettings(),t=this.savedAuthSettingName();return !t||!this.authSettingsLoaded()||e.some(n=>n.value===t)?e:[...e,{value:t,label:`${t} (not found)`}]});paramsValue=zi(null);initialParams=zi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=yT(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});isAutoGrantable=yT(()=>{let e=this.selectedType();return e?this.integrationTypes().find(t=>t.type===e)?.autoGrantable??false:false});autoGrantReach=yT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){this.authSettingsScope$.pipe(ma(e=>this.loadAuthSettingLayers(e)),U(this.destroyRef)).subscribe(e=>{this.loadedAuthSettings.set(this.toAuthSettingOptions(e)),this.authSettingsLoaded.set(true);}),Ff(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let a=this.parseScope(t.get("scope"));this.scopeControl.setValue(a),this.loadAuthSettingsForScope(a),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(D=>{this.loadAuthSettingsForScope(D);});let p=t.get("template");p&&this.hydrateFromTemplate(p);}parseScope(e){return e&&Ve.has(e)?e:"namespace"}deriveScopeFromConfig(e){return !e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t;let n=this.deriveScopeFromConfig(t);this.scopeControl.setValue(n),this.applyConfigToForm(t),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters),this.authSettingNameControl.setValue(e.authSettingName??null),this.savedAuthSettingName.set(e.authSettingName??null),this.autoGrantControl.setValue(e.autoGrant??false);}loadAuthSettingsForScope(e){this.authSettingsLoaded.set(false),this.authSettingsScope$.next(e);}loadAuthSettingLayers(e){let t=(p,D)=>D.pipe(ga(()=>_r([])),ne(Se=>({label:p,settings:Se}))),n=t("platform",this.authSettingState.loadPlatformSettings()),a=t("mine",this.authSettingState.loadUserSettings("global"));return e==="platform"||e==="userGlobal"?Ny([a,n]):Ny([t("mine",this.authSettingState.loadUserSettings(this.namespaceId)),t("namespace",this.authSettingState.loadNamespaceSettings(this.namespaceId)),a,n])}toAuthSettingOptions(e){let t=new Map;for(let{label:n,settings:a}of e)for(let{name:p}of a)p&&t.set(p,(t.get(p)??new Set).add(n));return [...t.entries()].sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>({value:n,label:`${n} (${[...a].join(", ")})`}))}onParamsChange(e){this.paramsValue.set(e);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let e=this.existingConfig?.id;!e||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(e).pipe(U(this.destroyRef)).subscribe({next:t=>{let n=new Blob([t],{type:"application/yaml"}),a=URL.createObjectURL(n),p=document.createElement("a");p.href=a,p.download=`${this.existingConfig?.name??"integration"}.yaml`,p.click(),URL.revokeObjectURL(a),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to integrations",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Scope",3,"disabled"],["dsCheck",""],["label","Type","controlId","integration-type","required",""],["dsControl","","id","integration-type",3,"formControl"],["value","","disabled",""],[3,"value"],["label","Name","controlId","integration-name","required",""],["dsControl","","id","integration-name","type","text","placeholder","Integration name","autocomplete","off",3,"formControl"],["label","Description","controlId","integration-description"],["dsControl","","id","integration-description","placeholder","Optional description","rows","3",3,"formControl"],["label","Auth Setting","controlId","integration-auth-setting","hint","Only the name is saved. It is resolved at run time for the user running the case, the most specific layer winning (user on this namespace > namespace > user > platform), so a shared integration can rely on each user's own auth setting of that name."],["dsControl","","id","integration-auth-setting",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["type","radio",3,"value","formControl","disabled"],["type","checkbox",3,"formControl"],[3,"valueChange","schema","value"],["dsButton","","type","button",3,"click","disabled"]],template:function(t,n){t&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Integrations "),ml()(),Qw(4,_e,2,0,"p",2)(5,Te,28,12,"form",3),ml()),t&2&&(KE(),pg("title",n.isEditMode()?"Edit integration":"New integration"),KE(3),Kw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,dn,at,un,cn,Kt,fd,Mo,Do,Ut,Mn,Qt,Ca,fo,go,Nn,Rn,Yt],encapsulation:2})};export{ve as IntegrationFormComponent};
1
+ import {I}from'./chunk-DeZZAjYs.js';import {O}from'./chunk-Bpq2cxDs.js';import {v}from'./chunk-C4rthJME.js';import {g,W,F,J as we,aa as J,ab as F$1,ac as _r,z as zi,ad as le,k as yT,a1 as ma,M as U,p as Ff,ae as Ny,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,a2 as ga,af as ne,s as aC,l as eC,ag as Zw,T as VI,a as hg,r as fC,t as tC,X as UI,q as Il,L as Lg,u as mf,w as yf}from'./main-KN7JT2CK.js';import {p as pt,T as Te$1,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,k as dn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn,Y as Yt}from'./chunk-Dyc2eHCz.js';import'./chunk-KoagtDeJ.js';var be=(i,e)=>e.value;function _e(i,e){i&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function xe(i,e){if(i&1&&(Is(0,"label",6),hg(1,"input",22),VI(),UC(2),ml()),i&2){let t=e.$implicit,n=fC(2);KE(),pg("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),UI(),KE(),Il(" ",t.label," ");}}function Ie(i,e){if(i&1&&(Is(0,"option",10),UC(1),ml()),i&2){let t=e.$implicit;pg("value",t.type),KE(),Lg(t.displayName);}}function Ne(i,e){if(i&1&&(Is(0,"option",10),UC(1),ml()),i&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Ae(i,e){if(i&1&&(Is(0,"div",18)(1,"label",6),hg(2,"input",23),VI(),UC(3," Grant automatically "),ml(),Is(4,"p",2),UC(5),ml()()),i&2){let t=fC(2);KE(2),pg("formControl",t.autoGrantControl),UI(),KE(3),Il(" Give this integration to ",t.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Ee(i,e){if(i&1){let t=aC();Is(0,"ds-card")(1,"ds-json-schema-form",24),Eg("valueChange",function(a){mf(t);let p=fC(2);return yf(p.onParamsChange(a))}),ml()();}if(i&2){let t=fC(2);KE(),pg("schema",e)("value",t.initialParams());}}function Fe(i,e){if(i&1){let t=aC();Is(0,"button",25),Eg("click",function(){mf(t);let a=fC(2);return yf(a.exportYaml())}),UC(1),ml();}if(i&2){let t=fC(2);pg("disabled",t.isExporting()),KE(),Il(" ",t.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Te(i,e){if(i&1){let t=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let a=fC();return yf(a.submit())}),Is(1,"ds-fieldset",5),eC(2,xe,3,4,"label",6,Zw().trackByScope,true),ml(),Is(4,"ds-form-field",7)(5,"select",8)(6,"option",9),UC(7,"Select type"),ml(),eC(8,Ie,2,2,"option",10,Zw().trackByType,true),ml(),VI(),ml(),Is(10,"ds-form-field",11),hg(11,"input",12),VI(),ml(),Is(12,"ds-form-field",13),hg(13,"textarea",14),VI(),ml(),Is(14,"ds-form-field",15)(15,"select",16)(16,"option",17),UC(17,"None"),ml(),eC(18,Ne,2,2,"option",10,be),ml(),VI(),ml(),Qw(20,Ae,6,2,"div",18),Qw(21,Ee,2,2,"ds-card"),Is(22,"ds-form-actions")(23,"button",19),UC(24),ml(),Qw(25,Fe,2,2,"button",20),Is(26,"button",21),Eg("click",function(){mf(t);let a=fC();return yf(a.cancel())}),UC(27,"Cancel"),ml()()();}if(i&2){let t,n=fC();pg("formGroup",n.form),KE(),pg("disabled",n.isEditMode()),KE(),tC(n.scopeOptions),KE(3),pg("formControl",n.typeControl),UI(),KE(3),tC(n.integrationTypes()),KE(3),pg("formControl",n.nameControl),UI(),KE(2),pg("formControl",n.descriptionControl),UI(),KE(2),pg("formControl",n.authSettingNameControl),UI(),KE(),pg("ngValue",null),KE(2),tC(n.authSettingOptions()),KE(2),Kw(n.isAutoGrantable()?20:-1),KE(),Kw((t=n.schema())?21:-1,t),KE(2),pg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),KE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),KE(),Kw(n.isEditMode()?25:-1);}}var Ve=new Set(["platform","namespace","userOnNs","userGlobal"]),w=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ve=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(O);integrationTypeController=g(J);authSettingState=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?_r(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te$1(null),type:new Te$1("",{nonNullable:true,validators:[bn.required]}),scope:new Te$1("namespace",{nonNullable:true}),autoGrant:new Te$1(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);scopeOptions=[{value:"platform",label:w.platform},{value:"namespace",label:w.namespace},{value:"userOnNs",label:w.userOnNs},{value:"userGlobal",label:w.userGlobal}];authSettingNameControl=new Te$1(null);loadedAuthSettings=zi([]);authSettingsLoaded=zi(false);savedAuthSettingName=zi(null);authSettingsScope$=new le;authSettingOptions=yT(()=>{let e=this.loadedAuthSettings(),t=this.savedAuthSettingName();return !t||!this.authSettingsLoaded()||e.some(n=>n.value===t)?e:[...e,{value:t,label:`${t} (not found)`}]});paramsValue=zi(null);initialParams=zi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=yT(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});isAutoGrantable=yT(()=>{let e=this.selectedType();return e?this.integrationTypes().find(t=>t.type===e)?.autoGrantable??false:false});autoGrantReach=yT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){this.authSettingsScope$.pipe(ma(e=>this.loadAuthSettingLayers(e)),U(this.destroyRef)).subscribe(e=>{this.loadedAuthSettings.set(this.toAuthSettingOptions(e)),this.authSettingsLoaded.set(true);}),Ff(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let a=this.parseScope(t.get("scope"));this.scopeControl.setValue(a),this.loadAuthSettingsForScope(a),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(D=>{this.loadAuthSettingsForScope(D);});let p=t.get("template");p&&this.hydrateFromTemplate(p);}parseScope(e){return e&&Ve.has(e)?e:"namespace"}deriveScopeFromConfig(e){return !e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t;let n=this.deriveScopeFromConfig(t);this.scopeControl.setValue(n),this.applyConfigToForm(t),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters),this.authSettingNameControl.setValue(e.authSettingName??null),this.savedAuthSettingName.set(e.authSettingName??null),this.autoGrantControl.setValue(e.autoGrant??false);}loadAuthSettingsForScope(e){this.authSettingsLoaded.set(false),this.authSettingsScope$.next(e);}loadAuthSettingLayers(e){let t=(p,D)=>D.pipe(ga(()=>_r([])),ne(Se=>({label:p,settings:Se}))),n=t("platform",this.authSettingState.loadPlatformSettings()),a=t("mine",this.authSettingState.loadUserSettings("global"));return e==="platform"||e==="userGlobal"?Ny([a,n]):Ny([t("mine",this.authSettingState.loadUserSettings(this.namespaceId)),t("namespace",this.authSettingState.loadNamespaceSettings(this.namespaceId)),a,n])}toAuthSettingOptions(e){let t=new Map;for(let{label:n,settings:a}of e)for(let{name:p}of a)p&&t.set(p,(t.get(p)??new Set).add(n));return [...t.entries()].sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>({value:n,label:`${n} (${[...a].join(", ")})`}))}onParamsChange(e){this.paramsValue.set(e);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let e=this.existingConfig?.id;!e||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(e).pipe(U(this.destroyRef)).subscribe({next:t=>{let n=new Blob([t],{type:"application/yaml"}),a=URL.createObjectURL(n),p=document.createElement("a");p.href=a,p.download=`${this.existingConfig?.name??"integration"}.yaml`,p.click(),URL.revokeObjectURL(a),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to integrations",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Scope",3,"disabled"],["dsCheck",""],["label","Type","controlId","integration-type","required",""],["dsControl","","id","integration-type",3,"formControl"],["value","","disabled",""],[3,"value"],["label","Name","controlId","integration-name","required",""],["dsControl","","id","integration-name","type","text","placeholder","Integration name","autocomplete","off",3,"formControl"],["label","Description","controlId","integration-description"],["dsControl","","id","integration-description","placeholder","Optional description","rows","3",3,"formControl"],["label","Auth Setting","controlId","integration-auth-setting","hint","Only the name is saved. It is resolved at run time for the user running the case, the most specific layer winning (user on this namespace > namespace > user > platform), so a shared integration can rely on each user's own auth setting of that name."],["dsControl","","id","integration-auth-setting",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["type","radio",3,"value","formControl","disabled"],["type","checkbox",3,"formControl"],[3,"valueChange","schema","value"],["dsButton","","type","button",3,"click","disabled"]],template:function(t,n){t&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Integrations "),ml()(),Qw(4,_e,2,0,"p",2)(5,Te,28,12,"form",3),ml()),t&2&&(KE(),pg("title",n.isEditMode()?"Edit integration":"New integration"),KE(3),Kw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,dn,at,un,cn,Kt,fd,Mo,Do,Ut,Mn,Qt,Ca,fo,go,Nn,Rn,Yt],encapsulation:2})};export{ve as IntegrationFormComponent};
@@ -1 +1 @@
1
- import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-VbI0SYDI.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-6TWWBEJW.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.edit(m))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=fC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.description||"\u2014"," "),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(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=xw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New prompt"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
1
+ import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-KN7JT2CK.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.edit(m))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=fC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.description||"\u2014"," "),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(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=xw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New prompt"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-mVP550cv.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-VbI0SYDI.js';import {g,F,J as we,z as zi,M as U$1,ak as We,an as Je,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-6TWWBEJW.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),UC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.description);}}function O(n,t){if(n&1){let e=aC();Is(0,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.toggle(s))}),UC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.edit(s))}),UC(3,"Edit"),ml();}if(n&2){let e=fC().$implicit;KE(),Lg(e.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=aC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=fC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,H,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19),Qw(12,O,4,2),Qw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.name),KE(),Kw(e.description?4:-1),KE(2),Lg(i.scheduleLabel(e)),KE(2),pg("variant",e.enabled?"accent":"outline"),KE(),Lg(e.enabled?"Enabled":"Disabled"),KE(3),Kw(i.deletion.confirmingId()!==e.id?12:-1),KE(),Kw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=fC();KE(14),tC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(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===We.WEEK?"week":"month",s=e.unit===We.WEEK&&e.days?.length?` (${e.days.map(c=>Je[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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,U,2,1,"p",3),Qw(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&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
1
+ import {c}from'./chunk-DW1F1agi.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import {g,F,J as we,z as zi,M as U$1,ak as Ge,ao as Ye,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-KN7JT2CK.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),UC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.description);}}function O(n,t){if(n&1){let e=aC();Is(0,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.toggle(s))}),UC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.edit(s))}),UC(3,"Edit"),ml();}if(n&2){let e=fC().$implicit;KE(),Lg(e.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=aC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=fC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,H,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19),Qw(12,O,4,2),Qw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.name),KE(),Kw(e.description?4:-1),KE(2),Lg(i.scheduleLabel(e)),KE(2),pg("variant",e.enabled?"accent":"outline"),KE(),Lg(e.enabled?"Enabled":"Disabled"),KE(3),Kw(i.deletion.confirmingId()!==e.id?12:-1),KE(),Kw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=fC();KE(14),tC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(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===Ge.WEEK?"week":"month",s=e.unit===Ge.WEEK&&e.days?.length?` (${e.days.map(c=>Ye[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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,U,2,1,"p",3),Qw(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&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
@@ -1 +1 @@
1
- import {i}from'./chunk-CG27SgJm.js';import {y}from'./chunk-VbI0SYDI.js';import {g,ah as _,aK as Te,$ as Sr,au as _y,a1 as ma,a2 as ga,ac as _r,af as ne,aG as Jy,a7 as Ed,a8 as A}from'./main-6TWWBEJW.js';var u=s=>s,N="none",w="me",O=class s{nsController=g(_);exportService=g(Te);userState=g(y);refresh$=new Sr(void 0);namespaceId$=new Sr(null);vm$=_y([this.namespaceId$,this.refresh$]).pipe(ma(([e])=>{let n=this.loadPlatformConfigs().pipe(ga(()=>_r([]))),t=this.loadUserConfigs("global").pipe(ga(()=>_r([])));return e?_y([n,this.loadNamespaceConfigs(e).pipe(ga(()=>_r([]))),this.loadUserConfigs(e).pipe(ga(()=>_r([]))),t]).pipe(ne(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):_y([n,t]).pipe(ne(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Jy({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):_r([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Ed(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Ed(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(Ed(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(Ed(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Ed(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=A({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
1
+ import {i}from'./chunk-KoagtDeJ.js';import {y}from'./chunk-Dyc2eHCz.js';import {g,ah as _,aL as Re,$ as Sr,av as _y,a1 as ma,a2 as ga,ac as _r,af as ne,aH as Jy,a7 as Ed,a8 as A}from'./main-KN7JT2CK.js';var u=s=>s,N="none",w="me",O=class s{nsController=g(_);exportService=g(Re);userState=g(y);refresh$=new Sr(void 0);namespaceId$=new Sr(null);vm$=_y([this.namespaceId$,this.refresh$]).pipe(ma(([e])=>{let n=this.loadPlatformConfigs().pipe(ga(()=>_r([]))),t=this.loadUserConfigs("global").pipe(ga(()=>_r([])));return e?_y([n,this.loadNamespaceConfigs(e).pipe(ga(()=>_r([]))),this.loadUserConfigs(e).pipe(ga(()=>_r([]))),t]).pipe(ne(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):_y([n,t]).pipe(ne(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Jy({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):_r([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Ed(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Ed(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(Ed(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(Ed(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Ed(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=A({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
@@ -1 +1 @@
1
- import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-VbI0SYDI.js';import {g,F,J as we,ai as U$1,$ as Sr,z as zi,a1 as ma,M as U$2,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-6TWWBEJW.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let t=fC();KE(),Lg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),UC(1,"Loading agent configs\u2026"),ml());}function H(n,e){n&1&&(Is(0,"p",5),UC(1,"No platform agent configs defined yet."),ml());}function U(n,e){n&1&&(Is(0,"p",4),UC(1,"No agent configs match the current filter."),ml());}function z(n,e){if(n&1){let t=aC();Is(0,"button",19),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.inspect(d))}),UC(1," Inspect "),ml(),Is(2,"button",19),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.edit(d))}),UC(3,"Edit"),ml();}if(n&2){let t=fC().$implicit;fg("aria-label","Inspect "+t.name),KE(2),fg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=aC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=fC().$implicit,a=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14),UC(6),ml(),Is(7,"td",15),UC(8),ml(),Is(9,"td",16)(10,"div",17),Qw(11,z,4,2),Qw(12,G,1,3,"agentos-row-delete-action",18),ml()()()),n&2){let t=e.$implicit,a=fC(2);KE(2),Lg(t.name),KE(2),Il(" ",t.description||"\u2014"," "),KE(2),Lg(t.modelName||"\u2014"),KE(2),Lg(a.mode(t)),KE(3),Kw(a.deletion.confirmingId()!==t.id?11:-1),KE(),Kw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Model"),ml(),Is(10,"th",10),UC(11,"Execution mode"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,J,13,6,"tr",9,B),ml()()()),n&2){let t=fC();KE(16),tC(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New agent config"),ml()(),Qw(4,j,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
1
+ import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import {g,F,J as we,ai as U$1,$ as Sr,z as zi,a1 as ma,M as U$2,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-KN7JT2CK.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let t=fC();KE(),Lg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),UC(1,"Loading agent configs\u2026"),ml());}function H(n,e){n&1&&(Is(0,"p",5),UC(1,"No platform agent configs defined yet."),ml());}function U(n,e){n&1&&(Is(0,"p",4),UC(1,"No agent configs match the current filter."),ml());}function z(n,e){if(n&1){let t=aC();Is(0,"button",19),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.inspect(d))}),UC(1," Inspect "),ml(),Is(2,"button",19),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.edit(d))}),UC(3,"Edit"),ml();}if(n&2){let t=fC().$implicit;fg("aria-label","Inspect "+t.name),KE(2),fg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=aC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=fC().$implicit,a=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14),UC(6),ml(),Is(7,"td",15),UC(8),ml(),Is(9,"td",16)(10,"div",17),Qw(11,z,4,2),Qw(12,G,1,3,"agentos-row-delete-action",18),ml()()()),n&2){let t=e.$implicit,a=fC(2);KE(2),Lg(t.name),KE(2),Il(" ",t.description||"\u2014"," "),KE(2),Lg(t.modelName||"\u2014"),KE(2),Lg(a.mode(t)),KE(3),Kw(a.deletion.confirmingId()!==t.id?11:-1),KE(),Kw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Model"),ml(),Is(10,"th",10),UC(11,"Execution mode"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,J,13,6,"tr",9,B),ml()()()),n&2){let t=fC();KE(16),tC(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New agent config"),ml()(),Qw(4,j,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-B4QJcXnP.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-VbI0SYDI.js';import {g,W,F,J as we,z as zi,M as U,P as x,O as w,x as xw,av as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,s as aC,a as hg,T as VI,l as eC,ao as Xw,X as UI,t as tC,q as Il,u as mf,w as yf,L as Lg}from'./main-6TWWBEJW.js';function ie(i,t){if(i&1&&(Is(0,"a",2),UC(1,"View skill \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function ne(i,t){i&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(i,t){if(i&1){let e=aC();Is(0,"div",15)(1,"div",19),hg(2,"input",20),VI(),Is(3,"button",21),Eg("click",function(){let l=mf(e).$implicit,te=fC(2);return yf(te.removeResource(l))}),UC(4," \xD7 "),ml()(),hg(5,"textarea",22),VI(),ml();}if(i&2){let e=t.$implicit;KE(2),pg("formControl",e.path),UI(),KE(3),pg("formControl",e.content),UI();}}function ae(i,t){if(i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function se(i,t){if(i&1){let e=aC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let l=fC();return yf(l.submit())}),Is(1,"ds-form-field",7),hg(2,"input",8),VI(),ml(),Is(3,"ds-form-field",9),hg(4,"textarea",10),VI(),ml(),Is(5,"ds-form-field",11),hg(6,"textarea",12),VI(),ml(),Is(7,"ds-form-field",13)(8,"div",14),eC(9,re,6,2,"div",15,Xw),Is(11,"div")(12,"button",16),Eg("click",function(){mf(e);let l=fC();return yf(l.addResource())}),UC(13,"+ Add resource"),ml()()()(),Qw(14,ae,2,1,"ds-notice"),Is(15,"ds-form-actions")(16,"button",17),UC(17),ml(),Is(18,"button",18),Eg("click",function(){mf(e);let l=fC();return yf(l.cancel())}),UC(19,"Cancel"),ml()()();}if(i&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.bodyControl),UI(),KE(3),tC(e.resourceRows()),KE(5),Kw(e.errorMessage()?14:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=zi(false);isLoading=zi(false);isSubmitting=zi(false);errorMessage=zi(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=zi([]);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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.cancel()}),UC(3,"\u2190 Skills"),ml(),Qw(4,ie,2,1,"a",2),Qw(5,oe,2,0,"ds-tag",3),ml(),Qw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),ml()),e&2&&(KE(),pg("title",o.isEditMode()?"Edit skill":"New skill"),KE(3),Kw(o.isEditMode()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
1
+ import {o}from'./chunk-DBAtlRoH.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-Dyc2eHCz.js';import {g,W,F,J as we,z as zi,M as U,P as x,O as w,x as xw,aw as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,s as aC,a as hg,T as VI,l as eC,ap as Xw,X as UI,t as tC,q as Il,u as mf,w as yf,L as Lg}from'./main-KN7JT2CK.js';function ie(i,t){if(i&1&&(Is(0,"a",2),UC(1,"View skill \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function ne(i,t){i&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(i,t){if(i&1){let e=aC();Is(0,"div",15)(1,"div",19),hg(2,"input",20),VI(),Is(3,"button",21),Eg("click",function(){let l=mf(e).$implicit,te=fC(2);return yf(te.removeResource(l))}),UC(4," \xD7 "),ml()(),hg(5,"textarea",22),VI(),ml();}if(i&2){let e=t.$implicit;KE(2),pg("formControl",e.path),UI(),KE(3),pg("formControl",e.content),UI();}}function ae(i,t){if(i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function se(i,t){if(i&1){let e=aC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let l=fC();return yf(l.submit())}),Is(1,"ds-form-field",7),hg(2,"input",8),VI(),ml(),Is(3,"ds-form-field",9),hg(4,"textarea",10),VI(),ml(),Is(5,"ds-form-field",11),hg(6,"textarea",12),VI(),ml(),Is(7,"ds-form-field",13)(8,"div",14),eC(9,re,6,2,"div",15,Xw),Is(11,"div")(12,"button",16),Eg("click",function(){mf(e);let l=fC();return yf(l.addResource())}),UC(13,"+ Add resource"),ml()()()(),Qw(14,ae,2,1,"ds-notice"),Is(15,"ds-form-actions")(16,"button",17),UC(17),ml(),Is(18,"button",18),Eg("click",function(){mf(e);let l=fC();return yf(l.cancel())}),UC(19,"Cancel"),ml()()();}if(i&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.bodyControl),UI(),KE(3),tC(e.resourceRows()),KE(5),Kw(e.errorMessage()?14:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=zi(false);isLoading=zi(false);isSubmitting=zi(false);errorMessage=zi(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=zi([]);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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.cancel()}),UC(3,"\u2190 Skills"),ml(),Qw(4,ie,2,1,"a",2),Qw(5,oe,2,0,"ds-tag",3),ml(),Qw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),ml()),e&2&&(KE(),pg("title",o.isEditMode()?"Edit skill":"New skill"),KE(3),Kw(o.isEditMode()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-B4QJcXnP.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-VbI0SYDI.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-6TWWBEJW.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Is(0,"p",3),UC(1),ml()),i&2){let t=fC();KE(),Lg(t.deletion.error());}}function A(i,e){i&1&&(Is(0,"p",4),UC(1,"Loading skills\u2026"),ml());}function H(i,e){i&1&&(Is(0,"p",5),UC(1,"No platform skills defined yet."),ml());}function U(i,e){i&1&&(Is(0,"p",4),UC(1,"No skills match the current filter."),ml());}function z(i,e){i&1&&(Is(0,"ds-tag",15),UC(1,"SKILL.md"),ml());}function G(i,e){if(i&1){let t=aC();Is(0,"button",21),Eg("click",function(){mf(t);let d=fC(2).$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(i&2){let t=fC(2).$implicit;fg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=aC();Is(0,"button",21),Eg("click",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.inspect(d))}),UC(1,"View"),ml(),Qw(2,G,2,1,"button",22);}if(i&2){let t=fC().$implicit;fg("aria-label","View "+t.name),KE(2),Kw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=aC();Is(0,"agentos-row-delete-action",23),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(i&2){let t=fC().$implicit,l=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),UC(4),ml(),Qw(5,z,2,0,"ds-tag",15),ml()(),Is(6,"td",16),UC(7),ml(),Is(8,"td",17),UC(9),ml(),Is(10,"td",18)(11,"div",19),Qw(12,J,3,2),Qw(13,Q,1,3,"agentos-row-delete-action",20),ml()()()),i&2){let t=e.$implicit,l=fC(2);KE(4),Lg(t.name),KE(),Kw(t.readOnly?5:-1),KE(2),Il(" ",t.description||"\u2014"," "),KE(2),Lg(l.resourceCount(t)),KE(3),Kw(l.deletion.confirmingId()!==t.id?12:-1),KE(),Kw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Resources"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,W,14,6,"tr",9,K),ml()()()),i&2){let t=fC();KE(14),tC(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();skills=zi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return l.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return l.openCreateForm()}),UC(3,"New skill"),ml()(),Qw(4,O,2,1,"p",3),Qw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(KE(),pg("query",l.rowFilter.query()),KE(3),Kw(l.deletion.error()?4:-1),KE(),Kw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
1
+ import {o}from'./chunk-DBAtlRoH.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-KN7JT2CK.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Is(0,"p",3),UC(1),ml()),i&2){let t=fC();KE(),Lg(t.deletion.error());}}function A(i,e){i&1&&(Is(0,"p",4),UC(1,"Loading skills\u2026"),ml());}function H(i,e){i&1&&(Is(0,"p",5),UC(1,"No platform skills defined yet."),ml());}function U(i,e){i&1&&(Is(0,"p",4),UC(1,"No skills match the current filter."),ml());}function z(i,e){i&1&&(Is(0,"ds-tag",15),UC(1,"SKILL.md"),ml());}function G(i,e){if(i&1){let t=aC();Is(0,"button",21),Eg("click",function(){mf(t);let d=fC(2).$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(i&2){let t=fC(2).$implicit;fg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=aC();Is(0,"button",21),Eg("click",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.inspect(d))}),UC(1,"View"),ml(),Qw(2,G,2,1,"button",22);}if(i&2){let t=fC().$implicit;fg("aria-label","View "+t.name),KE(2),Kw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=aC();Is(0,"agentos-row-delete-action",23),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(i&2){let t=fC().$implicit,l=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),UC(4),ml(),Qw(5,z,2,0,"ds-tag",15),ml()(),Is(6,"td",16),UC(7),ml(),Is(8,"td",17),UC(9),ml(),Is(10,"td",18)(11,"div",19),Qw(12,J,3,2),Qw(13,Q,1,3,"agentos-row-delete-action",20),ml()()()),i&2){let t=e.$implicit,l=fC(2);KE(4),Lg(t.name),KE(),Kw(t.readOnly?5:-1),KE(2),Il(" ",t.description||"\u2014"," "),KE(2),Lg(l.resourceCount(t)),KE(3),Kw(l.deletion.confirmingId()!==t.id?12:-1),KE(),Kw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Resources"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,W,14,6,"tr",9,K),ml()()()),i&2){let t=fC();KE(14),tC(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();skills=zi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return l.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return l.openCreateForm()}),UC(3,"New skill"),ml()(),Qw(4,O,2,1,"p",3),Qw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(KE(),pg("query",l.rowFilter.query()),KE(3),Kw(l.deletion.error()?4:-1),KE(),Kw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};