@whoz-oss/coday-client 0.0.0-workstream-forge.231 → 0.0.0-workstream-forge.233

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 (85) hide show
  1. package/browser/chunk-BEtE9u4S.js +1 -0
  2. package/browser/chunk-BHFL0zBW.js +1 -0
  3. package/browser/{chunk-CbFj_KVb.js → chunk-BL4O5z35.js} +1 -1
  4. package/browser/chunk-BRhYc841.js +2 -0
  5. package/browser/chunk-BSCoGKQH.js +1 -0
  6. package/browser/chunk-BSwOttIr.js +1 -0
  7. package/browser/chunk-BTyI5T9m.js +1 -0
  8. package/browser/chunk-BUAyDXTF.js +1 -0
  9. package/browser/{chunk-DXfFvlbW.js → chunk-BeFHuscX.js} +1 -1
  10. package/browser/chunk-BhiMaXTc.js +1 -0
  11. package/browser/chunk-BmWGkbfS.js +1 -0
  12. package/browser/chunk-BvB8BwW-.js +1 -0
  13. package/browser/chunk-BxyJxLnM.js +1 -0
  14. package/browser/chunk-By1CBVie.js +1 -0
  15. package/browser/chunk-ByIZOfZp.js +1 -0
  16. package/browser/chunk-CGIofH1S.js +1 -0
  17. package/browser/{chunk-DsLxDKjQ.js → chunk-CW0Xz9Gc.js} +1 -1
  18. package/browser/chunk-CXeXS2-8.js +1 -0
  19. package/browser/chunk-CkYlNhz9.js +1 -0
  20. package/browser/chunk-Cs_kiN3M.js +1 -0
  21. package/browser/chunk-D-GH6Vwh.js +1 -0
  22. package/browser/{chunk-DSPqMM_J.js → chunk-D25q4NMm.js} +1 -1
  23. package/browser/chunk-D4MihuHS.js +1 -0
  24. package/browser/chunk-D4Ru-LHQ.js +1 -0
  25. package/browser/chunk-D73N8VqQ.js +1 -0
  26. package/browser/chunk-D98SYWQ_.js +1 -0
  27. package/browser/{chunk-DuTuhgB1.js → chunk-DAJa9g45.js} +1 -1
  28. package/browser/chunk-DDqlkc9R.js +1 -0
  29. package/browser/chunk-DFBrAyo5.js +1 -0
  30. package/browser/chunk-DKNVANEr.js +1 -0
  31. package/browser/{chunk-D7Bi0wQe.js → chunk-DLa-RTUD.js} +1 -1
  32. package/browser/chunk-DPJF32r4.js +1 -0
  33. package/browser/{chunk-BTVosZlm.js → chunk-DPZEV56F.js} +1 -1
  34. package/browser/chunk-DQpYayn2.js +2 -0
  35. package/browser/chunk-DU2T72t1.js +674 -0
  36. package/browser/chunk-Df9nff1i.js +1 -0
  37. package/browser/{chunk-BdcXD8r2.js → chunk-DgP8Uad-.js} +1 -1
  38. package/browser/{chunk-Bx0NEc6t.js → chunk-Dje4hFK9.js} +1 -1
  39. package/browser/chunk-DofPUUm1.js +1 -0
  40. package/browser/chunk-DrUGsskB.js +1 -0
  41. package/browser/chunk-DrtsXIGf.js +1 -0
  42. package/browser/chunk-SfXGcx_u.js +2 -0
  43. package/browser/chunk-ZSYVOgwG.js +1 -0
  44. package/browser/chunk-k4Z-nQ9G.js +1 -0
  45. package/browser/{chunk-C3aDeufh.js → chunk-oglfMLBg.js} +1 -1
  46. package/browser/chunk-vbsIYZk_.js +1 -0
  47. package/browser/index.html +1 -1
  48. package/browser/{main-KD2BFLOW.js → main-WGM2SCAZ.js} +17 -17
  49. package/package.json +1 -1
  50. package/browser/chunk-8QzmmZxx.js +0 -1
  51. package/browser/chunk-B8lQiYrl.js +0 -1
  52. package/browser/chunk-BGFq838P.js +0 -1
  53. package/browser/chunk-BN-jkVWq.js +0 -1
  54. package/browser/chunk-BT9ydLH6.js +0 -2
  55. package/browser/chunk-BbtGMMKD.js +0 -1
  56. package/browser/chunk-Bk7l5aey.js +0 -1
  57. package/browser/chunk-BvO6WgcN.js +0 -2
  58. package/browser/chunk-BzzohX58.js +0 -1
  59. package/browser/chunk-C-w4ff8o.js +0 -1
  60. package/browser/chunk-C5dMauIn.js +0 -1
  61. package/browser/chunk-C9lZl1M2.js +0 -1
  62. package/browser/chunk-CGAwBErw.js +0 -1
  63. package/browser/chunk-CSjIaAEl.js +0 -1
  64. package/browser/chunk-CUJ0vffn.js +0 -1
  65. package/browser/chunk-Cba4he8B.js +0 -1
  66. package/browser/chunk-CirZuytZ.js +0 -1
  67. package/browser/chunk-CwQOg_Cf.js +0 -1
  68. package/browser/chunk-CyO4h_4p.js +0 -1
  69. package/browser/chunk-DDSOLg4o.js +0 -1
  70. package/browser/chunk-DQGrYB02.js +0 -2
  71. package/browser/chunk-D_dXBade.js +0 -1
  72. package/browser/chunk-Df8Mmk0a.js +0 -1
  73. package/browser/chunk-Dj8n77fK.js +0 -1
  74. package/browser/chunk-DkzlrId2.js +0 -1
  75. package/browser/chunk-DlvXf54E.js +0 -674
  76. package/browser/chunk-DwBZ8Z_r.js +0 -1
  77. package/browser/chunk-E46_f3PR.js +0 -1
  78. package/browser/chunk-FXeGxG1k.js +0 -1
  79. package/browser/chunk-Py6Xwfdb.js +0 -1
  80. package/browser/chunk-Rpwj_4-b.js +0 -1
  81. package/browser/chunk-_1v9c4EP.js +0 -1
  82. package/browser/chunk-jPo9er7c.js +0 -1
  83. package/browser/chunk-lAoLPd_T.js +0 -1
  84. package/browser/chunk-qPqD_h5H.js +0 -1
  85. package/browser/chunk-tOJzhNQY.js +0 -1
@@ -0,0 +1 @@
1
+ import {z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-DU2T72t1.js';import {g,q as F,I as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,K as U$2,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-WGM2SCAZ.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let t=eC();BE(),Fg(t.deletion.error());}}function K(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading agent configs\u2026"),hl());}function H(n,e){n&1&&(Es(0,"p",5),xC(1,"No platform agent configs defined yet."),hl());}function U(n,e){n&1&&(Es(0,"p",4),xC(1,"No agent configs match the current filter."),hl());}function z(n,e){if(n&1){let t=Yw();Es(0,"button",19),vg("click",function(){pf(t);let d=eC().$implicit,c=eC(2);return hf(c.inspect(d))}),xC(1," Inspect "),hl(),Es(2,"button",19),vg("click",function(){pf(t);let d=eC().$implicit,c=eC(2);return hf(c.edit(d))}),xC(3,"Edit"),hl();}if(n&2){let t=eC().$implicit;lg("aria-label","Inspect "+t.name),BE(2),lg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Yw();Es(0,"agentos-row-delete-action",20),vg("deleteRequested",function(){pf(t);let d=eC().$implicit,c=eC(2);return hf(c.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=eC().$implicit,c=eC(2);return hf(c.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=eC(3);return hf(d.deletion.cancel())}),hl();}if(n&2){let t=eC().$implicit,a=eC(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),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14),xC(6),hl(),Es(7,"td",15),xC(8),hl(),Es(9,"td",16)(10,"div",17),jw(11,z,4,2),jw(12,G,1,3,"agentos-row-delete-action",18),hl()()()),n&2){let t=e.$implicit,a=eC(2);BE(2),Fg(t.name),BE(2),Dl(" ",t.description||"\u2014"," "),BE(2),Fg(t.modelName||"\u2014"),BE(2),Fg(a.mode(t)),BE(3),Bw(a.deletion.confirmingId()!==t.id?11:-1),BE(),Bw(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),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10),xC(9,"Model"),hl(),Es(10,"th",10),xC(11,"Execution mode"),hl(),Es(12,"th",10)(13,"span",11),xC(14,"Actions"),hl()()()(),Es(15,"tbody",8),Uw(16,J,13,6,"tr",9,B),hl()()()),n&2){let t=eC();BE(16),$w(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=vw({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()}),xC(3,"New agent config"),hl()(),jw(4,j,2,1,"p",3),jw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(BE(),dg("query",a.rowFilter.query()),BE(3),Bw(a.deletion.error()?4:-1),BE(),Bw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import {z as k$1,O,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-DU2T72t1.js';import {g,q as F,I as we,ap as F$1,Z as Tr,$ as $i,a1 as ga,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,Y as Yw,l as lg,u as pf,w as hf}from'./main-WGM2SCAZ.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Es(0,"p",3),xC(1),hl()),i&2){let t=eC();BE(),Fg(t.deletion.error());}}function U(i,e){i&1&&(Es(0,"p",4),xC(1,"Loading AI providers\u2026"),hl());}function j(i,e){i&1&&(Es(0,"p",5),xC(1,"No platform AI providers defined yet."),hl());}function K(i,e){i&1&&(Es(0,"p",4),xC(1,"No AI providers match the current filter."),hl());}function H(i,e){if(i&1){let t=Yw();Es(0,"button",19),vg("click",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.edit(s))}),xC(1," Edit "),hl();}if(i&2){let t=eC().$implicit;lg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=Yw();Es(0,"agentos-row-delete-action",20),vg("deleteRequested",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.deletion.request(s.id))})("deleteConfirmed",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=eC().$implicit,r=eC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14),xC(6),hl(),Es(7,"td",15)(8,"div",16),jw(9,H,2,1,"button",17),jw(10,z,1,3,"agentos-row-delete-action",18),hl()()()),i&2){let t=e.$implicit,r=eC(2);BE(2),Fg(t.name),BE(2),Fg(t.apiType),BE(2),Fg(t.baseUrl||"\u2014"),BE(3),Bw(r.deletion.confirmingId()!==t.id?9:-1),BE(),Bw(t.id?10:-1);}}function J(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"API type"),hl(),Es(8,"th",10),xC(9,"Base URL"),hl(),Es(10,"th",10)(11,"span",11),xC(12,"Actions"),hl()()()(),Es(13,"tbody",8),Uw(14,G,11,5,"tr",9,B),hl()()()),i&2){let t=eC();BE(14),$w(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(we);aiProviderController=g(F$1);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k$1();providers=$i([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(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()}),xC(3,"New AI provider"),hl()(),jw(4,M,2,1,"p",3),jw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(BE(),dg("query",r.rowFilter.query()),BE(3),Bw(r.deletion.error()?4:-1),BE(),Bw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
@@ -1 +1 @@
1
- import {g,aK as fe,a6 as x}from'./main-KD2BFLOW.js';var o=class r{skillController=g(fe);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
1
+ import {g,aK as fe,a6 as x}from'./main-WGM2SCAZ.js';var o=class r{skillController=g(fe);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
@@ -0,0 +1,2 @@
1
+ import {v}from'./chunk-Df9nff1i.js';import {I,n as nt,i as it}from'./chunk-DLa-RTUD.js';import {g,W,q as F,I as we,$ as $i,a9 as F$1,r as rT,O as Of,K as U,N as x,L as w,v as vw,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,c as Bw,Y as Yw,U as Uw,ao as Hw,R as MI,f as fg,t as eC,S as xI,k as $w,s as Dl,ae as Pw,F as Fg,l as lg,u as pf,w as hf}from'./main-WGM2SCAZ.js';import {T as Te,a as fn,p as pt,d as pn,h as hn,e as cn,r as ln,g as dn,i as at,j as an,t as rn,U as Ut,n as nd,b as bo,x as xo,L as Lt,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An}from'./chunk-DU2T72t1.js';import'./chunk-BSwOttIr.js';function Ce(i,t){i&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function ye(i,t){if(i&1&&(Es(0,"label",16),fg(1,"input",17),MI(),xC(2),hl()),i&2){let e=t.$implicit,n=eC(3);BE(),dg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),xI(),BE(),Dl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Es(0,"ds-fieldset",5),Uw(1,ye,3,4,"label",16,Pw().trackByScope,true),hl()),i&2){let e=eC(2);dg("disabled",e.isEditMode()),BE(),$w(e.scopeOptions);}}function fe(i,t){if(i&1&&(Es(0,"option",8),xC(1),hl()),i&2){let e=t.$implicit,n=eC(2);dg("value",e),BE(),Fg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Es(0,"ds-form-field",18),fg(1,"input",19),MI(),hl()),i&2){let e=eC().$implicit;dg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),BE(),dg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),lg("aria-describedby",e.hint?"as-hint-"+e.key:null),xI();}}function Ae(i,t){if(i&1&&jw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=eC(3);Bw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Es(0,"ds-fieldset",13),Uw(1,Ae,1,1,null,null,Pw().trackByField,true),hl()),i&2){let e=eC(2);dg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),BE(),$w(e.credentialFields());}}function be(i,t){if(i&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let o=eC();return hf(o.submit())}),jw(1,ge,3,1,"ds-fieldset",5),Es(2,"ds-form-field",6)(3,"select",7),Uw(4,fe,2,2,"option",8,Hw),hl(),MI(),hl(),Es(6,"ds-form-field",9),fg(7,"input",10),MI(),hl(),Es(8,"ds-form-field",11),fg(9,"input",12),MI(),hl(),jw(10,ve,3,1,"ds-fieldset",13),Es(11,"ds-form-actions")(12,"button",14),xC(13),hl(),Es(14,"button",15),vg("click",function(){pf(e);let o=eC();return hf(o.cancel())}),xC(15,"Cancel"),hl()()();}if(i&2){let e=eC();dg("formGroup",e.form),BE(),Bw(e.isPlatformMode?-1:1),BE(2),dg("formControl",e.authTypeControl),xI(),BE(),$w(e.authTypeOptions),BE(3),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(),Bw(e.credentialFields().length>0?10:-1),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?$i(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=nt;authTypeLabel=it;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[fn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=rT(()=>_e[this.selectedAuthType()]);isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Of(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return n.cancel()}),xC(3," \u2190 Auth settings "),hl()(),jw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),hl()),e&2&&(BE(),dg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),BE(3),Bw(n.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,rn,Ut,nd,bo,xo,Lt,Gt,pa,mo,po,Vn,An],encapsulation:2})};
2
+ export{me as AuthSettingFormComponent};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-BeFHuscX.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DU2T72t1.js';import {g,W,q as F,I as we,$ as $i,ac as by,a2 as ha,aa as br,K as U,N as x,L as w,ai as Ne,al as De,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,Y as Yw,u as pf,w as hf,l as lg}from'./main-WGM2SCAZ.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let e=eC();BE(),Fg(e.deletion.error());}}function Y(n,t){n&1&&(Es(0,"p",4),xC(1,"Loading scheduled prompts\u2026"),hl());}function z(n,t){n&1&&(Es(0,"p",5),xC(1,"No scheduled prompts available."),hl());}function G(n,t){n&1&&(Es(0,"p",4),xC(1,"No scheduled prompts match the current filter."),hl());}function Q(n,t){if(n&1&&(Es(0,"span",14),xC(1),hl()),n&2){let e=eC().$implicit;BE(),Fg(e.prompt.description);}}function X(n,t){n&1&&(Es(0,"ds-tag",20),xC(1,"Read-only"),hl());}function Z(n,t){if(n&1){let e=Yw();Es(0,"button",25),vg("click",function(){pf(e);let l=eC(2).$implicit,p=eC(2);return hf(p.toggle(l))}),xC(1),hl(),Es(2,"button",25),vg("click",function(){pf(e);let l=eC(2).$implicit,p=eC(2);return hf(p.edit(l))}),xC(3," Edit "),hl();}if(n&2){let e=eC(2).$implicit;BE(),Fg(e.prompt.enabled?"Disable":"Enable"),BE(),lg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=Yw();jw(0,Z,4,2),Es(1,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(e);let l=eC().$implicit,p=eC(2);return hf(p.deletion.request(l.key))})("deleteConfirmed",function(){pf(e);let l=eC().$implicit,p=eC(2);return hf(p.confirmDelete(l))})("deleteCancelled",function(){pf(e);let l=eC(3);return hf(l.deletion.cancel())}),hl();}if(n&2){let e=eC().$implicit,i=eC(2);Bw(i.deletion.confirmingId()!==e.key?0:-1),BE(),dg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Es(0,"button",23),xC(1,"Inherited"),hl());}function ne(n,t){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),xC(3),hl(),jw(4,Q,2,1,"span",14),hl(),Es(5,"td",15),xC(6),hl(),Es(7,"td",16)(8,"ds-tag",17),xC(9),hl()(),Es(10,"td",18)(11,"div",19)(12,"ds-tag",17),xC(13),hl(),jw(14,X,2,0,"ds-tag",20),hl()(),Es(15,"td",21)(16,"div",22),jw(17,ee,2,4)(18,te,2,0,"button",23),hl()()()),n&2){let e=t.$implicit,i=eC(2);BE(3),Fg(e.prompt.name),BE(),Bw(e.prompt.description?4:-1),BE(2),Fg(i.scheduleLabel(e.prompt)),BE(2),dg("variant",e.prompt.enabled?"accent":"outline"),BE(),Fg(e.prompt.enabled?"Enabled":"Disabled"),BE(3),dg("variant",e.scope==="platform"?"neutral":"accent"),BE(),Fg(e.scope==="platform"?"Platform":"Namespace"),BE(),Bw(e.scope==="platform"?14:-1),BE(3),Bw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Schedule"),hl(),Es(8,"th",10),xC(9,"Status"),hl(),Es(10,"th",10),xC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),xC(14,"Actions"),hl()()()(),Es(15,"tbody",8),Uw(16,ne,19,9,"tr",9,J),hl()()()),n&2){let e=eC();BE(16),$w(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=$i([]);isLoading=$i(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){by({platform:this.state.listPlatform().pipe(ha(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===Ne.WEEK?"week":"month",l=e.unit===Ne.WEEK&&e.days?.length?` (${e.days.map(p=>De[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=vw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(p){return i.rowFilter.query.set(p)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),xC(3,"New scheduled prompt"),hl()(),jw(4,O,2,1,"p",3),jw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(BE(),dg("query",i.rowFilter.query()),BE(3),Bw(i.deletion.error()?4:-1),BE(),Bw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
@@ -0,0 +1 @@
1
+ import {a1 as ga,a2 as ha,aa as br,aD as $y}from'./main-WGM2SCAZ.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 {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DU2T72t1.js';import {g,W as W$1,q as F,I as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,K as U$2,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-WGM2SCAZ.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let t=eC();BE(),Fg(t.deletion.error());}}function z(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading agent configs\u2026"),hl());}function G(n,e){n&1&&(Es(0,"p",5),xC(1,"No agent configs available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),xC(1,"No agent configs match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",18),xC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(2).$implicit,d=eC(2);return hf(d.launch(s))}),xC(1," Launch "),hl();}if(n&2){let t=eC(2).$implicit;lg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(2).$implicit,d=eC(2);return hf(d.edit(s))}),xC(1," Edit "),hl();}if(n&2){let t=eC(2).$implicit;lg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC().$implicit,d=eC(2);return hf(d.inspect(s))}),xC(1," Inspect "),hl(),jw(2,X,2,1,"button",23),jw(3,Y,2,1,"button",23);}if(n&2){let t=eC().$implicit,i=eC(2);lg("aria-label","Inspect "+t.config.name),BE(2),Bw(i.canLaunch(t)?2:-1),BE(),Bw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Yw();Es(0,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(t);let s=eC().$implicit,d=eC(2);return hf(d.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=eC().$implicit,d=eC(2);return hf(d.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(3);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=eC().$implicit,i=eC(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),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14),xC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),xC(10),hl(),jw(11,W,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),jw(14,Z,4,3),jw(15,ee,1,3,"agentos-row-delete-action",21),hl()()()),n&2){let t=e.$implicit,i=eC(2);BE(2),Fg(t.config.name),BE(2),Dl(" ",t.config.description||"\u2014"," "),BE(2),Fg(i.mode(t)),BE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),BE(),Fg(t.scope==="platform"?"Platform":"Namespace"),BE(),Bw(t.scope==="platform"?11:-1),BE(3),Bw(i.deletion.confirmingId()!==t.key?14:-1),BE(),Bw(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),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10),xC(9,"Execution mode"),hl(),Es(10,"th",10),xC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),xC(14,"Actions"),hl()()()(),Es(15,"tbody",8),Uw(16,te,16,8,"tr",9,J),hl()()()),n&2){let t=eC();BE(16),$w(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=vw({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()}),xC(3,"New agent config"),hl()(),jw(4,U,2,1,"p",3),jw(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&&(BE(),dg("query",i.rowFilter.query()),BE(3),Bw(i.deletion.error()?4:-1),BE(),Bw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import {D as m,p as pt,E as Bt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,V as Vn,A as An,v as va,F as go,_ as _o,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an}from'./chunk-DU2T72t1.js';import {g,W,q as F,I as we,ag as U,$ as $i,K as U$1,a2 as ha,aa as br,N as x,L as w,v as vw,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,s as Dl,c as Bw,Y as Yw,f as fg,R as MI,U as Uw,am as Vw,t as eC,S as xI,F as Fg,k as $w,l as lg,u as pf,w as hf}from'./main-WGM2SCAZ.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function fe(o,t){if(o&1&&(Es(0,"ds-form-field",20),fg(1,"input",22),hl()),o&2){let e=eC(3);BE(),dg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Es(0,"option",24),xC(1),hl()),o&2){let e=t.$implicit;dg("ngValue",e.id),BE(),Fg(e.name);}}function Ce(o,t){if(o&1&&(Es(0,"ds-form-field",21)(1,"select",23)(2,"option",24),xC(3,"\u2014 None \u2014"),hl(),Uw(4,ge,2,2,"option",24,ce),hl(),MI(),hl()),o&2){let e=eC(3);BE(),dg("formControl",e.agentConfigIdControl),xI(),BE(),dg("ngValue",null),BE(2),$w(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&jw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=eC(2);Bw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Es(0,"p",2),xC(1,"No parameters defined."),hl());}function he(o,t){if(o&1){let e=Yw();Es(0,"div",11)(1,"div",25)(2,"ds-form-field",26),fg(3,"input",27),MI(),hl(),Es(4,"ds-form-field",28),fg(5,"input",29),MI(),hl(),Es(6,"ds-form-field",30),fg(7,"input",31),MI(),hl()(),Es(8,"button",32),vg("click",function(){let d=pf(e).$index,m=eC(2);return hf(m.removeParameter(d))}),xC(9," \xD7 "),hl()();}if(o&2){let e=t.$implicit,r=t.$index;dg("formGroupName",r),BE(2),dg("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),BE(),dg("id","param-name-"+r),xI(),BE(),dg("controlId","param-desc-"+r),BE(),dg("id","param-desc-"+r),xI(),BE(),dg("controlId","param-default-"+r),BE(),dg("id","param-default-"+r),xI();}}function _e(o,t){if(o&1){let e=Yw();Es(0,"div",14)(1,"span",33),xC(2),hl(),Es(3,"ds-form-field",34),fg(4,"textarea",35),MI(),hl(),Es(5,"button",36),vg("click",function(){let d=pf(e).$index,m=eC(2);return hf(m.removeContentEntry(d))}),xC(6," \xD7 "),hl()();}if(o&2){let e=t.$implicit,r=t.$index,d=eC(2);BE(2),Fg(r+1),BE(),dg("error",e.invalid&&e.touched?"Content entry must not be blank.":null),BE(),dg("formControlName",r),lg("aria-label","Content entry "+(r+1)),xI(),BE(),dg("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Es(0,"ds-notice"),xC(1),hl()),o&2){let e=eC(2);BE(),Fg(e.errorMessage());}}function be(o,t){if(o&1){let e=Yw();Es(0,"button",37),vg("click",function(){pf(e);let d=eC(2);return hf(d.exportYaml())}),xC(1),hl();}if(o&2){let e=eC(2);dg("disabled",e.isExporting()),BE(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let d=eC();return hf(d.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"input",8),MI(),hl(),jw(5,ye,2,1),Es(6,"ds-fieldset",9)(7,"p",2),xC(8," Each parameter must have a name and a default value. Use "),Es(9,"code"),xC(10),hl(),xC(11," in content entries to reference them. "),hl(),Es(12,"div",10),jw(13,ve,2,0,"p",2),Uw(14,he,10,8,"div",11,Vw),Es(16,"div")(17,"button",12),vg("click",function(){pf(e);let d=eC();return hf(d.addParameter())}),xC(18,"+ Add parameter"),hl()()()(),Es(19,"ds-fieldset",13)(20,"p",2),xC(21," Each content entry is a command. Use "),Es(22,"code"),xC(23,"@AgentName"),hl(),xC(24," to target an agent, "),Es(25,"code"),xC(26,"/promptName param1 param2"),hl(),xC(27," to call another prompt, and "),Es(28,"code"),xC(29),hl(),xC(30," for parameter placeholders. "),hl(),Es(31,"div",10),Uw(32,_e,7,5,"div",14,Vw),Es(34,"div")(35,"button",12),vg("click",function(){pf(e);let d=eC();return hf(d.addContentEntry())}),xC(36,"+ Add content entry"),hl()()()(),jw(37,xe,2,1,"ds-notice"),Es(38,"ds-form-field",15),fg(39,"textarea",16),MI(),hl(),Es(40,"ds-form-actions")(41,"button",17),xC(42),hl(),jw(43,be,2,2,"button",18),Es(44,"button",19),vg("click",function(){pf(e);let d=eC();return hf(d.cancel())}),xC(45,"Cancel"),hl()()();}if(o&2){let e=eC();dg("formGroup",e.form),BE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),BE(),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(),Bw(e.availableAgentConfigs().length>0?5:-1),BE(5),Fg(e.paramPlaceholderSyntax),BE(2),dg("formArrayName","parameters"),BE(),Bw(e.parametersArray.length===0?13:-1),BE(),$w(e.parametersArray.controls),BE(15),Fg(e.paramPlaceholderSyntax),BE(2),dg("formArrayName","content"),BE(),$w(e.contentArray.controls),BE(5),Bw(e.errorMessage()?37:-1),BE(),dg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),BE(),dg("formControl",e.externalMetadataJsonControl),xI(),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," "),BE(),Bw(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(we);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Bt([this.createContentControl()],{validators:[fn.required]}),parameters:new Bt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);isExporting=$i(false);errorMessage=$i(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=$i([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),ha(()=>br([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),ha(()=>br([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[fn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=vw({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value",3,"controlId"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return r.cancel()}),xC(3),hl()(),jw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),hl()),e&2&&(BE(),dg("title",r.isEditMode()?"Edit prompt":"New prompt"),BE(2),Dl(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),BE(),Bw(r.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,Vn,An,va,go,_o,pn,hn,cn,ln,dn,mn,at,an],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
@@ -1 +1 @@
1
- import {g,aJ as be,a6 as x}from'./main-KD2BFLOW.js';var c=class r{api=g(be);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,aJ as be,a6 as x}from'./main-WGM2SCAZ.js';var c=class r{api=g(be);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 {o}from'./chunk-BL4O5z35.js';import {p as pt,T as Te,a as fn,U as Ut,n as nd,L as Lt,m as mo,c as po,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,C as mn,i as at,j as an,l as ko}from'./chunk-DU2T72t1.js';import {g,W,q as F,I as we,$ as $i,K as U,N as x,L as w,v as vw,au as $t,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,c as Bw,t as eC,Y as Yw,f as fg,R as MI,U as Uw,am as Vw,S as xI,k as $w,s as Dl,u as pf,w as hf,F as Fg}from'./main-WGM2SCAZ.js';function ie(i,t){if(i&1&&(Es(0,"a",2),xC(1,"View skill \u2192"),hl()),i&2){let e=eC();dg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Es(0,"ds-tag",3),xC(1,"Platform level"),hl());}function ne(i,t){i&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function re(i,t){if(i&1){let e=Yw();Es(0,"div",15)(1,"div",19),fg(2,"input",20),MI(),Es(3,"button",21),vg("click",function(){let l=pf(e).$implicit,te=eC(2);return hf(te.removeResource(l))}),xC(4," \xD7 "),hl()(),fg(5,"textarea",22),MI(),hl();}if(i&2){let e=t.$implicit;BE(2),dg("formControl",e.path),xI(),BE(3),dg("formControl",e.content),xI();}}function ae(i,t){if(i&1&&(Es(0,"ds-notice"),xC(1),hl()),i&2){let e=eC(2);BE(),Fg(e.errorMessage());}}function se(i,t){if(i&1){let e=Yw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let l=eC();return hf(l.submit())}),Es(1,"ds-form-field",7),fg(2,"input",8),MI(),hl(),Es(3,"ds-form-field",9),fg(4,"textarea",10),MI(),hl(),Es(5,"ds-form-field",11),fg(6,"textarea",12),MI(),hl(),Es(7,"ds-form-field",13)(8,"div",14),Uw(9,re,6,2,"div",15,Vw),Es(11,"div")(12,"button",16),vg("click",function(){pf(e);let l=eC();return hf(l.addResource())}),xC(13,"+ Add resource"),hl()()()(),jw(14,ae,2,1,"ds-notice"),Es(15,"ds-form-actions")(16,"button",17),xC(17),hl(),Es(18,"button",18),vg("click",function(){pf(e);let l=eC();return hf(l.cancel())}),xC(19,"Cancel"),hl()()();}if(i&2){let e=eC();dg("formGroup",e.form),BE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),BE(),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.bodyControl),xI(),BE(3),$w(e.resourceRows()),BE(5),Bw(e.errorMessage()?14:-1),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),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:[fn.required,fn.maxLength(100),fn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(500),fn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})});resourceRows=$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=vw({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()}),xC(3,"\u2190 Skills"),hl(),jw(4,ie,2,1,"a",2),jw(5,oe,2,0,"ds-tag",3),hl(),jw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),hl()),e&2&&(BE(),dg("title",o.isEditMode()?"Edit skill":"New skill"),BE(3),Bw(o.isEditMode()?4:-1),BE(),Bw(o.isPlatformMode?5:-1),BE(),Bw(o.isLoading()?6:7));},dependencies:[Ut,nd,Lt,mo,po,Vn,An,$t,pn,hn,cn,dn,mn,at,an,ko],encapsulation:2})};export{ee as SkillFormComponent};
@@ -0,0 +1 @@
1
+ import {ab as N,d as pn,h as hn,e as cn,g as dn,C as mn,i as at,j as an}from'./chunk-DU2T72t1.js';import {g,W,q as F,aU as D,ag as U,I as we,$ as $i,K as U$1,B,aV as gy,v as vw,E as Es,Q as vg,x as xC,a as hl,f as fg,j as jw,b as BE,P as dg,c as Bw,s as Dl,t as eC,F as Fg}from'./main-WGM2SCAZ.js';function P(l,t){if(l&1&&(Es(0,"ds-notice"),xC(1),hl()),l&2){let n=eC();BE(),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=vw({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()}),xC(3," \u2190 Edit agent config "),hl()(),Es(4,"p",2),xC(5," The loop configuration below is read from "),Es(6,"code"),xC(7,"AgentConfig.loopConfig"),hl(),xC(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(),jw(11,P,2,1,"ds-notice"),Es(12,"ds-form-actions")(13,"button",5),vg("click",function(){return e.launch()}),xC(14),hl(),Es(15,"button",6),vg("click",function(){return e.back()}),xC(16,"Cancel"),hl()()()),n&2&&(BE(10),dg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),BE(),Bw(e.launchError()?11:-1),BE(2),dg("disabled",e.isLaunching()),BE(),Dl(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),BE(),dg("disabled",e.isLaunching()));},dependencies:[pn,hn,cn,dn,mn,at,an],encapsulation:2})};export{T as AgentConfigLaunchComponent};
@@ -0,0 +1 @@
1
+ import {O as O$1,i as at,h as hn,I as Io,l as ko,P}from'./chunk-DU2T72t1.js';import {g,I as we,X as W,Z as Tr,$ as $i,r as rT,a0 as $e,a1 as ga,a2 as ha,a3 as rn,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,U as Uw,t as eC,k as $w,s as Dl,F as Fg}from'./main-WGM2SCAZ.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Es(0,"p",10),xC(1,"Loading the configuration failed. Try refreshing."),hl());}function V(e,t){e&1&&(Es(0,"p",11),xC(1,"Loading configuration\u2026"),hl());}function j(e,t){e&1&&(Es(0,"p",12),xC(1,"The service reported no settings."),hl());}function O(e,t){e&1&&(Es(0,"p",11),xC(1,"No settings match the current filters."),hl());}function Y(e,t){e&1&&(Es(0,"ds-tag",22),xC(1,"on"),hl());}function z(e,t){e&1&&(Es(0,"ds-tag",20),xC(1,"off"),hl());}function H(e,t){if(e&1&&(Es(0,"ds-tag",20),xC(1),hl()),e&2){let i=eC().$implicit;BE(),Fg(i.display.text);}}function G(e,t){if(e&1&&(Es(0,"ds-tag",23),xC(1),hl()),e&2){let i=eC().$implicit;BE(),Fg(i.display.text);}}function J(e,t){if(e&1&&(Es(0,"span",24),xC(1),hl()),e&2){let i=eC().$implicit;BE(),Fg(i.display.text);}}function K(e,t){if(e&1&&(Es(0,"tr",16)(1,"td",18),xC(2),hl(),Es(3,"td",19)(4,"ds-tag",20),xC(5),hl()(),Es(6,"td",21),jw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),hl(),Es(12,"td",25),xC(13),hl()()),e&2){let i,a=t.$implicit,m=eC(2);BE(2),Dl(" ",a.entry.key," "),BE(3),Dl(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),BE(2),Bw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),BE(6),Dl(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Es(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),xC(5,"Setting"),hl(),Es(6,"th",17),xC(7,"Source"),hl(),Es(8,"th",17),xC(9,"Value"),hl(),Es(10,"th",17),xC(11,"Description"),hl()()(),Es(12,"tbody",15),Uw(13,K,14,4,"tr",16,U),hl()()()),e&2){let i=eC();BE(13),$w(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new Tr(void 0);isLoading=$i(true);loadError=$i(false);rows=$i([]);source=$i("ALL");status=$i("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=rT(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=$e;constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(ha(()=>(this.loadError.set(true),this.isLoading.set(false),rn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=vw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(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.reload()}),xC(3,"Refresh"),hl()(),Es(4,"div",3)(5,"select",4),vg("change",function(c){return a.source.set(c.target.value)}),Es(6,"option",5),xC(7,"All sources"),hl(),Es(8,"option",6),xC(9,"Environment variables"),hl(),Es(10,"option",6),xC(11,"Spring properties"),hl()(),Es(12,"select",7),vg("change",function(c){return a.status.set(c.target.value)}),Es(13,"option",5),xC(14,"Set and unset"),hl(),Es(15,"option",8),xC(16,"Set only"),hl(),Es(17,"option",9),xC(18,"Unset only"),hl()()(),jw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(BE(),dg("query",a.rowFilter.query()),BE(4),dg("value",a.source()),BE(3),dg("value",a.Source.ENVIRONMENT),BE(2),dg("value",a.Source.PROPERTY),BE(2),dg("value",a.status()),BE(7),Bw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,hn,Io,ko,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
@@ -0,0 +1 @@
1
+ import {O as O$1}from'./chunk-Dje4hFK9.js';import {g,q as F,I as we,af as G$1,Z as Tr,$ as $i,a1 as ga,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,Y as Yw,l as lg,u as pf,w as hf}from'./main-WGM2SCAZ.js';import {z as k,O as O$2,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-DU2T72t1.js';import'./chunk-BSwOttIr.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Es(0,"p",3),xC(1),hl()),t&2){let n=eC();BE(),Fg(n.deletion.error());}}function K(t,e){t&1&&(Es(0,"p",4),xC(1,"Loading integrations\u2026"),hl());}function H(t,e){t&1&&(Es(0,"p",5),xC(1,"No platform integrations defined yet."),hl());}function U(t,e){t&1&&(Es(0,"p",4),xC(1,"No integrations match the current filter."),hl());}function z(t,e){if(t&1){let n=Yw();Es(0,"button",18),vg("click",function(){pf(n);let d=eC().$implicit,m=eC(2);return hf(m.edit(d))}),xC(1,"Edit"),hl();}if(t&2){let n=eC().$implicit;lg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Yw();Es(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){pf(n);let d=eC().$implicit,m=eC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(n);let d=eC().$implicit,m=eC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(n);let d=eC(3);return hf(d.deletion.cancel())}),hl();}if(t&2){let n=eC().$implicit,r=eC(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),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14)(6,"div",15),jw(7,z,2,1,"button",16),jw(8,G,1,3,"agentos-row-delete-action",17),hl()()()),t&2){let n=e.$implicit,r=eC(2);BE(2),Fg(n.name),BE(2),Fg(n.integrationType),BE(3),Bw(r.deletion.confirmingId()!==n.id?7:-1),BE(),Bw(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),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Type"),hl(),Es(8,"th",10)(9,"span",11),xC(10,"Actions"),hl()()()(),Es(11,"tbody",8),Uw(12,J,9,4,"tr",9,j),hl()()()),t&2){let n=eC();BE(12),$w(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=vw({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()}),xC(3,"New integration"),hl()(),jw(4,A,2,1,"p",3),jw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(BE(),dg("query",r.rowFilter.query()),BE(3),Bw(r.deletion.error()?4:-1),BE(),Bw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
@@ -0,0 +1 @@
1
+ import {z as k$1,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DU2T72t1.js';import {g,W as W$1,q as F,I 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,K as U,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-WGM2SCAZ.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Es(0,"p",3),xC(1),hl()),i&2){let t=eC();BE(),Fg(t.deletion.error());}}function W(i,e){i&1&&(Es(0,"p",4),xC(1,"Loading AI models\u2026"),hl());}function X(i,e){i&1&&(Es(0,"p",5),xC(1,"No AI models configured."),hl());}function Y(i,e){i&1&&(Es(0,"p",4),xC(1,"No AI models match the current filter."),hl());}function Z(i,e){i&1&&(Es(0,"ds-tag",18),xC(1,"Read-only"),hl());}function ee(i,e){if(i&1){let t=Yw();Es(0,"button",24),vg("click",function(){pf(t);let s=eC(2).$implicit,m=eC(2);return hf(m.edit(s))}),xC(1,"Edit"),hl();}if(i&2){let t=eC(2).$implicit,n=eC(2);lg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Yw();jw(0,ee,2,1,"button",22),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=eC().$implicit,n=eC(2);Bw(n.deletion.confirmingId()!==t.key?0:-1),BE(),dg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Es(0,"button",21),xC(1,"Inherited"),hl());}function ne(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14),xC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),xC(10),hl(),jw(11,Z,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),jw(14,te,2,4)(15,ie,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,n=eC(2);BE(2),Fg(n.title(t)),BE(2),Fg(t.providerName),BE(2),Dl(" ",t.model.apiModelName," "),BE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),BE(),Fg(t.scope==="platform"?"Platform":"Namespace"),BE(),Bw(t.scope==="platform"?11:-1),BE(3),Bw(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),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Provider"),hl(),Es(8,"th",10),xC(9,"API model name"),hl(),Es(10,"th",10),xC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),xC(14,"Actions"),hl()()()(),Es(15,"tbody",8),Uw(16,ne,16,7,"tr",9,G),hl()()()),i&2){let t=eC();BE(16),$w(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=vw({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()}),xC(3,"New AI model"),hl()(),jw(4,Q,2,1,"p",3),jw(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&&(BE(),dg("query",n.rowFilter.query()),BE(3),Bw(n.deletion.error()?4:-1),BE(),Bw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
@@ -0,0 +1 @@
1
+ import {I as I$1}from'./chunk-DLa-RTUD.js';import {g,q as F,I as we,Z as Tr,$ as $i,a1 as ga,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,l as lg,u as pf,w as hf}from'./main-WGM2SCAZ.js';import {z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-DU2T72t1.js';import'./chunk-BSwOttIr.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Es(0,"p",3),xC(1),hl()),e&2){let n=eC();BE(),Fg(n.deletion.error());}}function K(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading auth settings\u2026"),hl());}function H(e,t){e&1&&(Es(0,"p",5),xC(1,"No platform auth settings defined yet."),hl());}function U(e,t){e&1&&(Es(0,"p",4),xC(1,"No auth settings match the current filter."),hl());}function z(e,t){if(e&1){let n=Yw();Es(0,"button",18),vg("click",function(){pf(n);let d=eC().$implicit,m=eC(2);return hf(m.onEdit(d))}),xC(1," Edit "),hl();}if(e&2){let n=eC().$implicit;lg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Yw();Es(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){pf(n);let d=eC().$implicit,m=eC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(n);let d=eC().$implicit,m=eC(2);return hf(m.onDelete(d))})("deleteCancelled",function(){pf(n);let d=eC(3);return hf(d.deletion.cancel())}),hl();}if(e&2){let n=eC().$implicit,a=eC(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),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14)(6,"div",15),jw(7,z,2,1,"button",16),jw(8,G,1,3,"agentos-row-delete-action",17),hl()()()),e&2){let n=t.$implicit,a=eC(2);BE(2),Fg(n.name),BE(2),Dl(" ",n.authType," "),BE(3),Bw(a.deletion.confirmingId()!==n.id?7:-1),BE(),Bw(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),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Authentication type"),hl(),Es(8,"th",10)(9,"span",11),xC(10,"Actions"),hl()()()(),Es(11,"tbody",8),Uw(12,J,9,4,"tr",9,B),hl()()()),e&2){let n=eC();BE(12),$w(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=vw({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()}),xC(3,"New auth setting"),hl()(),jw(4,j,2,1,"p",3),jw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(BE(),dg("query",a.rowFilter.query()),BE(3),Bw(a.deletion.error()?4:-1),BE(),Bw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -0,0 +1 @@
1
+ import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DU2T72t1.js';import {g,W as W$1,q as F,I as we,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-WGM2SCAZ.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let t=eC();BE(),Fg(t.deletion.error());}}function G(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading prompts\u2026"),hl());}function O(n,e){n&1&&(Es(0,"p",5),xC(1,"No prompts available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),xC(1,"No prompts match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",17),xC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Yw();Es(0,"button",23),vg("click",function(){pf(t);let l=eC(2).$implicit,m=eC(2);return hf(m.edit(l))}),xC(1," Edit "),hl();}if(n&2){let t=eC(2).$implicit;lg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=Yw();jw(0,X,2,1,"button",21),Es(1,"agentos-row-delete-action",22),vg("deleteRequested",function(){pf(t);let l=eC().$implicit,m=eC(2);return hf(m.deletion.request(l.key))})("deleteConfirmed",function(){pf(t);let l=eC().$implicit,m=eC(2);return hf(m.confirmDelete(l))})("deleteCancelled",function(){pf(t);let l=eC(3);return hf(l.deletion.cancel())}),hl();}if(n&2){let t=eC().$implicit,i=eC(2);Bw(i.deletion.confirmingId()!==t.key?0:-1),BE(),dg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Es(0,"button",20),xC(1,"Inherited"),hl());}function ee(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),xC(8),hl(),jw(9,W,2,0,"ds-tag",17),hl()(),Es(10,"td",18)(11,"div",19),jw(12,Y,2,4)(13,Z,2,0,"button",20),hl()()()),n&2){let t=e.$implicit;BE(2),Fg(t.prompt.name),BE(2),Dl(" ",t.prompt.description||"\u2014"," "),BE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),BE(),Fg(t.scope==="platform"?"Platform":"Namespace"),BE(),Bw(t.scope==="platform"?9:-1),BE(3),Bw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10),xC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),xC(12,"Actions"),hl()()()(),Es(13,"tbody",8),Uw(14,ee,14,6,"tr",9,U),hl()()()),n&2){let t=eC();BE(14),$w(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({platform:this.promptState.listPlatform().pipe(ha(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=vw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return i.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),xC(3,"New prompt"),hl()(),jw(4,z,2,1,"p",3),jw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(BE(),dg("query",i.rowFilter.query()),BE(3),Bw(i.deletion.error()?4:-1),BE(),Bw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
@@ -1 +1 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CbFj_KVb.js';import {O}from'./chunk-Bx0NEc6t.js';import {g,W,F as F$1,I as Ie,ag as U,ay as N,U as Ui,az as K,a8 as _,X as XC,a9 as F$2,aA as qe$1,G as U$1,a2 as da,aa as Tr,ac as Ty,ad as ne,M as x,K as w,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,Z as Zw,l as lg,_ as _I,R as NI,k as cg,v as vl,H as Hw,m as Uw,O as Og,r as df,s as ff,as as kg}from'./main-KD2BFLOW.js';import {N as A,p as pt$1,T as Te,a as fn,Q as E,U as Ut,n as nd,b as bo,x as xo,L as Lt$1,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at$1,j as an,t as rn,l as ko}from'./chunk-DlvXf54E.js';import'./chunk-CirZuytZ.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&&(Ds(0,"a",2),NC(1,"View resolved definition \u2192"),pl()),n&2){let e=Jw();ug("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function Qe(n,t){n&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function Ze(n,t){if(n&1&&(lg(0,"input",17),_I()),n&2){let e=Jw(2);ug("formControl",e.modelNameControl),NI();}}function et(n,t){if(n&1&&(Ds(0,"option",41),NC(1),pl()),n&2){let e=t;ug("ngValue",e.value),BE(),Og(e.label);}}function tt(n,t){if(n&1&&(Ds(0,"option",41),NC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),BE(),Og(e.label);}}function nt(n,t){if(n&1&&(Ds(0,"optgroup",42),Hw(1,tt,2,2,"option",41,je),pl()),n&2){let e=Jw(3);BE(),Uw(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Ds(0,"option",41),NC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),BE(),Og(e.label);}}function ot(n,t){if(n&1&&(Ds(0,"optgroup",43),Hw(1,it,2,2,"option",41,je),pl()),n&2){let e=Jw(3);BE(),Uw(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Ds(0,"select",18)(1,"option",40),NC(2,"Select a model"),pl(),Lw(3,et,2,2,"option",41),Lw(4,nt,3,0,"optgroup",42),Lw(5,ot,3,0,"optgroup",43),pl(),_I()),n&2){let e,i=Jw(2);ug("formControl",i.modelNameControl),NI(),BE(),ug("ngValue",null),BE(2),jw((e=i.modelOptions().current)?3:-1,e),BE(),jw(i.modelOptions().aliases.length>0?4:-1),BE(),jw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Ds(0,"span",44),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.config.integrationType);}}function rt(n,t){if(n&1&&(lg(0,"input",45),_I()),n&2){let e=Jw().$implicit;ug("formControl",e.toolsControl),cg("aria-label","Tools of "+e.config.name),NI();}}function st(n,t){if(n&1){let e=Zw();Ds(0,"div",10)(1,"label",11)(2,"input",23),mg("change",function(){let s=df(e).$implicit,c=Jw(3);return ff(c.toggleIntegration(s))}),pl(),Ds(3,"span",24),NC(4),pl(),Lw(5,lt,2,1,"span",44),pl(),Lw(6,rt,1,2,"input",45),pl();}if(n&2){let e=t.$implicit;BE(2),ug("checked",e.enabled()),BE(2),Og(e.config.name),BE(),jw(e.config.integrationType?5:-1),BE(),jw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Ds(0,"p",13),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Zw();Ds(0,"div",10)(1,"label",24),NC(2),Ds(3,"span",44),NC(4,"built-in"),pl()(),Ds(5,"select",47),mg("change",function(s){let c=df(e).$implicit,C=Jw(4);return ff(C.setBuiltInState(c,s.target.value))}),Ds(6,"option",48),NC(7),pl(),Ds(8,"option",49),NC(9,"Enabled"),pl(),Ds(10,"option",50),NC(11,"Disabled"),pl()(),Lw(12,dt,2,1,"p",13),Ds(13,"p",13),NC(14),pl()();}if(n&2){let e=t.$implicit,i=Jw(4);BE(),cg("for","built-in-"+e.type),BE(),vl(" ",e.displayName," "),BE(3),ug("id","built-in-"+e.type)("value",e.state()),BE(2),Og(i.builtInDefaultLabel(e)),BE(5),jw(e.state()==="on"&&e.restrictedTools?12:-1),BE(2),Og(e.description);}}function mt(n,t){if(n&1&&(Ds(0,"span",46),NC(1,"Built-in integrations"),pl(),Hw(2,ct,15,7,"div",10,qe)),n&2){let e=Jw(3);BE(2),Uw(e.builtInRows());}}function ut(n,t){n&1&&(Ds(0,"ds-notice",26),NC(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. "),pl());}function gt(n,t){if(n&1&&(Ds(0,"ds-fieldset",21),Hw(1,st,7,4,"div",10,Ye),Lw(3,mt,4,0),Lw(4,ut,2,0,"ds-notice",26),pl()),n&2){let e=Jw(2);BE(),Uw(e.integrationRows()),BE(2),jw(e.builtInRows().length>0?3:-1),BE(),jw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&NC(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&&(Ds(0,"ds-notice",26),NC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),NC(3,"*"),pl(),NC(4,". "),pl());}function Ct(n,t){n&1&&(Ds(0,"ds-notice"),NC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function _t(n,t){n&1&&(Ds(0,"p",4),NC(1,"No skill available in this scope yet."),pl());}function bt(n,t){n&1&&(Ds(0,"span",44),NC(1,"platform"),pl());}function ht(n,t){if(n&1&&(Ds(0,"span",44),NC(1),pl()),n&2){let e=Jw(4);BE(),vl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Ds(0,"p",13),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.description);}}function vt(n,t){if(n&1){let e=Zw();Ds(0,"div",10)(1,"label",11)(2,"input",51),mg("change",function(){let s=df(e).$implicit,c=Jw(3);return ff(c.toggleSkill(s))}),pl(),Ds(3,"span",24),NC(4),pl(),Lw(5,bt,2,0,"span",44),Lw(6,ht,2,1,"span",44),pl(),Lw(7,yt,2,1,"p",13),pl();}if(n&2){let e=t.$implicit,i=Jw(3);BE(2),ug("checked",e.selected())("disabled",i.allSkillsSelected()),BE(2),Og(e.name),BE(),jw(e.platform?5:-1),BE(),jw(e.unresolved?6:-1),BE(),jw(e.description?7:-1);}}function xt(n,t){if(n&1&&Hw(0,vt,8,6,"div",10,We),n&2){let e=Jw(2);Uw(e.skillRows());}}function St(n,t){if(n&1&&(Ds(0,"ds-form-field",30),lg(1,"textarea",52),_I(),Ds(2,"p",4),NC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Ds(4,"code"),NC(5,"AgentLoopPayload"),pl(),NC(6,". Leave empty if you always provide the payload at launch. "),pl()()),n&2){let e=Jw(2);ug("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),BE(),ug("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),NI();}}function At(n,t){n&1&&NC(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&&NC(0),n&2){let e=Jw(3);kg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Ds(0,"ds-notice",26),NC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),NC(3,"*"),pl(),NC(4,". "),Lw(5,wt,1,2),pl()),n&2){let e=Jw(2);BE(5),jw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Ds(0,"ds-notice"),NC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function kt(n,t){n&1&&(Ds(0,"p",4),NC(1,"No other agent is available in this scope yet."),pl());}function It(n,t){n&1&&(Ds(0,"span",44),NC(1,"pattern"),pl());}function Rt(n,t){n&1&&(Ds(0,"span",44),NC(1,"via pattern"),pl());}function Mt(n,t){if(n&1&&(Ds(0,"span",44),NC(1),pl()),n&2){let e=Jw(4);BE(),vl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Zw();Ds(0,"button",55),mg("click",function(){df(e);let s=Jw().$implicit,c=Jw(3);return ff(c.removeSubAgent(s))}),NC(1," \xD7 "),pl();}if(n&2){let e=Jw().$implicit;cg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Zw();Ds(0,"div",32)(1,"label",53)(2,"input",51),mg("change",function(){let s=df(e).$implicit,c=Jw(3);return ff(c.toggleSubAgent(s))}),pl(),Ds(3,"span",24),NC(4),pl(),Lw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),pl(),Lw(8,Ft,2,1,"button",54),pl();}if(n&2){let e=t.$implicit,i=Jw(3);BE(2),ug("checked",e.selected())("disabled",i.allSubAgentsSelected()),BE(2),Og(e.name),BE(),jw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),BE(3),jw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Hw(0,Nt,9,5,"div",32,We),n&2){let e=Jw(2);Uw(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Zw();Ds(0,"div")(1,"button",56),mg("click",function(){df(e);let s=Jw(2);return ff(s.useDefaultDelegationTimeout())}),NC(2," Use server default "),pl()();}}function Vt(n,t){n&1&&(Ds(0,"ds-notice"),NC(1),pl()),n&2&&(BE(),Og(t));}function Pt(n,t){if(n&1){let e=Zw();Ds(0,"button",57),mg("click",function(){df(e);let s=Jw(2);return ff(s.exportYaml())}),NC(1),pl();}if(n&2){let e=Jw(2);ug("disabled",e.isExporting()),BE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Zw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let s=Jw();return ff(s.submit())}),Ds(1,"ds-fieldset",7)(2,"ds-form-field",8),lg(3,"input",9),_I(),pl(),Ds(4,"div",10)(5,"label",11),lg(6,"input",12),_I(),NC(7," Enabled "),pl(),Ds(8,"p",13),NC(9,"Disabled agents are excluded from namespace resolution."),pl()(),Ds(10,"ds-form-field",14),lg(11,"input",15),_I(),pl(),Ds(12,"ds-form-field",16),Lw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),pl(),Ds(15,"ds-form-field",19),lg(16,"textarea",20),_I(),pl()(),Lw(17,gt,5,2,"ds-fieldset",21),Ds(18,"ds-fieldset",22)(19,"p",4),NC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Ds(21,"code"),NC(22,"readSkill"),pl(),NC(23," and "),Ds(24,"code"),NC(25,"readSkillResource"),pl(),NC(26," tools; selecting none grants neither. "),Lw(27,pt,1,0),pl(),Ds(28,"label",11)(29,"input",23),mg("change",function(){df(e);let s=Jw();return ff(s.toggleAllSkills())}),pl(),Ds(30,"span",24),NC(31,"Every skill in the catalogue ("),Ds(32,"code",25),NC(33,"*"),pl(),NC(34,")"),pl()(),Ds(35,"p",13),NC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),pl(),Lw(37,ft,5,0,"ds-notice",26),Lw(38,Ct,2,0,"ds-notice"),Lw(39,_t,2,0,"p",4)(40,xt,2,0),pl(),Ds(41,"ds-form-field",27)(42,"select",28)(43,"option",29),NC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),Ds(45,"option",29),NC(46,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),Ds(47,"option",29),NC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),_I(),pl(),Lw(49,St,7,3,"ds-form-field",30),Ds(50,"ds-fieldset",31)(51,"p",4),NC(52," The agents this one may delegate to. Selecting at least one grants it the "),Ds(53,"code"),NC(54,"DELEGATE__delegate"),pl(),NC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Lw(56,At,1,0),pl(),Ds(57,"label",11)(58,"input",23),mg("change",function(){df(e);let s=Jw();return ff(s.toggleAllSubAgents())}),pl(),Ds(59,"span",24),NC(60,"Every agent it can reach ("),Ds(61,"code",25),NC(62,"*"),pl(),NC(63,")"),pl()(),Ds(64,"p",13),NC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),pl(),Lw(66,Et,6,1,"ds-notice",26),Lw(67,Tt,2,0,"ds-notice"),Lw(68,kt,2,0,"p",4)(69,Dt,2,0),Ds(70,"p",4),NC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Ds(72,"code"),NC(73,"*Fixer"),pl(),NC(74," to cover BugFixer and StoryFixer. "),pl(),Ds(75,"div",32)(76,"input",33),mg("keydown.enter",function(){df(e);let s=Jw();return ff(s.addSubAgent())}),pl(),_I(),Ds(77,"button",34),mg("click",function(){df(e);let s=Jw();return ff(s.addSubAgent())}),NC(78," + "),pl()(),Ds(79,"ds-form-field",35),lg(80,"input",36),_I(),Lw(81,Lt,3,0,"div"),pl()(),Lw(82,Vt,2,1,"ds-notice"),Ds(83,"ds-form-actions")(84,"button",37),NC(85),pl(),Lw(86,Pt,2,2,"button",38),Ds(87,"button",39),mg("click",function(){df(e);let s=Jw();return ff(s.cancel())}),NC(88,"Cancel"),pl()()();}if(n&2){let e,i=Jw();ug("formGroup",i.form),BE(3),ug("formControl",i.nameControl),NI(),BE(3),ug("formControl",i.enabledControl),NI(),BE(5),ug("formControl",i.descriptionControl),NI(),BE(2),jw(i.modelAsFreeText()?13:14),BE(3),ug("formControl",i.instructionsControl),NI(),BE(),jw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),BE(10),jw(i.isPlatformMode?27:-1),BE(2),ug("checked",i.allSkillsSelected()),BE(8),jw(i.namedSkillSelectionDropped()?37:-1),BE(),jw(i.skillCatalogueUnavailable()?38:-1),BE(),jw(i.skillRows().length===0?39:40),BE(3),ug("formControl",i.executionModeControl),NI(),BE(),ug("value",i.ExecutionMode.SIMPLE),BE(2),ug("value",i.ExecutionMode.ADVANCED),BE(2),ug("value",i.ExecutionMode.LOOP),BE(2),jw(i.isLoopMode()?49:-1),BE(7),jw(i.isPlatformMode?56:-1),BE(2),ug("checked",i.allSubAgentsSelected()),BE(8),jw(i.namedSubAgentSelectionDropped()?66:-1),BE(),jw(i.subAgentCandidatesUnavailable()?67:-1),BE(),jw(i.subAgentRows().length===0?68:69),BE(8),ug("formControl",i.newSubAgentControl),NI(),BE(),ug("disabled",!i.newSubAgentControl.value.trim()),BE(2),ug("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),BE(),ug("formControl",i.delegationTimeoutControl),cg("aria-invalid",i.delegationTimeoutControl.invalid),NI(),BE(),jw(i.delegationTimeoutControl.value!==null?81:-1),BE(),jw((e=i.submitError())?82:-1,e),BE(2),ug("disabled",i.form.invalid||i.isSubmitting()),BE(),vl(" ",i.isEditMode()?"Save changes":"Create"," "),BE(),jw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(Ie);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=Ui(null);exportService=g(K);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:[fn.required,fn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[fn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[fn.min(1),fn.max(2147483647),fn.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=XC(()=>{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=XC(()=>this.executionModeValue()==="LOOP");subAgentRows=Ui([]);allSubAgentsSelected=Ui(false);subAgentCandidatesUnavailable=Ui(false);namedSubAgentSelectionDropped=XC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=XC(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=XC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);submitError=Ui(null);ExecutionMode=qe$1;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=Ui([]);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=XC(()=>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=Ui({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=Ui(false);modelAsFreeText=XC(()=>{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=Ui([]);skillRows=Ui([]);allSkillsSelected=Ui(false);skillCatalogueUnavailable=Ui(false);namedSkillSelectionDropped=XC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),da(()=>Tr(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),Ty({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Tr([]),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){Ty({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Tr([]),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(da(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Tr([]))))}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:Ui(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:Ui(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()):Tr([]);return Ty({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 da(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),Tr([])))}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:Ui(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:Ui(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),da(t=>(console.error("[agent-config-form] failed to load integration types",t),Tr([]))))}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:Ui(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:Ui(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:Ui(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=yw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return i.cancel()}),NC(3," \u2190 Agent configs "),pl(),Lw(4,ze,2,1,"a",2),Lw(5,Xe,2,0,"ds-tag",3),pl(),Lw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),pl()),e&2&&(BE(),ug("title",i.isEditMode()?"Edit agent config":"New agent config"),BE(3),jw(i.isEditMode()?4:-1),BE(),jw(i.isPlatformMode?5:-1),BE(),jw(i.isLoading()?6:7));},dependencies:[Ut,nd,bo,xo,Lt$1,kn,vn,Gt,mo,po,$r,qr,Vn,An,$t,pn,hn,cn,ln,dn,mn,at$1,an,rn,ko],encapsulation:2})};export{Ke as AgentConfigFormComponent};
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BL4O5z35.js';import {O}from'./chunk-Dje4hFK9.js';import {g,W,q as F$1,I as we,ag as U,ay as N,$ as $i,az as K,a8 as _,r as rT,a9 as F$2,aA as qe$1,K as U$1,a2 as ha,aa as br,ac as by,ad as ne,N as x,L as w,v as vw,au as $t,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,c as Bw,t as eC,Y as Yw,f as fg,R as MI,S as xI,l as lg,s as Dl,U as Uw,k as $w,F as Fg,u as pf,w as hf,as as Pg}from'./main-WGM2SCAZ.js';import {N as A,p as pt$1,T as Te,a as fn,Q as E,U as Ut,n as nd,b as bo,x as xo,L as Lt$1,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at$1,j as an,t as rn,l as ko}from'./chunk-DU2T72t1.js';import'./chunk-BSwOttIr.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),xC(1,"View resolved definition \u2192"),hl()),n&2){let e=eC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Es(0,"ds-tag",3),xC(1,"Platform level"),hl());}function Qe(n,t){n&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),MI()),n&2){let e=eC(2);dg("formControl",e.modelNameControl),xI();}}function et(n,t){if(n&1&&(Es(0,"option",41),xC(1),hl()),n&2){let e=t;dg("ngValue",e.value),BE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Es(0,"option",41),xC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),BE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Es(0,"optgroup",42),Uw(1,tt,2,2,"option",41,je),hl()),n&2){let e=eC(3);BE(),$w(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Es(0,"option",41),xC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),BE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Es(0,"optgroup",43),Uw(1,it,2,2,"option",41,je),hl()),n&2){let e=eC(3);BE(),$w(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Es(0,"select",18)(1,"option",40),xC(2,"Select a model"),hl(),jw(3,et,2,2,"option",41),jw(4,nt,3,0,"optgroup",42),jw(5,ot,3,0,"optgroup",43),hl(),MI()),n&2){let e,i=eC(2);dg("formControl",i.modelNameControl),xI(),BE(),dg("ngValue",null),BE(2),Bw((e=i.modelOptions().current)?3:-1,e),BE(),Bw(i.modelOptions().aliases.length>0?4:-1),BE(),Bw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Es(0,"span",44),xC(1),hl()),n&2){let e=eC().$implicit;BE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),MI()),n&2){let e=eC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),xI();}}function st(n,t){if(n&1){let e=Yw();Es(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=pf(e).$implicit,c=eC(3);return hf(c.toggleIntegration(s))}),hl(),Es(3,"span",24),xC(4),hl(),jw(5,lt,2,1,"span",44),hl(),jw(6,rt,1,2,"input",45),hl();}if(n&2){let e=t.$implicit;BE(2),dg("checked",e.enabled()),BE(2),Fg(e.config.name),BE(),Bw(e.config.integrationType?5:-1),BE(),Bw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Es(0,"p",13),xC(1),hl()),n&2){let e=eC().$implicit;BE(),Dl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Yw();Es(0,"div",10)(1,"label",24),xC(2),Es(3,"span",44),xC(4,"built-in"),hl()(),Es(5,"select",47),vg("change",function(s){let c=pf(e).$implicit,C=eC(4);return hf(C.setBuiltInState(c,s.target.value))}),Es(6,"option",48),xC(7),hl(),Es(8,"option",49),xC(9,"Enabled"),hl(),Es(10,"option",50),xC(11,"Disabled"),hl()(),jw(12,dt,2,1,"p",13),Es(13,"p",13),xC(14),hl()();}if(n&2){let e=t.$implicit,i=eC(4);BE(),lg("for","built-in-"+e.type),BE(),Dl(" ",e.displayName," "),BE(3),dg("id","built-in-"+e.type)("value",e.state()),BE(2),Fg(i.builtInDefaultLabel(e)),BE(5),Bw(e.state()==="on"&&e.restrictedTools?12:-1),BE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Es(0,"span",46),xC(1,"Built-in integrations"),hl(),Uw(2,ct,15,7,"div",10,qe)),n&2){let e=eC(3);BE(2),$w(e.builtInRows());}}function ut(n,t){n&1&&(Es(0,"ds-notice",26),xC(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),Uw(1,st,7,4,"div",10,Ye),jw(3,mt,4,0),jw(4,ut,2,0,"ds-notice",26),hl()),n&2){let e=eC(2);BE(),$w(e.integrationRows()),BE(2),Bw(e.builtInRows().length>0?3:-1),BE(),Bw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&xC(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),xC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),xC(3,"*"),hl(),xC(4,". "),hl());}function Ct(n,t){n&1&&(Es(0,"ds-notice"),xC(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),xC(1,"No skill available in this scope yet."),hl());}function bt(n,t){n&1&&(Es(0,"span",44),xC(1,"platform"),hl());}function ht(n,t){if(n&1&&(Es(0,"span",44),xC(1),hl()),n&2){let e=eC(4);BE(),Dl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Es(0,"p",13),xC(1),hl()),n&2){let e=eC().$implicit;BE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Yw();Es(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=eC(3);return hf(c.toggleSkill(s))}),hl(),Es(3,"span",24),xC(4),hl(),jw(5,bt,2,0,"span",44),jw(6,ht,2,1,"span",44),hl(),jw(7,yt,2,1,"p",13),hl();}if(n&2){let e=t.$implicit,i=eC(3);BE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),BE(2),Fg(e.name),BE(),Bw(e.platform?5:-1),BE(),Bw(e.unresolved?6:-1),BE(),Bw(e.description?7:-1);}}function xt(n,t){if(n&1&&Uw(0,vt,8,6,"div",10,We),n&2){let e=eC(2);$w(e.skillRows());}}function St(n,t){if(n&1&&(Es(0,"ds-form-field",30),fg(1,"textarea",52),MI(),Es(2,"p",4),xC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Es(4,"code"),xC(5,"AgentLoopPayload"),hl(),xC(6,". Leave empty if you always provide the payload at launch. "),hl()()),n&2){let e=eC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),BE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),xI();}}function At(n,t){n&1&&xC(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&&xC(0),n&2){let e=eC(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),xC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),xC(3,"*"),hl(),xC(4,". "),jw(5,wt,1,2),hl()),n&2){let e=eC(2);BE(5),Bw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Es(0,"ds-notice"),xC(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),xC(1,"No other agent is available in this scope yet."),hl());}function It(n,t){n&1&&(Es(0,"span",44),xC(1,"pattern"),hl());}function Rt(n,t){n&1&&(Es(0,"span",44),xC(1,"via pattern"),hl());}function Mt(n,t){if(n&1&&(Es(0,"span",44),xC(1),hl()),n&2){let e=eC(4);BE(),Dl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Yw();Es(0,"button",55),vg("click",function(){pf(e);let s=eC().$implicit,c=eC(3);return hf(c.removeSubAgent(s))}),xC(1," \xD7 "),hl();}if(n&2){let e=eC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Yw();Es(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=eC(3);return hf(c.toggleSubAgent(s))}),hl(),Es(3,"span",24),xC(4),hl(),jw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),hl(),jw(8,Ft,2,1,"button",54),hl();}if(n&2){let e=t.$implicit,i=eC(3);BE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),BE(2),Fg(e.name),BE(),Bw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),BE(3),Bw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Uw(0,Nt,9,5,"div",32,We),n&2){let e=eC(2);$w(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Yw();Es(0,"div")(1,"button",56),vg("click",function(){pf(e);let s=eC(2);return hf(s.useDefaultDelegationTimeout())}),xC(2," Use server default "),hl()();}}function Vt(n,t){n&1&&(Es(0,"ds-notice"),xC(1),hl()),n&2&&(BE(),Fg(t));}function Pt(n,t){if(n&1){let e=Yw();Es(0,"button",57),vg("click",function(){pf(e);let s=eC(2);return hf(s.exportYaml())}),xC(1),hl();}if(n&2){let e=eC(2);dg("disabled",e.isExporting()),BE(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Yw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let s=eC();return hf(s.submit())}),Es(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),MI(),hl(),Es(4,"div",10)(5,"label",11),fg(6,"input",12),MI(),xC(7," Enabled "),hl(),Es(8,"p",13),xC(9,"Disabled agents are excluded from namespace resolution."),hl()(),Es(10,"ds-form-field",14),fg(11,"input",15),MI(),hl(),Es(12,"ds-form-field",16),jw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),hl(),Es(15,"ds-form-field",19),fg(16,"textarea",20),MI(),hl()(),jw(17,gt,5,2,"ds-fieldset",21),Es(18,"ds-fieldset",22)(19,"p",4),xC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Es(21,"code"),xC(22,"readSkill"),hl(),xC(23," and "),Es(24,"code"),xC(25,"readSkillResource"),hl(),xC(26," tools; selecting none grants neither. "),jw(27,pt,1,0),hl(),Es(28,"label",11)(29,"input",23),vg("change",function(){pf(e);let s=eC();return hf(s.toggleAllSkills())}),hl(),Es(30,"span",24),xC(31,"Every skill in the catalogue ("),Es(32,"code",25),xC(33,"*"),hl(),xC(34,")"),hl()(),Es(35,"p",13),xC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),hl(),jw(37,ft,5,0,"ds-notice",26),jw(38,Ct,2,0,"ds-notice"),jw(39,_t,2,0,"p",4)(40,xt,2,0),hl(),Es(41,"ds-form-field",27)(42,"select",28)(43,"option",29),xC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),hl(),Es(45,"option",29),xC(46,"ADVANCED \u2014 Multi-step reasoning loop"),hl(),Es(47,"option",29),xC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),hl()(),MI(),hl(),jw(49,St,7,3,"ds-form-field",30),Es(50,"ds-fieldset",31)(51,"p",4),xC(52," The agents this one may delegate to. Selecting at least one grants it the "),Es(53,"code"),xC(54,"DELEGATE__delegate"),hl(),xC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),jw(56,At,1,0),hl(),Es(57,"label",11)(58,"input",23),vg("change",function(){pf(e);let s=eC();return hf(s.toggleAllSubAgents())}),hl(),Es(59,"span",24),xC(60,"Every agent it can reach ("),Es(61,"code",25),xC(62,"*"),hl(),xC(63,")"),hl()(),Es(64,"p",13),xC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),hl(),jw(66,Et,6,1,"ds-notice",26),jw(67,Tt,2,0,"ds-notice"),jw(68,kt,2,0,"p",4)(69,Dt,2,0),Es(70,"p",4),xC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Es(72,"code"),xC(73,"*Fixer"),hl(),xC(74," to cover BugFixer and StoryFixer. "),hl(),Es(75,"div",32)(76,"input",33),vg("keydown.enter",function(){pf(e);let s=eC();return hf(s.addSubAgent())}),hl(),MI(),Es(77,"button",34),vg("click",function(){pf(e);let s=eC();return hf(s.addSubAgent())}),xC(78," + "),hl()(),Es(79,"ds-form-field",35),fg(80,"input",36),MI(),jw(81,Lt,3,0,"div"),hl()(),jw(82,Vt,2,1,"ds-notice"),Es(83,"ds-form-actions")(84,"button",37),xC(85),hl(),jw(86,Pt,2,2,"button",38),Es(87,"button",39),vg("click",function(){pf(e);let s=eC();return hf(s.cancel())}),xC(88,"Cancel"),hl()()();}if(n&2){let e,i=eC();dg("formGroup",i.form),BE(3),dg("formControl",i.nameControl),xI(),BE(3),dg("formControl",i.enabledControl),xI(),BE(5),dg("formControl",i.descriptionControl),xI(),BE(2),Bw(i.modelAsFreeText()?13:14),BE(3),dg("formControl",i.instructionsControl),xI(),BE(),Bw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),BE(10),Bw(i.isPlatformMode?27:-1),BE(2),dg("checked",i.allSkillsSelected()),BE(8),Bw(i.namedSkillSelectionDropped()?37:-1),BE(),Bw(i.skillCatalogueUnavailable()?38:-1),BE(),Bw(i.skillRows().length===0?39:40),BE(3),dg("formControl",i.executionModeControl),xI(),BE(),dg("value",i.ExecutionMode.SIMPLE),BE(2),dg("value",i.ExecutionMode.ADVANCED),BE(2),dg("value",i.ExecutionMode.LOOP),BE(2),Bw(i.isLoopMode()?49:-1),BE(7),Bw(i.isPlatformMode?56:-1),BE(2),dg("checked",i.allSubAgentsSelected()),BE(8),Bw(i.namedSubAgentSelectionDropped()?66:-1),BE(),Bw(i.subAgentCandidatesUnavailable()?67:-1),BE(),Bw(i.subAgentRows().length===0?68:69),BE(8),dg("formControl",i.newSubAgentControl),xI(),BE(),dg("disabled",!i.newSubAgentControl.value.trim()),BE(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),BE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),xI(),BE(),Bw(i.delegationTimeoutControl.value!==null?81:-1),BE(),Bw((e=i.submitError())?82:-1,e),BE(2),dg("disabled",i.form.invalid||i.isSubmitting()),BE(),Dl(" ",i.isEditMode()?"Save changes":"Create"," "),BE(),Bw(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(K);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:[fn.required,fn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[fn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[fn.min(1),fn.max(2147483647),fn.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=rT(()=>{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=rT(()=>this.executionModeValue()==="LOOP");subAgentRows=$i([]);allSubAgentsSelected=$i(false);subAgentCandidatesUnavailable=$i(false);namedSubAgentSelectionDropped=rT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=rT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=rT(()=>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=qe$1;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=rT(()=>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=rT(()=>{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=rT(()=>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=vw({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()}),xC(3," \u2190 Agent configs "),hl(),jw(4,ze,2,1,"a",2),jw(5,Xe,2,0,"ds-tag",3),hl(),jw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),hl()),e&2&&(BE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),BE(3),Bw(i.isEditMode()?4:-1),BE(),Bw(i.isPlatformMode?5:-1),BE(),Bw(i.isLoading()?6:7));},dependencies:[Ut,nd,bo,xo,Lt$1,kn,vn,Gt,mo,po,$r,qr,Vn,An,$t,pn,hn,cn,ln,dn,mn,at$1,an,rn,ko],encapsulation:2})};export{Ke as AgentConfigFormComponent};
@@ -0,0 +1 @@
1
+ import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-Df9nff1i.js';import {I}from'./chunk-DLa-RTUD.js';import {g,W,q as F,I as we,$ as $i,K as U,ad as ne$1,a1 as ga,aa as br,aL as ui,a2 as ha,ac as by,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,z as DC,l as lg,s as Dl,U as Uw,k as $w,Y as Yw,u as pf,w as hf}from'./main-WGM2SCAZ.js';import {z as k,O,a5 as w,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DU2T72t1.js';import'./chunk-BSwOttIr.js';var Q=(i,t)=>t.key;function X(i,t){if(i&1&&(Es(0,"p",3),xC(1),hl()),i&2){let e=eC();BE(),Fg(e.deletion.error());}}function Z(i,t){if(i&1&&(Es(0,"p"),xC(1),hl()),i&2){let e=t;DC(e.kind==="error"?"settings-table__error":"settings-table__status"),lg("role",e.kind==="error"?"alert":"status"),BE(),Dl(" ",e.text," ");}}function ee(i,t){i&1&&(Es(0,"p",5),xC(1,"Loading auth settings\u2026"),hl());}function te(i,t){i&1&&(Es(0,"p",6),xC(1,"No auth settings available."),hl());}function ne(i,t){i&1&&(Es(0,"p",5),xC(1,"No auth settings match the current filter."),hl());}function ie(i,t){i&1&&(Es(0,"ds-tag",18),xC(1,"Read-only"),hl());}function oe(i,t){i&1&&(Es(0,"ds-tag",20),xC(1,"Connected"),hl());}function ae(i,t){i&1&&(Es(0,"ds-tag",18),xC(1,"Not connected"),hl());}function se(i,t){i&1&&(Es(0,"span",21),xC(1,"\u2014"),hl());}function re(i,t){if(i&1){let e=Yw();Es(0,"span",26),xC(1,"Waiting for authorization\u2026"),hl(),Es(2,"button",27),vg("click",function(){pf(e);let r=eC(4);return hf(r.cancelConnect())}),xC(3," Cancel "),hl();}if(i&2){let e=eC(2).$implicit;BE(2),lg("aria-label","Stop waiting for the authorization of "+e.config.name);}}function le(i,t){if(i&1){let e=Yw();Es(0,"span",28),xC(1,"Disconnect?"),hl(),Es(2,"button",29),vg("click",function(){pf(e);let r=eC(2).$implicit,d=eC(2);return hf(d.confirmReset(r))}),xC(3),hl(),Es(4,"button",29),vg("click",function(){pf(e);let r=eC(4);return hf(r.cancelReset())}),xC(5," Cancel "),hl();}if(i&2){let e=eC(2).$implicit,n=eC(2);BE(2),dg("disabled",n.resettingKey()===e.key),lg("aria-label","Confirm disconnecting "+e.config.name),BE(),Dl(" ",n.resettingKey()===e.key?"Disconnecting\u2026":"Confirm"," "),BE(),dg("disabled",n.resettingKey()===e.key),lg("aria-label","Cancel disconnecting "+e.config.name);}}function ce(i,t){if(i&1){let e=Yw();Es(0,"button",29),vg("click",function(){pf(e);let r=eC(3).$implicit,d=eC(2);return hf(d.requestReset(r))}),xC(1," Disconnect "),hl();}if(i&2){let e=eC(3).$implicit,n=eC(2);dg("disabled",n.connectingKey()!==null),lg("aria-label","Disconnect "+e.config.name);}}function de(i,t){if(i&1){let e=Yw();Es(0,"button",29),vg("click",function(){pf(e);let r=eC(2).$implicit,d=eC(2);return hf(d.connect(r))}),xC(1),hl(),jw(2,ce,2,2,"button",30);}if(i&2){let e=eC(2).$implicit,n=eC(2);dg("disabled",n.connectingKey()!==null||n.resettingKey()!==null),lg("aria-label",(n.connectionOf(e)==="connected"?"Reconnect ":"Connect ")+e.config.name),BE(),Dl(" ",n.connectionOf(e)==="connected"?"Reconnect":"Connect"," "),BE(),Bw(n.connectionOf(e)==="connected"?2:-1);}}function pe(i,t){if(i&1&&jw(0,re,4,1)(1,le,6,5)(2,de,3,4),i&2){let e=eC().$implicit,n=eC(2);Bw(n.connectingKey()===e.key?0:n.resetConfirmingKey()===e.key?1:n.deletion.confirmingId()!==e.key?2:-1);}}function ue(i,t){if(i&1){let e=Yw();Es(0,"button",27),vg("click",function(){pf(e);let r=eC().$implicit,d=eC(2);return hf(d.duplicate(r))}),xC(1," Duplicate "),hl();}if(i&2){let e=eC().$implicit;lg("aria-label","Duplicate "+e.config.name);}}function _e(i,t){if(i&1){let e=Yw();Es(0,"button",27),vg("click",function(){pf(e);let r=eC(2).$implicit,d=eC(2);return hf(d.edit(r))}),xC(1," Edit "),hl();}if(i&2){let e=eC(2).$implicit;lg("aria-label","Edit "+e.config.name);}}function me(i,t){if(i&1){let e=Yw();jw(0,_e,2,1,"button",24),Es(1,"agentos-row-delete-action",31),vg("deleteRequested",function(){pf(e);let r=eC().$implicit,d=eC(2);return hf(d.deletion.request(r.key))})("deleteConfirmed",function(){pf(e);let r=eC().$implicit,d=eC(2);return hf(d.confirmDelete(r))})("deleteCancelled",function(){pf(e);let r=eC(3);return hf(r.deletion.cancel())}),hl();}if(i&2){let e=eC().$implicit,n=eC(2);Bw(n.deletion.confirmingId()!==e.key?0:-1),BE(),dg("rowKey",e.key)("rowLabel",e.config.name)("state",n.deletion);}}function ge(i,t){i&1&&(Es(0,"button",25),xC(1,"Inherited"),hl());}function he(i,t){if(i&1&&(Es(0,"tr",10)(1,"td",13),xC(2),hl(),Es(3,"td",14),xC(4),hl(),Es(5,"td",15)(6,"div",16)(7,"ds-tag",17),xC(8),hl(),jw(9,ie,2,0,"ds-tag",18),hl()(),Es(10,"td",19),jw(11,oe,2,0,"ds-tag",20)(12,ae,2,0,"ds-tag",18)(13,se,2,0,"span",21),hl(),Es(14,"td",22)(15,"div",23),jw(16,pe,3,1),jw(17,ue,2,1,"button",24),jw(18,me,2,4)(19,ge,2,0,"button",25),hl()()()),i&2){let e=t.$implicit,n=eC(2);BE(2),Fg(e.config.name),BE(2),Dl(" ",e.config.authType," "),BE(3),dg("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),BE(),Fg(e.scopeLabel),BE(),Bw(e.canMutate?-1:9),BE(2),Bw(n.isOAuth(e)&&n.connectionOf(e)==="connected"?11:n.isOAuth(e)&&n.connectionOf(e)==="disconnected"?12:13),BE(5),Bw(n.isOAuth(e)?16:-1),BE(),Bw(n.deletion.confirmingId()!==e.key&&n.resetConfirmingKey()!==e.key&&n.connectingKey()!==e.key?17:-1),BE(),Bw(e.canMutate?18:19);}}function Ce(i,t){if(i&1&&(Es(0,"div",7)(1,"table",8)(2,"thead",9)(3,"tr",10)(4,"th",11),xC(5,"Name"),hl(),Es(6,"th",11),xC(7,"Authentication type"),hl(),Es(8,"th",11),xC(9,"Scope"),hl(),Es(10,"th",11),xC(11,"Connection"),hl(),Es(12,"th",11)(13,"span",12),xC(14,"Actions"),hl()()()(),Es(15,"tbody",9),Uw(16,he,20,9,"tr",10,Q),hl()()()),i&2){let e=eC();BE(16),$w(e.rowFilter.filteredRows());}}var fe=new Set(["OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"]),J=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=$i(false);isLoading=$i(true);rows=$i([]);deletion=k();connections=$i({});connectingKey=$i(null);resetConfirmingKey=$i(null);resettingKey=$i(null);actionMessage=$i(null);connectAttempt=null;connectPopup=null;connectionsLoad=null;rowFilter=O(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(ne$1(t=>t.get("namespaceId")??""),ga(t=>t?this.namespaceRole.isAdminOfNamespace$(t):br(false)),U(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false),this.loadConnections();},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}confirmDelete(t){!t.canMutate||!t.config.id||this.deletion.execute(t.key,{request$:this.state.delete(t.config.id,t.scope).pipe(U(this.destroyRef)),errorMessage:`Deleting "${t.config.name}" failed. Try again.`});}isOAuth(t){return fe.has(t.config.authType)}connectionOf(t){return this.connections()[t.key]??"unknown"}connect(t){let e=t.config.id;if(!e||this.connectingKey()||this.resettingKey())return;let n=w();if(!n){this.actionMessage.set({kind:"error",text:"The browser blocked the authorization window. Allow pop-ups for this site and try again."});return}this.actionMessage.set(null),this.resetConfirmingKey.set(null),this.connectPopup=n,this.connectingKey.set(t.key),this.connectAttempt=this.state.connect(e,this.namespaceParam(),r=>n.location.href=r,()=>n.closed).pipe(ui(()=>{this.connectingKey.set(null),this.connectAttempt=null,this.connectPopup=null;}),U(this.destroyRef)).subscribe({next:r=>this.onConnectOutcome(t,r,n),error:()=>{n.close(),this.actionMessage.set({kind:"error",text:`Connecting "${t.config.name}" failed. Check that its OAuth settings are complete, then try again.`});}});}cancelConnect(){this.connectAttempt?.unsubscribe(),this.connectPopup?.close();}requestReset(t){this.resettingKey()||this.connectingKey()||(this.actionMessage.set(null),this.resetConfirmingKey.set(t.key));}cancelReset(){this.resettingKey()||this.resetConfirmingKey.set(null);}confirmReset(t){let e=t.config.id;!e||this.resettingKey()||this.resetConfirmingKey()!==t.key||(this.resettingKey.set(t.key),this.state.resetCredential(e,this.namespaceParam()).pipe(U(this.destroyRef)).subscribe({next:()=>{this.resettingKey.set(null),this.resetConfirmingKey.set(null),this.loadConnections();},error:()=>{this.resettingKey.set(null),this.actionMessage.set({kind:"error",text:`Disconnecting "${t.config.name}" failed. Try again.`});}}));}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}onConnectOutcome(t,e,n){n.close(),this.loadConnections(),e==="abandoned"?this.actionMessage.set({kind:"info",text:`The authorization window was closed before "${t.config.name}" got connected.`}):e==="timeout"&&this.actionMessage.set({kind:"info",text:`No authorization was received for "${t.config.name}" in time. Try again.`});}namespaceParam(){return this.namespaceId||void 0}loadConnections(){this.connectionsLoad?.unsubscribe();let t=this.rows().filter(e=>this.isOAuth(e)&&e.config.id).map(e=>this.state.getConnection(e.config.id,this.namespaceParam()).pipe(ne$1(n=>[e.key,n.connected?"connected":"disconnected"]),ha(()=>br([e.key,"unknown"]))));if(t.length===0){this.connections.set({});return}this.connectionsLoad=by(t).pipe(U(this.destroyRef)).subscribe(e=>this.connections.set(Object.fromEntries(e)));}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,n,r){return t.map((d,Y)=>({key:`${e}:${d.id??Y}`,config:d,scope:e,scopeLabel:n,canMutate:r}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:10,vars:4,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],[3,"class"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Connection"],["variant","accent"],[1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["role","status",1,"settings-table__confirm-label"],["type","button",3,"click"],[1,"settings-table__confirm-label"],["type","button",3,"click","disabled"],["type","button",3,"disabled"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,n){if(e&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(d){return n.rowFilter.query.set(d)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),xC(3,"New auth setting"),hl()(),jw(4,X,2,1,"p",3),jw(5,Z,2,4,"p",4),jw(6,ee,2,0,"p",5)(7,te,2,0,"p",6)(8,ne,2,0,"p",5)(9,Ce,18,0,"div",7)),e&2){let r;BE(),dg("query",n.rowFilter.query()),BE(3),Bw(n.deletion.error()?4:-1),BE(),Bw((r=n.actionMessage())?5:-1,r),BE(),Bw(n.isLoading()?6:n.rows().length===0?7:n.rowFilter.filteredRows().length===0?8:9);}},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{J as AuthSettingsAllScopesComponent};