@whoz-oss/coday-client 0.0.0-workstream-forge.185 → 0.0.0-workstream-forge.187

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 (51) hide show
  1. package/browser/{chunk-yNnoMggg.js → chunk-3WW79jMM.js} +1 -1
  2. package/browser/{chunk-Dip9hqws.js → chunk-B5WH_4FH.js} +1 -1
  3. package/browser/{chunk-qFzWQjBe.js → chunk-BEsOIKio.js} +1 -1
  4. package/browser/{chunk-DHs2aKFP.js → chunk-BNTbKRR2.js} +1 -1
  5. package/browser/{chunk-BcRntJ-f.js → chunk-BNtNbO5E.js} +1 -1
  6. package/browser/{chunk-DzHTXkbw.js → chunk-BSsRV4Fv.js} +1 -1
  7. package/browser/{chunk-BDc-xbXC.js → chunk-Bg3nIRj0.js} +1 -1
  8. package/browser/{chunk-CkcpRLV2.js → chunk-Bol2JxkN.js} +1 -1
  9. package/browser/{chunk-BP01ZR-w.js → chunk-BvlT1UU9.js} +1 -1
  10. package/browser/{chunk-CBqrb7sY.js → chunk-C-NRs1Fa.js} +1 -1
  11. package/browser/{chunk-BWV_tKo4.js → chunk-C-nearu2.js} +1 -1
  12. package/browser/{chunk-DxD41Wpl.js → chunk-C4FR_eY4.js} +1 -1
  13. package/browser/{chunk-Dy-jqKED.js → chunk-C6IBoWC1.js} +1 -1
  14. package/browser/chunk-C6abvjjM.js +670 -0
  15. package/browser/{chunk-cudzLb_7.js → chunk-CBlHmoPp.js} +1 -1
  16. package/browser/{chunk-bir_vdHS.js → chunk-CEUf0XVF.js} +1 -1
  17. package/browser/{chunk-Dpp5qieV.js → chunk-CNIgVis0.js} +1 -1
  18. package/browser/{chunk-DDEKNHYj.js → chunk-CRKSJ8O0.js} +1 -1
  19. package/browser/chunk-CS0VTNy3.js +1 -0
  20. package/browser/{chunk-BTuAxVDp.js → chunk-CbDPIeAp.js} +1 -1
  21. package/browser/{chunk-Cn9pDxST.js → chunk-CdUkMLzU.js} +1 -1
  22. package/browser/{chunk-CqygV_yT.js → chunk-CmaRhQVd.js} +1 -1
  23. package/browser/{chunk-CvH1PYW_.js → chunk-CuAGAd4W.js} +1 -1
  24. package/browser/{chunk-D6ZmkGQx.js → chunk-D-Qlr6Wg.js} +1 -1
  25. package/browser/{chunk-DhUPCR8x.js → chunk-D0BZatSz.js} +1 -1
  26. package/browser/{chunk-CJ0bvrpa.js → chunk-DB5CNJmL.js} +1 -1
  27. package/browser/{chunk-CZq0sS47.js → chunk-DCQ55yGY.js} +1 -1
  28. package/browser/{chunk-Z5CORV68.js → chunk-DEb8JHkr.js} +1 -1
  29. package/browser/{chunk-CrlEsza5.js → chunk-DEpnxPHI.js} +1 -1
  30. package/browser/{chunk-Bb14uEa9.js → chunk-DLL0-X45.js} +1 -1
  31. package/browser/{chunk-WZ5n_WKd.js → chunk-DiZ4OzVo.js} +1 -1
  32. package/browser/{chunk-BjECEnNM.js → chunk-Dy4MmMVN.js} +1 -1
  33. package/browser/{chunk-IUT0U7MD.js → chunk-Fij8nktv.js} +1 -1
  34. package/browser/{chunk-cW39VhFz.js → chunk-HxHl935L.js} +1 -1
  35. package/browser/{chunk-Cgo9jwAr.js → chunk-SZWEz0ba.js} +1 -1
  36. package/browser/{chunk-CZ3swGRG.js → chunk-SzOkzSvH.js} +1 -1
  37. package/browser/{chunk-BaROBgKr.js → chunk-TMk5JI4C.js} +1 -1
  38. package/browser/{chunk-BVAhKRxf.js → chunk-Z2NbDhln.js} +1 -1
  39. package/browser/{chunk-CYpUOOXu.js → chunk-dKeZZvzF.js} +1 -1
  40. package/browser/{chunk-CRE2m4-M.js → chunk-gf10W9wo.js} +1 -1
  41. package/browser/{chunk-a30sSJMH.js → chunk-iuaAdzdQ.js} +1 -1
  42. package/browser/{chunk-BCj_QScJ.js → chunk-kZ9HbUrN.js} +1 -1
  43. package/browser/{chunk-BKcbagcs.js → chunk-oPrucL6T.js} +1 -1
  44. package/browser/{chunk-bmNwF1EA.js → chunk-prPPZpkY.js} +1 -1
  45. package/browser/{chunk-C1HA3aCU.js → chunk-rOhgxte3.js} +1 -1
  46. package/browser/{chunk-BuW-L7NV.js → chunk-w_Aq6bAN.js} +1 -1
  47. package/browser/index.html +1 -1
  48. package/browser/{main-HBKYHCPK.js → main-SWYRVFGZ.js} +1 -1
  49. package/package.json +1 -1
  50. package/browser/chunk-BiMuA5X-.js +0 -670
  51. package/browser/chunk-DQ6ffgp1.js +0 -1
@@ -1 +1 @@
1
- import {S}from'./chunk-BiMuA5X-.js';import {m as mw,Z as br,D as Ds,M as MC,a as pl,l as lg,G as ug}from'./main-HBKYHCPK.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=mw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Ds(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),MC(3,"Platform"),pl(),Ds(4,"span",2),MC(5,"/"),pl(),Ds(6,"span"),MC(7,"Administration"),pl()(),lg(8,"router-outlet"),pl()),e&2&&ug("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
1
+ import {S}from'./chunk-C6abvjjM.js';import {m as mw,Z as br,D as Ds,M as MC,a as pl,l as lg,G as ug}from'./main-SWYRVFGZ.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=mw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Ds(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),MC(3,"Platform"),pl(),Ds(4,"span",2),MC(5,"/"),pl(),Ds(6,"span"),MC(7,"Administration"),pl()(),lg(8,"router-outlet"),pl()),e&2&&ug("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
@@ -1 +1 @@
1
- import {d as pn,h as hn,q as on,C as mn,i as at,s as sn,K as Oi,M as On}from'./chunk-BiMuA5X-.js';import {g,W as W$1,F,I as Ie,ae as U,U as Ui,K as KC,x as U$1,m as mw,as as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,S as Sg,v as vl,V as Vw,H as Hw,q as qw,l as lg,at as $C,au as GC,k as df,n as ff,av as ZD}from'./main-HBKYHCPK.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Ds(0,"p",3),MC(1,"Loading\u2026"),pl());}function Q(t,n){t&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load agent definition."),pl());}function W(t,n){if(t&1&&(Ds(0,"dt"),MC(1,"User context"),pl(),Ds(2,"dd",6),MC(3),pl()),t&2){let e=Xw();jE(3),Og(e.userId);}}function X(t,n){if(t&1){let e=qw();Ds(0,"ds-card")(1,"ds-disclosure",12),mg("toggled",function(){df(e);let m=Xw(2);return ff(m.toggleSystemPrompt())}),Ds(2,"pre",13),MC(3),pl()()();}if(t&2){let e=Xw(),r=Xw();jE(),ug("open",!r.systemPromptCollapsed()),jE(2),Og(e.systemPrompt);}}function Y(t,n){if(t&1){let e=qw();Ds(0,"ds-card")(1,"ds-disclosure",14),mg("toggled",function(){df(e);let m=Xw(2);return ff(m.toggleInstructions())}),Ds(2,"pre",13),MC(3),pl()()();}if(t&2){let e=Xw(),r=Xw();jE(),ug("open",!r.instructionsCollapsed()),jE(2),Og(e.instructions);}}function Z(t,n){t&1&&(Ds(0,"p",3),MC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function ee(t,n){t&1&&(Ds(0,"span",17),MC(1,"platform"),pl());}function te(t,n){t&1&&(Ds(0,"span",17),MC(1,"SKILL.md"),pl());}function ne(t,n){if(t&1&&(Ds(0,"li",15)(1,"span")(2,"span",16),MC(3),pl(),Pw(4,ee,2,0,"span",17),Pw(5,te,2,0,"span",17),pl(),Ds(6,"p",3),MC(7),pl()()),t&2){let e=n.$implicit;jE(3),Og(e.name),jE(),Lw(e.namespaceId?-1:4),jE(),Lw(e.readOnly?5:-1),jE(2),Og(e.description);}}function ie(t,n){if(t&1&&(Ds(0,"ul",11),Vw(1,ne,8,4,"li",15,j),pl()),t&2){let e=Xw(2);jE(),Hw(e.resolvedSkills());}}function oe(t,n){t&1&&(Ds(0,"p",3),MC(1,"No tools available for this agent."),pl());}function ae(t,n){if(t&1&&(lg(0,"div",19),$C(1,"agentosMarkdown")),t&2){let e=Xw().$implicit;ug("innerHTML",GC(1,1,e.description),ZD);}}function de(t,n){if(t&1){let e=qw();Ds(0,"li")(1,"ds-disclosure",18),mg("toggled",function(){let m=df(e).$implicit,U=Xw(3);return ff(U.toggleTool(m))}),Pw(2,ae,2,3,"div",19),Ds(3,"pre",20),MC(4),pl()()();}if(t&2){let e=n.$implicit,r=Xw(3);jE(),ug("heading",e.name)("open",r.isToolExpanded(e)),jE(),Lw(e.description?2:-1),jE(2),Og(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Ds(0,"ul",11),Vw(1,de,5,4,"li",null,z),pl()),t&2){let e=Xw();jE(),Hw(e.tools);}}function se(t,n){if(t&1&&(Ds(0,"ds-card",4)(1,"dl",5)(2,"dt"),MC(3,"Name"),pl(),Ds(4,"dd"),MC(5),pl(),Ds(6,"dt"),MC(7,"Resolved model"),pl(),Ds(8,"dd",6),MC(9),pl(),Ds(10,"dt"),MC(11,"Provider"),pl(),Ds(12,"dd"),MC(13),pl(),Ds(14,"dt",7),MC(15,"Execution mode"),pl(),Ds(16,"dd",8)(17,"span",9),MC(18),pl()(),Pw(19,W,4,1),pl()(),Pw(20,X,4,2,"ds-card"),Pw(21,Y,4,2,"ds-card"),Ds(22,"ds-card",10),Pw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),pl(),Ds(25,"ds-card",10),Pw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),pl()),t&2){let e=n,r=Xw();jE(5),Og(e.name),jE(4),Og(e.resolvedModelApiName),jE(4),Og(e.resolvedProviderName),jE(4),Sg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),jE(),vl(" ",e.executionMode," "),jE(),Lw(e.userId?19:-1),jE(),Lw(e.systemPrompt?20:-1),jE(),Lw(e.instructions?21:-1),jE(),ug("heading","Skills ("+r.resolvedSkills().length+")"),jE(),Lw(r.resolvedSkills().length===0?23:24),jE(2),ug("heading","Tools ("+e.tools.length+")"),jE(),Lw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(Ie);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);definition=Ui(null);expandedTools=Ui(new Set);resolvedSkills=KC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Ui(true);instructionsCollapsed=Ui(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=mw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.back()}),MC(3," \u2190 Agent configs "),pl(),Ds(4,"a",2),MC(5,"Edit config \u2192"),pl()(),Pw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),pl()),e&2){let m;jE(4),ug("routerLink",r.editRoute()),jE(2),Lw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,pn,hn,on,mn,at,sn,Oi,On],encapsulation:2})};export{K as AgentConfigInspectComponent};
1
+ import {d as pn,h as hn,q as on,C as mn,i as at,s as sn,K as Oi,M as On}from'./chunk-C6abvjjM.js';import {g,W as W$1,F,I as Ie,ae as U,U as Ui,K as KC,x as U$1,m as mw,as as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,S as Sg,v as vl,V as Vw,H as Hw,q as qw,l as lg,at as $C,au as GC,k as df,n as ff,av as ZD}from'./main-SWYRVFGZ.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Ds(0,"p",3),MC(1,"Loading\u2026"),pl());}function Q(t,n){t&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load agent definition."),pl());}function W(t,n){if(t&1&&(Ds(0,"dt"),MC(1,"User context"),pl(),Ds(2,"dd",6),MC(3),pl()),t&2){let e=Xw();jE(3),Og(e.userId);}}function X(t,n){if(t&1){let e=qw();Ds(0,"ds-card")(1,"ds-disclosure",12),mg("toggled",function(){df(e);let m=Xw(2);return ff(m.toggleSystemPrompt())}),Ds(2,"pre",13),MC(3),pl()()();}if(t&2){let e=Xw(),r=Xw();jE(),ug("open",!r.systemPromptCollapsed()),jE(2),Og(e.systemPrompt);}}function Y(t,n){if(t&1){let e=qw();Ds(0,"ds-card")(1,"ds-disclosure",14),mg("toggled",function(){df(e);let m=Xw(2);return ff(m.toggleInstructions())}),Ds(2,"pre",13),MC(3),pl()()();}if(t&2){let e=Xw(),r=Xw();jE(),ug("open",!r.instructionsCollapsed()),jE(2),Og(e.instructions);}}function Z(t,n){t&1&&(Ds(0,"p",3),MC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function ee(t,n){t&1&&(Ds(0,"span",17),MC(1,"platform"),pl());}function te(t,n){t&1&&(Ds(0,"span",17),MC(1,"SKILL.md"),pl());}function ne(t,n){if(t&1&&(Ds(0,"li",15)(1,"span")(2,"span",16),MC(3),pl(),Pw(4,ee,2,0,"span",17),Pw(5,te,2,0,"span",17),pl(),Ds(6,"p",3),MC(7),pl()()),t&2){let e=n.$implicit;jE(3),Og(e.name),jE(),Lw(e.namespaceId?-1:4),jE(),Lw(e.readOnly?5:-1),jE(2),Og(e.description);}}function ie(t,n){if(t&1&&(Ds(0,"ul",11),Vw(1,ne,8,4,"li",15,j),pl()),t&2){let e=Xw(2);jE(),Hw(e.resolvedSkills());}}function oe(t,n){t&1&&(Ds(0,"p",3),MC(1,"No tools available for this agent."),pl());}function ae(t,n){if(t&1&&(lg(0,"div",19),$C(1,"agentosMarkdown")),t&2){let e=Xw().$implicit;ug("innerHTML",GC(1,1,e.description),ZD);}}function de(t,n){if(t&1){let e=qw();Ds(0,"li")(1,"ds-disclosure",18),mg("toggled",function(){let m=df(e).$implicit,U=Xw(3);return ff(U.toggleTool(m))}),Pw(2,ae,2,3,"div",19),Ds(3,"pre",20),MC(4),pl()()();}if(t&2){let e=n.$implicit,r=Xw(3);jE(),ug("heading",e.name)("open",r.isToolExpanded(e)),jE(),Lw(e.description?2:-1),jE(2),Og(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Ds(0,"ul",11),Vw(1,de,5,4,"li",null,z),pl()),t&2){let e=Xw();jE(),Hw(e.tools);}}function se(t,n){if(t&1&&(Ds(0,"ds-card",4)(1,"dl",5)(2,"dt"),MC(3,"Name"),pl(),Ds(4,"dd"),MC(5),pl(),Ds(6,"dt"),MC(7,"Resolved model"),pl(),Ds(8,"dd",6),MC(9),pl(),Ds(10,"dt"),MC(11,"Provider"),pl(),Ds(12,"dd"),MC(13),pl(),Ds(14,"dt",7),MC(15,"Execution mode"),pl(),Ds(16,"dd",8)(17,"span",9),MC(18),pl()(),Pw(19,W,4,1),pl()(),Pw(20,X,4,2,"ds-card"),Pw(21,Y,4,2,"ds-card"),Ds(22,"ds-card",10),Pw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),pl(),Ds(25,"ds-card",10),Pw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),pl()),t&2){let e=n,r=Xw();jE(5),Og(e.name),jE(4),Og(e.resolvedModelApiName),jE(4),Og(e.resolvedProviderName),jE(4),Sg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),jE(),vl(" ",e.executionMode," "),jE(),Lw(e.userId?19:-1),jE(),Lw(e.systemPrompt?20:-1),jE(),Lw(e.instructions?21:-1),jE(),ug("heading","Skills ("+r.resolvedSkills().length+")"),jE(),Lw(r.resolvedSkills().length===0?23:24),jE(2),ug("heading","Tools ("+e.tools.length+")"),jE(),Lw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(Ie);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);definition=Ui(null);expandedTools=Ui(new Set);resolvedSkills=KC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Ui(true);instructionsCollapsed=Ui(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=mw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.back()}),MC(3," \u2190 Agent configs "),pl(),Ds(4,"a",2),MC(5,"Edit config \u2192"),pl()(),Pw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),pl()),e&2){let m;jE(4),ug("routerLink",r.editRoute()),jE(2),Lw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,pn,hn,on,mn,at,sn,Oi,On],encapsulation:2})};export{K as AgentConfigInspectComponent};
@@ -1 +1 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-C1HA3aCU.js';import {R}from'./chunk-CvH1PYW_.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,az as ne$1,a1 as fa,aa as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-HBKYHCPK.js';import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function J(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function Q(n,e){n&1&&(Ds(0,"p",5),MC(1,"No auth settings available."),pl());}function W(n,e){n&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function X(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.duplicate(c))}),MC(1," Duplicate "),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw(2).$implicit,d=Xw(2);return ff(d.edit(c))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function ee(n,e){if(n&1){let t=qw();Pw(0,Z,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(c.key))})("deleteConfirmed",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(c))})("deleteCancelled",function(){df(t);let c=Xw(3);return ff(c.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function te(n,e){n&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function ne(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,X,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,1,"button",20),Pw(13,ee,2,4)(14,te,2,0,"button",21),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.authType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(a.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ne,15,7,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var K=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=k();rowFilter=O(this.rows,e=>[e.config.name,e.config.authType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,a,c){return e.map((d,H)=>({key:`${t}:${d.id??H}`,config:d,scope:t,scopeLabel:a,canMutate:c}))}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-auth-settings-all-scopes"]],decls:9,vars:3,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["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","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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return a.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New auth setting"),pl()(),Pw(4,z,2,1,"p",3),Pw(5,J,2,0,"p",4)(6,Q,2,0,"p",5)(7,W,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{K as AuthSettingsAllScopesComponent};
1
+ import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-rOhgxte3.js';import {R}from'./chunk-CuAGAd4W.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,az as ne$1,a1 as fa,aa as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-SWYRVFGZ.js';import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function J(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function Q(n,e){n&1&&(Ds(0,"p",5),MC(1,"No auth settings available."),pl());}function W(n,e){n&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function X(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.duplicate(c))}),MC(1," Duplicate "),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw(2).$implicit,d=Xw(2);return ff(d.edit(c))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function ee(n,e){if(n&1){let t=qw();Pw(0,Z,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(c.key))})("deleteConfirmed",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(c))})("deleteCancelled",function(){df(t);let c=Xw(3);return ff(c.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function te(n,e){n&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function ne(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,X,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,1,"button",20),Pw(13,ee,2,4)(14,te,2,0,"button",21),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.authType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(a.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ne,15,7,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var K=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=k();rowFilter=O(this.rows,e=>[e.config.name,e.config.authType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,a,c){return e.map((d,H)=>({key:`${t}:${d.id??H}`,config:d,scope:t,scopeLabel:a,canMutate:c}))}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-auth-settings-all-scopes"]],decls:9,vars:3,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["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","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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return a.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New auth setting"),pl()(),Pw(4,z,2,1,"p",3),Pw(5,J,2,0,"p",4)(6,Q,2,0,"p",5)(7,W,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{K as AuthSettingsAllScopesComponent};
@@ -1 +1 @@
1
- import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-BiMuA5X-.js';import {g,F,I as Ie,$ as wr,U as Ui,a1 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-HBKYHCPK.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),MC(1),pl()),t&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),MC(1,"Loading prompts\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform prompts defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No prompts match the current filter."),pl());}function z(t,e){if(t&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.edit(m))}),MC(1,"Edit"),pl();}if(t&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.deletion.request(m.id))})("deleteConfirmed",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.confirmDelete(m))})("deleteCancelled",function(){df(n);let m=Xw(3);return ff(m.deletion.cancel())}),pl();}if(t&2){let n=Xw().$implicit,r=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Xw(2);jE(2),Og(n.name),jE(2),vl(" ",n.description||"\u2014"," "),jE(3),Lw(r.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);promptState=g(m);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();prompts=Ui([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(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=mw({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&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return r.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New prompt"),pl()(),Pw(4,A,2,1,"p",3),Pw(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&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
1
+ import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-C6abvjjM.js';import {g,F,I as Ie,$ as wr,U as Ui,a1 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-SWYRVFGZ.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),MC(1),pl()),t&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),MC(1,"Loading prompts\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform prompts defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No prompts match the current filter."),pl());}function z(t,e){if(t&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.edit(m))}),MC(1,"Edit"),pl();}if(t&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.deletion.request(m.id))})("deleteConfirmed",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.confirmDelete(m))})("deleteCancelled",function(){df(n);let m=Xw(3);return ff(m.deletion.cancel())}),pl();}if(t&2){let n=Xw().$implicit,r=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Xw(2);jE(2),Og(n.name),jE(2),vl(" ",n.description||"\u2014"," "),jE(3),Lw(r.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);promptState=g(m);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();prompts=Ui([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(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=mw({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&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return r.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New prompt"),pl()(),Pw(4,A,2,1,"p",3),Pw(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&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
@@ -1 +1 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-C1HA3aCU.js';import {O}from'./chunk-CZ3swGRG.js';import {g,W as W$1,F,I as Ie,J,U as Ui,x as U$1,az as ne$1,a1 as fa,aa as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,G as ug,j as jE,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-HBKYHCPK.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function X(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function Z(n,e){n&1&&(Ds(0,"p",5),MC(1,"No integrations available."),pl());}function ee(n,e){n&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function te(n,e){n&1&&(Ds(0,"ds-tag",20),MC(1,"YAML"),pl(),Ds(2,"ds-tag",21),MC(3,"Read-only"),pl());}function ne(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw().$implicit,c=Xw(2);return ff(c.view(s))}),MC(1,"View"),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(3).$implicit,c=Xw(2);return ff(c.edit(s))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(3).$implicit;cg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.duplicate(s))}),MC(1," Duplicate "),pl(),Pw(2,ie,2,1,"button",19);}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Duplicate "+t.config.name),jE(2),Lw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",25),mg("deleteRequested",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(4);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Xw(2).$implicit,a=Xw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Ds(0,"button",24),MC(1,"Inherited"),pl());}function le(n,e){if(n&1&&(Pw(0,oe,3,2),Pw(1,ae,1,3,"agentos-row-delete-action",23),Pw(2,re,2,0,"button",24)),n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),Lw(t.canDelete?1:-1),jE(),Lw(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,te,4,0),pl()(),Ds(10,"td",17)(11,"div",18),Pw(12,ne,2,1,"button",19)(13,le,3,3),pl()()()),n&2){let t=e.$implicit;jE(2),Og(t.config.name),jE(2),vl(" ",t.config.integrationType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),vl(" ",t.scopeLabel," "),jE(),Lw(t.source==="FILESYSTEM"?9:-1),jE(3),Lw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,se,14,6,"tr",9,Q),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceApi=g(J);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=Ui("this namespace");isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["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","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,W,2,1,"p",3),Pw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(ug("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
1
+ import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-rOhgxte3.js';import {O}from'./chunk-SzOkzSvH.js';import {g,W as W$1,F,I as Ie,J,U as Ui,x as U$1,az as ne$1,a1 as fa,aa as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,G as ug,j as jE,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-SWYRVFGZ.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function X(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function Z(n,e){n&1&&(Ds(0,"p",5),MC(1,"No integrations available."),pl());}function ee(n,e){n&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function te(n,e){n&1&&(Ds(0,"ds-tag",20),MC(1,"YAML"),pl(),Ds(2,"ds-tag",21),MC(3,"Read-only"),pl());}function ne(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw().$implicit,c=Xw(2);return ff(c.view(s))}),MC(1,"View"),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(3).$implicit,c=Xw(2);return ff(c.edit(s))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(3).$implicit;cg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.duplicate(s))}),MC(1," Duplicate "),pl(),Pw(2,ie,2,1,"button",19);}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Duplicate "+t.config.name),jE(2),Lw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",25),mg("deleteRequested",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(4);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Xw(2).$implicit,a=Xw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Ds(0,"button",24),MC(1,"Inherited"),pl());}function le(n,e){if(n&1&&(Pw(0,oe,3,2),Pw(1,ae,1,3,"agentos-row-delete-action",23),Pw(2,re,2,0,"button",24)),n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),Lw(t.canDelete?1:-1),jE(),Lw(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,te,4,0),pl()(),Ds(10,"td",17)(11,"div",18),Pw(12,ne,2,1,"button",19)(13,le,3,3),pl()()()),n&2){let t=e.$implicit;jE(2),Og(t.config.name),jE(2),vl(" ",t.config.integrationType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),vl(" ",t.scopeLabel," "),jE(),Lw(t.source==="FILESYSTEM"?9:-1),jE(3),Lw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,se,14,6,"tr",9,Q),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceApi=g(J);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=Ui("this namespace");isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["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","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,W,2,1,"p",3),Pw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(ug("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
@@ -1 +1 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-CZ3swGRG.js';import {g,W,I as Ie,U as Ui,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,X as Xw,O as Og}from'./main-HBKYHCPK.js';import {d as pn,h as hn,q as on,C as mn,s as sn,l as ko}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';function O(r,e){r&1&&(Ds(0,"p",1),MC(1,"Loading integration\u2026"),pl());}function T(r,e){r&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load this integration configuration."),pl());}function L(r,e){r&1&&(Ds(0,"div",3)(1,"ds-tag",9),MC(2,"YAML"),pl(),Ds(3,"ds-tag",10),MC(4,"Read-only"),pl()());}function k(r,e){if(r&1&&(Ds(0,"ds-card",2),Pw(1,L,5,0,"div",3),Ds(2,"dl",4)(3,"dt"),MC(4,"Name"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"Type"),pl(),Ds(9,"dd",5),MC(10),pl(),Ds(11,"dt"),MC(12,"Description"),pl(),Ds(13,"dd"),MC(14),pl(),Ds(15,"dt"),MC(16,"Scope"),pl(),Ds(17,"dd"),MC(18),pl(),Ds(19,"dt"),MC(20,"Source"),pl(),Ds(21,"dd"),MC(22),pl(),Ds(23,"dt"),MC(24,"Auto grant"),pl(),Ds(25,"dd"),MC(26),pl(),Ds(27,"dt"),MC(28,"Auth setting"),pl(),Ds(29,"dd"),MC(30),pl()()(),Ds(31,"ds-card",6)(32,"p",7),MC(33,"Sensitive values are always redacted."),pl(),Ds(34,"pre",8),MC(35),pl()()),r&2){let o=e,a=Xw();jE(),Lw(a.source()==="FILESYSTEM"?1:-1),jE(5),Og(o.name),jE(4),Og(o.integrationType),jE(4),Og(o.description||"\u2014"),jE(4),Og(a.scopeOf(o)),jE(4),Og(a.source()),jE(4),Og(o.autoGrant?"Enabled":"Disabled"),jE(4),Og(o.authSettingName||"None"),jE(5),Og(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(Ie);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Ui(true);hasError=Ui(false);config=Ui(null);source=Ui("NEO4J");parameters=Ui("{}");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=mw({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&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Pw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),pl()),o&2){let m;jE(2),Lw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[pn,hn,on,mn,sn,ko],encapsulation:2})};export{V as IntegrationConfigViewComponent};
1
+ import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-SzOkzSvH.js';import {g,W,I as Ie,U as Ui,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,X as Xw,O as Og}from'./main-SWYRVFGZ.js';import {d as pn,h as hn,q as on,C as mn,s as sn,l as ko}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';function O(r,e){r&1&&(Ds(0,"p",1),MC(1,"Loading integration\u2026"),pl());}function T(r,e){r&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load this integration configuration."),pl());}function L(r,e){r&1&&(Ds(0,"div",3)(1,"ds-tag",9),MC(2,"YAML"),pl(),Ds(3,"ds-tag",10),MC(4,"Read-only"),pl()());}function k(r,e){if(r&1&&(Ds(0,"ds-card",2),Pw(1,L,5,0,"div",3),Ds(2,"dl",4)(3,"dt"),MC(4,"Name"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"Type"),pl(),Ds(9,"dd",5),MC(10),pl(),Ds(11,"dt"),MC(12,"Description"),pl(),Ds(13,"dd"),MC(14),pl(),Ds(15,"dt"),MC(16,"Scope"),pl(),Ds(17,"dd"),MC(18),pl(),Ds(19,"dt"),MC(20,"Source"),pl(),Ds(21,"dd"),MC(22),pl(),Ds(23,"dt"),MC(24,"Auto grant"),pl(),Ds(25,"dd"),MC(26),pl(),Ds(27,"dt"),MC(28,"Auth setting"),pl(),Ds(29,"dd"),MC(30),pl()()(),Ds(31,"ds-card",6)(32,"p",7),MC(33,"Sensitive values are always redacted."),pl(),Ds(34,"pre",8),MC(35),pl()()),r&2){let o=e,a=Xw();jE(),Lw(a.source()==="FILESYSTEM"?1:-1),jE(5),Og(o.name),jE(4),Og(o.integrationType),jE(4),Og(o.description||"\u2014"),jE(4),Og(a.scopeOf(o)),jE(4),Og(a.source()),jE(4),Og(o.autoGrant?"Enabled":"Disabled"),jE(4),Og(o.authSettingName||"None"),jE(5),Og(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(Ie);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Ui(true);hasError=Ui(false);config=Ui(null);source=Ui("NEO4J");parameters=Ui("{}");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=mw({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&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Pw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),pl()),o&2){let m;jE(2),Lw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[pn,hn,on,mn,sn,ko],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -1 +1 @@
1
- import {O}from'./chunk-BVAhKRxf.js';import {v}from'./chunk-C1HA3aCU.js';import {g,W,F,I as Ie,U as Ui,a9 as F$1,am as qe,A as Af,x as U,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,q as qw,V as Vw,ac as Bw,Q as SI,l as lg,al as jw,X as Xw,T as MI,H as Hw,v as vl,ab as kw,O as Og,k as df,n as ff}from'./main-HBKYHCPK.js';import {a as pt,E as Bt,T as Te,b as fn,d as pn,h as hn,e as cn,r as ln,g as dn,i as at,j as an,t as rn,U as Ut,n as nd,o as bo,x as xo,L as Lt,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An,v as va,F as go,_ as _o}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';function ge(o,t){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function be(o,t){if(o&1&&(Ds(0,"label",23),lg(1,"input",24),SI(),MC(2),pl()),o&2){let e=t.$implicit,r=Xw(3);jE(),ug("formControl",r.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!r.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function _e(o,t){if(o&1&&(Ds(0,"ds-fieldset",5),Vw(1,be,3,4,"label",23,kw().trackByScope,true),pl()),o&2){let e=Xw(2);ug("disabled",e.isEditMode()),jE(),Hw(e.scopeOptions);}}function Ae(o,t){if(o&1&&(Ds(0,"option",8),MC(1),pl()),o&2){let e=t.$implicit;ug("value",e),jE(),Og(e);}}function Se(o,t){if(o&1){let e=qw();Ds(0,"div",19),lg(1,"input",25),SI(),lg(2,"input",26),SI(),Ds(3,"button",27),mg("click",function(){let l=df(e).$index,f=Xw(2);return ff(f.removeHeader(l))}),MC(4," \xD7 "),pl()();}if(o&2){let e=t.$index;ug("formGroupName",e),jE(),MI(),jE(),MI();}}function Pe(o,t){if(o&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let l=Xw();return ff(l.submit())}),Pw(1,_e,3,1,"ds-fieldset",5),Ds(2,"ds-form-field",6)(3,"select",7),Vw(4,Ae,2,2,"option",8,Bw),pl(),SI(),pl(),Ds(6,"ds-form-field",9),lg(7,"input",10),SI(),pl(),Ds(8,"ds-form-field",11),lg(9,"input",12),SI(),pl(),Ds(10,"ds-form-field",13),lg(11,"input",14),SI(),pl(),Ds(12,"ds-form-field",15),lg(13,"input",16),SI(),pl(),Ds(14,"ds-form-field",17)(15,"div",18),Vw(16,Se,5,1,"div",19,jw),Ds(18,"div")(19,"button",20),mg("click",function(){df(e);let l=Xw();return ff(l.addHeader())}),MC(20,"+ Add header"),pl()()()(),Ds(21,"ds-form-actions")(22,"button",21),MC(23),pl(),Ds(24,"button",22),mg("click",function(){df(e);let l=Xw();return ff(l.cancel())}),MC(25,"Cancel"),pl()()();}if(o&2){let e=Xw();ug("formGroup",e.form),jE(),Lw(e.isPlatformMode?-1:1),jE(2),ug("formControl",e.apiTypeControl),MI(),jE(),Hw(e.apiTypeOptions),jE(3),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.baseUrlControl),MI(),jE(2),ug("formControl",e.apiKeyControl),MI(),jE(2),ug("formArrayName","headers"),jE(),Hw(e.headersArray.controls),jE(6),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var xe=new Set(["namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ye=class o{route=g(W);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Ui(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});apiTypeOptions=Object.values(qe);scopeOptions=[{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),apiType:new Te("OpenAI",{nonNullable:true,validators:[fn.required]}),baseUrl:new Te("",{nonNullable:true}),apiKey:new Te("",{nonNullable:true}),scope:new Te("namespace",{nonNullable:true}),headers:new Bt([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new pt({key:new Te("",{nonNullable:true,validators:[fn.required]}),value:new Te("",{nonNullable:true})}));}removeHeader(t){this.headersArray.removeAt(t);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||Af(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,r=t.get("aiProviderId"),l=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(r){this.isEditMode.set(true),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(r);return}this.scopeControl.setValue(l);let f=e.get("template");f&&this.hydrateFromTemplate(f);}parseScope(t){return t&&xe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId?"namespace":t.namespaceId?"userOnNs":"userGlobal"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AiProviderForm] Could not load provider '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.apiTypeControl.setValue(t.apiType),this.baseUrlControl.setValue(t.baseUrl??"");let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[r,l]of Object.entries(t.headers??{}))this.headersArray.push(new pt({key:new Te(r,{nonNullable:true,validators:[fn.required]}),value:new Te(l,{nonNullable:true})}));}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),r=this.apiKeyControl.value,l=this.isEditMode()&&r===this.initialApiKey?null:r,f=this.headersArray.controls.filter(A=>A.controls.key.value.trim()).map(A=>[A.controls.key.value.trim(),A.controls.value.value]),Ce=f.length>0?Object.fromEntries(f):null,V={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:t||null,baseUrl:e||null,apiKey:l,headers:Ce},w=this.form.getRawValue().scope,he=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,V,w,this.existingConfig):this.state.create(V,w,he)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"]);}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-ai-provider-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI providers",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","API type","controlId","llm-api-type","required",""],["dsControl","","id","llm-api-type",3,"formControl"],[3,"value"],["label","Name","controlId","llm-name","required",""],["dsControl","","id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",3,"formControl"],["label","Description","controlId","llm-description"],["dsControl","","id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",3,"formControl"],["label","Base URL","controlId","llm-base-url"],["dsControl","","id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",3,"formControl"],["label","API key","controlId","llm-api-key"],["dsControl","","id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",3,"formControl"],["label","Custom headers"],[1,"ds-stack","ds-stack--sm",3,"formArrayName"],[1,"ds-inline",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],["dsControl","","type","text","placeholder","Header name","formControlName","key","autocomplete","off"],["dsControl","","type","text","placeholder","Value","formControlName","value","autocomplete","off"],["dsButton","","variant","icon-danger","type","button","title","Remove header","aria-label","Remove header",3,"click"]],template:function(e,r){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.cancel()}),MC(3," \u2190 AI providers "),pl()(),Pw(4,ge,2,0,"p",2)(5,Pe,26,10,"form",3),pl()),e&2&&(jE(),ug("title",r.isEditMode()?"Edit AI provider":"New AI provider"),jE(3),Lw(r.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,rn,Ut,nd,bo,xo,Lt,Gt,pa,mo,po,Vn,An,va,go,_o],encapsulation:2})};export{ye as AiProviderFormComponent};
1
+ import {O}from'./chunk-Z2NbDhln.js';import {v}from'./chunk-rOhgxte3.js';import {g,W,F,I as Ie,U as Ui,a9 as F$1,am as qe,A as Af,x as U,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,q as qw,V as Vw,ac as Bw,Q as SI,l as lg,al as jw,X as Xw,T as MI,H as Hw,v as vl,ab as kw,O as Og,k as df,n as ff}from'./main-SWYRVFGZ.js';import {a as pt,E as Bt,T as Te,b as fn,d as pn,h as hn,e as cn,r as ln,g as dn,i as at,j as an,t as rn,U as Ut,n as nd,o as bo,x as xo,L as Lt,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An,v as va,F as go,_ as _o}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';function ge(o,t){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function be(o,t){if(o&1&&(Ds(0,"label",23),lg(1,"input",24),SI(),MC(2),pl()),o&2){let e=t.$implicit,r=Xw(3);jE(),ug("formControl",r.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!r.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function _e(o,t){if(o&1&&(Ds(0,"ds-fieldset",5),Vw(1,be,3,4,"label",23,kw().trackByScope,true),pl()),o&2){let e=Xw(2);ug("disabled",e.isEditMode()),jE(),Hw(e.scopeOptions);}}function Ae(o,t){if(o&1&&(Ds(0,"option",8),MC(1),pl()),o&2){let e=t.$implicit;ug("value",e),jE(),Og(e);}}function Se(o,t){if(o&1){let e=qw();Ds(0,"div",19),lg(1,"input",25),SI(),lg(2,"input",26),SI(),Ds(3,"button",27),mg("click",function(){let l=df(e).$index,f=Xw(2);return ff(f.removeHeader(l))}),MC(4," \xD7 "),pl()();}if(o&2){let e=t.$index;ug("formGroupName",e),jE(),MI(),jE(),MI();}}function Pe(o,t){if(o&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let l=Xw();return ff(l.submit())}),Pw(1,_e,3,1,"ds-fieldset",5),Ds(2,"ds-form-field",6)(3,"select",7),Vw(4,Ae,2,2,"option",8,Bw),pl(),SI(),pl(),Ds(6,"ds-form-field",9),lg(7,"input",10),SI(),pl(),Ds(8,"ds-form-field",11),lg(9,"input",12),SI(),pl(),Ds(10,"ds-form-field",13),lg(11,"input",14),SI(),pl(),Ds(12,"ds-form-field",15),lg(13,"input",16),SI(),pl(),Ds(14,"ds-form-field",17)(15,"div",18),Vw(16,Se,5,1,"div",19,jw),Ds(18,"div")(19,"button",20),mg("click",function(){df(e);let l=Xw();return ff(l.addHeader())}),MC(20,"+ Add header"),pl()()()(),Ds(21,"ds-form-actions")(22,"button",21),MC(23),pl(),Ds(24,"button",22),mg("click",function(){df(e);let l=Xw();return ff(l.cancel())}),MC(25,"Cancel"),pl()()();}if(o&2){let e=Xw();ug("formGroup",e.form),jE(),Lw(e.isPlatformMode?-1:1),jE(2),ug("formControl",e.apiTypeControl),MI(),jE(),Hw(e.apiTypeOptions),jE(3),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.baseUrlControl),MI(),jE(2),ug("formControl",e.apiKeyControl),MI(),jE(2),ug("formArrayName","headers"),jE(),Hw(e.headersArray.controls),jE(6),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var xe=new Set(["namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ye=class o{route=g(W);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Ui(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});apiTypeOptions=Object.values(qe);scopeOptions=[{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),apiType:new Te("OpenAI",{nonNullable:true,validators:[fn.required]}),baseUrl:new Te("",{nonNullable:true}),apiKey:new Te("",{nonNullable:true}),scope:new Te("namespace",{nonNullable:true}),headers:new Bt([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new pt({key:new Te("",{nonNullable:true,validators:[fn.required]}),value:new Te("",{nonNullable:true})}));}removeHeader(t){this.headersArray.removeAt(t);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||Af(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,r=t.get("aiProviderId"),l=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(r){this.isEditMode.set(true),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(r);return}this.scopeControl.setValue(l);let f=e.get("template");f&&this.hydrateFromTemplate(f);}parseScope(t){return t&&xe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId?"namespace":t.namespaceId?"userOnNs":"userGlobal"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AiProviderForm] Could not load provider '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.apiTypeControl.setValue(t.apiType),this.baseUrlControl.setValue(t.baseUrl??"");let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[r,l]of Object.entries(t.headers??{}))this.headersArray.push(new pt({key:new Te(r,{nonNullable:true,validators:[fn.required]}),value:new Te(l,{nonNullable:true})}));}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),r=this.apiKeyControl.value,l=this.isEditMode()&&r===this.initialApiKey?null:r,f=this.headersArray.controls.filter(A=>A.controls.key.value.trim()).map(A=>[A.controls.key.value.trim(),A.controls.value.value]),Ce=f.length>0?Object.fromEntries(f):null,V={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:t||null,baseUrl:e||null,apiKey:l,headers:Ce},w=this.form.getRawValue().scope,he=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,V,w,this.existingConfig):this.state.create(V,w,he)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"]);}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-ai-provider-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI providers",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","API type","controlId","llm-api-type","required",""],["dsControl","","id","llm-api-type",3,"formControl"],[3,"value"],["label","Name","controlId","llm-name","required",""],["dsControl","","id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",3,"formControl"],["label","Description","controlId","llm-description"],["dsControl","","id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",3,"formControl"],["label","Base URL","controlId","llm-base-url"],["dsControl","","id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",3,"formControl"],["label","API key","controlId","llm-api-key"],["dsControl","","id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",3,"formControl"],["label","Custom headers"],[1,"ds-stack","ds-stack--sm",3,"formArrayName"],[1,"ds-inline",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],["dsControl","","type","text","placeholder","Header name","formControlName","key","autocomplete","off"],["dsControl","","type","text","placeholder","Value","formControlName","value","autocomplete","off"],["dsButton","","variant","icon-danger","type","button","title","Remove header","aria-label","Remove header",3,"click"]],template:function(e,r){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.cancel()}),MC(3," \u2190 AI providers "),pl()(),Pw(4,ge,2,0,"p",2)(5,Pe,26,10,"form",3),pl()),e&2&&(jE(),ug("title",r.isEditMode()?"Edit AI provider":"New AI provider"),jE(3),Lw(r.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,rn,Ut,nd,bo,xo,Lt,Gt,pa,mo,po,Vn,An,va,go,_o],encapsulation:2})};export{ye as AiProviderFormComponent};
@@ -1,4 +1,4 @@
1
- import {aU as A,aV as z$1}from'./main-HBKYHCPK.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
1
+ import {aU as A,aV as z$1}from'./main-SWYRVFGZ.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
2
2
  `});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
3
3
  `?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
4
4
  `&&(E.last=l.length==0||l[0].tag==`
@@ -1 +1 @@
1
- import {O as O$1,i as at,h as hn,I as Io,l as ko,P}from'./chunk-BiMuA5X-.js';import {g,I as Ie,_ as W,$ as wr,U as Ui,K as KC,a0 as Me,a1 as fa,a2 as da,a3 as nn,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,V as Vw,X as Xw,H as Hw,v as vl,O as Og}from'./main-HBKYHCPK.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Ds(0,"p",10),MC(1,"Loading the configuration failed. Try refreshing."),pl());}function V(e,t){e&1&&(Ds(0,"p",11),MC(1,"Loading configuration\u2026"),pl());}function j(e,t){e&1&&(Ds(0,"p",12),MC(1,"The service reported no settings."),pl());}function O(e,t){e&1&&(Ds(0,"p",11),MC(1,"No settings match the current filters."),pl());}function Y(e,t){e&1&&(Ds(0,"ds-tag",22),MC(1,"on"),pl());}function z(e,t){e&1&&(Ds(0,"ds-tag",20),MC(1,"off"),pl());}function H(e,t){if(e&1&&(Ds(0,"ds-tag",20),MC(1),pl()),e&2){let i=Xw().$implicit;jE(),Og(i.display.text);}}function G(e,t){if(e&1&&(Ds(0,"ds-tag",23),MC(1),pl()),e&2){let i=Xw().$implicit;jE(),Og(i.display.text);}}function J(e,t){if(e&1&&(Ds(0,"span",24),MC(1),pl()),e&2){let i=Xw().$implicit;jE(),Og(i.display.text);}}function K(e,t){if(e&1&&(Ds(0,"tr",16)(1,"td",18),MC(2),pl(),Ds(3,"td",19)(4,"ds-tag",20),MC(5),pl()(),Ds(6,"td",21),Pw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),pl(),Ds(12,"td",25),MC(13),pl()()),e&2){let i,a=t.$implicit,m=Xw(2);jE(2),vl(" ",a.entry.key," "),jE(3),vl(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),jE(2),Lw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),jE(6),vl(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Ds(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),MC(5,"Setting"),pl(),Ds(6,"th",17),MC(7,"Source"),pl(),Ds(8,"th",17),MC(9,"Value"),pl(),Ds(10,"th",17),MC(11,"Description"),pl()()(),Ds(12,"tbody",15),Vw(13,K,14,4,"tr",16,U),pl()()()),e&2){let i=Xw();jE(13),Hw(i.visibleRows());}}var A=class e{destroyRef=g(Ie);configurationController=g(W);refresh$=new wr(void 0);isLoading=Ui(true);loadError=Ui(false);rows=Ui([]);source=Ui("ALL");status=Ui("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=KC(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Me;constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(da(()=>(this.loadError.set(true),this.isLoading.set(false),nn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["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","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.reload()}),MC(3,"Refresh"),pl()(),Ds(4,"div",3)(5,"select",4),mg("change",function(c){return a.source.set(c.target.value)}),Ds(6,"option",5),MC(7,"All sources"),pl(),Ds(8,"option",6),MC(9,"Environment variables"),pl(),Ds(10,"option",6),MC(11,"Spring properties"),pl()(),Ds(12,"select",7),mg("change",function(c){return a.status.set(c.target.value)}),Ds(13,"option",5),MC(14,"Set and unset"),pl(),Ds(15,"option",8),MC(16,"Set only"),pl(),Ds(17,"option",9),MC(18,"Unset only"),pl()()(),Pw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(jE(),ug("query",a.rowFilter.query()),jE(4),ug("value",a.source()),jE(3),ug("value",a.Source.ENVIRONMENT),jE(2),ug("value",a.Source.PROPERTY),jE(2),ug("value",a.status()),jE(7),Lw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,hn,Io,ko,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
1
+ import {O as O$1,i as at,h as hn,I as Io,l as ko,P}from'./chunk-C6abvjjM.js';import {g,I as Ie,_ as W,$ as wr,U as Ui,K as KC,a0 as Me,a1 as fa,a2 as da,a3 as nn,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,V as Vw,X as Xw,H as Hw,v as vl,O as Og}from'./main-SWYRVFGZ.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Ds(0,"p",10),MC(1,"Loading the configuration failed. Try refreshing."),pl());}function V(e,t){e&1&&(Ds(0,"p",11),MC(1,"Loading configuration\u2026"),pl());}function j(e,t){e&1&&(Ds(0,"p",12),MC(1,"The service reported no settings."),pl());}function O(e,t){e&1&&(Ds(0,"p",11),MC(1,"No settings match the current filters."),pl());}function Y(e,t){e&1&&(Ds(0,"ds-tag",22),MC(1,"on"),pl());}function z(e,t){e&1&&(Ds(0,"ds-tag",20),MC(1,"off"),pl());}function H(e,t){if(e&1&&(Ds(0,"ds-tag",20),MC(1),pl()),e&2){let i=Xw().$implicit;jE(),Og(i.display.text);}}function G(e,t){if(e&1&&(Ds(0,"ds-tag",23),MC(1),pl()),e&2){let i=Xw().$implicit;jE(),Og(i.display.text);}}function J(e,t){if(e&1&&(Ds(0,"span",24),MC(1),pl()),e&2){let i=Xw().$implicit;jE(),Og(i.display.text);}}function K(e,t){if(e&1&&(Ds(0,"tr",16)(1,"td",18),MC(2),pl(),Ds(3,"td",19)(4,"ds-tag",20),MC(5),pl()(),Ds(6,"td",21),Pw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),pl(),Ds(12,"td",25),MC(13),pl()()),e&2){let i,a=t.$implicit,m=Xw(2);jE(2),vl(" ",a.entry.key," "),jE(3),vl(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),jE(2),Lw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),jE(6),vl(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Ds(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),MC(5,"Setting"),pl(),Ds(6,"th",17),MC(7,"Source"),pl(),Ds(8,"th",17),MC(9,"Value"),pl(),Ds(10,"th",17),MC(11,"Description"),pl()()(),Ds(12,"tbody",15),Vw(13,K,14,4,"tr",16,U),pl()()()),e&2){let i=Xw();jE(13),Hw(i.visibleRows());}}var A=class e{destroyRef=g(Ie);configurationController=g(W);refresh$=new wr(void 0);isLoading=Ui(true);loadError=Ui(false);rows=Ui([]);source=Ui("ALL");status=Ui("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=KC(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Me;constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(da(()=>(this.loadError.set(true),this.isLoading.set(false),nn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["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","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.reload()}),MC(3,"Refresh"),pl()(),Ds(4,"div",3)(5,"select",4),mg("change",function(c){return a.source.set(c.target.value)}),Ds(6,"option",5),MC(7,"All sources"),pl(),Ds(8,"option",6),MC(9,"Environment variables"),pl(),Ds(10,"option",6),MC(11,"Spring properties"),pl()(),Ds(12,"select",7),mg("change",function(c){return a.status.set(c.target.value)}),Ds(13,"option",5),MC(14,"Set and unset"),pl(),Ds(15,"option",8),MC(16,"Set only"),pl(),Ds(17,"option",9),MC(18,"Unset only"),pl()()(),Pw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(jE(),ug("query",a.rowFilter.query()),jE(4),ug("value",a.source()),jE(3),ug("value",a.Source.ENVIRONMENT),jE(2),ug("value",a.Source.PROPERTY),jE(2),ug("value",a.status()),jE(7),Lw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,hn,Io,ko,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
@@ -1 +1 @@
1
- import {g,aF as fe,a6 as x}from'./main-HBKYHCPK.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,aF as fe,a6 as x}from'./main-SWYRVFGZ.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
@@ -1 +1 @@
1
- import {v}from'./chunk-C1HA3aCU.js';import {R}from'./chunk-CvH1PYW_.js';import {O}from'./chunk-CZ3swGRG.js';import {g,W,F,I as Ie$1,a8 as _,a9 as F$1,aa as Cr,U as Ui,K as KC,A as Af,x as U,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,q as qw,V as Vw,ab as kw,Q as SI,l as lg,ac as Bw,X as Xw,H as Hw,T as MI,v as vl,O as Og,k as df,n as ff}from'./main-HBKYHCPK.js';import {a as pt,T as Te,b as fn,d as pn,h as hn,e as cn,r as ln,g as dn,q as on,i as at,j as an,t as rn,U as Ut,n as nd,o as bo,x as xo,L as Lt,u as vn,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An,W as Wt}from'./chunk-BiMuA5X-.js';import'./chunk-DQ6ffgp1.js';function fe(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function Ce(i,t){if(i&1&&(Ds(0,"label",6),lg(1,"input",22),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(2);jE(),ug("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ye(i,t){if(i&1&&(Ds(0,"option",10),MC(1),pl()),i&2){let e=t.$implicit;ug("value",e.type),jE(),Og(e.displayName);}}function ve(i,t){if(i&1&&(Ds(0,"option",10),MC(1),pl()),i&2){let e=t.$implicit;ug("value",e),jE(),Og(e);}}function be(i,t){if(i&1&&(Ds(0,"div",18)(1,"label",6),lg(2,"input",23),SI(),MC(3," Grant automatically "),pl(),Ds(4,"p",2),MC(5),pl()()),i&2){let e=Xw(2);jE(2),ug("formControl",e.autoGrantControl),MI(),jE(3),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Se(i,t){if(i&1){let e=qw();Ds(0,"ds-card")(1,"ds-json-schema-form",24),mg("valueChange",function(s){df(e);let c=Xw(2);return ff(c.onParamsChange(s))}),pl()();}if(i&2){let e=Xw(2);jE(),ug("schema",t)("value",e.initialParams());}}function _e(i,t){if(i&1){let e=qw();Ds(0,"button",25),mg("click",function(){df(e);let s=Xw(2);return ff(s.exportYaml())}),MC(1),pl();}if(i&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function xe(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let s=Xw();return ff(s.submit())}),Ds(1,"ds-fieldset",5),Vw(2,Ce,3,4,"label",6,kw().trackByScope,true),pl(),Ds(4,"ds-form-field",7)(5,"select",8)(6,"option",9),MC(7,"Select type"),pl(),Vw(8,ye,2,2,"option",10,kw().trackByType,true),pl(),SI(),pl(),Ds(10,"ds-form-field",11),lg(11,"input",12),SI(),pl(),Ds(12,"ds-form-field",13),lg(13,"textarea",14),SI(),pl(),Ds(14,"ds-form-field",15)(15,"select",16)(16,"option",17),MC(17,"None"),pl(),Vw(18,ve,2,2,"option",10,Bw),pl(),SI(),pl(),Pw(20,be,6,2,"div",18),Pw(21,Se,2,2,"ds-card"),Ds(22,"ds-form-actions")(23,"button",19),MC(24),pl(),Pw(25,_e,2,2,"button",20),Ds(26,"button",21),mg("click",function(){df(e);let s=Xw();return ff(s.cancel())}),MC(27,"Cancel"),pl()()();}if(i&2){let e,n=Xw();ug("formGroup",n.form),jE(),ug("disabled",n.isEditMode()),jE(),Hw(n.scopeOptions),jE(3),ug("formControl",n.typeControl),MI(),jE(3),Hw(n.integrationTypes()),jE(3),ug("formControl",n.nameControl),MI(),jE(2),ug("formControl",n.descriptionControl),MI(),jE(2),ug("formControl",n.authSettingNameControl),MI(),jE(),ug("ngValue",null),jE(2),Hw(n.availableAuthSettings()),jE(2),Lw(n.isAutoGrantable()?20:-1),jE(),Lw((e=n.schema())?21:-1,e),jE(2),ug("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),jE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),jE(),Lw(n.isEditMode()?25:-1);}}var Ie=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"}),ge=class i{route=g(W);router=g(F);destroyRef=g(Ie$1);state=g(O);integrationTypeController=g(_);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?Cr(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),type:new Te("",{nonNullable:true,validators:[fn.required]}),scope:new Te("namespace",{nonNullable:true}),autoGrant:new Te(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=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(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(null);availableAuthSettings=Ui([]);paramsValue=Ui(null);initialParams=Ui(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=KC(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=KC(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=KC(()=>{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(){Af(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(he=>{this.loadAuthSettingsForScope(he);});let c=e.get("template");c&&this.hydrateFromTemplate(c);}parseScope(t){return t&&Ie.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(c=>c.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"integration"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({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"],["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(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Integrations "),pl()(),Pw(4,fe,2,0,"p",2)(5,xe,28,12,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit integration":"New integration"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,on,at,an,rn,Ut,nd,bo,xo,Lt,vn,Gt,pa,mo,po,Vn,An,Wt],encapsulation:2})};export{ge as IntegrationFormComponent};
1
+ import {v}from'./chunk-rOhgxte3.js';import {R}from'./chunk-CuAGAd4W.js';import {O}from'./chunk-SzOkzSvH.js';import {g,W,F,I as Ie$1,a8 as _,a9 as F$1,aa as Cr,U as Ui,K as KC,A as Af,x as U,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,G as ug,L as Lw,q as qw,V as Vw,ab as kw,Q as SI,l as lg,ac as Bw,X as Xw,H as Hw,T as MI,v as vl,O as Og,k as df,n as ff}from'./main-SWYRVFGZ.js';import {a as pt,T as Te,b as fn,d as pn,h as hn,e as cn,r as ln,g as dn,q as on,i as at,j as an,t as rn,U as Ut,n as nd,o as bo,x as xo,L as Lt,u as vn,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An,W as Wt}from'./chunk-C6abvjjM.js';import'./chunk-CS0VTNy3.js';function fe(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function Ce(i,t){if(i&1&&(Ds(0,"label",6),lg(1,"input",22),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(2);jE(),ug("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ye(i,t){if(i&1&&(Ds(0,"option",10),MC(1),pl()),i&2){let e=t.$implicit;ug("value",e.type),jE(),Og(e.displayName);}}function ve(i,t){if(i&1&&(Ds(0,"option",10),MC(1),pl()),i&2){let e=t.$implicit;ug("value",e),jE(),Og(e);}}function be(i,t){if(i&1&&(Ds(0,"div",18)(1,"label",6),lg(2,"input",23),SI(),MC(3," Grant automatically "),pl(),Ds(4,"p",2),MC(5),pl()()),i&2){let e=Xw(2);jE(2),ug("formControl",e.autoGrantControl),MI(),jE(3),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Se(i,t){if(i&1){let e=qw();Ds(0,"ds-card")(1,"ds-json-schema-form",24),mg("valueChange",function(s){df(e);let c=Xw(2);return ff(c.onParamsChange(s))}),pl()();}if(i&2){let e=Xw(2);jE(),ug("schema",t)("value",e.initialParams());}}function _e(i,t){if(i&1){let e=qw();Ds(0,"button",25),mg("click",function(){df(e);let s=Xw(2);return ff(s.exportYaml())}),MC(1),pl();}if(i&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function xe(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let s=Xw();return ff(s.submit())}),Ds(1,"ds-fieldset",5),Vw(2,Ce,3,4,"label",6,kw().trackByScope,true),pl(),Ds(4,"ds-form-field",7)(5,"select",8)(6,"option",9),MC(7,"Select type"),pl(),Vw(8,ye,2,2,"option",10,kw().trackByType,true),pl(),SI(),pl(),Ds(10,"ds-form-field",11),lg(11,"input",12),SI(),pl(),Ds(12,"ds-form-field",13),lg(13,"textarea",14),SI(),pl(),Ds(14,"ds-form-field",15)(15,"select",16)(16,"option",17),MC(17,"None"),pl(),Vw(18,ve,2,2,"option",10,Bw),pl(),SI(),pl(),Pw(20,be,6,2,"div",18),Pw(21,Se,2,2,"ds-card"),Ds(22,"ds-form-actions")(23,"button",19),MC(24),pl(),Pw(25,_e,2,2,"button",20),Ds(26,"button",21),mg("click",function(){df(e);let s=Xw();return ff(s.cancel())}),MC(27,"Cancel"),pl()()();}if(i&2){let e,n=Xw();ug("formGroup",n.form),jE(),ug("disabled",n.isEditMode()),jE(),Hw(n.scopeOptions),jE(3),ug("formControl",n.typeControl),MI(),jE(3),Hw(n.integrationTypes()),jE(3),ug("formControl",n.nameControl),MI(),jE(2),ug("formControl",n.descriptionControl),MI(),jE(2),ug("formControl",n.authSettingNameControl),MI(),jE(),ug("ngValue",null),jE(2),Hw(n.availableAuthSettings()),jE(2),Lw(n.isAutoGrantable()?20:-1),jE(),Lw((e=n.schema())?21:-1,e),jE(2),ug("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),jE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),jE(),Lw(n.isEditMode()?25:-1);}}var Ie=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"}),ge=class i{route=g(W);router=g(F);destroyRef=g(Ie$1);state=g(O);integrationTypeController=g(_);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?Cr(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),type:new Te("",{nonNullable:true,validators:[fn.required]}),scope:new Te("namespace",{nonNullable:true}),autoGrant:new Te(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=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(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(null);availableAuthSettings=Ui([]);paramsValue=Ui(null);initialParams=Ui(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=KC(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=KC(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=KC(()=>{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(){Af(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(he=>{this.loadAuthSettingsForScope(he);});let c=e.get("template");c&&this.hydrateFromTemplate(c);}parseScope(t){return t&&Ie.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(c=>c.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"integration"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({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"],["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(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Integrations "),pl()(),Pw(4,fe,2,0,"p",2)(5,xe,28,12,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit integration":"New integration"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,on,at,an,rn,Ut,nd,bo,xo,Lt,vn,Gt,pa,mo,po,Vn,An,Wt],encapsulation:2})};export{ge as IntegrationFormComponent};
@@ -1 +1 @@
1
- import {a8 as R,d as pn,h as hn,e as cn,g as dn,C as mn,i as at,j as an}from'./chunk-BiMuA5X-.js';import {g,W,F,aQ as D,ae as U,I as Ie,U as Ui,x as U$1,B,aR as hy,m as mw,D as Ds,N as mg,M as MC,a as pl,l as lg,P as Pw,j as jE,G as ug,L as Lw,v as vl,X as Xw,O as Og}from'./main-HBKYHCPK.js';function P(l,t){if(l&1&&(Ds(0,"ds-notice"),MC(1),pl()),l&2){let n=Xw();jE(),Og(n.launchError());}}var T=class l{route=g(W);router=g(F);caseController=g(D);caseState=g(R);agentConfigController=g(U);destroyRef=g(Ie);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=Ui("");launchError=Ui(null);isLaunching=Ui(false);isLoading=Ui(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.resolvedAgentConfig=t,t.loopConfig!=null&&this.payloadJson.set(JSON.stringify(t.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let t=this.resolvedAgentConfig??(yield hy(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield hy(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield hy(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(t){console.error("[AgentConfigLaunch] Failed to launch loop agent",t),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=mw({type:l,selectors:[["agentos-agent-config-launch"]],decls:17,vars:6,consts:[["title","Launch loop agent"],["dsButton","","variant","ghost","type","button","title","Back to agent config",3,"click"],[1,"ds-hint"],["label","Loop configuration (read-only)","controlId","agent-loop-payload"],["dsControl","","mono","","id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",3,"value","disabled"],["dsButton","","variant","primary","type","button",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(n,e){n&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return e.back()}),MC(3," \u2190 Edit agent config "),pl()(),Ds(4,"p",2),MC(5," The loop configuration below is read from "),Ds(6,"code"),MC(7,"AgentConfig.loopConfig"),pl(),MC(8," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),pl(),Ds(9,"ds-form-field",3),lg(10,"textarea",4),pl(),Pw(11,P,2,1,"ds-notice"),Ds(12,"ds-form-actions")(13,"button",5),mg("click",function(){return e.launch()}),MC(14),pl(),Ds(15,"button",6),mg("click",function(){return e.back()}),MC(16,"Cancel"),pl()()()),n&2&&(jE(10),ug("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),jE(),Lw(e.launchError()?11:-1),jE(2),ug("disabled",e.isLaunching()),jE(),vl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),jE(),ug("disabled",e.isLaunching()));},dependencies:[pn,hn,cn,dn,mn,at,an],encapsulation:2})};export{T as AgentConfigLaunchComponent};
1
+ import {a8 as R,d as pn,h as hn,e as cn,g as dn,C as mn,i as at,j as an}from'./chunk-C6abvjjM.js';import {g,W,F,aQ as D,ae as U,I as Ie,U as Ui,x as U$1,B,aR as hy,m as mw,D as Ds,N as mg,M as MC,a as pl,l as lg,P as Pw,j as jE,G as ug,L as Lw,v as vl,X as Xw,O as Og}from'./main-SWYRVFGZ.js';function P(l,t){if(l&1&&(Ds(0,"ds-notice"),MC(1),pl()),l&2){let n=Xw();jE(),Og(n.launchError());}}var T=class l{route=g(W);router=g(F);caseController=g(D);caseState=g(R);agentConfigController=g(U);destroyRef=g(Ie);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=Ui("");launchError=Ui(null);isLaunching=Ui(false);isLoading=Ui(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.resolvedAgentConfig=t,t.loopConfig!=null&&this.payloadJson.set(JSON.stringify(t.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let t=this.resolvedAgentConfig??(yield hy(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield hy(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield hy(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(t){console.error("[AgentConfigLaunch] Failed to launch loop agent",t),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=mw({type:l,selectors:[["agentos-agent-config-launch"]],decls:17,vars:6,consts:[["title","Launch loop agent"],["dsButton","","variant","ghost","type","button","title","Back to agent config",3,"click"],[1,"ds-hint"],["label","Loop configuration (read-only)","controlId","agent-loop-payload"],["dsControl","","mono","","id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",3,"value","disabled"],["dsButton","","variant","primary","type","button",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(n,e){n&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return e.back()}),MC(3," \u2190 Edit agent config "),pl()(),Ds(4,"p",2),MC(5," The loop configuration below is read from "),Ds(6,"code"),MC(7,"AgentConfig.loopConfig"),pl(),MC(8," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),pl(),Ds(9,"ds-form-field",3),lg(10,"textarea",4),pl(),Pw(11,P,2,1,"ds-notice"),Ds(12,"ds-form-actions")(13,"button",5),mg("click",function(){return e.launch()}),MC(14),pl(),Ds(15,"button",6),mg("click",function(){return e.back()}),MC(16,"Cancel"),pl()()()),n&2&&(jE(10),ug("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),jE(),Lw(e.launchError()?11:-1),jE(2),ug("disabled",e.isLaunching()),jE(),vl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),jE(),ug("disabled",e.isLaunching()));},dependencies:[pn,hn,cn,dn,mn,at,an],encapsulation:2})};export{T as AgentConfigLaunchComponent};
@@ -1 +1 @@
1
- import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-BiMuA5X-.js';import {g,W as W$1,F,I as Ie,$ as wr,U as Ui,a1 as fa,aj as Ty,a2 as da,aa as Cr,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-HBKYHCPK.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function G(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading prompts\u2026"),pl());}function O(n,e){n&1&&(Ds(0,"p",5),MC(1,"No prompts available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),MC(1,"No prompts match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=qw();Ds(0,"button",23),mg("click",function(){df(t);let l=Xw(2).$implicit,m=Xw(2);return ff(m.edit(l))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=qw();Pw(0,X,2,1,"button",21),Ds(1,"agentos-row-delete-action",22),mg("deleteRequested",function(){df(t);let l=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(l.key))})("deleteConfirmed",function(){df(t);let l=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(l))})("deleteCancelled",function(){df(t);let l=Xw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,i=Xw(2);Lw(i.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Ds(0,"button",20),MC(1,"Inherited"),pl());}function ee(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,W,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,4)(13,Z,2,0,"button",20),pl()()()),n&2){let t=e.$implicit;jE(2),Og(t.prompt.name),jE(2),vl(" ",t.prompt.description||"\u2014"," "),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?9:-1),jE(3),Lw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ee,14,6,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();rows=Ui([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.promptState.listPlatform().pipe(da(()=>Cr([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.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,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["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","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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return i.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New prompt"),pl()(),Pw(4,z,2,1,"p",3),Pw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
1
+ import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-C6abvjjM.js';import {g,W as W$1,F,I as Ie,$ as wr,U as Ui,a1 as fa,aj as Ty,a2 as da,aa as Cr,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,G as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-SWYRVFGZ.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function G(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading prompts\u2026"),pl());}function O(n,e){n&1&&(Ds(0,"p",5),MC(1,"No prompts available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),MC(1,"No prompts match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=qw();Ds(0,"button",23),mg("click",function(){df(t);let l=Xw(2).$implicit,m=Xw(2);return ff(m.edit(l))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=qw();Pw(0,X,2,1,"button",21),Ds(1,"agentos-row-delete-action",22),mg("deleteRequested",function(){df(t);let l=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(l.key))})("deleteConfirmed",function(){df(t);let l=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(l))})("deleteCancelled",function(){df(t);let l=Xw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,i=Xw(2);Lw(i.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Ds(0,"button",20),MC(1,"Inherited"),pl());}function ee(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,W,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,4)(13,Z,2,0,"button",20),pl()()()),n&2){let t=e.$implicit;jE(2),Og(t.prompt.name),jE(2),vl(" ",t.prompt.description||"\u2014"," "),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?9:-1),jE(3),Lw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ee,14,6,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();rows=Ui([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.promptState.listPlatform().pipe(da(()=>Cr([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.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,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["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","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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return i.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New prompt"),pl()(),Pw(4,z,2,1,"p",3),Pw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};