@whoz-oss/coday-client 0.0.0-workstream-forge.157 → 0.0.0-workstream-forge.158

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 (49) hide show
  1. package/browser/{chunk-BqhWG6lk.js → chunk-1nHviJjW.js} +1 -1
  2. package/browser/{chunk-DqxbU3op.js → chunk-5cYyrH4C.js} +1 -1
  3. package/browser/{chunk-CFIoTTqG.js → chunk-9NIY8Qde.js} +1 -1
  4. package/browser/{chunk-CICH059M.js → chunk-B6S2suRi.js} +1 -1
  5. package/browser/{chunk-B9qCgjjR.js → chunk-B8ebWTIT.js} +1 -1
  6. package/browser/{chunk-DxnUP_3H.js → chunk-B96o_J41.js} +1 -1
  7. package/browser/{chunk-B8i90l5G.js → chunk-BFgLoJy9.js} +1 -1
  8. package/browser/{chunk-CdJcvZj5.js → chunk-BLqpFOH8.js} +1 -1
  9. package/browser/{chunk-IjMcEeM0.js → chunk-BUEfDJc-.js} +1 -1
  10. package/browser/{chunk-FkhzQ1y5.js → chunk-BbGR6Hzh.js} +1 -1
  11. package/browser/{chunk-DROtTRoD.js → chunk-BhInoLFh.js} +1 -1
  12. package/browser/{chunk-CnGhS3Ge.js → chunk-Bs5GMOIl.js} +1 -1
  13. package/browser/{chunk-P8EUeRhR.js → chunk-C-W5jReJ.js} +1 -1
  14. package/browser/{chunk-C5QQ28qF.js → chunk-C0HBn4ie.js} +1 -1
  15. package/browser/{chunk-BMYaPU29.js → chunk-CGYOHQC8.js} +1 -1
  16. package/browser/{chunk-IHxyS_Ju.js → chunk-COXwQCHb.js} +1 -1
  17. package/browser/{chunk-x9X-KU6p.js → chunk-CW4ZcKQX.js} +1 -1
  18. package/browser/{chunk-SUV4IW7Q.js → chunk-CXFPz7cN.js} +1 -1
  19. package/browser/{chunk-aa3wmrge.js → chunk-CZ2VPZCS.js} +1 -1
  20. package/browser/{chunk-eP6cCP78.js → chunk-CawuEwqZ.js} +1 -1
  21. package/browser/{chunk-5JHn5JE5.js → chunk-CgGSFOp0.js} +1 -1
  22. package/browser/{chunk-D7S_ngWM.js → chunk-CpSZgQmG.js} +1 -1
  23. package/browser/{chunk-C97Nzk1F.js → chunk-Csmoz5PU.js} +1 -1
  24. package/browser/{chunk-BCVWMKBZ.js → chunk-D-P-QgBz.js} +1 -1
  25. package/browser/{chunk-CblC-I6e.js → chunk-D7UCdQqw.js} +1 -1
  26. package/browser/{chunk-Dc05FsvB.js → chunk-DAIRZxQZ.js} +4 -4
  27. package/browser/{chunk-Cq786-AQ.js → chunk-DJxQ08bU.js} +1 -1
  28. package/browser/{chunk-B6Zgm8Zj.js → chunk-DQqb4_YR.js} +1 -1
  29. package/browser/{chunk-BWigv8nN.js → chunk-DR3VpMrk.js} +1 -1
  30. package/browser/{chunk-DxIQuX1z.js → chunk-DSoamGVr.js} +1 -1
  31. package/browser/{chunk-C6EGFaju.js → chunk-DUBYB9bD.js} +1 -1
  32. package/browser/{chunk-DEKvoZJo.js → chunk-DX2p5LSv.js} +1 -1
  33. package/browser/{chunk-B728utsw.js → chunk-D_Hy03Ft.js} +1 -1
  34. package/browser/{chunk-DweagoP-.js → chunk-D_Tk6b6H.js} +1 -1
  35. package/browser/{chunk-CkjO5WgC.js → chunk-DeKzWb90.js} +1 -1
  36. package/browser/{chunk-BlzdMivI.js → chunk-Dhw2nmtZ.js} +1 -1
  37. package/browser/{chunk-lnU3XE9i.js → chunk-DrY9IYh7.js} +1 -1
  38. package/browser/{chunk-C1qOYELe.js → chunk-KIxjp0aL.js} +1 -1
  39. package/browser/{chunk-C_hr6aYA.js → chunk-NgOlXhdC.js} +1 -1
  40. package/browser/{chunk-D7xw8tIA.js → chunk-UtlEUOvL.js} +1 -1
  41. package/browser/{chunk-dYtrpqTm.js → chunk-Xep3gXjY.js} +1 -1
  42. package/browser/{chunk-BKSCIEi0.js → chunk-bJizDSXI.js} +1 -1
  43. package/browser/{chunk-Fd9cJ19m.js → chunk-cgIHNYDp.js} +1 -1
  44. package/browser/chunk-guv8L9D6.js +1 -0
  45. package/browser/{chunk-BXRhQZJG.js → chunk-jY3-S2x8.js} +1 -1
  46. package/browser/index.html +1 -1
  47. package/browser/{main-SHENI7ZL.js → main-A5TVR2ZW.js} +1 -1
  48. package/package.json +1 -1
  49. package/browser/chunk-CCZGyjHo.js +0 -1
@@ -1 +1 @@
1
- import {O,h as vi,x as xi,C as Ci,P}from'./chunk-Dc05FsvB.js';import {p,y as $t,o as It,M as Me,a9 as $,a7 as ve,g as ie,a8 as Ae,U as U$1,D as Df,ae as hw,af as Wn,a3 as _,$ as $a,K as lc,b as bf,t as t_,d as dT,m as mb,N as tv,f as fT,j as gT,_ as _T,k as mT,r as IT,I as Iv,A as Af,s as ig,v as sg}from'./main-SHENI7ZL.js';var j=(o,e)=>e.key;function z(o,e){o&1&&($a(0,"p",3),t_(1,"Loading agent configs\u2026"),bf());}function B(o,e){o&1&&($a(0,"p",4),t_(1,"No agent configs available."),bf());}function H(o,e){o&1&&($a(0,"p",3),t_(1,"No agent configs match the current filter."),bf());}function J(o,e){o&1&&($a(0,"ds-tag",17),t_(1,"Read-only"),bf());}function U(o,e){if(o&1){let t=IT();$a(0,"button",19),lc("click",function(){ig(t);let c=_T().$implicit,d=_T(2);return sg(d.launch(c))}),t_(1,"Launch"),bf();}}function G(o,e){if(o&1){let t=IT();$a(0,"button",19),lc("click",function(){ig(t);let c=_T().$implicit,d=_T(2);return sg(d.edit(c))}),t_(1,"Edit"),bf(),$a(2,"button",21),lc("click",function(){ig(t);let c=_T().$implicit,d=_T(2);return sg(d.delete(c))}),t_(3,"Delete"),bf();}}function K(o,e){if(o&1){let t=IT();$a(0,"tr",8)(1,"td",11),t_(2),bf(),$a(3,"td",12),t_(4),bf(),$a(5,"td",13),t_(6),bf(),$a(7,"td",14)(8,"div",15)(9,"ds-tag",16),t_(10),bf(),dT(11,J,2,0,"ds-tag",17),bf()(),$a(12,"td",18)(13,"button",19),lc("click",function(){let c=ig(t).$implicit,d=_T(2);return sg(d.inspect(c))}),t_(14,"Inspect"),bf(),dT(15,U,2,0,"button",20),dT(16,G,4,0),bf()();}if(o&2){let t=e.$implicit,a=_T(2);mb(2),Iv(t.config.name),mb(2),Af(" ",t.config.description||"\u2014"," "),mb(2),Iv(a.mode(t)),mb(3),tv("variant",t.scope==="platform"?"neutral":"accent"),mb(),Iv(t.scope==="platform"?"Platform":"Namespace"),mb(),fT(t.scope==="platform"?11:-1),mb(4),fT(a.canLaunch(t)?15:-1),mb(),fT(t.scope==="namespace"?16:-1);}}function Q(o,e){if(o&1&&($a(0,"div",5)(1,"table",6)(2,"thead",7)(3,"tr",8)(4,"th",9),t_(5,"Name"),bf(),$a(6,"th",9),t_(7,"Description"),bf(),$a(8,"th",9),t_(9,"Execution mode"),bf(),$a(10,"th",9),t_(11,"Scope"),bf(),$a(12,"th",9)(13,"span",10),t_(14,"Actions"),bf()()()(),$a(15,"tbody",7),gT(16,K,17,8,"tr",8,j),bf()()()),o&2){let t=_T();mb(16),mT(t.rowFilter.filteredRows());}}var q=class o{route=p($t);router=p(It);destroyRef=p(Me);controller=p($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new ve(void 0);isLoading=ie(true);rows=ie([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),hw({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(Wn(()=>_([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((a,c)=>({key:`platform:${a.id??c}`,config:a,scope:"platform"})),...e.map((a,c)=>({key:`namespace:${a.id??c}`,config:a,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}delete(e){e.scope==="platform"||!e.config.id||!confirm(`Delete agent config \u201C${e.config.name}\u201D?`)||this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Df({type:o,selectors:[["agentos-namespace-agent-configs"]],decls:8,vars:2,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["type","button",1,"agent-configs__new",3,"click"],["role","status",1,"agent-configs__status"],[1,"agent-configs__status"],[1,"agent-configs__table-wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"agent-configs__name"],["role","cell","data-label","Description",1,"agent-configs__description"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"agent-configs__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions","",1,"agent-configs__actions"],["type","button",3,"click"],["type","button"],["type","button",1,"agent-configs__delete",3,"click"]],template:function(t,a){t&1&&($a(0,"ds-section-header",0)(1,"agentos-table-filter",1),lc("queryChange",function(d){return a.rowFilter.query.set(d)}),bf(),$a(2,"button",2),lc("click",function(){return a.openCreateForm()}),t_(3," New agent config "),bf()(),dT(4,z,2,0,"p",3)(5,B,2,0,"p",4)(6,H,2,0,"p",3)(7,Q,18,0,"div",5)),t&2&&(mb(),tv("query",a.rowFilter.query()),mb(3),fT(a.isLoading()?4:a.rows().length===0?5:a.rowFilter.filteredRows().length===0?6:7));},dependencies:[vi,xi,Ci,P],styles:['.agent-configs__new[_ngcontent-%COMP%]{white-space:nowrap;padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.agent-configs__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.agent-configs__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-configs__name[_ngcontent-%COMP%]{font-weight:500}.agent-configs__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.agent-configs__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.agent-configs__actions[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle;text-align:center}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.agent-configs__actions[_ngcontent-%COMP%] .agent-configs__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}']})};export{q as NamespaceAgentConfigsComponent};
1
+ import {O,h as vi,x as xi,C as Ci,P}from'./chunk-DAIRZxQZ.js';import {p,y as $t,o as It,M as Me,a9 as $,a7 as ve,g as ie,a8 as Ae,U as U$1,D as Df,ae as hw,af as Wn,a3 as _,$ as $a,K as lc,b as bf,t as t_,d as dT,m as mb,N as tv,f as fT,j as gT,_ as _T,k as mT,r as IT,I as Iv,A as Af,s as ig,v as sg}from'./main-A5TVR2ZW.js';var j=(o,e)=>e.key;function z(o,e){o&1&&($a(0,"p",3),t_(1,"Loading agent configs\u2026"),bf());}function B(o,e){o&1&&($a(0,"p",4),t_(1,"No agent configs available."),bf());}function H(o,e){o&1&&($a(0,"p",3),t_(1,"No agent configs match the current filter."),bf());}function J(o,e){o&1&&($a(0,"ds-tag",17),t_(1,"Read-only"),bf());}function U(o,e){if(o&1){let t=IT();$a(0,"button",19),lc("click",function(){ig(t);let c=_T().$implicit,d=_T(2);return sg(d.launch(c))}),t_(1,"Launch"),bf();}}function G(o,e){if(o&1){let t=IT();$a(0,"button",19),lc("click",function(){ig(t);let c=_T().$implicit,d=_T(2);return sg(d.edit(c))}),t_(1,"Edit"),bf(),$a(2,"button",21),lc("click",function(){ig(t);let c=_T().$implicit,d=_T(2);return sg(d.delete(c))}),t_(3,"Delete"),bf();}}function K(o,e){if(o&1){let t=IT();$a(0,"tr",8)(1,"td",11),t_(2),bf(),$a(3,"td",12),t_(4),bf(),$a(5,"td",13),t_(6),bf(),$a(7,"td",14)(8,"div",15)(9,"ds-tag",16),t_(10),bf(),dT(11,J,2,0,"ds-tag",17),bf()(),$a(12,"td",18)(13,"button",19),lc("click",function(){let c=ig(t).$implicit,d=_T(2);return sg(d.inspect(c))}),t_(14,"Inspect"),bf(),dT(15,U,2,0,"button",20),dT(16,G,4,0),bf()();}if(o&2){let t=e.$implicit,a=_T(2);mb(2),Iv(t.config.name),mb(2),Af(" ",t.config.description||"\u2014"," "),mb(2),Iv(a.mode(t)),mb(3),tv("variant",t.scope==="platform"?"neutral":"accent"),mb(),Iv(t.scope==="platform"?"Platform":"Namespace"),mb(),fT(t.scope==="platform"?11:-1),mb(4),fT(a.canLaunch(t)?15:-1),mb(),fT(t.scope==="namespace"?16:-1);}}function Q(o,e){if(o&1&&($a(0,"div",5)(1,"table",6)(2,"thead",7)(3,"tr",8)(4,"th",9),t_(5,"Name"),bf(),$a(6,"th",9),t_(7,"Description"),bf(),$a(8,"th",9),t_(9,"Execution mode"),bf(),$a(10,"th",9),t_(11,"Scope"),bf(),$a(12,"th",9)(13,"span",10),t_(14,"Actions"),bf()()()(),$a(15,"tbody",7),gT(16,K,17,8,"tr",8,j),bf()()()),o&2){let t=_T();mb(16),mT(t.rowFilter.filteredRows());}}var q=class o{route=p($t);router=p(It);destroyRef=p(Me);controller=p($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new ve(void 0);isLoading=ie(true);rows=ie([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),hw({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(Wn(()=>_([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((a,c)=>({key:`platform:${a.id??c}`,config:a,scope:"platform"})),...e.map((a,c)=>({key:`namespace:${a.id??c}`,config:a,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}delete(e){e.scope==="platform"||!e.config.id||!confirm(`Delete agent config \u201C${e.config.name}\u201D?`)||this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Df({type:o,selectors:[["agentos-namespace-agent-configs"]],decls:8,vars:2,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["type","button",1,"agent-configs__new",3,"click"],["role","status",1,"agent-configs__status"],[1,"agent-configs__status"],[1,"agent-configs__table-wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"agent-configs__name"],["role","cell","data-label","Description",1,"agent-configs__description"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"agent-configs__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions","",1,"agent-configs__actions"],["type","button",3,"click"],["type","button"],["type","button",1,"agent-configs__delete",3,"click"]],template:function(t,a){t&1&&($a(0,"ds-section-header",0)(1,"agentos-table-filter",1),lc("queryChange",function(d){return a.rowFilter.query.set(d)}),bf(),$a(2,"button",2),lc("click",function(){return a.openCreateForm()}),t_(3," New agent config "),bf()(),dT(4,z,2,0,"p",3)(5,B,2,0,"p",4)(6,H,2,0,"p",3)(7,Q,18,0,"div",5)),t&2&&(mb(),tv("query",a.rowFilter.query()),mb(3),fT(a.isLoading()?4:a.rows().length===0?5:a.rowFilter.filteredRows().length===0?6:7));},dependencies:[vi,xi,Ci,P],styles:['.agent-configs__new[_ngcontent-%COMP%]{white-space:nowrap;padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.agent-configs__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.agent-configs__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-configs__name[_ngcontent-%COMP%]{font-weight:500}.agent-configs__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.agent-configs__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.agent-configs__actions[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle;text-align:center}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.agent-configs__actions[_ngcontent-%COMP%] .agent-configs__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}']})};export{q as NamespaceAgentConfigsComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-IHxyS_Ju.js';import {$ as $$1,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,b as pn,V as Vn}from'./chunk-Dc05FsvB.js';import {p,y as $t,o as It,M as Me$1,a9 as $,aa as Oe$1,ab as Ee$1,g as ie,ac as Ve$1,a2 as F,ad as Rs,h as Si,ae as hw,U,af as Wn,J as x,H as w,D as Df,a3 as _,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,A as Af,f as fT,r as IT,u as uc,L as oS,j as gT,_ as _T,N as tv,w as gv,O as sS,k as mT,I as Iv,s as ig,v as sg,X as Xm}from'./main-SHENI7ZL.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&($a(0,"p",5),t_(1,"Loading\u2026"),bf());}function ue(n,t){n&1&&($a(0,"span",12),t_(1," Name is required. "),bf());}function fe(n,t){if(n&1&&($a(0,"p",42),t_(1),bf(),$a(2,"span",13),t_(3,"Agent Config cannot be changed after creation."),bf()),n&2){let e=_T(2);mb(),Iv(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&($a(0,"a",43),t_(1,"Add an agent config"),bf(),t_(2," first. ")),n&2){let e=_T(3);tv("href","/agentos/"+e.namespaceId+"/agent-configs/new",Xm);}}function he(n,t){if(n&1&&($a(0,"p",13),t_(1," No agent configs available in this scope yet. "),dT(2,_e,3,1),bf()),n&2){let e=_T(2);mb(2),fT(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.id),mb(),Iv(e.name);}}function Ce(n,t){n&1&&($a(0,"span",12),t_(1,"Agent Config is required."),bf());}function ve(n,t){if(n&1&&($a(0,"select",44)(1,"option",45),t_(2,"Select an agent config\u2026"),bf(),gT(3,ge,2,2,"option",23,me),bf(),oS(),dT(5,Ce,2,0,"span",12),$a(6,"span",13),t_(7,"Immutable after creation."),bf()),n&2){let e=_T(2);tv("formControl",e.agentConfigIdControl),sS(),mb(3),mT(e.availableAgentConfigs()),mb(2),fT(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&($a(0,"span",12),t_(1,"Opening message is required."),bf());}function ye(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function be(n,t){if(n&1){let e=IT();$a(0,"label",48)(1,"input",49),lc("change",function(){let g=ig(e).$implicit,v=_T(3);return sg(v.toggleDay(g.value))}),bf(),$a(2,"span",50),t_(3),bf()();}if(n&2){let e=t.$implicit,d=_T(3);mb(),tv("checked",d.isDaySelected(e.value)),mb(2),Iv(e.label);}}function Se(n,t){if(n&1&&($a(0,"div",8)(1,"span",46),t_(2,"Days of week"),bf(),$a(3,"div",47),gT(4,be,4,2,"label",48,A),bf(),$a(6,"span",13),t_(7,"Leave empty to run every day of the week."),bf()()),n&2){let e=_T(2);mb(4),mT(e.dayOptions);}}function Ee(n,t){n&1&&($a(0,"span",12),t_(1,"Valid time is required (HH:mm)."),bf());}function Pe(n,t){n&1&&($a(0,"span",12),t_(1,"Start date is required."),bf());}function Me(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function Oe(n,t){n&1&&($a(0,"span",12),t_(1,"End date is required."),bf());}function De(n,t){if(n&1&&($a(0,"div",8)(1,"label",51),t_(2," End date "),$a(3,"span",10),t_(4,"*"),bf()(),uc(5,"input",52),oS(),dT(6,Oe,2,0,"span",12),bf()),n&2){let e=_T(2);mb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),tv("formControl",e.endDateControl),sS(),mb(),fT(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&($a(0,"span",12),t_(1,"Must be at least 1."),bf());}function we(n,t){if(n&1&&($a(0,"div",8)(1,"label",53),t_(2," Number of occurrences "),$a(3,"span",10),t_(4,"*"),bf()(),uc(5,"input",54),oS(),dT(6,Te,2,0,"span",12),bf()),n&2){let e=_T(2);mb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),tv("formControl",e.occurrenceCountControl),sS(),mb(),fT(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&($a(0,"span",12),t_(1,"Invalid JSON."),bf());}function Ne(n,t){if(n&1&&($a(0,"p",38),t_(1),bf()),n&2){let e=_T(2);mb(),Iv(e.errorMessage());}}function Fe(n,t){if(n&1){let e=IT();$a(0,"form",7),lc("ngSubmit",function(){ig(e);let g=_T();return sg(g.submit())}),$a(1,"div",8)(2,"label",9),t_(3," Name "),$a(4,"span",10),t_(5,"*"),bf()(),uc(6,"input",11),oS(),dT(7,ue,2,0,"span",12),$a(8,"span",13),t_(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),bf()(),$a(10,"div",8)(11,"label",14),t_(12,"Description"),bf(),uc(13,"input",15),oS(),bf(),$a(14,"div",8)(15,"label",16),t_(16," Agent Config "),$a(17,"span",10),t_(18,"*"),bf()(),dT(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),bf(),$a(22,"div",8)(23,"label",17),t_(24," Opening message "),$a(25,"span",10),t_(26,"*"),bf()(),uc(27,"textarea",18),oS(),dT(28,xe,2,0,"span",12),$a(29,"span",13),t_(30," The message sent to the agent when the scheduled prompt fires. "),bf()(),$a(31,"fieldset",19)(32,"legend",20),t_(33,"Recurrence"),bf(),$a(34,"div",8)(35,"label",21),t_(36," Unit "),$a(37,"span",10),t_(38,"*"),bf()(),$a(39,"select",22),gT(40,ye,2,2,"option",23,A),bf(),oS(),bf(),dT(42,Se,8,0,"div",8),$a(43,"div",8)(44,"label",24),t_(45," Time (UTC) "),$a(46,"span",10),t_(47,"*"),bf()(),$a(48,"div",25),uc(49,"input",26),oS(),$a(50,"span",27),t_(51,"UTC"),bf()(),dT(52,Ee,2,0,"span",12),bf()(),$a(53,"fieldset",19)(54,"legend",20),t_(55,"Planning"),bf(),$a(56,"div",8)(57,"label",28),t_(58," Start date "),$a(59,"span",10),t_(60,"*"),bf()(),uc(61,"input",29),oS(),dT(62,Pe,2,0,"span",12),bf(),$a(63,"div",8)(64,"label",30),t_(65," Ends "),$a(66,"span",10),t_(67,"*"),bf()(),$a(68,"select",31),gT(69,Me,2,2,"option",23,A),bf(),oS(),bf(),dT(71,De,7,4,"div",8),dT(72,we,7,4,"div",8),bf(),$a(73,"div",8)(74,"label",32),uc(75,"input",33),oS(),$a(76,"span",34),t_(77,"Enabled"),bf()(),$a(78,"p",35),t_(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),bf()(),$a(80,"div",8)(81,"label",36),t_(82,"External Metadata"),bf(),uc(83,"textarea",37),oS(),dT(84,ke,2,0,"span",12),$a(85,"span",13),t_(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),bf()(),dT(87,Ne,2,1,"p",38),$a(88,"div",39)(89,"button",40),t_(90),bf(),$a(91,"button",41),lc("click",function(){ig(e);let g=_T();return sg(g.cancel())}),t_(92,"Cancel"),bf()()();}if(n&2){let e=_T();tv("formGroup",e.form),mb(6),gv("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),tv("formControl",e.nameControl),sS(),mb(),fT(e.nameControl.invalid&&e.nameControl.touched?7:-1),mb(6),tv("formControl",e.descriptionControl),sS(),mb(6),fT(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),mb(8),gv("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),tv("formControl",e.promptContentControl),sS(),mb(),fT(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),mb(11),tv("formControl",e.unitControl),sS(),mb(),mT(e.schedulerUnits),mb(2),fT(e.showDayFilter()?42:-1),mb(7),tv("formControl",e.timeUtcControl),sS(),mb(3),fT(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),mb(9),gv("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),tv("formControl",e.startDateControl),sS(),mb(),fT(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),mb(6),tv("formControl",e.endTypeControl),sS(),mb(),mT(e.endTypes),mb(2),fT(e.showEndDate()?71:-1),mb(),fT(e.showOccurrenceCount()?72:-1),mb(3),tv("formControl",e.enabledControl),sS(),mb(8),tv("formControl",e.externalMetadataJsonControl),sS(),mb(),fT(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),mb(3),fT(e.errorMessage()?87:-1),mb(2),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=p($t);router=p(It);destroyRef=p(Me$1);state=p(c);agentConfigController=p($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve$1.required]}),description:new vt(null),agentConfigId:new vt("",{nonNullable:true,validators:[ve$1.required]}),promptContent:new vt("",{nonNullable:true,validators:[ve$1.required]}),unit:new vt(Ee$1.WEEK,{nonNullable:true,validators:[ve$1.required]}),days:new vt([],{nonNullable:true}),timeUtc:new vt("09:00",{nonNullable:true,validators:[ve$1.required,ve$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new vt("",{nonNullable:true,validators:[ve$1.required]}),endType:new vt(Oe$1.NEVER,{nonNullable:true,validators:[ve$1.required]}),endDate:new vt(null),occurrenceCount:new vt(null),enabled:new vt(true,{nonNullable:true}),externalMetadataJson:new vt("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);errorMessage=ie(null);SchedulerUnit=Ee$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ee$1.WEEK,label:"Week(s)"},{value:Ee$1.MONTH,label:"Month(s)"}];endTypes=[{value:Oe$1.NEVER,label:"Never"},{value:Oe$1.ON_DATE,label:"On date"},{value:Oe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Rs(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Rs(this.endTypeControl.value)));showDayFilter=Si(()=>this.unitSignal()===Ee$1.WEEK);showEndDate=Si(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=Si(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=ie([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),hw({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(Wn(()=>_([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Oe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Oe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Df({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return d.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5),bf(),$a(6,"h1",4),t_(7),bf()(),dT(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),bf()),e&2&&(mb(5),Af(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),mb(2),Af(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),mb(),fT(d.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn$1,qt,pn,Vn],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Oe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Oe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
1
+ import {c}from'./chunk-COXwQCHb.js';import {$ as $$1,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,b as pn,V as Vn}from'./chunk-DAIRZxQZ.js';import {p,y as $t,o as It,M as Me$1,a9 as $,aa as Oe$1,ab as Ee$1,g as ie,ac as Ve$1,a2 as F,ad as Rs,h as Si,ae as hw,U,af as Wn,J as x,H as w,D as Df,a3 as _,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,A as Af,f as fT,r as IT,u as uc,L as oS,j as gT,_ as _T,N as tv,w as gv,O as sS,k as mT,I as Iv,s as ig,v as sg,X as Xm}from'./main-A5TVR2ZW.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&($a(0,"p",5),t_(1,"Loading\u2026"),bf());}function ue(n,t){n&1&&($a(0,"span",12),t_(1," Name is required. "),bf());}function fe(n,t){if(n&1&&($a(0,"p",42),t_(1),bf(),$a(2,"span",13),t_(3,"Agent Config cannot be changed after creation."),bf()),n&2){let e=_T(2);mb(),Iv(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&($a(0,"a",43),t_(1,"Add an agent config"),bf(),t_(2," first. ")),n&2){let e=_T(3);tv("href","/agentos/"+e.namespaceId+"/agent-configs/new",Xm);}}function he(n,t){if(n&1&&($a(0,"p",13),t_(1," No agent configs available in this scope yet. "),dT(2,_e,3,1),bf()),n&2){let e=_T(2);mb(2),fT(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.id),mb(),Iv(e.name);}}function Ce(n,t){n&1&&($a(0,"span",12),t_(1,"Agent Config is required."),bf());}function ve(n,t){if(n&1&&($a(0,"select",44)(1,"option",45),t_(2,"Select an agent config\u2026"),bf(),gT(3,ge,2,2,"option",23,me),bf(),oS(),dT(5,Ce,2,0,"span",12),$a(6,"span",13),t_(7,"Immutable after creation."),bf()),n&2){let e=_T(2);tv("formControl",e.agentConfigIdControl),sS(),mb(3),mT(e.availableAgentConfigs()),mb(2),fT(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&($a(0,"span",12),t_(1,"Opening message is required."),bf());}function ye(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function be(n,t){if(n&1){let e=IT();$a(0,"label",48)(1,"input",49),lc("change",function(){let g=ig(e).$implicit,v=_T(3);return sg(v.toggleDay(g.value))}),bf(),$a(2,"span",50),t_(3),bf()();}if(n&2){let e=t.$implicit,d=_T(3);mb(),tv("checked",d.isDaySelected(e.value)),mb(2),Iv(e.label);}}function Se(n,t){if(n&1&&($a(0,"div",8)(1,"span",46),t_(2,"Days of week"),bf(),$a(3,"div",47),gT(4,be,4,2,"label",48,A),bf(),$a(6,"span",13),t_(7,"Leave empty to run every day of the week."),bf()()),n&2){let e=_T(2);mb(4),mT(e.dayOptions);}}function Ee(n,t){n&1&&($a(0,"span",12),t_(1,"Valid time is required (HH:mm)."),bf());}function Pe(n,t){n&1&&($a(0,"span",12),t_(1,"Start date is required."),bf());}function Me(n,t){if(n&1&&($a(0,"option",23),t_(1),bf()),n&2){let e=t.$implicit;tv("value",e.value),mb(),Iv(e.label);}}function Oe(n,t){n&1&&($a(0,"span",12),t_(1,"End date is required."),bf());}function De(n,t){if(n&1&&($a(0,"div",8)(1,"label",51),t_(2," End date "),$a(3,"span",10),t_(4,"*"),bf()(),uc(5,"input",52),oS(),dT(6,Oe,2,0,"span",12),bf()),n&2){let e=_T(2);mb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),tv("formControl",e.endDateControl),sS(),mb(),fT(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&($a(0,"span",12),t_(1,"Must be at least 1."),bf());}function we(n,t){if(n&1&&($a(0,"div",8)(1,"label",53),t_(2," Number of occurrences "),$a(3,"span",10),t_(4,"*"),bf()(),uc(5,"input",54),oS(),dT(6,Te,2,0,"span",12),bf()),n&2){let e=_T(2);mb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),tv("formControl",e.occurrenceCountControl),sS(),mb(),fT(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&($a(0,"span",12),t_(1,"Invalid JSON."),bf());}function Ne(n,t){if(n&1&&($a(0,"p",38),t_(1),bf()),n&2){let e=_T(2);mb(),Iv(e.errorMessage());}}function Fe(n,t){if(n&1){let e=IT();$a(0,"form",7),lc("ngSubmit",function(){ig(e);let g=_T();return sg(g.submit())}),$a(1,"div",8)(2,"label",9),t_(3," Name "),$a(4,"span",10),t_(5,"*"),bf()(),uc(6,"input",11),oS(),dT(7,ue,2,0,"span",12),$a(8,"span",13),t_(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),bf()(),$a(10,"div",8)(11,"label",14),t_(12,"Description"),bf(),uc(13,"input",15),oS(),bf(),$a(14,"div",8)(15,"label",16),t_(16," Agent Config "),$a(17,"span",10),t_(18,"*"),bf()(),dT(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),bf(),$a(22,"div",8)(23,"label",17),t_(24," Opening message "),$a(25,"span",10),t_(26,"*"),bf()(),uc(27,"textarea",18),oS(),dT(28,xe,2,0,"span",12),$a(29,"span",13),t_(30," The message sent to the agent when the scheduled prompt fires. "),bf()(),$a(31,"fieldset",19)(32,"legend",20),t_(33,"Recurrence"),bf(),$a(34,"div",8)(35,"label",21),t_(36," Unit "),$a(37,"span",10),t_(38,"*"),bf()(),$a(39,"select",22),gT(40,ye,2,2,"option",23,A),bf(),oS(),bf(),dT(42,Se,8,0,"div",8),$a(43,"div",8)(44,"label",24),t_(45," Time (UTC) "),$a(46,"span",10),t_(47,"*"),bf()(),$a(48,"div",25),uc(49,"input",26),oS(),$a(50,"span",27),t_(51,"UTC"),bf()(),dT(52,Ee,2,0,"span",12),bf()(),$a(53,"fieldset",19)(54,"legend",20),t_(55,"Planning"),bf(),$a(56,"div",8)(57,"label",28),t_(58," Start date "),$a(59,"span",10),t_(60,"*"),bf()(),uc(61,"input",29),oS(),dT(62,Pe,2,0,"span",12),bf(),$a(63,"div",8)(64,"label",30),t_(65," Ends "),$a(66,"span",10),t_(67,"*"),bf()(),$a(68,"select",31),gT(69,Me,2,2,"option",23,A),bf(),oS(),bf(),dT(71,De,7,4,"div",8),dT(72,we,7,4,"div",8),bf(),$a(73,"div",8)(74,"label",32),uc(75,"input",33),oS(),$a(76,"span",34),t_(77,"Enabled"),bf()(),$a(78,"p",35),t_(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),bf()(),$a(80,"div",8)(81,"label",36),t_(82,"External Metadata"),bf(),uc(83,"textarea",37),oS(),dT(84,ke,2,0,"span",12),$a(85,"span",13),t_(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),bf()(),dT(87,Ne,2,1,"p",38),$a(88,"div",39)(89,"button",40),t_(90),bf(),$a(91,"button",41),lc("click",function(){ig(e);let g=_T();return sg(g.cancel())}),t_(92,"Cancel"),bf()()();}if(n&2){let e=_T();tv("formGroup",e.form),mb(6),gv("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),tv("formControl",e.nameControl),sS(),mb(),fT(e.nameControl.invalid&&e.nameControl.touched?7:-1),mb(6),tv("formControl",e.descriptionControl),sS(),mb(6),fT(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),mb(8),gv("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),tv("formControl",e.promptContentControl),sS(),mb(),fT(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),mb(11),tv("formControl",e.unitControl),sS(),mb(),mT(e.schedulerUnits),mb(2),fT(e.showDayFilter()?42:-1),mb(7),tv("formControl",e.timeUtcControl),sS(),mb(3),fT(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),mb(9),gv("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),tv("formControl",e.startDateControl),sS(),mb(),fT(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),mb(6),tv("formControl",e.endTypeControl),sS(),mb(),mT(e.endTypes),mb(2),fT(e.showEndDate()?71:-1),mb(),fT(e.showOccurrenceCount()?72:-1),mb(3),tv("formControl",e.enabledControl),sS(),mb(8),tv("formControl",e.externalMetadataJsonControl),sS(),mb(),fT(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),mb(3),fT(e.errorMessage()?87:-1),mb(2),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=p($t);router=p(It);destroyRef=p(Me$1);state=p(c);agentConfigController=p($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve$1.required]}),description:new vt(null),agentConfigId:new vt("",{nonNullable:true,validators:[ve$1.required]}),promptContent:new vt("",{nonNullable:true,validators:[ve$1.required]}),unit:new vt(Ee$1.WEEK,{nonNullable:true,validators:[ve$1.required]}),days:new vt([],{nonNullable:true}),timeUtc:new vt("09:00",{nonNullable:true,validators:[ve$1.required,ve$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new vt("",{nonNullable:true,validators:[ve$1.required]}),endType:new vt(Oe$1.NEVER,{nonNullable:true,validators:[ve$1.required]}),endDate:new vt(null),occurrenceCount:new vt(null),enabled:new vt(true,{nonNullable:true}),externalMetadataJson:new vt("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);errorMessage=ie(null);SchedulerUnit=Ee$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ee$1.WEEK,label:"Week(s)"},{value:Ee$1.MONTH,label:"Month(s)"}];endTypes=[{value:Oe$1.NEVER,label:"Never"},{value:Oe$1.ON_DATE,label:"On date"},{value:Oe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Rs(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Rs(this.endTypeControl.value)));showDayFilter=Si(()=>this.unitSignal()===Ee$1.WEEK);showEndDate=Si(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=Si(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=ie([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),hw({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(Wn(()=>_([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Oe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Oe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Df({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return d.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5),bf(),$a(6,"h1",4),t_(7),bf()(),dT(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),bf()),e&2&&(mb(5),Af(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),mb(2),Af(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),mb(),fT(d.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn$1,qt,pn,Vn],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Oe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Oe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
@@ -1 +1 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CICH059M.js';import {O as O$1}from'./chunk-BXRhQZJG.js';import {p,y as $t,o as It,M as Me$1,a9 as $,ax as U,g as ie,ay as Y,a1 as W,a2 as F,h as Si,az as we,U as U$1,af as Wn,ae as hw,a3 as _,aA as j$1,J as x,H as w,D as Df,at as pu,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,_ as _T,N as tv,r as IT,u as uc,L as oS,O as sS,e as cc,A as Af,j as gT,k as mT,s as ig,v as sg,ar as Cv}from'./main-SHENI7ZL.js';import {$ as $$1,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye$1,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,t as Lt,b as pn,V as Vn}from'./chunk-Dc05FsvB.js';import'./chunk-CCZGyjHo.js';var O="*";function Ae(o){return (o??[]).some(t=>t.trim()===O)}function ke(o){let t=(o??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==O).map(e=>e.toLowerCase());return new Set(t)}function j(o){return o.includes(O)}var Ee="AGENTOS_CONFIG",Oe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Me(o){return o.configEnabled&&(o.hasSubAgents||o.integrationTypes.some(t=>Oe.has(t)))}var Pe=(o,t)=>t.config.id,Re=(o,t)=>t.type,Ie=(o,t)=>t.selector;function Fe(o,t){if(o&1&&($a(0,"a",5),t_(1,"View resolved definition \u2192"),bf()),o&2){let e=_T();tv("routerLink",e.inspectRoute());}}function De(o,t){o&1&&($a(0,"span",6),t_(1,"Platform level"),bf());}function Ne(o,t){o&1&&($a(0,"p",7),t_(1,"Loading\u2026"),bf());}function Le(o,t){if(o&1&&($a(0,"span",57),t_(1),bf()),o&2){let e=_T().$implicit;mb(),Iv(e.config.integrationType);}}function Ve(o,t){if(o&1&&(uc(0,"input",58),oS()),o&2){let e=_T().$implicit;tv("formControl",e.toolsControl),sS();}}function ze(o,t){if(o&1){let e=IT();$a(0,"div",52)(1,"label",54)(2,"input",55),lc("change",function(){let s=ig(e).$implicit,c=_T(3);return sg(c.toggleIntegration(s))}),bf(),$a(3,"span",56),t_(4),bf(),dT(5,Le,2,1,"span",57),bf(),dT(6,Ve,1,1,"input",58),bf();}if(o&2){let e=t.$implicit;mb(2),tv("checked",e.enabled()),mb(2),Iv(e.config.name),mb(),fT(e.config.integrationType?5:-1),mb(),fT(e.enabled()?6:-1);}}function Be(o,t){if(o&1&&($a(0,"p",64),t_(1),bf()),o&2){let e=_T().$implicit;mb(),Af(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function $e(o,t){if(o&1){let e=IT();$a(0,"div",52)(1,"label",54)(2,"span",56),t_(3),bf(),$a(4,"span",57),t_(5,"built-in"),bf()(),$a(6,"select",60),lc("change",function(s){let c=ig(e).$implicit,C=_T(4);return sg(C.setBuiltInState(c,s.target.value))}),$a(7,"option",61),t_(8),bf(),$a(9,"option",62),t_(10,"Enabled"),bf(),$a(11,"option",63),t_(12,"Disabled"),bf()(),dT(13,Be,2,1,"p",64),$a(14,"p",65),t_(15),bf()();}if(o&2){let e=t.$implicit,n=_T(4);mb(),cc("for","built-in-"+e.type),mb(2),Iv(e.displayName),mb(3),tv("id","built-in-"+e.type)("value",e.state()),mb(2),Iv(n.builtInDefaultLabel(e)),mb(5),fT(e.state()==="on"&&e.restrictedTools?13:-1),mb(2),Iv(e.description);}}function Ue(o,t){if(o&1&&($a(0,"p",59),t_(1,"Built-in integrations"),bf(),gT(2,$e,16,7,"div",52,Re)),o&2){let e=_T(3);mb(2),mT(e.builtInRows());}}function Ge(o,t){o&1&&($a(0,"p",53),t_(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),bf());}function je(o,t){if(o&1&&($a(0,"fieldset",20)(1,"legend",22),t_(2,"Integrations"),bf(),$a(3,"p",51),t_(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),bf(),gT(5,ze,7,4,"div",52,Pe),dT(7,Ue,4,0),dT(8,Ge,2,0,"p",53),bf()),o&2){let e=_T(2);mb(5),mT(e.integrationRows()),mb(2),fT(e.builtInRows().length>0?7:-1),mb(),fT(e.configAgentExposureWarning()?8:-1);}}function We(o,t){o&1&&t_(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function Je(o,t){o&1&&($a(0,"p",29),t_(1," Saving with this on replaces the selection below with "),$a(2,"code",24),t_(3,"*"),bf(),t_(4,". "),bf());}function Ke(o,t){o&1&&($a(0,"p",29),t_(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),bf());}function Ye(o,t){o&1&&($a(0,"p",30),t_(1,"No skill available in this scope yet."),bf());}function He(o,t){o&1&&($a(0,"span",69),t_(1,"platform"),bf());}function qe(o,t){if(o&1&&($a(0,"span",70),t_(1),bf()),o&2){let e=_T(4);mb(),Af(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Xe(o,t){if(o&1&&($a(0,"p",71),t_(1),bf()),o&2){let e=_T().$implicit;mb(),Iv(e.description);}}function Qe(o,t){if(o&1){let e=IT();$a(0,"div",66)(1,"label",67)(2,"input",68),lc("change",function(){let s=ig(e).$implicit,c=_T(3);return sg(c.toggleSkill(s))}),bf(),$a(3,"span",27),t_(4),bf(),dT(5,He,2,0,"span",69),dT(6,qe,2,1,"span",70),bf(),dT(7,Xe,2,1,"p",71),bf();}if(o&2){let e=t.$implicit,n=_T(3);mb(2),tv("checked",e.selected())("disabled",n.allSkillsSelected()),mb(2),Iv(e.name),mb(),fT(e.platform?5:-1),mb(),fT(e.unresolved?6:-1),mb(),fT(e.description?7:-1);}}function Ze(o,t){if(o&1&&gT(0,Qe,8,6,"div",66,Ie),o&2){let e=_T(2);mT(e.skillRows());}}function et(o,t){o&1&&($a(0,"p",74),t_(1,"Invalid JSON \u2014 please fix the syntax."),bf());}function tt(o,t){if(o&1&&($a(0,"div",10)(1,"label",72),t_(2,"Loop configuration (JSON)"),bf(),uc(3,"textarea",73),oS(),dT(4,et,2,0,"p",74),$a(5,"p",28),t_(6," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),$a(7,"code",24),t_(8,"AgentLoopPayload"),bf(),t_(9,". Leave empty if you always provide the payload at launch. "),bf()()),o&2){let e=_T(2);mb(3),tv("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),sS(),mb(),fT(e.loopConfigControl.invalid&&e.loopConfigControl.touched?4:-1);}}function nt(o,t){o&1&&t_(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function ot(o,t){o&1&&($a(0,"p",29),t_(1," Saving with this on replaces the selection below with "),$a(2,"code",24),t_(3,"*"),bf(),t_(4,". "),bf());}function it(o,t){o&1&&($a(0,"p",29),t_(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),bf());}function at(o,t){o&1&&($a(0,"p",30),t_(1,"No other agent is available in this scope yet."),bf());}function rt(o,t){o&1&&($a(0,"span",69),t_(1,"pattern"),bf());}function lt(o,t){if(o&1&&($a(0,"span",70),t_(1),bf()),o&2){let e=_T(4);mb(),Af(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function st(o,t){if(o&1){let e=IT();$a(0,"button",76),lc("click",function(){ig(e);let s=_T().$implicit,c=_T(3);return sg(c.removeSubAgent(s))}),t_(1," \u{1F5D1} "),bf();}}function ct(o,t){if(o&1){let e=IT();$a(0,"div",66)(1,"label",67)(2,"input",68),lc("change",function(){let s=ig(e).$implicit,c=_T(3);return sg(c.toggleSubAgent(s))}),bf(),$a(3,"span",27),t_(4),bf(),dT(5,rt,2,0,"span",69)(6,lt,2,1,"span",70),dT(7,st,2,0,"button",75),bf()();}if(o&2){let e=t.$implicit,n=_T(3);mb(2),tv("checked",e.selected())("disabled",n.allSubAgentsSelected()),mb(2),Iv(e.name),mb(),fT(e.pattern?5:e.unresolved?6:-1),mb(2),fT(e.unresolved?7:-1);}}function dt(o,t){if(o&1&&gT(0,ct,8,5,"div",66,Ie),o&2){let e=_T(2);mT(e.subAgentRows());}}function gt(o,t){if(o&1&&t_(0),o&2){let e=_T(2);Cv(" : ",e.defaultDelegationTimeoutSeconds()," s (",e.defaultDelegationTimeoutSeconds()/60," min) ");}}function mt(o,t){o&1&&($a(0,"p",44),t_(1," Enter a valid positive whole number of seconds, or leave empty to inherit the server default. "),bf());}function ft(o,t){if(o&1){let e=IT();$a(0,"button",77),lc("click",function(){ig(e);let s=_T(2);return sg(s.useDefaultDelegationTimeout())}),t_(1," Use server default "),bf();}}function ut(o,t){o&1&&($a(0,"p",46),t_(1),bf()),o&2&&(mb(),Iv(t));}function pt(o,t){if(o&1){let e=IT();$a(0,"button",78),lc("click",function(){ig(e);let s=_T(2);return sg(s.exportYaml())}),t_(1),bf();}if(o&2){let e=_T(2);tv("disabled",e.isExporting()),mb(),Af(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function _t(o,t){if(o&1){let e=IT();$a(0,"form",9),lc("ngSubmit",function(){ig(e);let s=_T();return sg(s.submit())}),$a(1,"div",10)(2,"label",11),t_(3,"Name "),$a(4,"span",12),t_(5,"*"),bf()(),uc(6,"input",13),oS(),bf(),$a(7,"div",10)(8,"label",14),t_(9,"Description"),bf(),uc(10,"input",15),oS(),bf(),$a(11,"div",10)(12,"label",16),t_(13,"Model name"),bf(),uc(14,"input",17),oS(),bf(),$a(15,"div",10)(16,"label",18),t_(17,"Instructions"),bf(),uc(18,"textarea",19),oS(),bf(),dT(19,je,9,2,"fieldset",20),$a(20,"fieldset",21)(21,"legend",22),t_(22,"Skills"),bf(),$a(23,"p",23),t_(24," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),$a(25,"code",24),t_(26,"readSkill"),bf(),t_(27," and "),$a(28,"code",24),t_(29,"readSkillResource"),bf(),t_(30," tools; selecting none grants neither. "),dT(31,We,1,0),bf(),$a(32,"label",25)(33,"input",26),lc("change",function(){ig(e);let s=_T();return sg(s.toggleAllSkills())}),bf(),$a(34,"span",27),t_(35," Every skill in the catalogue ("),$a(36,"code",24),t_(37,"*"),bf(),t_(38,") "),bf()(),$a(39,"p",28),t_(40," Resolved at run time, so skills added later are granted too, without editing this agent. "),bf(),dT(41,Je,5,0,"p",29),dT(42,Ke,2,0,"p",29),dT(43,Ye,2,0,"p",30)(44,Ze,2,0),bf(),$a(45,"div",10)(46,"label",31),t_(47,"Execution mode"),bf(),$a(48,"select",32)(49,"option",33),t_(50,"SIMPLE \u2014 Standard agent (single LLM call)"),bf(),$a(51,"option",33),t_(52,"ADVANCED \u2014 Multi-step reasoning loop"),bf(),$a(53,"option",33),t_(54,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),bf()(),oS(),$a(55,"p",28),t_(56,' SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu. '),bf()(),dT(57,tt,10,3,"div",10),$a(58,"div",10)(59,"label",34),uc(60,"input",35),oS(),$a(61,"span",36),t_(62,"Enabled"),bf()(),$a(63,"p",37),t_(64,"Disabled agents are excluded from namespace resolution."),bf()(),$a(65,"fieldset",21)(66,"legend",22),t_(67,"Sub-agents"),bf(),$a(68,"p",23),t_(69," The agents this one may delegate to. Selecting at least one grants it the "),$a(70,"code",24),t_(71,"DELEGATE__delegate"),bf(),t_(72," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),dT(73,nt,1,0),bf(),$a(74,"label",25)(75,"input",26),lc("change",function(){ig(e);let s=_T();return sg(s.toggleAllSubAgents())}),bf(),$a(76,"span",27),t_(77," Every agent it can reach ("),$a(78,"code",24),t_(79,"*"),bf(),t_(80,") "),bf()(),$a(81,"p",28),t_(82," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),bf(),dT(83,ot,5,0,"p",29),dT(84,it,2,0,"p",29),dT(85,at,2,0,"p",30)(86,dt,2,0),$a(87,"p",28),t_(88," Advanced \u2014 add a glob instead of picking a name, for example "),$a(89,"code",24),t_(90,"*Fixer"),bf(),t_(91," to cover BugFixer and StoryFixer. "),bf(),$a(92,"div",38)(93,"input",39),lc("keydown.enter",function(){ig(e);let s=_T();return sg(s.addSubAgent())}),bf(),oS(),$a(94,"button",40),lc("click",function(){ig(e);let s=_T();return sg(s.addSubAgent())}),t_(95," + "),bf()()(),$a(96,"div",10)(97,"label",41),t_(98,"Delegation timeout (seconds)"),bf(),$a(99,"p",42),t_(100," How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default "),dT(101,gt,1,2),t_(102," . "),bf(),uc(103,"input",43),oS(),dT(104,mt,2,0,"p",44),dT(105,ft,2,0,"button",45),bf(),dT(106,ut,2,1,"p",46),$a(107,"div",47)(108,"button",48),t_(109),bf(),dT(110,pt,2,2,"button",49),$a(111,"button",50),lc("click",function(){ig(e);let s=_T();return sg(s.cancel())}),t_(112,"Cancel"),bf()()();}if(o&2){let e,n=_T();tv("formGroup",n.form),mb(6),tv("formControl",n.nameControl),sS(),mb(4),tv("formControl",n.descriptionControl),sS(),mb(4),tv("formControl",n.modelNameControl),sS(),mb(4),tv("formControl",n.instructionsControl),sS(),mb(),fT(n.integrationRows().length>0||n.builtInRows().length>0?19:-1),mb(12),fT(n.isPlatformMode?31:-1),mb(2),tv("checked",n.allSkillsSelected()),mb(8),fT(n.namedSkillSelectionDropped()?41:-1),mb(),fT(n.skillCatalogueUnavailable()?42:-1),mb(),fT(n.skillRows().length===0?43:44),mb(5),tv("formControl",n.executionModeControl),sS(),mb(),tv("value",n.ExecutionMode.SIMPLE),mb(2),tv("value",n.ExecutionMode.ADVANCED),mb(2),tv("value",n.ExecutionMode.LOOP),mb(4),fT(n.isLoopMode()?57:-1),mb(3),tv("formControl",n.enabledControl),sS(),mb(13),fT(n.isPlatformMode?73:-1),mb(2),tv("checked",n.allSubAgentsSelected()),mb(8),fT(n.namedSubAgentSelectionDropped()?83:-1),mb(),fT(n.subAgentCandidatesUnavailable()?84:-1),mb(),fT(n.subAgentRows().length===0?85:86),mb(8),tv("formControl",n.newSubAgentControl),sS(),mb(),tv("disabled",!n.newSubAgentControl.value.trim()),mb(7),fT(n.defaultDelegationTimeoutSeconds()!==null?101:-1),mb(2),tv("formControl",n.delegationTimeoutControl),cc("aria-invalid",n.delegationTimeoutControl.invalid),sS(),mb(),fT(n.delegationTimeoutControl.invalid?104:-1),mb(),fT(n.delegationTimeoutControl.value!==null?105:-1),mb(),fT((e=n.submitError())?106:-1,e),mb(2),tv("disabled",n.form.invalid||n.isSubmitting()),mb(),Af(" ",n.isEditMode()?"Save changes":"Create"," "),mb(),fT(n.isEditMode()?110:-1);}}var Te=class o$2{route=p($t);router=p(It);destroyRef=p(Me$1);agentConfigController=p($);defaultsController=p(U);defaultDelegationTimeoutSeconds=ie(null);exportService=p(Y);integrationConfigState=p(O$1);integrationTypeController=p(W);skillState=p(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),modelName:new vt(null),instructions:new vt(null),executionMode:new vt("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new vt(null,{validators:[ve.min(1),ve.max(2147483647),ve.pattern(/^\d+$/)]}),enabled:new vt(false,{nonNullable:true}),loopConfig:new vt(null,{validators:[o$2.jsonValidator]})});static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(n){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=Si(()=>this.executionModeValue()==="LOOP");subAgentRows=ie([]);allSubAgentsSelected=ie(false);subAgentCandidatesUnavailable=ie(false);namedSubAgentSelectionDropped=Si(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));hasAnySubAgent=Si(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new vt("",{nonNullable:true});isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);isExporting=ie(false);submitError=ie(null);ExecutionMode=we;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=ie([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=Si(()=>Me({configEnabled:this.builtInRows().some(t=>t.type===Ee&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));integrationRows=ie([]);skillRows=ie([]);allSkillsSelected=ie(false);skillCatalogueUnavailable=ie(false);namedSkillSelectionDropped=Si(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),Wn(()=>_(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),hw({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:n,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:v})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let T=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(T),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let p=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(p,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Ae(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(v,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){hw({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:n,builtInTypes:s,skillCatalogue:c,delegationCandidates:C})=>{let v=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(v,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(j$1(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(Wn(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_([]))))}buildSkillRows(t,e){let s=(e??[]).map(p=>p.trim()).filter(p=>p.length>0).filter(p=>p!==r),c=i(s),C=new Set(t.map(p=>p.name.toLowerCase())),v=t.map(p=>({selector:p.name,name:p.name,description:p.description,platform:p.namespaceId==null,unresolved:false,selected:ie(c.has(p.name.toLowerCase()))})),T=new Set;for(let p of s){let _=l(p).toLowerCase();C.has(_)||T.has(_)||(T.add(_),v.push({selector:p,name:p,description:"",platform:false,unresolved:true,selected:ie(true)}));}return v}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){return (this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,true):this.agentConfigController.listPlatformAgentsAgentConfig(true)).pipe(j$1(e=>e.map(n=>n.name).filter(n=>n.length>0)),Wn(e=>(console.error("[agent-config-form] failed to load the delegation candidates",e),this.subAgentCandidatesUnavailable.set(true),_([]))))}buildSubAgentRows(t,e,n){let s=t.filter(_=>_!==n),c=ke(e),C=new Set(s.map(_=>_.toLowerCase())),v=s.map(_=>({selector:_,name:_,unresolved:false,pattern:false,selected:ie(c.has(_.toLowerCase()))})),T=new Set,p=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==O);for(let _ of p){let B=_.toLowerCase();C.has(B)||T.has(B)||(T.add(B),v.push({selector:_,name:_,unresolved:true,pattern:j(_),selected:ie(true)}));}return v}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(j$1(t=>t.filter(e=>!e.configSchema)),Wn(t=>(console.error("[agent-config-form] failed to load integration types",t),_([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",c=e?.[s],C=e!=null&&s in e,v=Array.isArray(c)?c.join(", "):"";return {config:n,enabled:ie(C),toolsControl:new vt(v,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,c=e?.[n.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:ie(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===O?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>[...n,{selector:t,name:t,unresolved:true,pattern:j(t),selected:ie(true)}]),this.newSubAgentControl.reset("");}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(n=>n!==t));}toggleSubAgent(t){t.selected.update(e=>!e);}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t);}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [O];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",c=n.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:n=>{this.isSubmitting.set(false),this.submitError.set(o$2.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;return typeof n=="string"&&n.trim().length>0?n:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(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??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||o$2)};static \u0275cmp=Df({type:o$2,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__skills"],[1,"agent-config-form__label"],[1,"agent-config-form__skills-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__skill-all"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked"],[1,"agent-config-form__skill-name"],[1,"agent-config-form__field-hint"],["role","alert",1,"agent-config-form__skills-warning"],[1,"agent-config-form__skills-empty"],["for","agent-config-execution-mode",1,"agent-config-form__label"],["id","agent-config-execution-mode",1,"agent-config-form__select",3,"formControl"],[3,"value"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],["for","delegation-timeout",1,"agent-config-form__label"],["id","delegation-timeout-hint",1,"agent-config-form__field-hint"],["id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",1,"agent-config-form__input",3,"formControl"],["id","delegation-timeout-error","role","alert",1,"agent-config-form__field-hint"],["type","button",1,"agent-config-form__sub-agent-btn"],["role","alert",1,"agent-config-form__submit-error"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],["role","note",1,"agent-config-form__integration-warning"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__skill-row"],[1,"agent-config-form__skill-toggle"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked","disabled"],[1,"agent-config-form__skill-badge"],[1,"agent-config-form__skill-badge","agent-config-form__skill-badge--unresolved"],[1,"agent-config-form__skill-desc"],["for","agent-config-loop-config",1,"agent-config-form__label"],["id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",1,"agent-config-form__textarea","agent-config-form__textarea--mono",3,"placeholder","formControl"],["role","alert",1,"agent-config-form__field-error"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__sub-agent-btn",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return n.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," Agent Configs "),bf(),$a(6,"h1",4),t_(7),bf(),dT(8,Fe,2,1,"a",5),dT(9,De,2,0,"span",6),bf(),dT(10,Ne,2,0,"p",7)(11,_t,113,33,"form",8),bf()),e&2&&(mb(7),Iv(n.isEditMode()?"Edit agent config":"New agent config"),mb(),fT(n.isEditMode()?8:-1),mb(),fT(n.isPlatformMode?9:-1),mb(),fT(n.isLoading()?10:11));},dependencies:[Kn,zn,Zn,Xn,Ye$1,dn,Ft,bt,Ln,Wn$1,qt,Lt,pn,Vn,pu],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.8125rem}.agent-config-form__submit-error[_ngcontent-%COMP%]{margin:1rem 0 0;padding:.625rem .875rem;border:1px solid var(--color-error, var(--red, #dc2626));font-size:.85rem;color:var(--color-error, var(--red, #dc2626));line-height:1.5}.agent-config-form__field-error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;transition:border-color .15s ease;appearance:auto}.agent-config-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-warning[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8rem;color:var(--color-warning, #b25000);line-height:1.4}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__skills[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-form__skills-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__skills-warning[_ngcontent-%COMP%]{margin:0;font-size:.8rem;line-height:1.4;color:var(--color-error, var(--red, #dc2626))}.agent-config-form__skills-empty[_ngcontent-%COMP%]{margin:0;font-size:.8rem;font-style:italic;color:var(--color-text-secondary)}.agent-config-form__skill-all[_ngcontent-%COMP%], .agent-config-form__skill-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.agent-config-form__skill-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.agent-config-form__skill-checkbox[_ngcontent-%COMP%]{flex:0 0 auto}.agent-config-form__skill-name[_ngcontent-%COMP%]{font-size:.875rem}.agent-config-form__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary)}.agent-config-form__skill-badge--unresolved[_ngcontent-%COMP%]{color:var(--color-error, var(--red, #dc2626))}.agent-config-form__skill-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{Te as AgentConfigFormComponent};
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-B6S2suRi.js';import {O as O$1}from'./chunk-jY3-S2x8.js';import {p,y as $t,o as It,M as Me$1,a9 as $,ax as U,g as ie,ay as Y,a1 as W,a2 as F,h as Si,az as we,U as U$1,af as Wn,ae as hw,a3 as _,aA as j$1,J as x,H as w,D as Df,at as pu,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,_ as _T,N as tv,r as IT,u as uc,L as oS,O as sS,e as cc,A as Af,j as gT,k as mT,s as ig,v as sg,ar as Cv}from'./main-A5TVR2ZW.js';import {$ as $$1,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye$1,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,t as Lt,b as pn,V as Vn}from'./chunk-DAIRZxQZ.js';import'./chunk-guv8L9D6.js';var O="*";function Ae(o){return (o??[]).some(t=>t.trim()===O)}function ke(o){let t=(o??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==O).map(e=>e.toLowerCase());return new Set(t)}function j(o){return o.includes(O)}var Ee="AGENTOS_CONFIG",Oe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Me(o){return o.configEnabled&&(o.hasSubAgents||o.integrationTypes.some(t=>Oe.has(t)))}var Pe=(o,t)=>t.config.id,Re=(o,t)=>t.type,Ie=(o,t)=>t.selector;function Fe(o,t){if(o&1&&($a(0,"a",5),t_(1,"View resolved definition \u2192"),bf()),o&2){let e=_T();tv("routerLink",e.inspectRoute());}}function De(o,t){o&1&&($a(0,"span",6),t_(1,"Platform level"),bf());}function Ne(o,t){o&1&&($a(0,"p",7),t_(1,"Loading\u2026"),bf());}function Le(o,t){if(o&1&&($a(0,"span",57),t_(1),bf()),o&2){let e=_T().$implicit;mb(),Iv(e.config.integrationType);}}function Ve(o,t){if(o&1&&(uc(0,"input",58),oS()),o&2){let e=_T().$implicit;tv("formControl",e.toolsControl),sS();}}function ze(o,t){if(o&1){let e=IT();$a(0,"div",52)(1,"label",54)(2,"input",55),lc("change",function(){let s=ig(e).$implicit,c=_T(3);return sg(c.toggleIntegration(s))}),bf(),$a(3,"span",56),t_(4),bf(),dT(5,Le,2,1,"span",57),bf(),dT(6,Ve,1,1,"input",58),bf();}if(o&2){let e=t.$implicit;mb(2),tv("checked",e.enabled()),mb(2),Iv(e.config.name),mb(),fT(e.config.integrationType?5:-1),mb(),fT(e.enabled()?6:-1);}}function Be(o,t){if(o&1&&($a(0,"p",64),t_(1),bf()),o&2){let e=_T().$implicit;mb(),Af(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function $e(o,t){if(o&1){let e=IT();$a(0,"div",52)(1,"label",54)(2,"span",56),t_(3),bf(),$a(4,"span",57),t_(5,"built-in"),bf()(),$a(6,"select",60),lc("change",function(s){let c=ig(e).$implicit,C=_T(4);return sg(C.setBuiltInState(c,s.target.value))}),$a(7,"option",61),t_(8),bf(),$a(9,"option",62),t_(10,"Enabled"),bf(),$a(11,"option",63),t_(12,"Disabled"),bf()(),dT(13,Be,2,1,"p",64),$a(14,"p",65),t_(15),bf()();}if(o&2){let e=t.$implicit,n=_T(4);mb(),cc("for","built-in-"+e.type),mb(2),Iv(e.displayName),mb(3),tv("id","built-in-"+e.type)("value",e.state()),mb(2),Iv(n.builtInDefaultLabel(e)),mb(5),fT(e.state()==="on"&&e.restrictedTools?13:-1),mb(2),Iv(e.description);}}function Ue(o,t){if(o&1&&($a(0,"p",59),t_(1,"Built-in integrations"),bf(),gT(2,$e,16,7,"div",52,Re)),o&2){let e=_T(3);mb(2),mT(e.builtInRows());}}function Ge(o,t){o&1&&($a(0,"p",53),t_(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),bf());}function je(o,t){if(o&1&&($a(0,"fieldset",20)(1,"legend",22),t_(2,"Integrations"),bf(),$a(3,"p",51),t_(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),bf(),gT(5,ze,7,4,"div",52,Pe),dT(7,Ue,4,0),dT(8,Ge,2,0,"p",53),bf()),o&2){let e=_T(2);mb(5),mT(e.integrationRows()),mb(2),fT(e.builtInRows().length>0?7:-1),mb(),fT(e.configAgentExposureWarning()?8:-1);}}function We(o,t){o&1&&t_(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function Je(o,t){o&1&&($a(0,"p",29),t_(1," Saving with this on replaces the selection below with "),$a(2,"code",24),t_(3,"*"),bf(),t_(4,". "),bf());}function Ke(o,t){o&1&&($a(0,"p",29),t_(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),bf());}function Ye(o,t){o&1&&($a(0,"p",30),t_(1,"No skill available in this scope yet."),bf());}function He(o,t){o&1&&($a(0,"span",69),t_(1,"platform"),bf());}function qe(o,t){if(o&1&&($a(0,"span",70),t_(1),bf()),o&2){let e=_T(4);mb(),Af(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Xe(o,t){if(o&1&&($a(0,"p",71),t_(1),bf()),o&2){let e=_T().$implicit;mb(),Iv(e.description);}}function Qe(o,t){if(o&1){let e=IT();$a(0,"div",66)(1,"label",67)(2,"input",68),lc("change",function(){let s=ig(e).$implicit,c=_T(3);return sg(c.toggleSkill(s))}),bf(),$a(3,"span",27),t_(4),bf(),dT(5,He,2,0,"span",69),dT(6,qe,2,1,"span",70),bf(),dT(7,Xe,2,1,"p",71),bf();}if(o&2){let e=t.$implicit,n=_T(3);mb(2),tv("checked",e.selected())("disabled",n.allSkillsSelected()),mb(2),Iv(e.name),mb(),fT(e.platform?5:-1),mb(),fT(e.unresolved?6:-1),mb(),fT(e.description?7:-1);}}function Ze(o,t){if(o&1&&gT(0,Qe,8,6,"div",66,Ie),o&2){let e=_T(2);mT(e.skillRows());}}function et(o,t){o&1&&($a(0,"p",74),t_(1,"Invalid JSON \u2014 please fix the syntax."),bf());}function tt(o,t){if(o&1&&($a(0,"div",10)(1,"label",72),t_(2,"Loop configuration (JSON)"),bf(),uc(3,"textarea",73),oS(),dT(4,et,2,0,"p",74),$a(5,"p",28),t_(6," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),$a(7,"code",24),t_(8,"AgentLoopPayload"),bf(),t_(9,". Leave empty if you always provide the payload at launch. "),bf()()),o&2){let e=_T(2);mb(3),tv("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),sS(),mb(),fT(e.loopConfigControl.invalid&&e.loopConfigControl.touched?4:-1);}}function nt(o,t){o&1&&t_(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function ot(o,t){o&1&&($a(0,"p",29),t_(1," Saving with this on replaces the selection below with "),$a(2,"code",24),t_(3,"*"),bf(),t_(4,". "),bf());}function it(o,t){o&1&&($a(0,"p",29),t_(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),bf());}function at(o,t){o&1&&($a(0,"p",30),t_(1,"No other agent is available in this scope yet."),bf());}function rt(o,t){o&1&&($a(0,"span",69),t_(1,"pattern"),bf());}function lt(o,t){if(o&1&&($a(0,"span",70),t_(1),bf()),o&2){let e=_T(4);mb(),Af(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function st(o,t){if(o&1){let e=IT();$a(0,"button",76),lc("click",function(){ig(e);let s=_T().$implicit,c=_T(3);return sg(c.removeSubAgent(s))}),t_(1," \u{1F5D1} "),bf();}}function ct(o,t){if(o&1){let e=IT();$a(0,"div",66)(1,"label",67)(2,"input",68),lc("change",function(){let s=ig(e).$implicit,c=_T(3);return sg(c.toggleSubAgent(s))}),bf(),$a(3,"span",27),t_(4),bf(),dT(5,rt,2,0,"span",69)(6,lt,2,1,"span",70),dT(7,st,2,0,"button",75),bf()();}if(o&2){let e=t.$implicit,n=_T(3);mb(2),tv("checked",e.selected())("disabled",n.allSubAgentsSelected()),mb(2),Iv(e.name),mb(),fT(e.pattern?5:e.unresolved?6:-1),mb(2),fT(e.unresolved?7:-1);}}function dt(o,t){if(o&1&&gT(0,ct,8,5,"div",66,Ie),o&2){let e=_T(2);mT(e.subAgentRows());}}function gt(o,t){if(o&1&&t_(0),o&2){let e=_T(2);Cv(" : ",e.defaultDelegationTimeoutSeconds()," s (",e.defaultDelegationTimeoutSeconds()/60," min) ");}}function mt(o,t){o&1&&($a(0,"p",44),t_(1," Enter a valid positive whole number of seconds, or leave empty to inherit the server default. "),bf());}function ft(o,t){if(o&1){let e=IT();$a(0,"button",77),lc("click",function(){ig(e);let s=_T(2);return sg(s.useDefaultDelegationTimeout())}),t_(1," Use server default "),bf();}}function ut(o,t){o&1&&($a(0,"p",46),t_(1),bf()),o&2&&(mb(),Iv(t));}function pt(o,t){if(o&1){let e=IT();$a(0,"button",78),lc("click",function(){ig(e);let s=_T(2);return sg(s.exportYaml())}),t_(1),bf();}if(o&2){let e=_T(2);tv("disabled",e.isExporting()),mb(),Af(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function _t(o,t){if(o&1){let e=IT();$a(0,"form",9),lc("ngSubmit",function(){ig(e);let s=_T();return sg(s.submit())}),$a(1,"div",10)(2,"label",11),t_(3,"Name "),$a(4,"span",12),t_(5,"*"),bf()(),uc(6,"input",13),oS(),bf(),$a(7,"div",10)(8,"label",14),t_(9,"Description"),bf(),uc(10,"input",15),oS(),bf(),$a(11,"div",10)(12,"label",16),t_(13,"Model name"),bf(),uc(14,"input",17),oS(),bf(),$a(15,"div",10)(16,"label",18),t_(17,"Instructions"),bf(),uc(18,"textarea",19),oS(),bf(),dT(19,je,9,2,"fieldset",20),$a(20,"fieldset",21)(21,"legend",22),t_(22,"Skills"),bf(),$a(23,"p",23),t_(24," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),$a(25,"code",24),t_(26,"readSkill"),bf(),t_(27," and "),$a(28,"code",24),t_(29,"readSkillResource"),bf(),t_(30," tools; selecting none grants neither. "),dT(31,We,1,0),bf(),$a(32,"label",25)(33,"input",26),lc("change",function(){ig(e);let s=_T();return sg(s.toggleAllSkills())}),bf(),$a(34,"span",27),t_(35," Every skill in the catalogue ("),$a(36,"code",24),t_(37,"*"),bf(),t_(38,") "),bf()(),$a(39,"p",28),t_(40," Resolved at run time, so skills added later are granted too, without editing this agent. "),bf(),dT(41,Je,5,0,"p",29),dT(42,Ke,2,0,"p",29),dT(43,Ye,2,0,"p",30)(44,Ze,2,0),bf(),$a(45,"div",10)(46,"label",31),t_(47,"Execution mode"),bf(),$a(48,"select",32)(49,"option",33),t_(50,"SIMPLE \u2014 Standard agent (single LLM call)"),bf(),$a(51,"option",33),t_(52,"ADVANCED \u2014 Multi-step reasoning loop"),bf(),$a(53,"option",33),t_(54,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),bf()(),oS(),$a(55,"p",28),t_(56,' SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu. '),bf()(),dT(57,tt,10,3,"div",10),$a(58,"div",10)(59,"label",34),uc(60,"input",35),oS(),$a(61,"span",36),t_(62,"Enabled"),bf()(),$a(63,"p",37),t_(64,"Disabled agents are excluded from namespace resolution."),bf()(),$a(65,"fieldset",21)(66,"legend",22),t_(67,"Sub-agents"),bf(),$a(68,"p",23),t_(69," The agents this one may delegate to. Selecting at least one grants it the "),$a(70,"code",24),t_(71,"DELEGATE__delegate"),bf(),t_(72," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),dT(73,nt,1,0),bf(),$a(74,"label",25)(75,"input",26),lc("change",function(){ig(e);let s=_T();return sg(s.toggleAllSubAgents())}),bf(),$a(76,"span",27),t_(77," Every agent it can reach ("),$a(78,"code",24),t_(79,"*"),bf(),t_(80,") "),bf()(),$a(81,"p",28),t_(82," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),bf(),dT(83,ot,5,0,"p",29),dT(84,it,2,0,"p",29),dT(85,at,2,0,"p",30)(86,dt,2,0),$a(87,"p",28),t_(88," Advanced \u2014 add a glob instead of picking a name, for example "),$a(89,"code",24),t_(90,"*Fixer"),bf(),t_(91," to cover BugFixer and StoryFixer. "),bf(),$a(92,"div",38)(93,"input",39),lc("keydown.enter",function(){ig(e);let s=_T();return sg(s.addSubAgent())}),bf(),oS(),$a(94,"button",40),lc("click",function(){ig(e);let s=_T();return sg(s.addSubAgent())}),t_(95," + "),bf()()(),$a(96,"div",10)(97,"label",41),t_(98,"Delegation timeout (seconds)"),bf(),$a(99,"p",42),t_(100," How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default "),dT(101,gt,1,2),t_(102," . "),bf(),uc(103,"input",43),oS(),dT(104,mt,2,0,"p",44),dT(105,ft,2,0,"button",45),bf(),dT(106,ut,2,1,"p",46),$a(107,"div",47)(108,"button",48),t_(109),bf(),dT(110,pt,2,2,"button",49),$a(111,"button",50),lc("click",function(){ig(e);let s=_T();return sg(s.cancel())}),t_(112,"Cancel"),bf()()();}if(o&2){let e,n=_T();tv("formGroup",n.form),mb(6),tv("formControl",n.nameControl),sS(),mb(4),tv("formControl",n.descriptionControl),sS(),mb(4),tv("formControl",n.modelNameControl),sS(),mb(4),tv("formControl",n.instructionsControl),sS(),mb(),fT(n.integrationRows().length>0||n.builtInRows().length>0?19:-1),mb(12),fT(n.isPlatformMode?31:-1),mb(2),tv("checked",n.allSkillsSelected()),mb(8),fT(n.namedSkillSelectionDropped()?41:-1),mb(),fT(n.skillCatalogueUnavailable()?42:-1),mb(),fT(n.skillRows().length===0?43:44),mb(5),tv("formControl",n.executionModeControl),sS(),mb(),tv("value",n.ExecutionMode.SIMPLE),mb(2),tv("value",n.ExecutionMode.ADVANCED),mb(2),tv("value",n.ExecutionMode.LOOP),mb(4),fT(n.isLoopMode()?57:-1),mb(3),tv("formControl",n.enabledControl),sS(),mb(13),fT(n.isPlatformMode?73:-1),mb(2),tv("checked",n.allSubAgentsSelected()),mb(8),fT(n.namedSubAgentSelectionDropped()?83:-1),mb(),fT(n.subAgentCandidatesUnavailable()?84:-1),mb(),fT(n.subAgentRows().length===0?85:86),mb(8),tv("formControl",n.newSubAgentControl),sS(),mb(),tv("disabled",!n.newSubAgentControl.value.trim()),mb(7),fT(n.defaultDelegationTimeoutSeconds()!==null?101:-1),mb(2),tv("formControl",n.delegationTimeoutControl),cc("aria-invalid",n.delegationTimeoutControl.invalid),sS(),mb(),fT(n.delegationTimeoutControl.invalid?104:-1),mb(),fT(n.delegationTimeoutControl.value!==null?105:-1),mb(),fT((e=n.submitError())?106:-1,e),mb(2),tv("disabled",n.form.invalid||n.isSubmitting()),mb(),Af(" ",n.isEditMode()?"Save changes":"Create"," "),mb(),fT(n.isEditMode()?110:-1);}}var Te=class o$2{route=p($t);router=p(It);destroyRef=p(Me$1);agentConfigController=p($);defaultsController=p(U);defaultDelegationTimeoutSeconds=ie(null);exportService=p(Y);integrationConfigState=p(O$1);integrationTypeController=p(W);skillState=p(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),modelName:new vt(null),instructions:new vt(null),executionMode:new vt("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new vt(null,{validators:[ve.min(1),ve.max(2147483647),ve.pattern(/^\d+$/)]}),enabled:new vt(false,{nonNullable:true}),loopConfig:new vt(null,{validators:[o$2.jsonValidator]})});static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(n){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=Si(()=>this.executionModeValue()==="LOOP");subAgentRows=ie([]);allSubAgentsSelected=ie(false);subAgentCandidatesUnavailable=ie(false);namedSubAgentSelectionDropped=Si(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));hasAnySubAgent=Si(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new vt("",{nonNullable:true});isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);isExporting=ie(false);submitError=ie(null);ExecutionMode=we;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=ie([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=Si(()=>Me({configEnabled:this.builtInRows().some(t=>t.type===Ee&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));integrationRows=ie([]);skillRows=ie([]);allSkillsSelected=ie(false);skillCatalogueUnavailable=ie(false);namedSkillSelectionDropped=Si(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),Wn(()=>_(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),hw({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:n,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:v})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let T=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(T),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let p=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(p,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Ae(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(v,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){hw({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:n,builtInTypes:s,skillCatalogue:c,delegationCandidates:C})=>{let v=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(v,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(j$1(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(Wn(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_([]))))}buildSkillRows(t,e){let s=(e??[]).map(p=>p.trim()).filter(p=>p.length>0).filter(p=>p!==r),c=i(s),C=new Set(t.map(p=>p.name.toLowerCase())),v=t.map(p=>({selector:p.name,name:p.name,description:p.description,platform:p.namespaceId==null,unresolved:false,selected:ie(c.has(p.name.toLowerCase()))})),T=new Set;for(let p of s){let _=l(p).toLowerCase();C.has(_)||T.has(_)||(T.add(_),v.push({selector:p,name:p,description:"",platform:false,unresolved:true,selected:ie(true)}));}return v}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){return (this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,true):this.agentConfigController.listPlatformAgentsAgentConfig(true)).pipe(j$1(e=>e.map(n=>n.name).filter(n=>n.length>0)),Wn(e=>(console.error("[agent-config-form] failed to load the delegation candidates",e),this.subAgentCandidatesUnavailable.set(true),_([]))))}buildSubAgentRows(t,e,n){let s=t.filter(_=>_!==n),c=ke(e),C=new Set(s.map(_=>_.toLowerCase())),v=s.map(_=>({selector:_,name:_,unresolved:false,pattern:false,selected:ie(c.has(_.toLowerCase()))})),T=new Set,p=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==O);for(let _ of p){let B=_.toLowerCase();C.has(B)||T.has(B)||(T.add(B),v.push({selector:_,name:_,unresolved:true,pattern:j(_),selected:ie(true)}));}return v}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(j$1(t=>t.filter(e=>!e.configSchema)),Wn(t=>(console.error("[agent-config-form] failed to load integration types",t),_([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",c=e?.[s],C=e!=null&&s in e,v=Array.isArray(c)?c.join(", "):"";return {config:n,enabled:ie(C),toolsControl:new vt(v,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,c=e?.[n.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:ie(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===O?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>[...n,{selector:t,name:t,unresolved:true,pattern:j(t),selected:ie(true)}]),this.newSubAgentControl.reset("");}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(n=>n!==t));}toggleSubAgent(t){t.selected.update(e=>!e);}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t);}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [O];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",c=n.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:n=>{this.isSubmitting.set(false),this.submitError.set(o$2.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;return typeof n=="string"&&n.trim().length>0?n:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(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??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||o$2)};static \u0275cmp=Df({type:o$2,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__skills"],[1,"agent-config-form__label"],[1,"agent-config-form__skills-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__skill-all"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked"],[1,"agent-config-form__skill-name"],[1,"agent-config-form__field-hint"],["role","alert",1,"agent-config-form__skills-warning"],[1,"agent-config-form__skills-empty"],["for","agent-config-execution-mode",1,"agent-config-form__label"],["id","agent-config-execution-mode",1,"agent-config-form__select",3,"formControl"],[3,"value"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],["for","delegation-timeout",1,"agent-config-form__label"],["id","delegation-timeout-hint",1,"agent-config-form__field-hint"],["id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",1,"agent-config-form__input",3,"formControl"],["id","delegation-timeout-error","role","alert",1,"agent-config-form__field-hint"],["type","button",1,"agent-config-form__sub-agent-btn"],["role","alert",1,"agent-config-form__submit-error"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],["role","note",1,"agent-config-form__integration-warning"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__skill-row"],[1,"agent-config-form__skill-toggle"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked","disabled"],[1,"agent-config-form__skill-badge"],[1,"agent-config-form__skill-badge","agent-config-form__skill-badge--unresolved"],[1,"agent-config-form__skill-desc"],["for","agent-config-loop-config",1,"agent-config-form__label"],["id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",1,"agent-config-form__textarea","agent-config-form__textarea--mono",3,"placeholder","formControl"],["role","alert",1,"agent-config-form__field-error"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__sub-agent-btn",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return n.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," Agent Configs "),bf(),$a(6,"h1",4),t_(7),bf(),dT(8,Fe,2,1,"a",5),dT(9,De,2,0,"span",6),bf(),dT(10,Ne,2,0,"p",7)(11,_t,113,33,"form",8),bf()),e&2&&(mb(7),Iv(n.isEditMode()?"Edit agent config":"New agent config"),mb(),fT(n.isEditMode()?8:-1),mb(),fT(n.isPlatformMode?9:-1),mb(),fT(n.isLoading()?10:11));},dependencies:[Kn,zn,Zn,Xn,Ye$1,dn,Ft,bt,Ln,Wn$1,qt,Lt,pn,Vn,pu],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.8125rem}.agent-config-form__submit-error[_ngcontent-%COMP%]{margin:1rem 0 0;padding:.625rem .875rem;border:1px solid var(--color-error, var(--red, #dc2626));font-size:.85rem;color:var(--color-error, var(--red, #dc2626));line-height:1.5}.agent-config-form__field-error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;transition:border-color .15s ease;appearance:auto}.agent-config-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-warning[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8rem;color:var(--color-warning, #b25000);line-height:1.4}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__skills[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-form__skills-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__skills-warning[_ngcontent-%COMP%]{margin:0;font-size:.8rem;line-height:1.4;color:var(--color-error, var(--red, #dc2626))}.agent-config-form__skills-empty[_ngcontent-%COMP%]{margin:0;font-size:.8rem;font-style:italic;color:var(--color-text-secondary)}.agent-config-form__skill-all[_ngcontent-%COMP%], .agent-config-form__skill-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.agent-config-form__skill-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.agent-config-form__skill-checkbox[_ngcontent-%COMP%]{flex:0 0 auto}.agent-config-form__skill-name[_ngcontent-%COMP%]{font-size:.875rem}.agent-config-form__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary)}.agent-config-form__skill-badge--unresolved[_ngcontent-%COMP%]{color:var(--color-error, var(--red, #dc2626))}.agent-config-form__skill-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{Te as AgentConfigFormComponent};
@@ -0,0 +1 @@
1
+ import {a8 as Ae,aE as pw,af as Wn,a3 as _}from'./main-A5TVR2ZW.js';function i(t,o,p){return t.pipe(Ae(()=>o().pipe(Wn(()=>_(p)))),pw({bufferSize:1,refCount:true}))}export{i};
@@ -1 +1 @@
1
- import {i}from'./chunk-CCZGyjHo.js';import {l}from'./chunk-Dc05FsvB.js';import {p,a6 as D,aG as me,a7 as ve,as as Ss,a8 as Ae,aE as pw,a3 as _,Y as Le,Z as R,af as Wn,aA as j}from'./main-SHENI7ZL.js';var u=s=>s,N="none",w="me",O=class s{nsController=p(D);exportService=p(me);userState=p(l);refresh$=new ve(void 0);namespaceId$=new ve(null);vm$=Ss([this.namespaceId$,this.refresh$]).pipe(Ae(([e])=>{let n=this.loadPlatformConfigs().pipe(Wn(()=>_([]))),t=this.loadUserConfigs("global").pipe(Wn(()=>_([])));return e?Ss([n,this.loadNamespaceConfigs(e).pipe(Wn(()=>_([]))),this.loadUserConfigs(e).pipe(Wn(()=>_([]))),t]).pipe(j(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):Ss([n,t]).pipe(j(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),pw({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):_([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Le(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Le(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(Le(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(Le(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Le(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=R({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
1
+ import {i}from'./chunk-guv8L9D6.js';import {l}from'./chunk-DAIRZxQZ.js';import {p,a6 as D,aG as me,a7 as ve,as as Ss,a8 as Ae,aE as pw,a3 as _,Y as Le,Z as R,af as Wn,aA as j}from'./main-A5TVR2ZW.js';var u=s=>s,N="none",w="me",O=class s{nsController=p(D);exportService=p(me);userState=p(l);refresh$=new ve(void 0);namespaceId$=new ve(null);vm$=Ss([this.namespaceId$,this.refresh$]).pipe(Ae(([e])=>{let n=this.loadPlatformConfigs().pipe(Wn(()=>_([]))),t=this.loadUserConfigs("global").pipe(Wn(()=>_([])));return e?Ss([n,this.loadNamespaceConfigs(e).pipe(Wn(()=>_([]))),this.loadUserConfigs(e).pipe(Wn(()=>_([]))),t]).pipe(j(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):Ss([n,t]).pipe(j(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),pw({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):_([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Le(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Le(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(Le(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(Le(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Le(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=R({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
@@ -31,5 +31,5 @@
31
31
  <style>:root{--color-bg:#f5f6f8;--color-bg-solid:#f5f6f8;--color-bg-secondary:rgba(255, 255, 255, .7);--color-bg-secondary-rgb:255 255 255;--color-text:#1d1d1f;--color-text-secondary:#6e6e73;--color-text-inverse:#ffffff;--color-text-tertiary:#a1a1a6;--color-primary:#007aff;--color-primary-hover:#0051d5;--color-accent:#8b5cf6;--color-link:#007aff;--color-border:rgba(0, 0, 0, .1);--color-border-light:rgba(40, 40, 40, .08);--color-input-bg:rgba(255, 255, 255, .8);--color-bg-hover:rgba(0, 0, 0, .04);--color-success:#34c759;--color-success-bg:#e3f5e1;--color-error:#ff3b30;--color-warning:#ff9500;--color-info:#5ac8fa;--color-message-user:rgba(0, 122, 255, .1);--color-message-ai:rgba(255, 255, 255, .8);--color-code-bg:rgba(142, 142, 147, .12);--color-code-text:#ff375f;--glass-bg:rgba(255, 255, 255, .72);--glass-border:rgba(255, 255, 255, .18);--glass-shadow:0 8px 32px 0 rgba(31, 38, 135, .15);--glass-backdrop-blur:blur(20px);--color-modal-bg:#ffffff;--color-surface:#ffffff;--color-modal-border:rgba(0, 0, 0, .12);--color-modal-shadow:0 8px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .1);--color-shadow:rgba(0, 0, 0, .08);--color-overlay:rgba(0, 0, 0, .4);--color-surface-hover:var(--color-bg-hover);--color-surface-secondary:rgba(0, 0, 0, .03);--color-surface-muted:rgba(0, 0, 0, .05);--color-divider:rgba(0, 0, 0, .1)}*{box-sizing:border-box}html{color-scheme:light}html{--mat-sys-background:light-dark(#faf9fd, #121316);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f2f0f4, #2f3033);--mat-sys-inverse-primary:light-dark(#abc7ff, #005cbb);--mat-sys-inverse-surface:light-dark(#2f3033, #e3e2e6);--mat-sys-on-background:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#93000a, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #002f65);--mat-sys-on-primary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-primary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-primary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-on-secondary:light-dark(#ffffff, #283041);--mat-sys-on-secondary-container:light-dark(#3e4759, #dae2f9);--mat-sys-on-secondary-fixed:light-dark(#131c2b, #131c2b);--mat-sys-on-secondary-fixed-variant:light-dark(#3e4759, #3e4759);--mat-sys-on-surface:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-surface-variant:light-dark(#44474e, #e0e2ec);--mat-sys-on-tertiary:light-dark(#ffffff, #002f65);--mat-sys-on-tertiary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-tertiary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-tertiary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-outline:light-dark(#74777f, #8e9099);--mat-sys-outline-variant:light-dark(#c4c6d0, #44474e);--mat-sys-primary:light-dark(#005cbb, #abc7ff);--mat-sys-primary-container:light-dark(#d7e3ff, #00458f);--mat-sys-primary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-primary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#565e71, #bec6dc);--mat-sys-secondary-container:light-dark(#dae2f9, #3e4759);--mat-sys-secondary-fixed:light-dark(#dae2f9, #dae2f9);--mat-sys-secondary-fixed-dim:light-dark(#bec6dc, #bec6dc);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#faf9fd, #121316);--mat-sys-surface-bright:light-dark(#faf9fd, #38393c);--mat-sys-surface-container:light-dark(#efedf0, #1f2022);--mat-sys-surface-container-high:light-dark(#e9e7eb, #292a2c);--mat-sys-surface-container-highest:light-dark(#e3e2e6, #343537);--mat-sys-surface-container-low:light-dark(#f4f3f6, #1a1b1f);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0d0e11);--mat-sys-surface-dim:light-dark(#dbd9dd, #121316);--mat-sys-surface-tint:light-dark(#005cbb, #abc7ff);--mat-sys-surface-variant:light-dark(#e0e2ec, #44474e);--mat-sys-tertiary:light-dark(#005cbb, #abc7ff);--mat-sys-tertiary-container:light-dark(#d7e3ff, #00458f);--mat-sys-tertiary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-tertiary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-neutral-variant20:#2d3038;--mat-sys-neutral10:#1a1b1f;--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);--mat-sys-body-large:400 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-line-height:1.5rem;--mat-sys-body-large-size:1rem;--mat-sys-body-large-tracking:.031rem;--mat-sys-body-large-weight:400;--mat-sys-body-medium:400 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-line-height:1.25rem;--mat-sys-body-medium-size:.875rem;--mat-sys-body-medium-tracking:.016rem;--mat-sys-body-medium-weight:400;--mat-sys-body-small:400 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-line-height:1rem;--mat-sys-body-small-size:.75rem;--mat-sys-body-small-tracking:.025rem;--mat-sys-body-small-weight:400;--mat-sys-display-large:400 3.562rem / 4rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-line-height:4rem;--mat-sys-display-large-size:3.562rem;--mat-sys-display-large-tracking:-.016rem;--mat-sys-display-large-weight:400;--mat-sys-display-medium:400 2.812rem / 3.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-line-height:3.25rem;--mat-sys-display-medium-size:2.812rem;--mat-sys-display-medium-tracking:0;--mat-sys-display-medium-weight:400;--mat-sys-display-small:400 2.25rem / 2.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-line-height:2.75rem;--mat-sys-display-small-size:2.25rem;--mat-sys-display-small-tracking:0;--mat-sys-display-small-weight:400;--mat-sys-headline-large:400 2rem / 2.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-line-height:2.5rem;--mat-sys-headline-large-size:2rem;--mat-sys-headline-large-tracking:0;--mat-sys-headline-large-weight:400;--mat-sys-headline-medium:400 1.75rem / 2.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-line-height:2.25rem;--mat-sys-headline-medium-size:1.75rem;--mat-sys-headline-medium-tracking:0;--mat-sys-headline-medium-weight:400;--mat-sys-headline-small:400 1.5rem / 2rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-line-height:2rem;--mat-sys-headline-small-size:1.5rem;--mat-sys-headline-small-tracking:0;--mat-sys-headline-small-weight:400;--mat-sys-label-large:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-line-height:1.25rem;--mat-sys-label-large-size:.875rem;--mat-sys-label-large-tracking:.006rem;--mat-sys-label-large-weight:500;--mat-sys-label-large-weight-prominent:700;--mat-sys-label-medium:500 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-line-height:1rem;--mat-sys-label-medium-size:.75rem;--mat-sys-label-medium-tracking:.031rem;--mat-sys-label-medium-weight:500;--mat-sys-label-medium-weight-prominent:700;--mat-sys-label-small:500 .688rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-line-height:1rem;--mat-sys-label-small-size:.688rem;--mat-sys-label-small-tracking:.031rem;--mat-sys-label-small-weight:500;--mat-sys-title-large:400 1.375rem / 1.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-line-height:1.75rem;--mat-sys-title-large-size:1.375rem;--mat-sys-title-large-tracking:0;--mat-sys-title-large-weight:400;--mat-sys-title-medium:500 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-line-height:1.5rem;--mat-sys-title-medium-size:1rem;--mat-sys-title-medium-tracking:.009rem;--mat-sys-title-medium-weight:500;--mat-sys-title-small:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-line-height:1.25rem;--mat-sys-title-small-size:.875rem;--mat-sys-title-small-tracking:.006rem;--mat-sys-title-small-weight:500;--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px;--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12;--mat-snack-bar-container-shape:transparent;--mat-snack-bar-container-color:transparent;--mat-snack-bar-supporting-text-color:var(--color-text)}html,body{margin:0;padding:0;width:100%;height:100%}body{background:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Segoe UI,Helvetica Neue,Arial,sans-serif;transition:background .3s ease,color .3s ease;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:0!important}</style><link rel="stylesheet" href="styles-TDH2HBFP.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-TDH2HBFP.css"></noscript></head>
32
32
  <body>
33
33
  <app-root></app-root>
34
- <script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-SHENI7ZL.js" type="module"></script></body>
34
+ <script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-A5TVR2ZW.js" type="module"></script></body>
35
35
  </html>