@whoz-oss/coday-client 0.0.0-workstream-messaging.10 → 0.0.0-workstream-forge.277

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 (91) hide show
  1. package/browser/chunk-56OxYvTW.js +1 -0
  2. package/browser/chunk-BED4qwEN.js +1 -0
  3. package/browser/chunk-BLThxRwW.js +2 -0
  4. package/browser/chunk-BNJKMQ40.js +1 -0
  5. package/browser/chunk-BRG2mZxM.js +1 -0
  6. package/browser/chunk-BUteAT98.js +1 -0
  7. package/browser/chunk-BVxZcExv.js +1 -0
  8. package/browser/chunk-B_i7Gb4p.js +1 -0
  9. package/browser/chunk-BlVXMV5_.js +1 -0
  10. package/browser/chunk-ByQeZNnk.js +1 -0
  11. package/browser/chunk-C4IVnZbu.js +1 -0
  12. package/browser/{chunk-DoiOjutD.js → chunk-CB0PeoYM.js} +1 -1
  13. package/browser/chunk-CImBOm7_.js +1 -0
  14. package/browser/chunk-COGFVAu7.js +1 -0
  15. package/browser/chunk-CQza1bwI.js +1 -0
  16. package/browser/chunk-CR5KknLd.js +1 -0
  17. package/browser/chunk-CZ4W1lh-.js +1 -0
  18. package/browser/chunk-CZ4YI741.js +1 -0
  19. package/browser/{chunk-DPNOnAOU.js → chunk-CeDVuO_Z.js} +1 -1
  20. package/browser/chunk-ClakYmhV.js +1 -0
  21. package/browser/chunk-CtCeahwW.js +1 -0
  22. package/browser/{chunk-Cdql7t44.js → chunk-CwqgCML1.js} +1 -1
  23. package/browser/chunk-DAL6CPFu.js +1 -0
  24. package/browser/chunk-DDsv6wXk.js +1 -0
  25. package/browser/chunk-DHk5Re07.js +1 -0
  26. package/browser/{chunk-BFAp9jo2.js → chunk-DLxGcM5-.js} +1 -1
  27. package/browser/chunk-DOSprkJV.js +1 -0
  28. package/browser/{chunk-rKr5ufU2.js → chunk-DOx8GaaP.js} +1 -1
  29. package/browser/chunk-DTnDeD2s.js +1 -0
  30. package/browser/chunk-D_xqMlq6.js +1 -0
  31. package/browser/chunk-DkF8DhYk.js +1 -0
  32. package/browser/chunk-DklN7iCc.js +1 -0
  33. package/browser/chunk-Ds5GmwHL.js +1 -0
  34. package/browser/chunk-Dv92ICfv.js +1 -0
  35. package/browser/{chunk-R1TauUsQ.js → chunk-ISCbSjnU.js} +1 -1
  36. package/browser/chunk-Ke2U7XMU.js +670 -0
  37. package/browser/chunk-LYjM3kyc.js +1 -0
  38. package/browser/{chunk-BwyYPrKV.js → chunk-N8U2a1qx.js} +1 -1
  39. package/browser/chunk-bhbaK714.js +1 -0
  40. package/browser/chunk-hgAOKq8J.js +2 -0
  41. package/browser/{chunk-BuwHCrKf.js → chunk-k40UYrbW.js} +1 -1
  42. package/browser/chunk-lpJxVOWy.js +1 -0
  43. package/browser/chunk-mDzCbzth.js +1 -0
  44. package/browser/chunk-w-M5MTSs.js +1 -0
  45. package/browser/chunk-w6EbeVVz.js +1 -0
  46. package/browser/chunk-wyDpS97m.js +1 -0
  47. package/browser/index.html +1 -1
  48. package/browser/main-5FVEDMYL.js +1253 -0
  49. package/package.json +1 -1
  50. package/browser/chunk-0mZ3Y_ZJ.js +0 -1
  51. package/browser/chunk-1XF6Qsuy.js +0 -1
  52. package/browser/chunk-2KFuV5E5.js +0 -671
  53. package/browser/chunk-ATg3fmRI.js +0 -1
  54. package/browser/chunk-BL1cOmqY.js +0 -1
  55. package/browser/chunk-BMbtNfWQ.js +0 -1
  56. package/browser/chunk-BqHLVmOf.js +0 -1
  57. package/browser/chunk-C0i49sQV.js +0 -1
  58. package/browser/chunk-C4EP50-g.js +0 -1
  59. package/browser/chunk-C4OG4ewl.js +0 -1
  60. package/browser/chunk-C57t194y.js +0 -1
  61. package/browser/chunk-C7nsTLJX.js +0 -1
  62. package/browser/chunk-CCDRNHex.js +0 -1
  63. package/browser/chunk-CIeSnHU_.js +0 -1
  64. package/browser/chunk-CL0y_n4N.js +0 -1
  65. package/browser/chunk-CMZIhnyc.js +0 -1
  66. package/browser/chunk-CVlOQ_eN.js +0 -1
  67. package/browser/chunk-C_6VN9jF.js +0 -1
  68. package/browser/chunk-C_ual2NQ.js +0 -2
  69. package/browser/chunk-CqT7zdSp.js +0 -1
  70. package/browser/chunk-D2x7xu27.js +0 -1
  71. package/browser/chunk-D51v34BD.js +0 -1
  72. package/browser/chunk-D7Yaudd7.js +0 -1
  73. package/browser/chunk-D9gwrCSe.js +0 -1
  74. package/browser/chunk-DAoXL__Q.js +0 -2
  75. package/browser/chunk-DKPVmUTX.js +0 -1
  76. package/browser/chunk-D_jkAHyb.js +0 -1
  77. package/browser/chunk-DpA9bfvt.js +0 -1
  78. package/browser/chunk-DqrAPruo.js +0 -1
  79. package/browser/chunk-Dt3vfYW7.js +0 -1
  80. package/browser/chunk-DvR4terh.js +0 -1
  81. package/browser/chunk-SMenvxTt.js +0 -1
  82. package/browser/chunk-dszE6BqR.js +0 -1
  83. package/browser/chunk-hCtZ2RNp.js +0 -1
  84. package/browser/chunk-ijPuDimC.js +0 -1
  85. package/browser/chunk-nnH-h9C7.js +0 -1
  86. package/browser/chunk-peLkf2eQ.js +0 -1
  87. package/browser/chunk-tNsYxLDx.js +0 -1
  88. package/browser/chunk-wXEAK6xj.js +0 -1
  89. package/browser/chunk-wmoMXtn0.js +0 -1
  90. package/browser/chunk-x7GGjcqr.js +0 -1
  91. package/browser/main-EPHSXFSY.js +0 -1254
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-k40UYrbW.js';import {B as s,q as k,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import {g,W,t as F,K as we,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,ad as ne$1,U,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,as as Pg,Q as Qw,w as pf,x as hf,n as lg}from'./main-5FVEDMYL.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function ee(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading skills\u2026"),hl());}function te(n,e){n&1&&(Es(0,"p",5),AC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),hl());}function ne(n,e){n&1&&(Es(0,"p",4),AC(1,"No skills match the current filter."),hl());}function ie(n,e){if(n&1&&(Es(0,"span",14),AC(1),hl()),n&2){let t=tC().$implicit;VE(),Pg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Es(0,"ds-tag",20),AC(1,"Read-only"),hl());}function oe(n,e){n&1&&(Es(0,"ds-tag",21),AC(1,"SKILL.md"),hl());}function le(n,e){if(n&1){let t=Qw();Es(0,"button",25),vg("click",function(){pf(t);let d=tC(2).$implicit,c=tC(2);return hf(c.edit(d))}),AC(1,"Edit"),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=Qw();Es(0,"button",25),vg("click",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.inspect(d))}),AC(1," View "),hl(),Bw(2,le,2,1,"button",26);}if(n&2){let t=tC().$implicit,a=tC(2);lg("aria-label","View "+t.skill.name),VE(2),Vw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",27),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.requestDelete(d))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,a=tC(2);dg("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),AC(3),hl(),Bw(4,ie,2,2,"span",14),hl(),Es(5,"td",15),AC(6),hl(),Es(7,"td",16),AC(8),hl(),Es(9,"td",17)(10,"div",18)(11,"ds-tag",19),AC(12),hl(),Bw(13,ae,2,0,"ds-tag",20),Bw(14,oe,2,0,"ds-tag",21),hl()(),Es(15,"td",22)(16,"div",23),Bw(17,re,3,2),Bw(18,se,1,3,"agentos-row-delete-action",24),hl()()()),n&2){let t=e.$implicit,a=tC(2);VE(3),Fg(t.skill.name),VE(),Vw(t.namedByAgents>0?4:-1),VE(2),Dl(" ",t.skill.description||"\u2014"," "),VE(2),Fg(a.resourceCount(t.skill)),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?13:-1),VE(),Vw(t.skill.readOnly?14:-1),VE(3),Vw(a.deletion.confirmingId()!==t.key?17:-1),VE(),Vw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Resources"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ce,19,10,"tr",9,Y),hl()()()),n&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({platform:this.skillState.listPlatform().pipe(ha(()=>br([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),ha(()=>br([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),AC(3,"New skill"),hl()(),Bw(4,Z,2,1,"p",3),Bw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(VE(),dg("query",a.rowFilter.query()),VE(3),Vw(a.deletion.error()?4:-1),VE(),Vw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
@@ -0,0 +1 @@
1
+ import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import {g,t as F,K as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,U as U$2,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-5FVEDMYL.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function K(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading agent configs\u2026"),hl());}function H(n,e){n&1&&(Es(0,"p",5),AC(1,"No platform agent configs defined yet."),hl());}function U(n,e){n&1&&(Es(0,"p",4),AC(1,"No agent configs match the current filter."),hl());}function z(n,e){if(n&1){let t=Qw();Es(0,"button",19),vg("click",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.inspect(d))}),AC(1," Inspect "),hl(),Es(2,"button",19),vg("click",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.edit(d))}),AC(3,"Edit"),hl();}if(n&2){let t=tC().$implicit;lg("aria-label","Inspect "+t.name),VE(2),lg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",20),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,a=tC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15),AC(8),hl(),Es(9,"td",16)(10,"div",17),Bw(11,z,4,2),Bw(12,G,1,3,"agentos-row-delete-action",18),hl()()()),n&2){let t=e.$implicit,a=tC(2);VE(2),Fg(t.name),VE(2),Dl(" ",t.description||"\u2014"," "),VE(2),Fg(t.modelName||"\u2014"),VE(2),Fg(a.mode(t)),VE(3),Vw(a.deletion.confirmingId()!==t.id?11:-1),VE(),Vw(t.id?12:-1);}}function O(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Model"),hl(),Es(10,"th",10),AC(11,"Execution mode"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,J,13,6,"tr",9,B),hl()()()),n&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();configs=$i([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),AC(3,"New agent config"),hl()(),Bw(4,j,2,1,"p",3),Bw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(VE(),dg("query",a.rowFilter.query()),VE(3),Vw(a.deletion.error()?4:-1),VE(),Vw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -0,0 +1,2 @@
1
+ import {I}from'./chunk-DkF8DhYk.js';import {g,W,aX as L,K as we,$ as $i,o as oT,aY as Ue,ac as by,U,a2 as ha,aa as br,D as Dw,E as Es,f as fg,a as Bw,c as hl,R as vg,d as VE,i as Vw,P as dg,b as AC,Q as Qw,S as NI,q as $w,v as tC,T as AI,z as zw,u as Dl,as as Pg,w as pf,x as hf,F as Fg}from'./main-5FVEDMYL.js';import {a6 as gd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,c as fo,a8 as _a,ac as Bi,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-Ke2U7XMU.js';import'./chunk-ClakYmhV.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Es(0,"p",1),AC(1,"Loading\u2026"),hl());}function se(i,t){if(i&1&&(Es(0,"ds-notice"),AC(1),hl()),i&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function re(i,t){if(i&1){let e=Qw();Es(0,"div")(1,"button",23),vg("click",function(){pf(e);let s=tC(2);return hf(s.retryLoad())}),AC(2,"Retry loading"),hl()();}}function ce(i,t){if(i&1&&(fg(0,"br"),AC(1)),i&2){let e=tC(3);VE(),Dl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Es(0,"ds-notice",3),AC(1),Bw(2,ce,2,1),hl()),i&2){let e=tC(2);dg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),VE(),Dl(" Repository: ",e.checkoutStatus()," "),VE(),Vw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Es(0,"option",12),AC(1),hl()),i&2){let e=t.$implicit,c=tC(2);dg("value",e.id),VE(),Pg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Es(0,"p",13),AC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),hl());}function pe(i,t){if(i&1){let e=Qw();Es(0,"button",24),vg("click",function(){pf(e);let s=tC(2);return hf(s.remove())}),AC(1," Remove association "),hl();}if(i&2){let e=tC(2);dg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Qw();Bw(0,se,2,1,"ds-notice"),Bw(1,re,3,0,"div"),Bw(2,de,3,3,"ds-notice",3),Es(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.repositoryUrl.set(s))}),hl(),NI(),hl(),Es(6,"ds-form-field",7)(7,"input",8),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.mainBranch.set(s))}),hl(),NI(),hl(),Es(8,"ds-form-field",9)(9,"select",10),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.serviceAuthSettingId.set(s))}),Es(10,"option",11),AC(11,"Select an auth setting\u2026"),hl(),$w(12,le,2,3,"option",12,oe),hl(),NI(),Bw(14,me,2,0,"p",13),hl()(),Es(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.autoWorktree.set(s))}),hl(),NI(),AC(19," Offer a worktree to every new top-level case "),hl(),Es(20,"p",18),AC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),hl()(),Es(22,"ds-form-field",19)(23,"input",20),vg("ngModelChange",function(s){pf(e);let u=tC();return hf(u.setupCommand.set(s))}),hl(),NI(),Es(24,"p",13),AC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),hl()()(),Es(26,"ds-form-actions")(27,"button",21),vg("click",function(){pf(e);let s=tC();return hf(s.save())}),AC(28),hl(),Bw(29,pe,2,1,"button",22),hl();}if(i&2){let e=tC();Vw(e.errorMessage()?0:-1),VE(),Vw(e.associationLoaded()?-1:1),VE(),Vw(e.isAssociated()&&e.checkoutStatus()?2:-1),VE(),dg("disabled",!e.associationLoaded()||e.isSaving()),VE(2),dg("ngModel",e.repositoryUrl()),AI(),VE(2),dg("ngModel",e.mainBranch()),AI(),VE(2),dg("ngModel",e.serviceAuthSettingId()),AI(),VE(3),zw(e.eligibleAuthSettings()),VE(2),Vw(e.eligibleAuthSettings().length===0?14:-1),VE(),dg("disabled",!e.associationLoaded()||e.isSaving()),VE(3),dg("ngModel",e.autoWorktree()),AI(),VE(5),dg("ngModel",e.setupCommand()),AI(),VE(4),dg("disabled",!e.canSave()),VE(),Dl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),VE(),Vw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=$i(true);isSaving=$i(false);confirmingRemove=$i(false);associationLoaded=$i(false);errorMessage=$i(null);association=$i(null);authSettings=$i([]);repositoryUrl=$i("");mainBranch=$i("main");serviceAuthSettingId=$i("");autoWorktree=$i(false);setupCommand=$i("");namespaceId="";isAssociated=oT(()=>this.association()?.associated===true);eligibleAuthSettings=oT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=oT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=oT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),by({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),Bw(2,ae,2,0,"p",1)(3,ue,30,14),hl(),Es(4,"ds-confirm-dialog",2),vg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),hl()),e&2&&(VE(2),Vw(c.isLoading()?2:3),VE(2),dg("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
2
+ export{ne as NamespaceGitComponent};
@@ -0,0 +1 @@
1
+ import {ab as N,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un}from'./chunk-Ke2U7XMU.js';import {g,W,t as F,aV as D,ag as U,K as we,$ as $i,U as U$1,B,aW as gy,D as Dw,E as Es,R as vg,b as AC,c as hl,f as fg,a as Bw,d as VE,P as dg,i as Vw,u as Dl,v as tC,F as Fg}from'./main-5FVEDMYL.js';function P(l,t){if(l&1&&(Es(0,"ds-notice"),AC(1),hl()),l&2){let n=tC();VE(),Fg(n.launchError());}}var T=class l{route=g(W);router=g(F);caseController=g(D);caseState=g(N);agentConfigController=g(U);destroyRef=g(we);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=$i("");launchError=$i(null);isLaunching=$i(false);isLoading=$i(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.resolvedAgentConfig=t,t.loopConfig!=null&&this.payloadJson.set(JSON.stringify(t.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let t=this.resolvedAgentConfig??(yield gy(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield gy(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield gy(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(t){console.error("[AgentConfigLaunch] Failed to launch loop agent",t),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=Dw({type:l,selectors:[["agentos-agent-config-launch"]],decls:17,vars:6,consts:[["title","Launch loop agent"],["dsButton","","variant","ghost","type","button","title","Back to agent config",3,"click"],[1,"ds-hint"],["label","Loop configuration (read-only)","controlId","agent-loop-payload"],["dsControl","","mono","","id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",3,"value","disabled"],["dsButton","","variant","primary","type","button",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(n,e){n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return e.back()}),AC(3," \u2190 Edit agent config "),hl()(),Es(4,"p",2),AC(5," The loop configuration below is read from "),Es(6,"code"),AC(7,"AgentConfig.loopConfig"),hl(),AC(8," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),hl(),Es(9,"ds-form-field",3),fg(10,"textarea",4),hl(),Bw(11,P,2,1,"ds-notice"),Es(12,"ds-form-actions")(13,"button",5),vg("click",function(){return e.launch()}),AC(14),hl(),Es(15,"button",6),vg("click",function(){return e.back()}),AC(16,"Cancel"),hl()()()),n&2&&(VE(10),dg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),VE(),Vw(e.launchError()?11:-1),VE(2),dg("disabled",e.isLaunching()),VE(),Dl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),VE(),dg("disabled",e.isLaunching()));},dependencies:[vn,yn,fn,hn,_n,at,un],encapsulation:2})};export{T as AgentConfigLaunchComponent};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-k40UYrbW.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as On}from'./chunk-Ke2U7XMU.js';import {g,W,t as F,K as we,$ as $i,o as oT,U,ac as by,a2 as ha,aa as br,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,i as Vw,v as tC,P as dg,Q as Qw,f as fg,av as QC,F as Fg,u as Dl,aw as XC,q as $w,z as zw,ao as Uw,w as pf,x as hf,ax as YD}from'./main-5FVEDMYL.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Es(0,"a",2),AC(1,"Edit skill \u2192"),hl()),e&2){let n=tC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function te(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function ne(e,t){e&1&&(Es(0,"ds-notice"),AC(1,"Failed to load skill."),hl());}function ie(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Created by"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Last updated"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(Bw(0,ie,4,1),Bw(1,oe,4,1)),e&2){let n=tC();Vw(n.createdBy?0:-1),VE(),Vw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Es(0,"p",4),AC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),hl());}function se(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function re(e,t){e&1&&(Es(0,"ds-notice"),AC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),hl());}function de(e,t){e&1&&(Es(0,"p",4),AC(1,"No agent references this skill."),hl());}function ce(e,t){e&1&&(Es(0,"ds-tag",15),AC(1,"platform agent"),hl());}function me(e,t){e&1&&(Es(0,"ds-tag",15),AC(1,"via *"),hl());}function pe(e,t){if(e&1&&(Es(0,"li",13)(1,"span",14),AC(2),hl(),Bw(3,ce,2,0,"ds-tag",15),Bw(4,me,2,0,"ds-tag",15),hl()),e&2){let n=t.$implicit;VE(2),Fg(n.name),VE(),Vw(n.platform?3:-1),VE(),Vw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Es(0,"ul",12),$w(1,pe,5,3,"li",13,Y),hl(),Es(3,"p",4),AC(4," An agent listed "),Es(5,"code"),AC(6,"via *"),hl(),AC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),hl()),e&2){let n=tC(2);VE(),zw(n.consumers());}}function _e(e,t){e&1&&(Es(0,"p",4),AC(1,"No resources bundled with this skill."),hl());}function ge(e,t){if(e&1){let n=Qw();Es(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=pf(n).$implicit,g=tC(3);return hf(g.toggleResource(r))}),Es(2,"pre",17),AC(3),hl()()();}if(e&2){let n=t.$implicit,o=tC(3);VE(),dg("heading",n)("open",o.isResourceExpanded(n)),VE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Es(0,"ul",12),$w(1,ge,4,3,"li",null,Uw),hl()),e&2){let n=tC(2);VE(),zw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Qw();Es(0,"ds-card",5)(1,"dl",6)(2,"dt"),AC(3,"Name"),hl(),Es(4,"dd",7),AC(5),hl(),Es(6,"dt"),AC(7,"Description"),hl(),Es(8,"dd"),AC(9),hl(),Es(10,"dt"),AC(11,"Scope"),hl(),Es(12,"dd"),AC(13),hl(),Es(14,"dt"),AC(15,"Storage"),hl(),Es(16,"dd")(17,"ds-tag",8),AC(18),hl()(),Bw(19,ae,2,2),hl()(),Es(20,"ds-card",9),Bw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),hl(),Es(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){pf(n);let r=tC();return hf(r.toggleBody())}),fg(28,"div",11),QC(29,"agentosMarkdown"),hl()(),Es(30,"ds-card",9),Bw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),hl();}if(e&2){let n=t,o=tC();VE(5),Fg(n.name),VE(4),Fg(n.description),VE(4),Fg(n.namespaceId?"Namespace":"Platform"),VE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),VE(),Dl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),VE(),Vw(o.isFilesystemBacked()?-1:19),VE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),VE(),Vw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),VE(6),dg("open",!o.bodyCollapsed()),VE(),dg("innerHTML",XC(29,12,n.body),YD),VE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),VE(),Vw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);skill=$i(null);bodyCollapsed=$i(false);expandedResources=$i(new Set);resourcePaths=oT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=oT(()=>this.skill()?.readOnly===true);consumers=$i([]);consumersUnavailable=$i(false);consumersLoading=$i(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),AC(3,"\u2190 Skills"),hl(),Bw(4,Z,2,1,"a",2),Bw(5,ee,2,0,"ds-tag",3),hl(),Bw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),hl()),n&2){let r;VE(4),Vw(o.skill()&&!o.isFilesystemBacked()?4:-1),VE(),Vw(o.isPlatformMode?5:-1),VE(),Vw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,On],encapsulation:2})};export{X as SkillInspectComponent};
@@ -0,0 +1 @@
1
+ import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-Ke2U7XMU.js';import {g,K as we,W,I as J,$ as $i,U,D as Dw,E as Es,f as fg,R as vg,a as Bw,c as hl,S as NI,b as AC,d as VE,P as dg,i as Vw,T as AI,u as Dl,a4 as we$1,a5 as vd,a6 as x,v as tC,Q as Qw,F as Fg,a7 as Fn,w as pf,x as hf,q as $w,z as zw}from'./main-5FVEDMYL.js';var I=class e{api=g(we$1);isLoading=$i(false);result=$i(null);errorMessage=$i(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(vd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Fn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Es(0,"p",14),AC(1,"Loading namespaces\u2026"),hl());}function pe(e,t){if(e&1&&(Es(0,"option",17),AC(1),hl()),e&2){let n=t.$implicit;dg("value",n.id),VE(),Fg(n.name);}}function ce(e,t){if(e&1&&(Es(0,"select",15)(1,"option",16),AC(2,"Select a namespace"),hl(),$w(3,pe,2,2,"option",17,de),hl(),NI()),e&2){let n=tC(2);AI(),VE(3),zw(n.namespaces());}}function ue(e,t){if(e&1&&Bw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=tC();Vw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&fg(0,"input",3),e&2){let n=tC();dg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Qw();Es(0,"button",18),vg("click",function(){pf(n);let l=tC();return hf(l.reset())}),AC(1,"Clear result"),hl();}}function ve(e,t){e&1&&(Es(0,"ds-card",12)(1,"pre",19),AC(2),hl()()),e&2&&(VE(2),Fg(t));}function ye(e,t){e&1&&(Es(0,"span",21),AC(1,"Metadata"),hl(),Es(2,"pre",19),AC(3),hl()),e&2&&(VE(3),Fg(t));}function Ce(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Type"),hl(),Es(2,"dd",23),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.errorType);}}function _e(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Message"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.errorMessage);}}function be(e,t){if(e&1&&(Es(0,"span",21),AC(1,"Tool error details"),hl(),Es(2,"dl",22),Bw(3,Ce,4,1),Bw(4,_e,4,1),hl()),e&2){let n=tC();VE(3),Vw(n.errorType?3:-1),VE(),Vw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Es(0,"ds-card",13)(1,"div")(2,"ds-tag",20),AC(3),hl()(),Es(4,"span",21),AC(5,"Output"),hl(),Es(6,"pre",19),AC(7),hl(),Bw(8,ye,4,1),Es(9,"span",21),AC(10,"Structured output"),hl(),Es(11,"pre",19),AC(12),hl(),Bw(13,be,5,2),hl()),e&2){let n,o=t,l=tC();dg("heading","Result \u2014 "+o.toolName),VE(2),dg("variant",o.success?"accent":"outline"),VE(),Fg(o.success?"Success":"Tool error"),VE(4),Fg(o.output),VE(),Vw((n=l.formatMetadata(o.metadata))?8:-1,n),VE(4),Fg(l.formatStructuredOutput(o.structuredOutput)??"null"),VE(),Vw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=$i([]);namespacesLoading=$i(true);namespaceName=$i(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),Es(2,"form",1),vg("ngSubmit",function(){return o.submit()}),Es(3,"ds-form-field",2),Bw(4,ue,2,1)(5,fe,1,1,"input",3),hl(),Es(6,"ds-form-field",4),fg(7,"input",5),NI(),hl(),Es(8,"ds-form-field",6),fg(9,"input",7),NI(),hl(),Es(10,"ds-form-field",8),fg(11,"textarea",9),NI(),hl(),Es(12,"ds-form-actions")(13,"button",10),AC(14),hl(),Bw(15,ge,2,0,"button",11),hl()(),Bw(16,ve,3,1,"ds-card",12),Bw(17,he,14,7,"ds-card",13),hl()),n&2){let l,v;VE(),dg("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),VE(),dg("formGroup",o.form),VE(2),Vw(o.isPlatformMode?4:5),VE(3),AI(),VE(2),AI(),VE(2),AI(),VE(2),dg("disabled",o.form.invalid||o.state.isLoading()),VE(),Dl(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),VE(),Vw(o.state.result()||o.state.errorMessage()?15:-1),VE(),Vw((l=o.state.errorMessage())?16:-1,l),VE(),Vw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -0,0 +1 @@
1
+ import {q as k,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import {g,W as W$1,t as F,K as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U as U$2,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-5FVEDMYL.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function z(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading agent configs\u2026"),hl());}function G(n,e){n&1&&(Es(0,"p",5),AC(1,"No agent configs available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),AC(1,"No agent configs match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(2).$implicit,d=tC(2);return hf(d.launch(s))}),AC(1," Launch "),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(2).$implicit,d=tC(2);return hf(d.edit(s))}),AC(1," Edit "),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC().$implicit,d=tC(2);return hf(d.inspect(s))}),AC(1," Inspect "),hl(),Bw(2,X,2,1,"button",23),Bw(3,Y,2,1,"button",23);}if(n&2){let t=tC().$implicit,i=tC(2);lg("aria-label","Inspect "+t.config.name),VE(2),Vw(i.canLaunch(t)?2:-1),VE(),Vw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(t);let s=tC().$implicit,d=tC(2);return hf(d.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC().$implicit,d=tC(2);return hf(d.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,i=tC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),AC(10),hl(),Bw(11,W,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),Bw(14,Z,4,3),Bw(15,ee,1,3,"agentos-row-delete-action",21),hl()()()),n&2){let t=e.$implicit,i=tC(2);VE(2),Fg(t.config.name),VE(2),Dl(" ",t.config.description||"\u2014"," "),VE(2),Fg(i.mode(t)),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?11:-1),VE(3),Vw(i.deletion.confirmingId()!==t.key?14:-1),VE(),Vw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Execution mode"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,te,16,8,"tr",9,J),hl()()()),n&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(we);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(ha(()=>br([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,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"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}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||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,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"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(d){return i.rowFilter.query.set(d)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New agent config"),hl()(),Bw(4,U,2,1,"p",3),Bw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-CeDVuO_Z.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import {g,t as F,K as we,$ as $i,U as U$1,ai as ke,al as We,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,Q as Qw,w as pf,x as hf,n as lg}from'./main-5FVEDMYL.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let e=tC();VE(),Fg(e.deletion.error());}}function B(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading scheduled prompts\u2026"),hl());}function j(n,t){n&1&&(Es(0,"p",5),AC(1,"No platform scheduled prompts defined yet."),hl());}function W(n,t){n&1&&(Es(0,"p",4),AC(1,"No scheduled prompts match the current filter."),hl());}function H(n,t){if(n&1&&(Es(0,"span",14),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.description);}}function O(n,t){if(n&1){let e=Qw();Es(0,"button",21),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.toggle(s))}),AC(1),hl(),Es(2,"button",21),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.edit(s))}),AC(3,"Edit"),hl();}if(n&2){let e=tC().$implicit;VE(),Fg(e.enabled?"Disable":"Enable"),VE(),lg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=Qw();Es(0,"agentos-row-delete-action",22),vg("deleteRequested",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.deletion.request(s.id))})("deleteConfirmed",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.confirmDelete(s))})("deleteCancelled",function(){pf(e);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(n&2){let e=tC().$implicit,i=tC(2);dg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),AC(3),hl(),Bw(4,H,2,1,"span",14),hl(),Es(5,"td",15),AC(6),hl(),Es(7,"td",16)(8,"ds-tag",17),AC(9),hl()(),Es(10,"td",18)(11,"div",19),Bw(12,O,4,2),Bw(13,Y,1,3,"agentos-row-delete-action",20),hl()()()),n&2){let e=t.$implicit,i=tC(2);VE(3),Fg(e.name),VE(),Vw(e.description?4:-1),VE(2),Fg(i.scheduleLabel(e)),VE(2),dg("variant",e.enabled?"accent":"outline"),VE(),Fg(e.enabled?"Enabled":"Disabled"),VE(3),Vw(i.deletion.confirmingId()!==e.id?12:-1),VE(),Vw(e.id?13:-1);}}function G(n,t){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Schedule"),hl(),Es(8,"th",10),AC(9,"Status"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,z,14,7,"tr",9,M),hl()()()),n&2){let e=tC();VE(14),zw(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=$i([]);isLoading=$i(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===ke.WEEK?"week":"month",s=e.unit===ke.WEEK&&e.days?.length?` (${e.days.map(c=>We[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return i.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New scheduled prompt"),hl()(),Bw(4,U,2,1,"p",3),Bw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
@@ -0,0 +1 @@
1
+ import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-Ke2U7XMU.js';import {g,W,aN as Y,$ as $i,ab as le,O as Of,D as Dw,aO as Eb,E as Es,f as fg,a as Bw,c as hl,d as VE,i as Vw,ak as yd,a1 as ga,a3 as rn,ac as by,a2 as ha,b as AC,Q as Qw,R as vg,aP as Hg,S as NI,v as tC,aQ as Vg,T as AI,q as $w,z as zw,aR as GC,aS as zC,F as Fg,n as lg,av as QC,aw as XC,as as Pg,u as Dl,aT as JC,w as pf,x as hf,aU as LC}from'./main-5FVEDMYL.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Es(0,"p",2),AC(1,"Loading usage settings\u2026"),hl());}function fe(e,a){if(e&1){let t=Qw();Es(0,"ds-notice"),AC(1,"Could not load usage settings. Please try again."),hl(),Es(2,"div")(3,"button",3),vg("click",function(){pf(t);let s=tC();return hf(s.configuration.retry())}),AC(4,"Retry usage settings"),hl()();}}function ye(e,a){e&1&&(Es(0,"p",2),AC(1,"Usage tracking is disabled."),hl());}function be(e,a){e&1&&(Es(0,"ds-notice"),AC(1),hl()),e&2&&(VE(),Fg(a));}function xe(e,a){e&1&&(Es(0,"p",2),AC(1,"Loading usage\u2026"),hl());}function he(e,a){e&1&&(Es(0,"p",12),AC(1,"No recorded usage for this period."),hl());}function Se(e,a){if(e&1&&(Es(0,"p",10),AC(1),hl()),e&2){let t=tC().$implicit;VE(),Dl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Es(0,"tr",16)(1,"td",18),AC(2),hl(),Es(3,"td",19),AC(4),QC(5,"number"),hl(),Es(6,"td",20),AC(7),QC(8,"number"),QC(9,"number"),hl(),Es(10,"td",21),AC(11),QC(12,"number"),QC(13,"number"),hl(),Es(14,"td",22),AC(15),QC(16,"agentosCost"),Bw(17,Se,2,1,"p",10),hl()()),e&2){let t=a.$implicit;VE(2),Fg(t.key),VE(2),Fg(XC(5,8,t.aggregate.totalTokens)),VE(3),Pg(" ",XC(8,10,t.aggregate.inputTokens)," / ",XC(9,12,t.aggregate.outputTokens)," "),VE(4),Pg(" ",XC(12,14,t.aggregate.cacheReadTokens)," / ",XC(13,16,t.aggregate.cacheWriteTokens)," "),VE(4),Dl(" ",JC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),VE(2),Vw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Es(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),AC(5,"Name"),hl(),Es(6,"th",17),AC(7,"Tokens"),hl(),Es(8,"th",17),AC(9,"Input / output"),hl(),Es(10,"th",17),AC(11,"Cache read / write"),hl(),Es(12,"th",17),AC(13,"Estimated cost"),hl()()(),Es(14,"tbody",15),$w(15,we,18,21,"tr",16,_e),hl()()()),e&2){let t=tC().$implicit;VE(),lg("aria-label","Usage "+t.title.toLowerCase()),VE(14),zw(t.rows);}}function Ne(e,a){if(e&1&&(Es(0,"h3",11),AC(1),hl(),Bw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;VE(),Fg(t.title),VE(),Vw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&($w(0,Ne,4,2,null,null,ue),Es(2,"p",10),AC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),hl()),e&2){let t=tC(2);zw(GC(4,ge,zC(0,ce,t.agents()),zC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(t);let s=tC();return hf(s.load())}),Es(1,"ds-form-field",5)(2,"input",6),Hg("ngModelChange",function(s){pf(t);let m=tC();return LC(m.from,s)||(m.from=s),hf(s)}),hl(),NI(),hl(),Es(3,"ds-form-field",7)(4,"input",8),Hg("ngModelChange",function(s){pf(t);let m=tC();return LC(m.to,s)||(m.to=s),hf(s)}),hl(),NI(),hl(),Es(5,"button",9),AC(6,"Refresh"),hl()(),Bw(7,be,2,1,"ds-notice"),Bw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=tC();VE(2),Vg("ngModel",r.from),AI(),VE(2),Vg("ngModel",r.to),AI(),VE(3),Vw((t=r.error())?7:-1,t),VE(),Vw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Y);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=$i([]);models=$i([]);error=$i(null);loading=$i(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Of(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(yd(void 0),ga(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),rn):(this.loading.set(true),by({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ha(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),rn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),hl()),t&2&&(VE(2),Vw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Eb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
@@ -0,0 +1 @@
1
+ import {q as k$1,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import {g,W as W$1,t as F,K as we,aq as k,ap as F$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-5FVEDMYL.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function W(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading AI models\u2026"),hl());}function X(i,e){i&1&&(Es(0,"p",5),AC(1,"No AI models configured."),hl());}function Y(i,e){i&1&&(Es(0,"p",4),AC(1,"No AI models match the current filter."),hl());}function Z(i,e){i&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function ee(i,e){if(i&1){let t=Qw();Es(0,"button",24),vg("click",function(){pf(t);let s=tC(2).$implicit,m=tC(2);return hf(m.edit(s))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit,n=tC(2);lg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Qw();Bw(0,ee,2,1,"button",22),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,n=tC(2);Vw(n.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Es(0,"button",21),AC(1,"Inherited"),hl());}function ne(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),AC(10),hl(),Bw(11,Z,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),Bw(14,te,2,4)(15,ie,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,n=tC(2);VE(2),Fg(n.title(t)),VE(2),Fg(t.providerName),VE(2),Dl(" ",t.model.apiModelName," "),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?11:-1),VE(3),Vw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Provider"),hl(),Es(8,"th",10),AC(9,"API model name"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ne,16,7,"tr",9,G),hl()()()),i&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k$1();rows=$i([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ha(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(ga(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return by({namespace:br(e),platform:br(t),providers:br(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(ha(()=>br([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,n){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return n.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),AC(3,"New AI model"),hl()(),Bw(4,Q,2,1,"p",3),Bw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(VE(),dg("query",n.rowFilter.query()),VE(3),Vw(n.deletion.error()?4:-1),VE(),Vw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-CQza1bwI.js';import {O}from'./chunk-DAL6CPFu.js';import {g,W as W$1,t as F,K as we,I as J,$ as $i,U as U$1,ad as ne$1,a1 as ga,aa as br,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,P as dg,d as VE,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,n as lg,w as pf,x as hf}from'./main-5FVEDMYL.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import'./chunk-ClakYmhV.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function X(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading integrations\u2026"),hl());}function Z(n,e){n&1&&(Es(0,"p",5),AC(1,"No integrations available."),hl());}function ee(n,e){n&1&&(Es(0,"p",4),AC(1,"No integrations match the current filter."),hl());}function te(n,e){n&1&&(Es(0,"ds-tag",20),AC(1,"YAML"),hl(),Es(2,"ds-tag",21),AC(3,"Read-only"),hl());}function ne(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC().$implicit,c=tC(2);return hf(c.view(s))}),AC(1,"View"),hl();}if(n&2){let t=tC().$implicit;lg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(3).$implicit,c=tC(2);return hf(c.edit(s))}),AC(1," Edit "),hl();}if(n&2){let t=tC(3).$implicit;lg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let s=tC(2).$implicit,c=tC(2);return hf(c.duplicate(s))}),AC(1," Duplicate "),hl(),Bw(2,ie,2,1,"button",19);}if(n&2){let t=tC(2).$implicit;lg("aria-label","Duplicate "+t.config.name),VE(2),Vw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=Qw();Es(0,"agentos-row-delete-action",25),vg("deleteRequested",function(){pf(t);let s=tC(2).$implicit,c=tC(2);return hf(c.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC(2).$implicit,c=tC(2);return hf(c.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(4);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=tC(2).$implicit,a=tC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Es(0,"button",24),AC(1,"Inherited"),hl());}function le(n,e){if(n&1&&(Bw(0,oe,3,2),Bw(1,ae,1,3,"agentos-row-delete-action",23),Bw(2,re,2,0,"button",24)),n&2){let t=tC().$implicit,a=tC(2);Vw(a.deletion.confirmingId()!==t.key?0:-1),VE(),Vw(t.canDelete?1:-1),VE(),Vw(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),AC(8),hl(),Bw(9,te,4,0),hl()(),Es(10,"td",17)(11,"div",18),Bw(12,ne,2,1,"button",19)(13,le,3,3),hl()()()),n&2){let t=e.$implicit;VE(2),Fg(t.config.name),VE(2),Dl(" ",t.config.integrationType," "),VE(3),dg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),VE(),Dl(" ",t.scopeLabel," "),VE(),Vw(t.source==="FILESYSTEM"?9:-1),VE(3),Vw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Type"),hl(),Es(8,"th",10),AC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,se,14,6,"tr",9,Q),hl()()()),n&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceApi=g(J);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=$i("this namespace");isAdmin=$i(false);isLoading=$i(true);rows=$i([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=Dw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),AC(3,"New integration"),hl()(),Bw(4,W,2,1,"p",3),Bw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(dg("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),VE(),dg("query",a.rowFilter.query()),VE(3),Vw(a.deletion.error()?4:-1),VE(),Vw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-BuwHCrKf.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-2KFuV5E5.js';import {g,W,F,v as we,M as Mi,x as U,E as x,C as w,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,L as Lw,R as Rw,H as Hh,N as lI,T as Tw,aq as Cw,Q as fI,_ as _w,Y as Yu,P as Pd,n as Ld,l as lg}from'./main-EPHSXFSY.js';function ie(i,t){if(i&1&&(os(0,"a",2),pC(1,"View skill \u2192"),zu()),i&2){let e=Lw();Vh("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(os(0,"ds-tag",3),pC(1,"Platform level"),zu());}function ne(i,t){i&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function re(i,t){if(i&1){let e=Rw();os(0,"div",15)(1,"div",19),Hh(2,"input",20),lI(),os(3,"button",21),qh("click",function(){let l=Pd(e).$implicit,te=Lw(2);return Ld(te.removeResource(l))}),pC(4," \xD7 "),zu()(),Hh(5,"textarea",22),lI(),zu();}if(i&2){let e=t.$implicit;IE(2),Vh("formControl",e.path),fI(),IE(3),Vh("formControl",e.content),fI();}}function ae(i,t){if(i&1&&(os(0,"ds-notice"),pC(1),zu()),i&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function se(i,t){if(i&1){let e=Rw();os(0,"form",6),qh("ngSubmit",function(){Pd(e);let l=Lw();return Ld(l.submit())}),os(1,"ds-form-field",7),Hh(2,"input",8),lI(),zu(),os(3,"ds-form-field",9),Hh(4,"textarea",10),lI(),zu(),os(5,"ds-form-field",11),Hh(6,"textarea",12),lI(),zu(),os(7,"ds-form-field",13)(8,"div",14),Tw(9,re,6,2,"div",15,Cw),os(11,"div")(12,"button",16),qh("click",function(){Pd(e);let l=Lw();return Ld(l.addResource())}),pC(13,"+ Add resource"),zu()()()(),Iw(14,ae,2,1,"ds-notice"),os(15,"ds-form-actions")(16,"button",17),pC(17),zu(),os(18,"button",18),qh("click",function(){Pd(e);let l=Lw();return Ld(l.cancel())}),pC(19,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.bodyControl),fI(),IE(3),_w(e.resourceRows()),IE(5),ww(e.errorMessage()?14:-1),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Mi(false);isLoading=Mi(false);isSubmitting=Mi(false);errorMessage=Mi(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=Mi([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return o.cancel()}),pC(3,"\u2190 Skills"),zu(),Iw(4,ie,2,1,"a",2),Iw(5,oe,2,0,"ds-tag",3),zu(),Iw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),zu()),e&2&&(IE(),Vh("title",o.isEditMode()?"Edit skill":"New skill"),IE(3),ww(o.isEditMode()?4:-1),IE(),ww(o.isPlatformMode?5:-1),IE(),ww(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
1
+ import {o}from'./chunk-k40UYrbW.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-Ke2U7XMU.js';import {g,W,t as F,K as we,$ as $i,U,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,q as $w,am as Hw,T as AI,z as zw,u as Dl,w as pf,x as hf,F as Fg}from'./main-5FVEDMYL.js';function ie(i,t){if(i&1&&(Es(0,"a",2),AC(1,"View skill \u2192"),hl()),i&2){let e=tC();dg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function ne(i,t){i&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function re(i,t){if(i&1){let e=Qw();Es(0,"div",15)(1,"div",19),fg(2,"input",20),NI(),Es(3,"button",21),vg("click",function(){let l=pf(e).$implicit,te=tC(2);return hf(te.removeResource(l))}),AC(4," \xD7 "),hl()(),fg(5,"textarea",22),NI(),hl();}if(i&2){let e=t.$implicit;VE(2),dg("formControl",e.path),AI(),VE(3),dg("formControl",e.content),AI();}}function ae(i,t){if(i&1&&(Es(0,"ds-notice"),AC(1),hl()),i&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function se(i,t){if(i&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let l=tC();return hf(l.submit())}),Es(1,"ds-form-field",7),fg(2,"input",8),NI(),hl(),Es(3,"ds-form-field",9),fg(4,"textarea",10),NI(),hl(),Es(5,"ds-form-field",11),fg(6,"textarea",12),NI(),hl(),Es(7,"ds-form-field",13)(8,"div",14),$w(9,re,6,2,"div",15,Hw),Es(11,"div")(12,"button",16),vg("click",function(){pf(e);let l=tC();return hf(l.addResource())}),AC(13,"+ Add resource"),hl()()()(),Bw(14,ae,2,1,"ds-notice"),Es(15,"ds-form-actions")(16,"button",17),AC(17),hl(),Es(18,"button",18),vg("click",function(){pf(e);let l=tC();return hf(l.cancel())}),AC(19,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),VE(),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.bodyControl),AI(),VE(3),zw(e.resourceRows()),VE(5),Vw(e.errorMessage()?14:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=$i(false);isLoading=$i(false);isSubmitting=$i(false);errorMessage=$i(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=$i([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.cancel()}),AC(3,"\u2190 Skills"),hl(),Bw(4,ie,2,1,"a",2),Bw(5,oe,2,0,"ds-tag",3),hl(),Bw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),hl()),e&2&&(VE(),dg("title",o.isEditMode()?"Edit skill":"New skill"),VE(3),Vw(o.isEditMode()?4:-1),VE(),Vw(o.isPlatformMode?5:-1),VE(),Vw(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
@@ -0,0 +1 @@
1
+ import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-Ke2U7XMU.js';import {g,W,t as F,K as we,aq as k,ap as F$1,a9 as F$2,a2 as ha,aa as br,ar as Ne,o as oT,$ as $i,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,f as fg,S as NI,q as $w,ao as Uw,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,as as Pg,w as pf,x as hf}from'./main-5FVEDMYL.js';function he(r,t){r&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ve(r,t){if(r&1&&fg(0,"input",6),r&2){let e=tC(2);dg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Es(0,"option",44),AC(1),hl()),r&2){let e=t.$implicit;dg("value",e.id),VE(),Pg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Es(0,"select",7)(1,"option",43),AC(2,"Select provider"),hl(),$w(3,ye,2,3,"option",44,Lw().trackByProvider,true),hl(),NI()),r&2){let e=tC(2);dg("formControl",e.aiProviderIdControl),AI(),VE(3),zw(e.providers());}}function xe(r,t){if(r&1&&(Es(0,"option",25),AC(1),hl()),r&2){let e=t.$implicit;dg("ngValue",e),VE(),Fg(e.toLowerCase());}}function _e(r,t){r&1&&(Es(0,"p",2),AC(1,"Not supported yet for Anthropic and Gemini providers."),hl());}function Me(r,t){r&1&&(Es(0,"p",2),AC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),hl());}function Ee(r,t){r&1&&(Es(0,"p",26),AC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),hl());}function Ae(r,t){if(r&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let u=tC();return hf(u.submit())}),Es(1,"ds-form-field",5),Bw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),hl(),Es(4,"ds-form-field",8),fg(5,"input",9),NI(),hl(),Es(6,"ds-form-field",10),fg(7,"input",11),NI(),hl(),Es(8,"ds-form-field",12),fg(9,"input",13),NI(),hl(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"div",16)(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19),fg(16,"input",20),NI(),hl()(),Es(17,"ds-form-field",21),fg(18,"input",22),NI(),hl(),Es(19,"ds-form-field",23)(20,"select",24)(21,"option",25),AC(22,"Provider default"),hl(),$w(23,xe,2,2,"option",25,Uw),hl(),NI(),Bw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Bw(27,Ee,2,0,"p",26),hl(),Es(28,"div",27)(29,"label",28),fg(30,"input",29),NI(),Es(31,"span",30),AC(32,"Supports advanced execution"),hl()(),Es(33,"p",31),AC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),hl()(),Es(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),fg(38,"input",34),NI(),hl(),Es(39,"ds-form-field",35),fg(40,"input",36),NI(),hl()(),Es(41,"div",16)(42,"ds-form-field",37),fg(43,"input",38),NI(),hl(),Es(44,"ds-form-field",39),fg(45,"input",40),NI(),hl()()(),Es(46,"ds-form-actions")(47,"button",41),AC(48),hl(),Es(49,"button",42),vg("click",function(){pf(e);let u=tC();return hf(u.cancel())}),AC(50,"Cancel"),hl()()();}if(r&2){let e=tC();dg("formGroup",e.form),VE(2),Vw(e.isEditMode()?2:3),VE(3),dg("formControl",e.apiModelNameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.aliasControl),AI(),VE(2),dg("formControl",e.priorityControl),AI(),VE(3),dg("formControl",e.temperatureControl),AI(),VE(2),dg("formControl",e.contextWindowControl),AI(),VE(2),dg("formControl",e.maxCompletionTokensControl),AI(),VE(2),dg("formControl",e.reasoningEffortControl),AI(),VE(),dg("ngValue",null),VE(2),zw(e.reasoningEffortOptions),VE(2),Vw(e.reasoningEffortUnsupported()?25:26),VE(2),Vw(e.temperatureMayConflictWithEffort()?27:-1),VE(3),dg("formControl",e.supportsAdvancedExecutionControl),AI(),VE(5),dg("formGroup",e.pricingGroup),VE(3),AI(),VE(2),AI(),VE(3),AI(),VE(2),AI(),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ha(()=>br([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=oT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=oT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);selectedProviderLabel=oT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Of(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Dw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return c.cancel()}),AC(3," \u2190 AI models "),hl()(),Bw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),hl()),e&2&&(VE(),dg("title",c.isEditMode()?"Edit AI model":"New AI model"),VE(3),Vw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
@@ -0,0 +1 @@
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-k40UYrbW.js';import {O}from'./chunk-DAL6CPFu.js';import {g,W,t as F$1,K as we,ag as U,ay as N,$ as $i,az as Q,a8 as _,o as oT,a9 as F$2,aA as Me,U as U$1,a2 as ha,aa as br,ac as by,ad as ne,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,T as AI,n as lg,u as Dl,q as $w,z as zw,F as Fg,w as pf,x as hf,as as Pg}from'./main-5FVEDMYL.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-Ke2U7XMU.js';import'./chunk-ClakYmhV.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Es(0,"a",2),AC(1,"View resolved definition \u2192"),hl()),n&2){let e=tC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function Qe(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),NI()),n&2){let e=tC(2);dg("formControl",e.modelNameControl),AI();}}function et(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t;dg("ngValue",e.value),VE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Es(0,"optgroup",42),$w(1,tt,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Es(0,"optgroup",43),$w(1,it,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Es(0,"select",18)(1,"option",40),AC(2,"Select a model"),hl(),Bw(3,et,2,2,"option",41),Bw(4,nt,3,0,"optgroup",42),Bw(5,ot,3,0,"optgroup",43),hl(),NI()),n&2){let e,i=tC(2);dg("formControl",i.modelNameControl),AI(),VE(),dg("ngValue",null),VE(2),Vw((e=i.modelOptions().current)?3:-1,e),VE(),Vw(i.modelOptions().aliases.length>0?4:-1),VE(),Vw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),NI()),n&2){let e=tC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),AI();}}function st(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleIntegration(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,lt,2,1,"span",44),hl(),Bw(6,rt,1,2,"input",45),hl();}if(n&2){let e=t.$implicit;VE(2),dg("checked",e.enabled()),VE(2),Fg(e.config.name),VE(),Vw(e.config.integrationType?5:-1),VE(),Vw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Dl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",24),AC(2),Es(3,"span",44),AC(4,"built-in"),hl()(),Es(5,"select",47),vg("change",function(s){let c=pf(e).$implicit,C=tC(4);return hf(C.setBuiltInState(c,s.target.value))}),Es(6,"option",48),AC(7),hl(),Es(8,"option",49),AC(9,"Enabled"),hl(),Es(10,"option",50),AC(11,"Disabled"),hl()(),Bw(12,dt,2,1,"p",13),Es(13,"p",13),AC(14),hl()();}if(n&2){let e=t.$implicit,i=tC(4);VE(),lg("for","built-in-"+e.type),VE(),Dl(" ",e.displayName," "),VE(3),dg("id","built-in-"+e.type)("value",e.state()),VE(2),Fg(i.builtInDefaultLabel(e)),VE(5),Vw(e.state()==="on"&&e.restrictedTools?12:-1),VE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Es(0,"span",46),AC(1,"Built-in integrations"),hl(),$w(2,ct,15,7,"div",10,qe)),n&2){let e=tC(3);VE(2),zw(e.builtInRows());}}function ut(n,t){n&1&&(Es(0,"ds-notice",26),AC(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. "),hl());}function gt(n,t){if(n&1&&(Es(0,"ds-fieldset",21),$w(1,st,7,4,"div",10,Ye),Bw(3,mt,4,0),Bw(4,ut,2,0,"ds-notice",26),hl()),n&2){let e=tC(2);VE(),zw(e.integrationRows()),VE(2),Vw(e.builtInRows().length>0?3:-1),VE(),Vw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&AC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),hl());}function Ct(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function _t(n,t){n&1&&(Es(0,"p",4),AC(1,"No skill available in this scope yet."),hl());}function bt(n,t){n&1&&(Es(0,"span",44),AC(1,"platform"),hl());}function ht(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSkill(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,bt,2,0,"span",44),Bw(6,ht,2,1,"span",44),hl(),Bw(7,yt,2,1,"p",13),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),VE(2),Fg(e.name),VE(),Vw(e.platform?5:-1),VE(),Vw(e.unresolved?6:-1),VE(),Vw(e.description?7:-1);}}function xt(n,t){if(n&1&&$w(0,vt,8,6,"div",10,We),n&2){let e=tC(2);zw(e.skillRows());}}function St(n,t){if(n&1&&(Es(0,"ds-form-field",30),fg(1,"textarea",52),NI(),Es(2,"p",4),AC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Es(4,"code"),AC(5,"AgentLoopPayload"),hl(),AC(6,". Leave empty if you always provide the payload at launch. "),hl()()),n&2){let e=tC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),VE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),AI();}}function At(n,t){n&1&&AC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&AC(0),n&2){let e=tC(3);Pg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),Bw(5,wt,1,2),hl()),n&2){let e=tC(2);VE(5),Vw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function kt(n,t){n&1&&(Es(0,"p",4),AC(1,"No other agent is available in this scope yet."),hl());}function It(n,t){n&1&&(Es(0,"span",44),AC(1,"pattern"),hl());}function Rt(n,t){n&1&&(Es(0,"span",44),AC(1,"via pattern"),hl());}function Mt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Qw();Es(0,"button",55),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(3);return hf(c.removeSubAgent(s))}),AC(1," \xD7 "),hl();}if(n&2){let e=tC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Qw();Es(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSubAgent(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),hl(),Bw(8,Ft,2,1,"button",54),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),VE(2),Fg(e.name),VE(),Vw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),VE(3),Vw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&$w(0,Nt,9,5,"div",32,We),n&2){let e=tC(2);zw(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Qw();Es(0,"div")(1,"button",56),vg("click",function(){pf(e);let s=tC(2);return hf(s.useDefaultDelegationTimeout())}),AC(2," Use server default "),hl()();}}function Vt(n,t){n&1&&(Es(0,"ds-notice"),AC(1),hl()),n&2&&(VE(),Fg(t));}function Pt(n,t){if(n&1){let e=Qw();Es(0,"button",57),vg("click",function(){pf(e);let s=tC(2);return hf(s.exportYaml())}),AC(1),hl();}if(n&2){let e=tC(2);dg("disabled",e.isExporting()),VE(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let s=tC();return hf(s.submit())}),Es(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),NI(),hl(),Es(4,"div",10)(5,"label",11),fg(6,"input",12),NI(),AC(7," Enabled "),hl(),Es(8,"p",13),AC(9,"Disabled agents are excluded from namespace resolution."),hl()(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"ds-form-field",16),Bw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),hl(),Es(15,"ds-form-field",19),fg(16,"textarea",20),NI(),hl()(),Bw(17,gt,5,2,"ds-fieldset",21),Es(18,"ds-fieldset",22)(19,"p",4),AC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Es(21,"code"),AC(22,"readSkill"),hl(),AC(23," and "),Es(24,"code"),AC(25,"readSkillResource"),hl(),AC(26," tools; selecting none grants neither. "),Bw(27,pt,1,0),hl(),Es(28,"label",11)(29,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSkills())}),hl(),Es(30,"span",24),AC(31,"Every skill in the catalogue ("),Es(32,"code",25),AC(33,"*"),hl(),AC(34,")"),hl()(),Es(35,"p",13),AC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),hl(),Bw(37,ft,5,0,"ds-notice",26),Bw(38,Ct,2,0,"ds-notice"),Bw(39,_t,2,0,"p",4)(40,xt,2,0),hl(),Es(41,"ds-form-field",27)(42,"select",28)(43,"option",29),AC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),hl(),Es(45,"option",29),AC(46,"ADVANCED \u2014 Multi-step reasoning loop"),hl(),Es(47,"option",29),AC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),hl()(),NI(),hl(),Bw(49,St,7,3,"ds-form-field",30),Es(50,"ds-fieldset",31)(51,"p",4),AC(52," The agents this one may delegate to. Selecting at least one grants it the "),Es(53,"code"),AC(54,"DELEGATE__delegate"),hl(),AC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Bw(56,At,1,0),hl(),Es(57,"label",11)(58,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSubAgents())}),hl(),Es(59,"span",24),AC(60,"Every agent it can reach ("),Es(61,"code",25),AC(62,"*"),hl(),AC(63,")"),hl()(),Es(64,"p",13),AC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),hl(),Bw(66,Et,6,1,"ds-notice",26),Bw(67,Tt,2,0,"ds-notice"),Bw(68,kt,2,0,"p",4)(69,Dt,2,0),Es(70,"p",4),AC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Es(72,"code"),AC(73,"*Fixer"),hl(),AC(74," to cover BugFixer and StoryFixer. "),hl(),Es(75,"div",32)(76,"input",33),vg("keydown.enter",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),hl(),NI(),Es(77,"button",34),vg("click",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),AC(78," + "),hl()(),Es(79,"ds-form-field",35),fg(80,"input",36),NI(),Bw(81,Lt,3,0,"div"),hl()(),Bw(82,Vt,2,1,"ds-notice"),Es(83,"ds-form-actions")(84,"button",37),AC(85),hl(),Bw(86,Pt,2,2,"button",38),Es(87,"button",39),vg("click",function(){pf(e);let s=tC();return hf(s.cancel())}),AC(88,"Cancel"),hl()()();}if(n&2){let e,i=tC();dg("formGroup",i.form),VE(3),dg("formControl",i.nameControl),AI(),VE(3),dg("formControl",i.enabledControl),AI(),VE(5),dg("formControl",i.descriptionControl),AI(),VE(2),Vw(i.modelAsFreeText()?13:14),VE(3),dg("formControl",i.instructionsControl),AI(),VE(),Vw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),VE(10),Vw(i.isPlatformMode?27:-1),VE(2),dg("checked",i.allSkillsSelected()),VE(8),Vw(i.namedSkillSelectionDropped()?37:-1),VE(),Vw(i.skillCatalogueUnavailable()?38:-1),VE(),Vw(i.skillRows().length===0?39:40),VE(3),dg("formControl",i.executionModeControl),AI(),VE(),dg("value",i.ExecutionMode.SIMPLE),VE(2),dg("value",i.ExecutionMode.ADVANCED),VE(2),dg("value",i.ExecutionMode.LOOP),VE(2),Vw(i.isLoopMode()?49:-1),VE(7),Vw(i.isPlatformMode?56:-1),VE(2),dg("checked",i.allSubAgentsSelected()),VE(8),Vw(i.namedSubAgentSelectionDropped()?66:-1),VE(),Vw(i.subAgentCandidatesUnavailable()?67:-1),VE(),Vw(i.subAgentRows().length===0?68:69),VE(8),dg("formControl",i.newSubAgentControl),AI(),VE(),dg("disabled",!i.newSubAgentControl.value.trim()),VE(2),dg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),VE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),AI(),VE(),Vw(i.delegationTimeoutControl.value!==null?81:-1),VE(),Vw((e=i.submitError())?82:-1,e),VE(2),dg("disabled",i.form.invalid||i.isSubmitting()),VE(),Dl(" ",i.isEditMode()?"Save changes":"Create"," "),VE(),Vw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=$i(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){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();}delegationTimeoutHint=oT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `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${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=oT(()=>this.executionModeValue()==="LOOP");subAgentRows=$i([]);allSubAgentsSelected=$i(false);subAgentCandidatesUnavailable=$i(false);namedSubAgentSelectionDropped=oT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=oT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=oT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);isExporting=$i(false);submitError=$i(null);ExecutionMode=Me;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=$i([]);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=oT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=$i({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=$i(false);modelAsFreeText=oT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=$i([]);skillRows=$i([]);allSkillsSelected=$i(false);skillCatalogueUnavailable=$i(false);namedSkillSelectionDropped=oT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ha(()=>br(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),by({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),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 N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,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){by({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,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(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ha(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),br([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:$i(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:$i(true)}));}return E}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(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):br([]);return by({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ha(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),br([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:$i(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:$i(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ha(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:$i(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:$i(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(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:$i(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=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:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"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 i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),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||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'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.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return i.cancel()}),AC(3," \u2190 Agent configs "),hl(),Bw(4,ze,2,1,"a",2),Bw(5,Xe,2,0,"ds-tag",3),hl(),Bw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),hl()),e&2&&(VE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),VE(3),Vw(i.isEditMode()?4:-1),VE(),Vw(i.isPlatformMode?5:-1),VE(),Vw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
@@ -0,0 +1 @@
1
+ import {y}from'./chunk-Ke2U7XMU.js';import {g,aB as ie,aC as T,aa as br,a1 as ga,ad as ne,a2 as ha,aD as $y,a6 as x}from'./main-5FVEDMYL.js';var v=class i{userState=g(y);membership=g(ie);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return br(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(ga(a=>a?a.isAdmin?br(true):this.membership.getMembersNamespaceMembership(e).pipe(ne(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),ha(()=>br(false))):br(false)),$y({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-CeDVuO_Z.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-Ke2U7XMU.js';import {g,W,t as F,K as we$1,ag as U,ah as Fe$1,ai as ke$1,$ as $i,aj as De$1,a9 as F$1,ak as yd,o as oT,ac as by,U as U$1,a2 as ha,aa as br,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,u as Dl,i as Vw,Q as Qw,f as fg,S as NI,q as $w,v as tC,T as AI,z as zw,F as Fg,w as pf,x as hf,y as sh}from'./main-5FVEDMYL.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function _e(n,t){if(n&1&&(Es(0,"ds-form-field",9),fg(1,"input",38),hl()),n&2){let e=tC(2);VE(),dg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Es(0,"a",39),AC(1,"Add an agent config"),hl(),AC(2," first. ")),n&2){let e=tC(3);dg("href","/agentos/"+e.namespaceId+"/agent-configs/new",sh);}}function xe(n,t){if(n&1&&(Es(0,"ds-form-field",10)(1,"p",2),AC(2," No agent configs available in this scope yet. "),Bw(3,Se,3,1),hl()()),n&2){let e=tC(2);VE(3),Vw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Es(0,"option",17),AC(1),hl()),n&2){let e=t.$implicit;dg("value",e.id),VE(),Fg(e.name);}}function De(n,t){if(n&1&&(Es(0,"ds-form-field",11)(1,"select",40)(2,"option",41),AC(3,"Select an agent config\u2026"),hl(),$w(4,Ee,2,2,"option",17,ve),hl(),NI(),hl()),n&2){let e=tC(2);dg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),VE(),dg("formControl",e.agentConfigIdControl),AI(),VE(3),zw(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Es(0,"option",17),AC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function Ne(n,t){if(n&1){let e=Qw();Es(0,"label",31)(1,"input",43),vg("change",function(){let f=pf(e).$implicit,h=tC(3);return hf(h.toggleDay(f.value))}),hl(),AC(2),hl();}if(n&2){let e=t.$implicit,l=tC(3);VE(),dg("checked",l.isDaySelected(e.value)),VE(),Dl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Es(0,"ds-form-field",18)(1,"div",42),$w(2,Ne,3,2,"label",31,V),hl()()),n&2){let e=tC(2);VE(2),zw(e.dayOptions);}}function Me(n,t){if(n&1&&(Es(0,"option",17),AC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function Pe(n,t){if(n&1&&(Es(0,"ds-form-field",28),fg(1,"input",44),NI(),hl()),n&2){let e=tC(2);dg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),VE(),dg("formControl",e.endDateControl),AI();}}function we(n,t){if(n&1&&(Es(0,"ds-form-field",29),fg(1,"input",45),NI(),hl()),n&2){let e=tC(2);dg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),VE(),dg("formControl",e.occurrenceCountControl),AI();}}function Fe(n,t){if(n&1&&(Es(0,"ds-notice"),AC(1),hl()),n&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let f=tC();return hf(f.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),NI(),hl(),Es(3,"ds-form-field",7),fg(4,"input",8),NI(),hl(),Bw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Es(8,"ds-form-field",12),fg(9,"textarea",13),NI(),hl(),Es(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),$w(13,Te,2,2,"option",17,V),hl(),NI(),hl(),Bw(15,Ie,4,0,"ds-form-field",18),Es(16,"ds-form-field",19)(17,"div",20),fg(18,"input",21),NI(),Es(19,"span",22),AC(20,"UTC"),hl()()()(),Es(21,"ds-fieldset",23)(22,"ds-form-field",24),fg(23,"input",25),NI(),hl(),Es(24,"ds-form-field",26)(25,"select",27),$w(26,Me,2,2,"option",17,V),hl(),NI(),hl(),Bw(28,Pe,2,2,"ds-form-field",28),Bw(29,we,2,2,"ds-form-field",29),hl(),Es(30,"div",30)(31,"label",31),fg(32,"input",32),NI(),AC(33," Enabled "),hl(),Es(34,"p",33),AC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),hl()(),Es(36,"ds-form-field",34),fg(37,"textarea",35),NI(),hl(),Bw(38,Fe,2,1,"ds-notice"),Es(39,"ds-form-actions")(40,"button",36),AC(41),hl(),Es(42,"button",37),vg("click",function(){pf(e);let f=tC();return hf(f.cancel())}),AC(43,"Cancel"),hl()()();}if(n&2){let e=tC();dg("formGroup",e.form),VE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),VE(),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(),Vw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),VE(3),dg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),VE(),dg("formControl",e.promptContentControl),AI(),VE(3),dg("formControl",e.unitControl),AI(),VE(),zw(e.schedulerUnits),VE(2),Vw(e.showDayFilter()?15:-1),VE(),dg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),VE(2),dg("formControl",e.timeUtcControl),AI(),VE(4),dg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),VE(),dg("formControl",e.startDateControl),AI(),VE(2),dg("formControl",e.endTypeControl),AI(),VE(),zw(e.endTypes),VE(2),Vw(e.showEndDate()?28:-1),VE(),Vw(e.showOccurrenceCount()?29:-1),VE(3),dg("formControl",e.enabledControl),AI(),VE(4),dg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),VE(),dg("formControl",e.externalMetadataJsonControl),AI(),VE(),Vw(e.errorMessage()?38:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(ke$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(Fe$1.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,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=$i(false);isSubmitting=$i(false);isLoading=$i(false);errorMessage=$i(null);SchedulerUnit=ke$1;SchedulerEndType=Fe$1;schedulerUnits=[{value:ke$1.WEEK,label:"Week(s)"},{value:ke$1.MONTH,label:"Month(s)"}];endTypes=[{value:Fe$1.NEVER,label:"Never"},{value:Fe$1.ON_DATE,label:"On date"},{value:Fe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(De$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(yd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(yd(this.endTypeControl.value)));showDayFilter=oT(()=>this.unitSignal()===ke$1.WEEK);showEndDate=oT(()=>this.endTypeSignal()===Fe$1.ON_DATE);showOccurrenceCount=oT(()=>this.endTypeSignal()===Fe$1.OCCURRENCES);agentConfigs=$i([]);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),by({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ha(()=>br([])))}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,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}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,l=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===Fe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Fe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.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=Dw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return l.cancel()}),AC(3),hl()(),Bw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),hl()),e&2&&(VE(),dg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),VE(2),Dl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),VE(),Vw(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Fe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Fe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(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"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
@@ -0,0 +1 @@
1
+ import {i}from'./chunk-ClakYmhV.js';import {y}from'./chunk-Ke2U7XMU.js';import {g as g$1,ap as F,Z as Tr,at as Cy,a1 as ga,a2 as ha,aa as br,ad as ne,aD as $y,a5 as vd,L as w,a6 as x}from'./main-5FVEDMYL.js';var g="none",N="me",O=class p{nsController=g$1(F);userState=g$1(y);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Cy([this.namespaceId$,this.refresh$]).pipe(ga(([e])=>{let r=this.loadPlatformProviders().pipe(ha(()=>br([])));return e?Cy([r,this.loadNamespaceProviders(e).pipe(ha(()=>br([]))),this.loadUserProviders(e).pipe(ha(()=>br([]))),this.loadUserProviders("global").pipe(ha(()=>br([])))]).pipe(ne(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):Cy([r,this.loadNamespaceProviders("").pipe(ha(()=>br([]))),this.loadUserProviders("global").pipe(ha(()=>br([])))]).pipe(ne(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),$y({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):br([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(vd(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(vd(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(vd(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(vd(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
@@ -0,0 +1 @@
1
+ import {I as I$1}from'./chunk-DkF8DhYk.js';import {g,t as F,K as we,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,n as lg,w as pf,x as hf}from'./main-5FVEDMYL.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import'./chunk-ClakYmhV.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Es(0,"p",3),AC(1),hl()),e&2){let n=tC();VE(),Fg(n.deletion.error());}}function K(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading auth settings\u2026"),hl());}function H(e,t){e&1&&(Es(0,"p",5),AC(1,"No platform auth settings defined yet."),hl());}function U(e,t){e&1&&(Es(0,"p",4),AC(1,"No auth settings match the current filter."),hl());}function z(e,t){if(e&1){let n=Qw();Es(0,"button",18),vg("click",function(){pf(n);let d=tC().$implicit,m=tC(2);return hf(m.onEdit(d))}),AC(1," Edit "),hl();}if(e&2){let n=tC().$implicit;lg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Qw();Es(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){pf(n);let d=tC().$implicit,m=tC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(n);let d=tC().$implicit,m=tC(2);return hf(m.onDelete(d))})("deleteCancelled",function(){pf(n);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(e&2){let n=tC().$implicit,a=tC(2);dg("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15),Bw(7,z,2,1,"button",16),Bw(8,G,1,3,"agentos-row-delete-action",17),hl()()()),e&2){let n=t.$implicit,a=tC(2);VE(2),Fg(n.name),VE(2),Dl(" ",n.authType," "),VE(3),Vw(a.deletion.confirmingId()!==n.id?7:-1),VE(),Vw(n.id?8:-1);}}function O(e,t){if(e&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Authentication type"),hl(),Es(8,"th",10)(9,"span",11),AC(10,"Actions"),hl()()()(),Es(11,"tbody",8),$w(12,J,9,4,"tr",9,B),hl()()()),e&2){let n=tC();VE(12),zw(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();settings=$i([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return a.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),AC(3,"New auth setting"),hl()(),Bw(4,j,2,1,"p",3),Bw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(VE(),dg("query",a.rowFilter.query()),VE(3),Vw(a.deletion.error()?4:-1),VE(),Vw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -1 +1 @@
1
- import {g,aQ as he,aa as k}from'./main-EPHSXFSY.js';var c=class r{api=g(he);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,aJ as fe,a6 as x}from'./main-5FVEDMYL.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
@@ -0,0 +1 @@
1
+ import {a1 as ga,a2 as ha,aa as br,aD as $y}from'./main-5FVEDMYL.js';function i(t,o,p){return t.pipe(ga(()=>o().pipe(ha(()=>br(p)))),$y({bufferSize:1,refCount:true}))}export{i};
@@ -0,0 +1 @@
1
+ import {O as O$1}from'./chunk-DAL6CPFu.js';import {g,t as F,K as we,af as G$1,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,Q as Qw,n as lg,w as pf,x as hf}from'./main-5FVEDMYL.js';import {q as k,O as O$2,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Ke2U7XMU.js';import'./chunk-ClakYmhV.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Es(0,"p",3),AC(1),hl()),t&2){let n=tC();VE(),Fg(n.deletion.error());}}function K(t,e){t&1&&(Es(0,"p",4),AC(1,"Loading integrations\u2026"),hl());}function H(t,e){t&1&&(Es(0,"p",5),AC(1,"No platform integrations defined yet."),hl());}function U(t,e){t&1&&(Es(0,"p",4),AC(1,"No integrations match the current filter."),hl());}function z(t,e){if(t&1){let n=Qw();Es(0,"button",18),vg("click",function(){pf(n);let d=tC().$implicit,m=tC(2);return hf(m.edit(d))}),AC(1,"Edit"),hl();}if(t&2){let n=tC().$implicit;lg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Qw();Es(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){pf(n);let d=tC().$implicit,m=tC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(n);let d=tC().$implicit,m=tC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(n);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(t&2){let n=tC().$implicit,r=tC(2);dg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15),Bw(7,z,2,1,"button",16),Bw(8,G,1,3,"agentos-row-delete-action",17),hl()()()),t&2){let n=e.$implicit,r=tC(2);VE(2),Fg(n.name),VE(2),Fg(n.integrationType),VE(3),Vw(r.deletion.confirmingId()!==n.id?7:-1),VE(),Vw(n.id?8:-1);}}function O(t,e){if(t&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Type"),hl(),Es(8,"th",10)(9,"span",11),AC(10,"Actions"),hl()()()(),Es(11,"tbody",8),$w(12,J,9,4,"tr",9,j),hl()()()),t&2){let n=tC();VE(12),zw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);state=g(O$1);integrationConfigController=g(G$1);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();configs=$i([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Dw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return r.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return r.openCreateForm()}),AC(3,"New integration"),hl()(),Bw(4,A,2,1,"p",3),Bw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(VE(),dg("query",r.rowFilter.query()),VE(3),Vw(r.deletion.error()?4:-1),VE(),Vw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};