@whoz-oss/coday-client 0.0.0-workstream-forge.244 → 0.0.0-workstream-messaging.4

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 (96) hide show
  1. package/browser/chunk-B7jX7zgs.js +1 -0
  2. package/browser/chunk-BDVgHP1k.js +1 -0
  3. package/browser/chunk-BITDsEPS.js +1 -0
  4. package/browser/chunk-BMfdBnfJ.js +1 -0
  5. package/browser/chunk-BT-f7pOo.js +1 -0
  6. package/browser/chunk-BUVHuntB.js +2 -0
  7. package/browser/chunk-BeJGuL-w.js +1 -0
  8. package/browser/chunk-BfmxY0U2.js +1 -0
  9. package/browser/chunk-BkHh71pt.js +1 -0
  10. package/browser/chunk-BvRDo1Xd.js +1 -0
  11. package/browser/chunk-BvgKYsgP.js +1 -0
  12. package/browser/chunk-Bvjz4EuH.js +2 -0
  13. package/browser/chunk-C1OYQ9z3.js +1 -0
  14. package/browser/chunk-CCUIsU71.js +1 -0
  15. package/browser/chunk-CCZ1b0na.js +674 -0
  16. package/browser/chunk-CEFBjtqS.js +1 -0
  17. package/browser/chunk-CVAz4Lko.js +1 -0
  18. package/browser/chunk-CYowS7ps.js +1 -0
  19. package/browser/{chunk-WwdM1pqC.js → chunk-C_m8f_OQ.js} +1 -1
  20. package/browser/chunk-CaLaUzUo.js +1 -0
  21. package/browser/chunk-CasQE1P8.js +1 -0
  22. package/browser/chunk-CfeR-40i.js +1 -0
  23. package/browser/chunk-Cvh22V1I.js +1 -0
  24. package/browser/{chunk-CfifMtwC.js → chunk-D6na643q.js} +1 -1
  25. package/browser/chunk-D7cDcWU_.js +1 -0
  26. package/browser/chunk-DJYg-Uvg.js +2 -0
  27. package/browser/chunk-DQEn5_2f.js +1 -0
  28. package/browser/chunk-DQRocvRJ.js +1 -0
  29. package/browser/chunk-DSeOF-b7.js +1 -0
  30. package/browser/chunk-DdcAhCFt.js +1 -0
  31. package/browser/chunk-Df_pypwY.js +1 -0
  32. package/browser/chunk-DloTeM9a.js +1 -0
  33. package/browser/chunk-DqQwkTmj.js +1 -0
  34. package/browser/chunk-Dyc4B4N5.js +1 -0
  35. package/browser/chunk-DyrGPeSh.js +1 -0
  36. package/browser/chunk-DzlYU9Mb.js +1 -0
  37. package/browser/{chunk-zfSbYfDB.js → chunk-Jcjs0qUP.js} +1 -1
  38. package/browser/chunk-L1iy-QYW.js +1 -0
  39. package/browser/chunk-MmNnob5o.js +1 -0
  40. package/browser/chunk-OGl61xgu.js +1 -0
  41. package/browser/chunk-XCYDtfAr.js +1 -0
  42. package/browser/chunk-YazOGc5y.js +1 -0
  43. package/browser/chunk-_4rWzEoG.js +1 -0
  44. package/browser/chunk-cAmP4Ess.js +1 -0
  45. package/browser/chunk-go60iT_m.js +1 -0
  46. package/browser/chunk-m2Qa9RC5.js +1 -0
  47. package/browser/chunk-ns52VA45.js +1 -0
  48. package/browser/chunk-tHzqEHGj.js +1 -0
  49. package/browser/chunk-xMNw9k_r.js +1 -0
  50. package/browser/index.html +1 -1
  51. package/browser/main-63IEQS3X.js +1254 -0
  52. package/package.json +1 -1
  53. package/browser/chunk-8SxX32rO.js +0 -1
  54. package/browser/chunk-B6rPUjlK.js +0 -1
  55. package/browser/chunk-BH7OLSx0.js +0 -1
  56. package/browser/chunk-BKnj9uiw.js +0 -1
  57. package/browser/chunk-BLR-ZTHh.js +0 -1
  58. package/browser/chunk-BMpFwNrL.js +0 -1
  59. package/browser/chunk-BbYQjxBb.js +0 -2
  60. package/browser/chunk-Bo2-yEbp.js +0 -1
  61. package/browser/chunk-BwqiXXvR.js +0 -1
  62. package/browser/chunk-Bz9_W213.js +0 -1
  63. package/browser/chunk-C1CvCiQs.js +0 -1
  64. package/browser/chunk-C2LkuBYd.js +0 -1
  65. package/browser/chunk-C3AaPoyZ.js +0 -1
  66. package/browser/chunk-C4CyLTkA.js +0 -2
  67. package/browser/chunk-C8Q6ccMm.js +0 -1
  68. package/browser/chunk-CBtsWofj.js +0 -1
  69. package/browser/chunk-CNBrzP9I.js +0 -1
  70. package/browser/chunk-CTrUVP-N.js +0 -1
  71. package/browser/chunk-CX2oEBf9.js +0 -1
  72. package/browser/chunk-C_TR3rI-.js +0 -1
  73. package/browser/chunk-CcI4CWl6.js +0 -1
  74. package/browser/chunk-CoWzfbqL.js +0 -1
  75. package/browser/chunk-CyIUjRWT.js +0 -1
  76. package/browser/chunk-D0jMQDes.js +0 -1
  77. package/browser/chunk-D8BMEvrt.js +0 -1
  78. package/browser/chunk-DAiaXy53.js +0 -1
  79. package/browser/chunk-DNefc5l8.js +0 -1
  80. package/browser/chunk-DV5IlfBq.js +0 -1
  81. package/browser/chunk-DbN0_APN.js +0 -1
  82. package/browser/chunk-DlJR_onX.js +0 -1
  83. package/browser/chunk-DtJYpVtU.js +0 -2
  84. package/browser/chunk-DwXfEpcA.js +0 -1
  85. package/browser/chunk-E81L_Bla.js +0 -1
  86. package/browser/chunk-GUDFMaEy.js +0 -1
  87. package/browser/chunk-GaJWiH82.js +0 -1
  88. package/browser/chunk-MZXI10vX.js +0 -1
  89. package/browser/chunk-RGb_eFD5.js +0 -1
  90. package/browser/chunk-Uf57QzfJ.js +0 -674
  91. package/browser/chunk-cIF5t9Db.js +0 -1
  92. package/browser/chunk-dgHw3CIi.js +0 -1
  93. package/browser/chunk-kO5zS3K9.js +0 -1
  94. package/browser/chunk-mgh7hiln.js +0 -1
  95. package/browser/chunk-ogAJa2CM.js +0 -1
  96. package/browser/main-DYDARBQQ.js +0 -1253
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "0.0.0-workstream-forge.244",
3
+ "version": "0.0.0-workstream-messaging.4",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- import {O as O$1}from'./chunk-C_TR3rI-.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-DYDARBQQ.js';import {z as k,j as O$2,e as at,c as fn,k as ko,P,B as P$1}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.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,fn,ko,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
@@ -1 +0,0 @@
1
- import {b as hn,c as fn,r as rn,D as pn,e as at,n as ln,J as Pi,K as On}from'./chunk-Uf57QzfJ.js';import {g,W as W$1,q as F,I as we,ag as U,$ as $i,r as rT,K as U$1,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,F as Fg,M as Mg,s as Dl,U as Uw,k as $w,Y as Yw,f as fg,av as YC,aw as KC,u as pf,w as hf,ax as YD}from'./main-DYDARBQQ.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Es(0,"p",3),xC(1,"Loading\u2026"),hl());}function Q(t,n){t&1&&(Es(0,"ds-notice"),xC(1,"Failed to load agent definition."),hl());}function W(t,n){if(t&1&&(Es(0,"dt"),xC(1,"User context"),hl(),Es(2,"dd",6),xC(3),hl()),t&2){let e=eC();BE(3),Fg(e.userId);}}function X(t,n){if(t&1){let e=Yw();Es(0,"ds-card")(1,"ds-disclosure",12),vg("toggled",function(){pf(e);let m=eC(2);return hf(m.toggleSystemPrompt())}),Es(2,"pre",13),xC(3),hl()()();}if(t&2){let e=eC(),r=eC();BE(),dg("open",!r.systemPromptCollapsed()),BE(2),Fg(e.systemPrompt);}}function Y(t,n){if(t&1){let e=Yw();Es(0,"ds-card")(1,"ds-disclosure",14),vg("toggled",function(){pf(e);let m=eC(2);return hf(m.toggleInstructions())}),Es(2,"pre",13),xC(3),hl()()();}if(t&2){let e=eC(),r=eC();BE(),dg("open",!r.instructionsCollapsed()),BE(2),Fg(e.instructions);}}function Z(t,n){t&1&&(Es(0,"p",3),xC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),hl());}function ee(t,n){t&1&&(Es(0,"span",17),xC(1,"platform"),hl());}function te(t,n){t&1&&(Es(0,"span",17),xC(1,"SKILL.md"),hl());}function ne(t,n){if(t&1&&(Es(0,"li",15)(1,"span")(2,"span",16),xC(3),hl(),jw(4,ee,2,0,"span",17),jw(5,te,2,0,"span",17),hl(),Es(6,"p",3),xC(7),hl()()),t&2){let e=n.$implicit;BE(3),Fg(e.name),BE(),Bw(e.namespaceId?-1:4),BE(),Bw(e.readOnly?5:-1),BE(2),Fg(e.description);}}function ie(t,n){if(t&1&&(Es(0,"ul",11),Uw(1,ne,8,4,"li",15,j),hl()),t&2){let e=eC(2);BE(),$w(e.resolvedSkills());}}function oe(t,n){t&1&&(Es(0,"p",3),xC(1,"No tools available for this agent."),hl());}function ae(t,n){if(t&1&&(fg(0,"div",19),YC(1,"agentosMarkdown")),t&2){let e=eC().$implicit;dg("innerHTML",KC(1,1,e.description),YD);}}function de(t,n){if(t&1){let e=Yw();Es(0,"li")(1,"ds-disclosure",18),vg("toggled",function(){let m=pf(e).$implicit,U=eC(3);return hf(U.toggleTool(m))}),jw(2,ae,2,3,"div",19),Es(3,"pre",20),xC(4),hl()()();}if(t&2){let e=n.$implicit,r=eC(3);BE(),dg("heading",e.name)("open",r.isToolExpanded(e)),BE(),Bw(e.description?2:-1),BE(2),Fg(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Es(0,"ul",11),Uw(1,de,5,4,"li",null,z),hl()),t&2){let e=eC();BE(),$w(e.tools);}}function se(t,n){if(t&1&&(Es(0,"ds-card",4)(1,"dl",5)(2,"dt"),xC(3,"Name"),hl(),Es(4,"dd"),xC(5),hl(),Es(6,"dt"),xC(7,"Resolved model"),hl(),Es(8,"dd",6),xC(9),hl(),Es(10,"dt"),xC(11,"Provider"),hl(),Es(12,"dd"),xC(13),hl(),Es(14,"dt",7),xC(15,"Execution mode"),hl(),Es(16,"dd",8)(17,"span",9),xC(18),hl()(),jw(19,W,4,1),hl()(),jw(20,X,4,2,"ds-card"),jw(21,Y,4,2,"ds-card"),Es(22,"ds-card",10),jw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),hl(),Es(25,"ds-card",10),jw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),hl()),t&2){let e=n,r=eC();BE(5),Fg(e.name),BE(4),Fg(e.resolvedModelApiName),BE(4),Fg(e.resolvedProviderName),BE(4),Mg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),BE(),Dl(" ",e.executionMode," "),BE(),Bw(e.userId?19:-1),BE(),Bw(e.systemPrompt?20:-1),BE(),Bw(e.instructions?21:-1),BE(),dg("heading","Skills ("+r.resolvedSkills().length+")"),BE(),Bw(r.resolvedSkills().length===0?23:24),BE(2),dg("heading","Tools ("+e.tools.length+")"),BE(),Bw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);definition=$i(null);expandedTools=$i(new Set);resolvedSkills=rT(()=>this.definition()?.skills??[]);systemPromptCollapsed=$i(true);instructionsCollapsed=$i(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let r=new Set(e);return r.has(n.name)?r.delete(n.name):r.add(n.name),r});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=vw({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,r){if(e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return r.back()}),xC(3," \u2190 Agent configs "),hl(),Es(4,"a",2),xC(5,"Edit config \u2192"),hl()(),jw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),hl()),e&2){let m;BE(4),dg("routerLink",r.editRoute()),BE(2),Bw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Pi,On],encapsulation:2})};export{K as AgentConfigInspectComponent};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-zfSbYfDB.js';import {I as s,z as k,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-Uf57QzfJ.js';import {g,W,q as F,I as we,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,ad as ne$1,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,as as Pg,Y as Yw,u as pf,w as hf,l as lg}from'./main-DYDARBQQ.js';var Y=(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 ee(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading skills\u2026"),hl());}function te(n,e){n&1&&(Es(0,"p",5),xC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),hl());}function ne(n,e){n&1&&(Es(0,"p",4),xC(1,"No skills match the current filter."),hl());}function ie(n,e){if(n&1&&(Es(0,"span",14),xC(1),hl()),n&2){let t=eC().$implicit;BE(),Pg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Es(0,"ds-tag",20),xC(1,"Read-only"),hl());}function oe(n,e){n&1&&(Es(0,"ds-tag",21),xC(1,"SKILL.md"),hl());}function le(n,e){if(n&1){let t=Yw();Es(0,"button",25),vg("click",function(){pf(t);let d=eC(2).$implicit,c=eC(2);return hf(c.edit(d))}),xC(1,"Edit"),hl();}if(n&2){let t=eC(2).$implicit;lg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=Yw();Es(0,"button",25),vg("click",function(){pf(t);let d=eC().$implicit,c=eC(2);return hf(c.inspect(d))}),xC(1," View "),hl(),jw(2,le,2,1,"button",26);}if(n&2){let t=eC().$implicit,a=eC(2);lg("aria-label","View "+t.skill.name),BE(2),Bw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=Yw();Es(0,"agentos-row-delete-action",27),vg("deleteRequested",function(){pf(t);let d=eC().$implicit,c=eC(2);return hf(c.requestDelete(d))})("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.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),xC(3),hl(),jw(4,ie,2,2,"span",14),hl(),Es(5,"td",15),xC(6),hl(),Es(7,"td",16),xC(8),hl(),Es(9,"td",17)(10,"div",18)(11,"ds-tag",19),xC(12),hl(),jw(13,ae,2,0,"ds-tag",20),jw(14,oe,2,0,"ds-tag",21),hl()(),Es(15,"td",22)(16,"div",23),jw(17,re,3,2),jw(18,se,1,3,"agentos-row-delete-action",24),hl()()()),n&2){let t=e.$implicit,a=eC(2);BE(3),Fg(t.skill.name),BE(),Bw(t.namedByAgents>0?4:-1),BE(2),Dl(" ",t.skill.description||"\u2014"," "),BE(2),Fg(a.resourceCount(t.skill)),BE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),BE(),Fg(t.scope==="platform"?"Platform":"Namespace"),BE(),Bw(t.scope==="platform"?13:-1),BE(),Bw(t.skill.readOnly?14:-1),BE(3),Bw(a.deletion.confirmingId()!==t.key?17:-1),BE(),Bw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10),xC(9,"Resources"),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,ce,19,10,"tr",9,Y),hl()()()),n&2){let t=eC();BE(16),$w(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({platform:this.skillState.listPlatform().pipe(ha(()=>br([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),ha(()=>br([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=vw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),xC(3,"New skill"),hl()(),jw(4,Z,2,1,"p",3),jw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(BE(),dg("query",a.rowFilter.query()),BE(3),Bw(a.deletion.error()?4:-1),BE(),Bw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-zfSbYfDB.js';import {I as s,b as hn,c as fn,r as rn,D as pn,e as at,n as ln,l as Fo,J as Pi,K as On}from'./chunk-Uf57QzfJ.js';import {g,W,q as F,I as we,$ as $i,r as rT,K as U,ac as by,a2 as ha,aa as br,v as vw,au as $t,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,c as Bw,t as eC,P as dg,Y as Yw,f as fg,av as YC,F as Fg,s as Dl,aw as KC,U as Uw,k as $w,ao as Hw,u as pf,w as hf,ax as YD}from'./main-DYDARBQQ.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Es(0,"a",2),xC(1,"Edit skill \u2192"),hl()),e&2){let n=eC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Es(0,"ds-tag",3),xC(1,"Platform level"),hl());}function te(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function ne(e,t){e&1&&(Es(0,"ds-notice"),xC(1,"Failed to load skill."),hl());}function ie(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Created by"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Last updated"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(jw(0,ie,4,1),jw(1,oe,4,1)),e&2){let n=eC();Bw(n.createdBy?0:-1),BE(),Bw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Es(0,"p",4),xC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),hl());}function se(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function re(e,t){e&1&&(Es(0,"ds-notice"),xC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),hl());}function de(e,t){e&1&&(Es(0,"p",4),xC(1,"No agent references this skill."),hl());}function ce(e,t){e&1&&(Es(0,"ds-tag",15),xC(1,"platform agent"),hl());}function me(e,t){e&1&&(Es(0,"ds-tag",15),xC(1,"via *"),hl());}function pe(e,t){if(e&1&&(Es(0,"li",13)(1,"span",14),xC(2),hl(),jw(3,ce,2,0,"ds-tag",15),jw(4,me,2,0,"ds-tag",15),hl()),e&2){let n=t.$implicit;BE(2),Fg(n.name),BE(),Bw(n.platform?3:-1),BE(),Bw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Es(0,"ul",12),Uw(1,pe,5,3,"li",13,Y),hl(),Es(3,"p",4),xC(4," An agent listed "),Es(5,"code"),xC(6,"via *"),hl(),xC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),hl()),e&2){let n=eC(2);BE(),$w(n.consumers());}}function _e(e,t){e&1&&(Es(0,"p",4),xC(1,"No resources bundled with this skill."),hl());}function ge(e,t){if(e&1){let n=Yw();Es(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=pf(n).$implicit,g=eC(3);return hf(g.toggleResource(r))}),Es(2,"pre",17),xC(3),hl()()();}if(e&2){let n=t.$implicit,o=eC(3);BE(),dg("heading",n)("open",o.isResourceExpanded(n)),BE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Es(0,"ul",12),Uw(1,ge,4,3,"li",null,Hw),hl()),e&2){let n=eC(2);BE(),$w(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Yw();Es(0,"ds-card",5)(1,"dl",6)(2,"dt"),xC(3,"Name"),hl(),Es(4,"dd",7),xC(5),hl(),Es(6,"dt"),xC(7,"Description"),hl(),Es(8,"dd"),xC(9),hl(),Es(10,"dt"),xC(11,"Scope"),hl(),Es(12,"dd"),xC(13),hl(),Es(14,"dt"),xC(15,"Storage"),hl(),Es(16,"dd")(17,"ds-tag",8),xC(18),hl()(),jw(19,ae,2,2),hl()(),Es(20,"ds-card",9),jw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),hl(),Es(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){pf(n);let r=eC();return hf(r.toggleBody())}),fg(28,"div",11),YC(29,"agentosMarkdown"),hl()(),Es(30,"ds-card",9),jw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),hl();}if(e&2){let n=t,o=eC();BE(5),Fg(n.name),BE(4),Fg(n.description),BE(4),Fg(n.namespaceId?"Namespace":"Platform"),BE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),BE(),Dl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),BE(),Bw(o.isFilesystemBacked()?-1:19),BE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),BE(),Bw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),BE(6),dg("open",!o.bodyCollapsed()),BE(),dg("innerHTML",KC(29,12,n.body),YD),BE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),BE(),Bw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);skill=$i(null);bodyCollapsed=$i(false);expandedResources=$i(new Set);resourcePaths=rT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=rT(()=>this.skill()?.readOnly===true);consumers=$i([]);consumersUnavailable=$i(false);consumersLoading=$i(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=vw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),xC(3,"\u2190 Skills"),hl(),jw(4,Z,2,1,"a",2),jw(5,ee,2,0,"ds-tag",3),hl(),jw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),hl()),n&2){let r;BE(4),Bw(o.skill()&&!o.isFilesystemBacked()?4:-1),BE(),Bw(o.isPlatformMode?5:-1),BE(),Bw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Fo,Pi,On],encapsulation:2})};export{X as SkillInspectComponent};
@@ -1 +0,0 @@
1
- import {z as k,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-Uf57QzfJ.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-DYDARBQQ.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,fn,ko,Fo,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-WwdM1pqC.js';import {p as pt,T as Te$1,g as gn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,v as yn,U as Ut,a as po,h as ho,Z as Zr,A as An,O as On,b as hn,c as fn,u as un,o as dn,d as cn,D as pn,e as at,i as sn,t as an}from'./chunk-Uf57QzfJ.js';import {g,W,q as F,I as we$1,ag as U,ah as ke$1,ai as Ne$1,$ as $i,aj as Fe$1,a9 as F$1,ak as yd,r as rT,ac as by,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,t as eC,S as xI,k as $w,F as Fg,u as pf,w as hf,y as sh}from'./main-DYDARBQQ.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function _e(n,t){if(n&1&&(Es(0,"ds-form-field",9),fg(1,"input",38),hl()),n&2){let e=eC(2);BE(),dg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Es(0,"a",39),xC(1,"Add an agent config"),hl(),xC(2," first. ")),n&2){let e=eC(3);dg("href","/agentos/"+e.namespaceId+"/agent-configs/new",sh);}}function xe(n,t){if(n&1&&(Es(0,"ds-form-field",10)(1,"p",2),xC(2," No agent configs available in this scope yet. "),jw(3,Se,3,1),hl()()),n&2){let e=eC(2);BE(3),Bw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.id),BE(),Fg(e.name);}}function De(n,t){if(n&1&&(Es(0,"ds-form-field",11)(1,"select",40)(2,"option",41),xC(3,"Select an agent config\u2026"),hl(),Uw(4,Ee,2,2,"option",17,ve),hl(),MI(),hl()),n&2){let e=eC(2);dg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),BE(),dg("formControl",e.agentConfigIdControl),xI(),BE(3),$w(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function Ne(n,t){if(n&1){let e=Yw();Es(0,"label",31)(1,"input",43),vg("change",function(){let f=pf(e).$implicit,h=eC(3);return hf(h.toggleDay(f.value))}),hl(),xC(2),hl();}if(n&2){let e=t.$implicit,l=eC(3);BE(),dg("checked",l.isDaySelected(e.value)),BE(),Dl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Es(0,"ds-form-field",18)(1,"div",42),Uw(2,Ne,3,2,"label",31,V),hl()()),n&2){let e=eC(2);BE(2),$w(e.dayOptions);}}function Me(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function Pe(n,t){if(n&1&&(Es(0,"ds-form-field",28),fg(1,"input",44),MI(),hl()),n&2){let e=eC(2);dg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),BE(),dg("formControl",e.endDateControl),xI();}}function we(n,t){if(n&1&&(Es(0,"ds-form-field",29),fg(1,"input",45),MI(),hl()),n&2){let e=eC(2);dg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),BE(),dg("formControl",e.occurrenceCountControl),xI();}}function Fe(n,t){if(n&1&&(Es(0,"ds-notice"),xC(1),hl()),n&2){let e=eC(2);BE(),Fg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let f=eC();return hf(f.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,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Es(8,"ds-form-field",12),fg(9,"textarea",13),MI(),hl(),Es(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Uw(13,Te,2,2,"option",17,V),hl(),MI(),hl(),jw(15,Ie,4,0,"ds-form-field",18),Es(16,"ds-form-field",19)(17,"div",20),fg(18,"input",21),MI(),Es(19,"span",22),xC(20,"UTC"),hl()()()(),Es(21,"ds-fieldset",23)(22,"ds-form-field",24),fg(23,"input",25),MI(),hl(),Es(24,"ds-form-field",26)(25,"select",27),Uw(26,Me,2,2,"option",17,V),hl(),MI(),hl(),jw(28,Pe,2,2,"ds-form-field",28),jw(29,we,2,2,"ds-form-field",29),hl(),Es(30,"div",30)(31,"label",31),fg(32,"input",32),MI(),xC(33," Enabled "),hl(),Es(34,"p",33),xC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),hl()(),Es(36,"ds-form-field",34),fg(37,"textarea",35),MI(),hl(),jw(38,Fe,2,1,"ds-notice"),Es(39,"ds-form-actions")(40,"button",36),xC(41),hl(),Es(42,"button",37),vg("click",function(){pf(e);let f=eC();return hf(f.cancel())}),xC(43,"Cancel"),hl()()();}if(n&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.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),BE(3),dg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),BE(),dg("formControl",e.promptContentControl),xI(),BE(3),dg("formControl",e.unitControl),xI(),BE(),$w(e.schedulerUnits),BE(2),Bw(e.showDayFilter()?15:-1),BE(),dg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),BE(2),dg("formControl",e.timeUtcControl),xI(),BE(4),dg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),BE(),dg("formControl",e.startDateControl),xI(),BE(2),dg("formControl",e.endTypeControl),xI(),BE(),$w(e.endTypes),BE(2),Bw(e.showEndDate()?28:-1),BE(),Bw(e.showOccurrenceCount()?29:-1),BE(3),dg("formControl",e.enabledControl),xI(),BE(4),dg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),BE(),dg("formControl",e.externalMetadataJsonControl),xI(),BE(),Bw(e.errorMessage()?38:-1),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[gn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[gn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[gn.required]}),unit:new Te$1(Ne$1.WEEK,{nonNullable:true,validators:[gn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[gn.required,gn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[gn.required]}),endType:new Te$1(ke$1.NEVER,{nonNullable:true,validators:[gn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);errorMessage=$i(null);SchedulerUnit=Ne$1;SchedulerEndType=ke$1;schedulerUnits=[{value:Ne$1.WEEK,label:"Week(s)"},{value:Ne$1.MONTH,label:"Month(s)"}];endTypes=[{value:ke$1.NEVER,label:"Never"},{value:ke$1.ON_DATE,label:"On date"},{value:ke$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Fe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(yd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(yd(this.endTypeControl.value)));showDayFilter=rT(()=>this.unitSignal()===Ne$1.WEEK);showEndDate=rT(()=>this.endTypeSignal()===ke$1.ON_DATE);showOccurrenceCount=rT(()=>this.endTypeSignal()===ke$1.OCCURRENCES);agentConfigs=$i([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),by({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ha(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===ke$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ke$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=vw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return l.cancel()}),xC(3),hl()(),jw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),hl()),e&2&&(BE(),dg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),BE(2),Dl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),BE(),Bw(l.isLoading()?4:5));},dependencies:[qt,md,Co,Mo,Ht,Fn,yn,Ut,po,ho,Zr,An,On,hn,fn,un,dn,cn,pn,at,sn,an],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ke$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ke$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
@@ -1,2 +0,0 @@
1
- import {I}from'./chunk-DbN0_APN.js';import {g,W,aW as L,I as we,$ as $i,r as rT,aX as Be,ac as by,K as U,a2 as ha,aa as br,v as vw,E as Es,f as fg,j as jw,a as hl,Q as vg,b as BE,c as Bw,P as dg,x as xC,Y as Yw,R as MI,U as Uw,t as eC,S as xI,k as $w,s as Dl,as as Pg,u as pf,w as hf,F as Fg}from'./main-DYDARBQQ.js';import {a6 as pd,C as Co,M as Mo,H as Ht,v as yn,U as Ut,a as po,a8 as fa,ac as Ri,b as hn,c as fn,u as un,o as dn,d as cn,D as pn,e as at,i as sn,t as an}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Es(0,"p",1),xC(1,"Loading\u2026"),hl());}function se(i,t){if(i&1&&(Es(0,"ds-notice"),xC(1),hl()),i&2){let e=eC(2);BE(),Fg(e.errorMessage());}}function re(i,t){if(i&1){let e=Yw();Es(0,"div")(1,"button",23),vg("click",function(){pf(e);let s=eC(2);return hf(s.retryLoad())}),xC(2,"Retry loading"),hl()();}}function ce(i,t){if(i&1&&(fg(0,"br"),xC(1)),i&2){let e=eC(3);BE(),Dl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Es(0,"ds-notice",3),xC(1),jw(2,ce,2,1),hl()),i&2){let e=eC(2);dg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),BE(),Dl(" Repository: ",e.checkoutStatus()," "),BE(),Bw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Es(0,"option",12),xC(1),hl()),i&2){let e=t.$implicit,c=eC(2);dg("value",e.id),BE(),Pg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Es(0,"p",13),xC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),hl());}function pe(i,t){if(i&1){let e=Yw();Es(0,"button",24),vg("click",function(){pf(e);let s=eC(2);return hf(s.remove())}),xC(1," Remove association "),hl();}if(i&2){let e=eC(2);dg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Yw();jw(0,se,2,1,"ds-notice"),jw(1,re,3,0,"div"),jw(2,de,3,3,"ds-notice",3),Es(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),vg("ngModelChange",function(s){pf(e);let u=eC();return hf(u.repositoryUrl.set(s))}),hl(),MI(),hl(),Es(6,"ds-form-field",7)(7,"input",8),vg("ngModelChange",function(s){pf(e);let u=eC();return hf(u.mainBranch.set(s))}),hl(),MI(),hl(),Es(8,"ds-form-field",9)(9,"select",10),vg("ngModelChange",function(s){pf(e);let u=eC();return hf(u.serviceAuthSettingId.set(s))}),Es(10,"option",11),xC(11,"Select an auth setting\u2026"),hl(),Uw(12,le,2,3,"option",12,oe),hl(),MI(),jw(14,me,2,0,"p",13),hl()(),Es(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),vg("ngModelChange",function(s){pf(e);let u=eC();return hf(u.autoWorktree.set(s))}),hl(),MI(),xC(19," Offer a worktree to every new top-level case "),hl(),Es(20,"p",18),xC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),hl()(),Es(22,"ds-form-field",19)(23,"input",20),vg("ngModelChange",function(s){pf(e);let u=eC();return hf(u.setupCommand.set(s))}),hl(),MI(),Es(24,"p",13),xC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),hl()()(),Es(26,"ds-form-actions")(27,"button",21),vg("click",function(){pf(e);let s=eC();return hf(s.save())}),xC(28),hl(),jw(29,pe,2,1,"button",22),hl();}if(i&2){let e=eC();Bw(e.errorMessage()?0:-1),BE(),Bw(e.associationLoaded()?-1:1),BE(),Bw(e.isAssociated()&&e.checkoutStatus()?2:-1),BE(),dg("disabled",!e.associationLoaded()||e.isSaving()),BE(2),dg("ngModel",e.repositoryUrl()),xI(),BE(2),dg("ngModel",e.mainBranch()),xI(),BE(2),dg("ngModel",e.serviceAuthSettingId()),xI(),BE(3),$w(e.eligibleAuthSettings()),BE(2),Bw(e.eligibleAuthSettings().length===0?14:-1),BE(),dg("disabled",!e.associationLoaded()||e.isSaving()),BE(3),dg("ngModel",e.autoWorktree()),xI(),BE(5),dg("ngModel",e.setupCommand()),xI(),BE(4),dg("disabled",!e.canSave()),BE(),Dl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),BE(),Bw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=$i(true);isSaving=$i(false);confirmingRemove=$i(false);associationLoaded=$i(false);errorMessage=$i(null);association=$i(null);authSettings=$i([]);repositoryUrl=$i("");mainBranch=$i("main");serviceAuthSettingId=$i("");autoWorktree=$i(false);setupCommand=$i("");namespaceId="";isAssociated=rT(()=>this.association()?.associated===true);eligibleAuthSettings=rT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=rT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=rT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Be;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),by({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ha(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),jw(2,ae,2,0,"p",1)(3,ue,30,14),hl(),Es(4,"ds-confirm-dialog",2),vg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),hl()),e&2&&(BE(2),Bw(c.isLoading()?2:3),BE(2),dg("open",c.confirmingRemove()));},dependencies:[pd,Co,Mo,Ht,yn,Ut,po,fa,Ri,hn,fn,un,dn,cn,pn,at,sn,an],encapsulation:2})};
2
- export{ne as NamespaceGitComponent};
@@ -1 +0,0 @@
1
- import {y,p as pt,T as Te,g as gn,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,a as po,h as ho,O as On,w as wa,b as hn,c as fn,u as un,d as cn,r as rn,e as at,i as sn,n as ln,l as Fo}from'./chunk-Uf57QzfJ.js';import {g,I as we,W,H as J,$ as $i,K as U,v as vw,E as Es,f as fg,Q as vg,j as jw,a as hl,R as MI,x as xC,b as BE,P as dg,c as Bw,S as xI,s as Dl,a4 as je,a5 as vd,a6 as x,t as eC,Y as Yw,F as Fg,a7 as Fn,u as pf,w as hf,U as Uw,k as $w}from'./main-DYDARBQQ.js';var I=class e{api=g(je);isLoading=$i(false);result=$i(null);errorMessage=$i(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(vd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Fn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Es(0,"p",14),xC(1,"Loading namespaces\u2026"),hl());}function pe(e,t){if(e&1&&(Es(0,"option",17),xC(1),hl()),e&2){let n=t.$implicit;dg("value",n.id),BE(),Fg(n.name);}}function ce(e,t){if(e&1&&(Es(0,"select",15)(1,"option",16),xC(2,"Select a namespace"),hl(),Uw(3,pe,2,2,"option",17,de),hl(),MI()),e&2){let n=eC(2);xI(),BE(3),$w(n.namespaces());}}function ue(e,t){if(e&1&&jw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=eC();Bw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&fg(0,"input",3),e&2){let n=eC();dg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Yw();Es(0,"button",18),vg("click",function(){pf(n);let l=eC();return hf(l.reset())}),xC(1,"Clear result"),hl();}}function ve(e,t){e&1&&(Es(0,"ds-card",12)(1,"pre",19),xC(2),hl()()),e&2&&(BE(2),Fg(t));}function ye(e,t){e&1&&(Es(0,"span",21),xC(1,"Metadata"),hl(),Es(2,"pre",19),xC(3),hl()),e&2&&(BE(3),Fg(t));}function Ce(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Type"),hl(),Es(2,"dd",23),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.errorType);}}function _e(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Message"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.errorMessage);}}function be(e,t){if(e&1&&(Es(0,"span",21),xC(1,"Tool error details"),hl(),Es(2,"dl",22),jw(3,Ce,4,1),jw(4,_e,4,1),hl()),e&2){let n=eC();BE(3),Bw(n.errorType?3:-1),BE(),Bw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Es(0,"ds-card",13)(1,"div")(2,"ds-tag",20),xC(3),hl()(),Es(4,"span",21),xC(5,"Output"),hl(),Es(6,"pre",19),xC(7),hl(),jw(8,ye,4,1),Es(9,"span",21),xC(10,"Structured output"),hl(),Es(11,"pre",19),xC(12),hl(),jw(13,be,5,2),hl()),e&2){let n,o=t,l=eC();dg("heading","Result \u2014 "+o.toolName),BE(2),dg("variant",o.success?"accent":"outline"),BE(),Fg(o.success?"Success":"Tool error"),BE(4),Fg(o.output),BE(),Bw((n=l.formatMetadata(o.metadata))?8:-1,n),BE(4),Fg(l.formatStructuredOutput(o.structuredOutput)??"null"),BE(),Bw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=$i([]);namespacesLoading=$i(true);namespaceName=$i(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[gn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[gn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=vw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),Es(2,"form",1),vg("ngSubmit",function(){return o.submit()}),Es(3,"ds-form-field",2),jw(4,ue,2,1)(5,fe,1,1,"input",3),hl(),Es(6,"ds-form-field",4),fg(7,"input",5),MI(),hl(),Es(8,"ds-form-field",6),fg(9,"input",7),MI(),hl(),Es(10,"ds-form-field",8),fg(11,"textarea",9),MI(),hl(),Es(12,"ds-form-actions")(13,"button",10),xC(14),hl(),jw(15,ge,2,0,"button",11),hl()(),jw(16,ve,3,1,"ds-card",12),jw(17,he,14,7,"ds-card",13),hl()),n&2){let l,v;BE(),dg("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),BE(),dg("formGroup",o.form),BE(2),Bw(o.isPlatformMode?4:5),BE(3),xI(),BE(2),xI(),BE(2),xI(),BE(2),dg("disabled",o.form.invalid||o.state.isLoading()),BE(),Dl(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),BE(),Bw(o.state.result()||o.state.errorMessage()?15:-1),BE(),Bw((l=o.state.errorMessage())?16:-1,l),BE(),Bw((v=o.state.result())?17:-1,v);}},dependencies:[qt,md,Co,Mo,Ht,Ut,po,ho,On,wa,hn,fn,un,cn,rn,at,sn,ln,Fo],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -1 +0,0 @@
1
- import {O}from'./chunk-dgHw3CIi.js';import {v}from'./chunk-D8BMEvrt.js';import {g,W,q as F,I as we,$ as $i,a9 as F$1,an as Me,O as Of,K as U,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,am as Vw,t as eC,S as xI,k as $w,s as Dl,ae as Pw,F as Fg,u as pf,w as hf}from'./main-DYDARBQQ.js';import {p as pt,L as Lt,T as Te,g as gn,b as hn,c as fn,u as un,o as dn,d as cn,e as at,i as sn,t as an,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,x as ya,a as po,h as ho,A as An,O as On,w as wa,_ as _o,G as vo}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.js';function ge(o,t){o&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function be(o,t){if(o&1&&(Es(0,"label",23),fg(1,"input",24),MI(),xC(2),hl()),o&2){let e=t.$implicit,r=eC(3);BE(),dg("formControl",r.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!r.isAdmin()),xI(),BE(),Dl(" ",e.label," ");}}function _e(o,t){if(o&1&&(Es(0,"ds-fieldset",5),Uw(1,be,3,4,"label",23,Pw().trackByScope,true),hl()),o&2){let e=eC(2);dg("disabled",e.isEditMode()),BE(),$w(e.scopeOptions);}}function Ae(o,t){if(o&1&&(Es(0,"option",8),xC(1),hl()),o&2){let e=t.$implicit;dg("value",e),BE(),Fg(e);}}function Se(o,t){if(o&1){let e=Yw();Es(0,"div",19),fg(1,"input",25),MI(),fg(2,"input",26),MI(),Es(3,"button",27),vg("click",function(){let l=pf(e).$index,f=eC(2);return hf(f.removeHeader(l))}),xC(4," \xD7 "),hl()();}if(o&2){let e=t.$index;dg("formGroupName",e),BE(),xI(),BE(),xI();}}function Pe(o,t){if(o&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let l=eC();return hf(l.submit())}),jw(1,_e,3,1,"ds-fieldset",5),Es(2,"ds-form-field",6)(3,"select",7),Uw(4,Ae,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(),Es(10,"ds-form-field",13),fg(11,"input",14),MI(),hl(),Es(12,"ds-form-field",15),fg(13,"input",16),MI(),hl(),Es(14,"ds-form-field",17)(15,"div",18),Uw(16,Se,5,1,"div",19,Vw),Es(18,"div")(19,"button",20),vg("click",function(){pf(e);let l=eC();return hf(l.addHeader())}),xC(20,"+ Add header"),hl()()()(),Es(21,"ds-form-actions")(22,"button",21),xC(23),hl(),Es(24,"button",22),vg("click",function(){pf(e);let l=eC();return hf(l.cancel())}),xC(25,"Cancel"),hl()()();}if(o&2){let e=eC();dg("formGroup",e.form),BE(),Bw(e.isPlatformMode?-1:1),BE(2),dg("formControl",e.apiTypeControl),xI(),BE(),$w(e.apiTypeOptions),BE(3),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.baseUrlControl),xI(),BE(2),dg("formControl",e.apiKeyControl),xI(),BE(2),dg("formArrayName","headers"),BE(),$w(e.headersArray.controls),BE(6),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var xe=new Set(["namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ye=class o{route=g(W);router=g(F);destroyRef=g(we);state=g(O);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});apiTypeOptions=Object.values(Me);scopeOptions=[{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];form=new pt({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te(null),apiType:new Te("OpenAI",{nonNullable:true,validators:[gn.required]}),baseUrl:new Te("",{nonNullable:true}),apiKey:new Te("",{nonNullable:true}),scope:new Te("namespace",{nonNullable:true}),headers:new Lt([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new pt({key:new Te("",{nonNullable:true,validators:[gn.required]}),value:new Te("",{nonNullable:true})}));}removeHeader(t){this.headersArray.removeAt(t);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingConfig=null;initialApiKey="";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,r=t.get("aiProviderId"),l=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(r){this.isEditMode.set(true),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(r);return}this.scopeControl.setValue(l);let f=e.get("template");f&&this.hydrateFromTemplate(f);}parseScope(t){return t&&xe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId?"namespace":t.namespaceId?"userOnNs":"userGlobal"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AiProviderForm] Could not load provider '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.apiTypeControl.setValue(t.apiType),this.baseUrlControl.setValue(t.baseUrl??"");let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[r,l]of Object.entries(t.headers??{}))this.headersArray.push(new pt({key:new Te(r,{nonNullable:true,validators:[gn.required]}),value:new Te(l,{nonNullable:true})}));}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),r=this.apiKeyControl.value,l=this.isEditMode()&&r===this.initialApiKey?null:r,f=this.headersArray.controls.filter(A=>A.controls.key.value.trim()).map(A=>[A.controls.key.value.trim(),A.controls.value.value]),Ce=f.length>0?Object.fromEntries(f):null,V={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:t||null,baseUrl:e||null,apiKey:l,headers:Ce},w=this.form.getRawValue().scope,he=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,V,w,this.existingConfig):this.state.create(V,w,he)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"]);}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=vw({type:o,selectors:[["agentos-ai-provider-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI providers",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","API type","controlId","llm-api-type","required",""],["dsControl","","id","llm-api-type",3,"formControl"],[3,"value"],["label","Name","controlId","llm-name","required",""],["dsControl","","id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",3,"formControl"],["label","Description","controlId","llm-description"],["dsControl","","id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",3,"formControl"],["label","Base URL","controlId","llm-base-url"],["dsControl","","id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",3,"formControl"],["label","API key","controlId","llm-api-key"],["dsControl","","id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",3,"formControl"],["label","Custom headers"],[1,"ds-stack","ds-stack--sm",3,"formArrayName"],[1,"ds-inline",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],["dsControl","","type","text","placeholder","Header name","formControlName","key","autocomplete","off"],["dsControl","","type","text","placeholder","Value","formControlName","value","autocomplete","off"],["dsButton","","variant","icon-danger","type","button","title","Remove header","aria-label","Remove header",3,"click"]],template:function(e,r){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return r.cancel()}),xC(3," \u2190 AI providers "),hl()(),jw(4,ge,2,0,"p",2)(5,Pe,26,10,"form",3),hl()),e&2&&(BE(),dg("title",r.isEditMode()?"Edit AI provider":"New AI provider"),BE(3),Bw(r.isLoading()?4:5));},dependencies:[hn,fn,un,dn,cn,at,sn,an,qt,md,Co,Mo,Ht,Ut,ya,po,ho,An,On,wa,_o,vo],encapsulation:2})};export{ye as AiProviderFormComponent};
@@ -1 +0,0 @@
1
- import {o}from'./chunk-zfSbYfDB.js';import {p as pt,T as Te,g as gn,q as qt,m as md,H as Ht,a as po,h as ho,A as An,O as On,b as hn,c as fn,u as un,d as cn,D as pn,e as at,i as sn,l as Fo}from'./chunk-Uf57QzfJ.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-DYDARBQQ.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:[gn.required,gn.maxLength(100),gn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[gn.required,gn.maxLength(500),gn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[gn.required,gn.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:[qt,md,Ht,po,ho,An,On,$t,hn,fn,un,cn,pn,at,sn,Fo],encapsulation:2})};export{ee as SkillFormComponent};
@@ -1 +0,0 @@
1
- import {I as I$1}from'./chunk-DbN0_APN.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-DYDARBQQ.js';import {z as k,j as O$1,e as at,c as fn,k as ko,P,B as P$1}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.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,fn,ko,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -1 +0,0 @@
1
- import {z as k$1,j as O,e as at,c as fn,k as ko,P,B as P$1}from'./chunk-Uf57QzfJ.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-DYDARBQQ.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,fn,ko,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
@@ -1 +0,0 @@
1
- import {f,y,p as pt,T as Te,g as gn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,U as Ut,a as po,h as ho,Z as Zr,A as An,O as On,b as hn,c as fn,u as un,d as cn,e as at,i as sn}from'./chunk-Uf57QzfJ.js';import {g,W,q as F,H as J,I as we,r as rT,$ as $i,O as Of,K as U,L as w,N as x,v as vw,E as Es,f as fg,j as jw,a as hl,P as dg,b as BE,c as Bw,x as xC,Y as Yw,Q as vg,R as MI,U as Uw,t as eC,S as xI,l as lg,k as $w,s as Dl,F as Fg,u as pf,w as hf}from'./main-DYDARBQQ.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),xC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=eC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),MI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),MI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),MI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),MI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),MI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),MI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=eC();return hf(se.onMaxToolRoundsInput(p))}),hl(),MI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),Uw(19,he,2,2,"option",23,ce),hl(),MI(),hl(),Es(21,"ds-form-actions")(22,"button",24),xC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=eC();return hf(p.cancel())}),xC(25,"Cancel"),hl()()();}if(i&2){let e=eC();dg("formGroup",e.form),BE(2),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.externalIdControl),xI(),BE(2),dg("formControl",e.defaultAgentNameControl),xI(),BE(2),dg("formControl",e.configPathControl),xI(),BE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),BE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),xI(),BE(),dg("hint",e.runCostThresholdHint()),BE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),xI(),BE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),BE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),xI(),BE(2),dg("formControl",e.adminCaseListingControl),xI(),BE(),$w(e.adminCaseListingOptions),BE(3),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=rT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=rT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=rT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=rT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[gn.min(fe),gn.max(ge),gn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),jw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),BE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),BE(),Bw(u.isLoading()?2:3));},dependencies:[qt,md,Co,Mo,Ht,Fn,Ut,po,ho,Zr,An,On,hn,fn,un,cn,at,sn],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
@@ -1,2 +0,0 @@
1
- import {v}from'./chunk-D8BMEvrt.js';import {I,n as nt,i as it}from'./chunk-DbN0_APN.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-DYDARBQQ.js';import {T as Te,g as gn,p as pt,b as hn,c as fn,u as un,o as dn,d as cn,e as at,i as sn,t as an,q as qt,m as md,C as Co,M as Mo,H as Ht,U as Ut,x as ya,a as po,h as ho,A as An,O as On}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.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:[gn.required,gn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[gn.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:[hn,fn,un,dn,cn,at,sn,an,qt,md,Co,Mo,Ht,Ut,ya,po,ho,An,On],encapsulation:2})};
2
- export{me as AuthSettingFormComponent};
@@ -1 +0,0 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-D8BMEvrt.js';import {O}from'./chunk-C_TR3rI-.js';import {g,W as W$1,q as F,I as we,H as J,$ as $i,K as U$1,ad as ne$1,a1 as ga,aa as br,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,P as dg,b as BE,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-DYDARBQQ.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let t=eC();BE(),Fg(t.deletion.error());}}function X(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading integrations\u2026"),hl());}function Z(n,e){n&1&&(Es(0,"p",5),xC(1,"No integrations available."),hl());}function ee(n,e){n&1&&(Es(0,"p",4),xC(1,"No integrations match the current filter."),hl());}function te(n,e){n&1&&(Es(0,"ds-tag",20),xC(1,"YAML"),hl(),Es(2,"ds-tag",21),xC(3,"Read-only"),hl());}function ne(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC().$implicit,c=eC(2);return hf(c.view(s))}),xC(1,"View"),hl();}if(n&2){let t=eC().$implicit;lg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(3).$implicit,c=eC(2);return hf(c.edit(s))}),xC(1," Edit "),hl();}if(n&2){let t=eC(3).$implicit;lg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(2).$implicit,c=eC(2);return hf(c.duplicate(s))}),xC(1," Duplicate "),hl(),jw(2,ie,2,1,"button",19);}if(n&2){let t=eC(2).$implicit;lg("aria-label","Duplicate "+t.config.name),BE(2),Bw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=Yw();Es(0,"agentos-row-delete-action",25),vg("deleteRequested",function(){pf(t);let s=eC(2).$implicit,c=eC(2);return hf(c.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=eC(2).$implicit,c=eC(2);return hf(c.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(4);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=eC(2).$implicit,a=eC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Es(0,"button",24),xC(1,"Inherited"),hl());}function le(n,e){if(n&1&&(jw(0,oe,3,2),jw(1,ae,1,3,"agentos-row-delete-action",23),jw(2,re,2,0,"button",24)),n&2){let t=eC().$implicit,a=eC(2);Bw(a.deletion.confirmingId()!==t.key?0:-1),BE(),Bw(t.canDelete?1:-1),BE(),Bw(!t.canEdit&&!t.canDelete?2:-1);}}function se(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,te,4,0),hl()(),Es(10,"td",17)(11,"div",18),jw(12,ne,2,1,"button",19)(13,le,3,3),hl()()()),n&2){let t=e.$implicit;BE(2),Fg(t.config.name),BE(2),Dl(" ",t.config.integrationType," "),BE(3),dg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),BE(),Dl(" ",t.scopeLabel," "),BE(),Bw(t.source==="FILESYSTEM"?9:-1),BE(3),Bw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Type"),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,se,14,6,"tr",9,Q),hl()()()),n&2){let t=eC();BE(14),$w(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceApi=g(J);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=$i("this namespace");isAdmin=$i(false);isLoading=$i(true);rows=$i([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=vw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),xC(3,"New integration"),hl()(),jw(4,W,2,1,"p",3),jw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(dg("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),BE(),dg("query",a.rowFilter.query()),BE(3),Bw(a.deletion.error()?4:-1),BE(),Bw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
@@ -1 +0,0 @@
1
- import {z as k$1,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-Uf57QzfJ.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-DYDARBQQ.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,fn,ko,Fo,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
@@ -1 +0,0 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-D8BMEvrt.js';import {I}from'./chunk-DbN0_APN.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-DYDARBQQ.js';import {z as k,j as O,a5 as w,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-Uf57QzfJ.js';import'./chunk-CTrUVP-N.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,fn,ko,Fo,P,P$1],encapsulation:2})};export{J as AuthSettingsAllScopesComponent};
@@ -1 +0,0 @@
1
- import {a1 as ga,a2 as ha,aa as br,aD as $y}from'./main-DYDARBQQ.js';function i(t,o,p){return t.pipe(ga(()=>o().pipe(ha(()=>br(p)))),$y({bufferSize:1,refCount:true}))}export{i};
@@ -1 +0,0 @@
1
- import {S}from'./chunk-Uf57QzfJ.js';import {v as vw,T as br,E as Es,x as xC,a as hl,f as fg,P as dg}from'./main-DYDARBQQ.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=vw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Es(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),xC(3,"Platform"),hl(),Es(4,"span",2),xC(5,"/"),hl(),Es(6,"span"),xC(7,"Administration"),hl()(),fg(8,"router-outlet"),hl()),e&2&&dg("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
@@ -1 +0,0 @@
1
- import {i}from'./chunk-CTrUVP-N.js';import {y}from'./chunk-Uf57QzfJ.js';import {g,af as G,aI as ve,Z as Tr,at as Cy,a1 as ga,a2 as ha,aa as br,ad as ne,aD as $y,a5 as vd,a6 as x}from'./main-DYDARBQQ.js';var u=s=>s,N="none",w="me",O=class s{nsController=g(G);exportService=g(ve);userState=g(y);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Cy([this.namespaceId$,this.refresh$]).pipe(ga(([e])=>{let n=this.loadPlatformConfigs().pipe(ha(()=>br([]))),t=this.loadUserConfigs("global").pipe(ha(()=>br([])));return e?Cy([n,this.loadNamespaceConfigs(e).pipe(ha(()=>br([]))),this.loadUserConfigs(e).pipe(ha(()=>br([]))),t]).pipe(ne(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):Cy([n,t]).pipe(ne(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),$y({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):br([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(vd(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(vd(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(vd(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(vd(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(vd(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};