@whoz-oss/coday-client 0.0.0-workstream-forge.329 → 0.0.0-workstream-forge.330

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 (52) hide show
  1. package/browser/{chunk-kV_5OY32.js → chunk-B1PSn9Vo.js} +1 -1
  2. package/browser/{chunk-BYaUEPYY.js → chunk-B2L2kvLq.js} +1 -1
  3. package/browser/{chunk-BxoAK56U.js → chunk-BJSkFaiH.js} +1 -1
  4. package/browser/{chunk-Bpq2cxDs.js → chunk-BXy0XrJ7.js} +1 -1
  5. package/browser/{chunk-_or-ZV6c.js → chunk-Bl1Jy9cH.js} +1 -1
  6. package/browser/{chunk-9kt9Zpi9.js → chunk-BlRwzjFw.js} +1 -1
  7. package/browser/{chunk-DW1F1agi.js → chunk-Bp_blBHP.js} +1 -1
  8. package/browser/{chunk-BUczjq1y.js → chunk-Br-wGpbZ.js} +1 -1
  9. package/browser/{chunk-CSCGguJE.js → chunk-BrcOBDRd.js} +1 -1
  10. package/browser/{chunk-B-eADh5Q.js → chunk-BzLz9Mg9.js} +1 -1
  11. package/browser/chunk-C8HHjL6L.js +1 -0
  12. package/browser/{chunk-BhTrfE6J.js → chunk-CGWRFT9M.js} +1 -1
  13. package/browser/{chunk-DVvBqlA6.js → chunk-CHPBPjc7.js} +1 -1
  14. package/browser/{chunk-DZ_uca7F.js → chunk-CUGm4nCg.js} +1 -1
  15. package/browser/{chunk-DeZZAjYs.js → chunk-CYWAQOjO.js} +1 -1
  16. package/browser/{chunk-CJ1G9ZZ4.js → chunk-CZcM0Sjp.js} +1 -1
  17. package/browser/{chunk-55LWJGaA.js → chunk-Cpqn5pZ4.js} +1 -1
  18. package/browser/{chunk-CgSo-dYR.js → chunk-Cql1YU1b.js} +1 -1
  19. package/browser/{chunk-QfQLJc6L.js → chunk-CsR6DO0s.js} +1 -1
  20. package/browser/{chunk-4XyXLv7M.js → chunk-CunO3NfH.js} +1 -1
  21. package/browser/{chunk-QNrc6Dr5.js → chunk-CxV0A3YW.js} +1 -1
  22. package/browser/{chunk-Cqvh5zMj.js → chunk-Cy7RQh_n.js} +1 -1
  23. package/browser/{chunk-cTQHZeWw.js → chunk-DF9MTUxe.js} +1 -1
  24. package/browser/{chunk-DBAtlRoH.js → chunk-DI1Ofx5C.js} +1 -1
  25. package/browser/{chunk-B3AHVGbg.js → chunk-DIb4BOjN.js} +1 -1
  26. package/browser/{chunk-DcwIvh2i.js → chunk-DLw7Yxnr.js} +1 -1
  27. package/browser/{chunk-DCdnLzkw.js → chunk-DRBlC7Dh.js} +1 -1
  28. package/browser/{chunk-D1CD3CQL.js → chunk-DTSUiMvP.js} +1 -1
  29. package/browser/{chunk-BDLuQKQn.js → chunk-DXEGVZ5g.js} +1 -1
  30. package/browser/{chunk-D2xcbQ3c.js → chunk-DXif4PCM.js} +1 -1
  31. package/browser/{chunk-C4rthJME.js → chunk-DbPMcsRl.js} +1 -1
  32. package/browser/{chunk-CkbvRYAk.js → chunk-DbVcBI5h.js} +1 -1
  33. package/browser/{chunk-C1ehWUNM.js → chunk-DfkL0d-F.js} +1 -1
  34. package/browser/{chunk-Dsekephn.js → chunk-DuXyP0Ap.js} +1 -1
  35. package/browser/{chunk-CU9M40tK.js → chunk-EjwZJyua.js} +1 -1
  36. package/browser/chunk-P1kjpuYu.js +855 -0
  37. package/browser/{chunk-BuhxCyTp.js → chunk-TLD8l1O4.js} +1 -1
  38. package/browser/{chunk-ZTrp2NAu.js → chunk-Vj6PaaqT.js} +1 -1
  39. package/browser/{chunk-FgaKW7JT.js → chunk-W17CbVUg.js} +1 -1
  40. package/browser/{chunk-fcRhoM7k.js → chunk-Yv3pJ6Y8.js} +1 -1
  41. package/browser/{chunk-H55X8917.js → chunk-aH3HwIDf.js} +1 -1
  42. package/browser/{chunk-DgytN0P6.js → chunk-j1O2PWZu.js} +1 -1
  43. package/browser/{chunk-C2_MZOh9.js → chunk-lLZuYwL0.js} +1 -1
  44. package/browser/{chunk-B_yQQni6.js → chunk-mg2KQsdS.js} +1 -1
  45. package/browser/{chunk-ChZCgoPM.js → chunk-tcVMGkY_.js} +1 -1
  46. package/browser/{chunk-DNzk8sl-.js → chunk-wJQDNmya.js} +1 -1
  47. package/browser/{chunk-IQzQsjXY.js → chunk-wNQndqtu.js} +1 -1
  48. package/browser/index.html +1 -1
  49. package/browser/{main-KN7JT2CK.js → main-K3GOQJ4U.js} +1 -1
  50. package/package.json +1 -1
  51. package/browser/chunk-Dyc2eHCz.js +0 -855
  52. package/browser/chunk-KoagtDeJ.js +0 -1
@@ -1 +1 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DBAtlRoH.js';import {O}from'./chunk-Bpq2cxDs.js';import {g,W,F,J as we,ai as U,aA as N,z as zi,aB as K$1,aa as J,k as yT,ab as F$1,aC as QB,aD as Ne,M as U$1,a2 as ga,ac as _r,ae as Ny,af as ne,P as x,O as w,x as xw,aw as $t$1,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,aE as Sg,aF as DC,r as fC,s as aC,a as hg,T as VI,u as mf,w as yf,X as UI,c as xg,j as fg,q as Il,l as eC,t as tC,L as Lg,a5 as jg}from'./main-KN7JT2CK.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt$1,a as fd,M as Mo,D as Do,U as Ut$1,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-Dyc2eHCz.js';import'./chunk-KoagtDeJ.js';var D="*";function Ke(i){return (i??[]).some(t=>t.trim()===D)}function He(i){let t=(i??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D).map(e=>e.toLowerCase());return new Set(t)}function K(i){return i.includes(D)}function Qe(i){let t=i.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(i,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D&&K(e)).some(e=>Qe(e)?.test(i)??false)}var We="AGENTOS_CONFIG",Xe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Je(i){return i.configEnabled&&(i.hasSubAgents||i.integrationTypes.some(t=>Xe.has(t)))}var Ze=["instructionsTextarea"],Ye=(i,t)=>t.value,et=(i,t)=>t.config.id,tt=(i,t)=>t.type,ze=(i,t)=>t.selector;function nt(i,t){if(i&1&&(Is(0,"a",3),UC(1,"View resolved definition \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function it(i,t){i&1&&(Is(0,"ds-tag",4),UC(1,"Platform level"),ml());}function ot(i,t){i&1&&(Is(0,"p",5),UC(1,"Loading\u2026"),ml());}function at(i,t){if(i&1&&(hg(0,"input",18),VI()),i&2){let e=fC(2);pg("formControl",e.modelNameControl),UI();}}function lt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t;pg("ngValue",e.value),KE(),Lg(e.label);}}function rt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function st(i,t){if(i&1&&(Is(0,"optgroup",46),eC(1,rt,2,2,"option",45,Ye),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().aliases);}}function dt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function ct(i,t){if(i&1&&(Is(0,"optgroup",47),eC(1,dt,2,2,"option",45,Ye),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().apiNames);}}function ut(i,t){if(i&1&&(Is(0,"select",19)(1,"option",44),UC(2,"Select a model"),ml(),Qw(3,lt,2,2,"option",45),Qw(4,st,3,0,"optgroup",46),Qw(5,ct,3,0,"optgroup",47),ml(),VI()),i&2){let e,n=fC(2);pg("formControl",n.modelNameControl),UI(),KE(),pg("ngValue",null),KE(2),Kw((e=n.modelOptions().current)?3:-1,e),KE(),Kw(n.modelOptions().aliases.length>0?4:-1),KE(),Kw(n.modelOptions().apiNames.length>0?5:-1);}}function gt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.config.integrationType);}}function mt(i,t){if(i&1&&(hg(0,"input",49),VI()),i&2){let e=fC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),UI();}}function pt(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",27),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleIntegration(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,gt,2,1,"span",48),ml(),Qw(6,mt,1,2,"input",49),ml();}if(i&2){let e=t.$implicit;KE(2),pg("checked",e.enabled()),KE(2),Lg(e.config.name),KE(),Kw(e.config.integrationType?5:-1),KE(),Kw(e.enabled()?6:-1);}}function ft(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ct(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",28),UC(2),Is(3,"span",48),UC(4,"built-in"),ml()(),Is(5,"select",51),Eg("change",function(s){let u=mf(e).$implicit,C=fC(4);return yf(C.setBuiltInState(u,s.target.value))}),Is(6,"option",52),UC(7),ml(),Is(8,"option",53),UC(9,"Enabled"),ml(),Is(10,"option",54),UC(11,"Disabled"),ml()(),Qw(12,ft,2,1,"p",14),Is(13,"p",14),UC(14),ml()();}if(i&2){let e=t.$implicit,n=fC(4);KE(),fg("for","built-in-"+e.type),KE(),Il(" ",e.displayName," "),KE(3),pg("id","built-in-"+e.type)("value",e.state()),KE(2),Lg(n.builtInDefaultLabel(e)),KE(5),Kw(e.state()==="on"&&e.restrictedTools?12:-1),KE(2),Lg(e.description);}}function _t(i,t){if(i&1&&(Is(0,"span",50),UC(1,"Built-in integrations"),ml(),eC(2,Ct,15,7,"div",11,tt)),i&2){let e=fC(3);KE(2),tC(e.builtInRows());}}function bt(i,t){i&1&&(Is(0,"ds-notice",30),UC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function ht(i,t){if(i&1&&(Is(0,"ds-fieldset",25),eC(1,pt,7,4,"div",11,et),Qw(3,_t,4,0),Qw(4,bt,2,0,"ds-notice",30),ml()),i&2){let e=fC(2);KE(),tC(e.integrationRows()),KE(2),Kw(e.builtInRows().length>0?3:-1),KE(),Kw(e.configAgentExposureWarning()?4:-1);}}function yt(i,t){i&1&&UC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function xt(i,t){i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),ml());}function vt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function St(i,t){i&1&&(Is(0,"p",5),UC(1,"No skill available in this scope yet."),ml());}function At(i,t){i&1&&(Is(0,"span",48),UC(1,"platform"),ml());}function wt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Et(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.description);}}function Tt(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSkill(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,At,2,0,"span",48),Qw(6,wt,2,1,"span",48),ml(),Qw(7,Et,2,1,"p",14),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSkillsSelected()),KE(2),Lg(e.name),KE(),Kw(e.platform?5:-1),KE(),Kw(e.unresolved?6:-1),KE(),Kw(e.description?7:-1);}}function kt(i,t){if(i&1&&eC(0,Tt,8,6,"div",11,ze),i&2){let e=fC(2);tC(e.skillRows());}}function It(i,t){if(i&1&&(Is(0,"ds-form-field",34),hg(1,"textarea",56),VI(),Is(2,"p",5),UC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),UC(5,"AgentLoopPayload"),ml(),UC(6,". Leave empty if you always provide the payload at launch. "),ml()()),i&2){let e=fC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),KE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI();}}function Mt(i,t){i&1&&UC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Ft(i,t){if(i&1&&UC(0),i&2){let e=fC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Rt(i,t){if(i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),Qw(5,Ft,1,2),ml()),i&2){let e=fC(2);KE(5),Kw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Nt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function Dt(i,t){i&1&&(Is(0,"p",5),UC(1,"No other agent is available in this scope yet."),ml());}function Lt(i,t){i&1&&(Is(0,"span",48),UC(1,"pattern"),ml());}function Vt(i,t){i&1&&(Is(0,"span",48),UC(1,"via pattern"),ml());}function Pt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ot(i,t){if(i&1){let e=aC();Is(0,"button",59),Eg("click",function(){mf(e);let s=fC().$implicit,u=fC(3);return yf(u.removeSubAgent(s))}),UC(1," \xD7 "),ml();}if(i&2){let e=fC().$implicit;fg("aria-label","Remove "+e.selector);}}function Bt(i,t){if(i&1){let e=aC();Is(0,"div",36)(1,"label",57)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSubAgent(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,Lt,2,0,"span",48)(6,Vt,2,0,"span",48)(7,Pt,2,1,"span",48),ml(),Qw(8,Ot,2,1,"button",58),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSubAgentsSelected()),KE(2),Lg(e.name),KE(),Kw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),KE(3),Kw(e.unresolved?8:-1);}}function $t(i,t){if(i&1&&eC(0,Bt,9,5,"div",36,ze),i&2){let e=fC(2);tC(e.subAgentRows());}}function Ut(i,t){if(i&1){let e=aC();Is(0,"div")(1,"button",60),Eg("click",function(){mf(e);let s=fC(2);return yf(s.useDefaultDelegationTimeout())}),UC(2," Use server default "),ml()();}}function Gt(i,t){i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2&&(KE(),Lg(t));}function jt(i,t){if(i&1){let e=aC();Is(0,"button",61),Eg("click",function(){mf(e);let s=fC(2);return yf(s.exportYaml())}),UC(1),ml();}if(i&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Kt(i,t){if(i&1){let e=aC();Is(0,"form",7),Eg("ngSubmit",function(){mf(e);let s=fC();return yf(s.submit())}),Is(1,"ds-fieldset",8)(2,"ds-form-field",9),hg(3,"input",10),VI(),ml(),Is(4,"div",11)(5,"label",12),hg(6,"input",13),VI(),UC(7," Enabled "),ml(),Is(8,"p",14),UC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",15),hg(11,"input",16),VI(),ml(),Is(12,"ds-form-field",17),Qw(13,at,1,1,"input",18)(14,ut,6,5,"select",19),ml(),Is(15,"div",20)(16,"div",21)(17,"button",22),Eg("click",function(){mf(e);let s=fC();return yf(s.toggleInstructionsFullscreen())})("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),UC(18),ml()(),Is(19,"ds-form-field",23)(20,"textarea",24,0),Eg("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),ml(),VI(),ml()()(),Qw(22,ht,5,2,"ds-fieldset",25),Is(23,"ds-fieldset",26)(24,"p",5),UC(25," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(26,"code"),UC(27,"readSkill"),ml(),UC(28," and "),Is(29,"code"),UC(30,"readSkillResource"),ml(),UC(31," tools; selecting none grants neither. "),Qw(32,yt,1,0),ml(),Is(33,"label",12)(34,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSkills())}),ml(),Is(35,"span",28),UC(36,"Every skill in the catalogue ("),Is(37,"code",29),UC(38,"*"),ml(),UC(39,")"),ml()(),Is(40,"p",14),UC(41," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Qw(42,xt,5,0,"ds-notice",30),Qw(43,vt,2,0,"ds-notice"),Qw(44,St,2,0,"p",5)(45,kt,2,0),ml(),Is(46,"ds-form-field",31)(47,"select",32)(48,"option",33),UC(49,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(50,"option",33),UC(51,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(52,"option",33),UC(53,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),VI(),ml(),Qw(54,It,7,3,"ds-form-field",34),Is(55,"ds-fieldset",35)(56,"p",5),UC(57," The agents this one may delegate to. Selecting at least one grants it the "),Is(58,"code"),UC(59,"DELEGATE__delegate"),ml(),UC(60," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Qw(61,Mt,1,0),ml(),Is(62,"label",12)(63,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSubAgents())}),ml(),Is(64,"span",28),UC(65,"Every agent it can reach ("),Is(66,"code",29),UC(67,"*"),ml(),UC(68,")"),ml()(),Is(69,"p",14),UC(70," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Qw(71,Rt,6,1,"ds-notice",30),Qw(72,Nt,2,0,"ds-notice"),Qw(73,Dt,2,0,"p",5)(74,$t,2,0),Is(75,"p",5),UC(76," Advanced \u2014 add a glob instead of picking a name, for example "),Is(77,"code"),UC(78,"*Fixer"),ml(),UC(79," to cover BugFixer and StoryFixer. "),ml(),Is(80,"div",36)(81,"input",37),Eg("keydown.enter",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),ml(),VI(),Is(82,"button",38),Eg("click",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),UC(83," + "),ml()(),Is(84,"ds-form-field",39),hg(85,"input",40),VI(),Qw(86,Ut,3,0,"div"),ml()(),Qw(87,Gt,2,1,"ds-notice"),Is(88,"ds-form-actions")(89,"button",41),UC(90),ml(),Qw(91,jt,2,2,"button",42),Is(92,"button",43),Eg("click",function(){mf(e);let s=fC();return yf(s.cancel())}),UC(93,"Cancel"),ml()()();}if(i&2){let e,n=fC();pg("formGroup",n.form),KE(3),pg("formControl",n.nameControl),UI(),KE(3),pg("formControl",n.enabledControl),UI(),KE(5),pg("formControl",n.descriptionControl),UI(),KE(2),Kw(n.modelAsFreeText()?13:14),KE(2),xg("agent-config-instructions--fullscreen",n.instructionsFullscreen()),KE(2),fg("aria-pressed",n.instructionsFullscreen()),KE(),Il(" ",n.instructionsFullscreen()?"Exit full screen":"Full screen"," "),KE(),pg("hint",n.instructionsCounter())("error",n.instructionsError()),KE(),pg("formControl",n.instructionsControl),fg("aria-invalid",n.instructionsControl.invalid),UI(),KE(2),Kw(n.integrationRows().length>0||n.builtInRows().length>0?22:-1),KE(10),Kw(n.isPlatformMode?32:-1),KE(2),pg("checked",n.allSkillsSelected()),KE(8),Kw(n.namedSkillSelectionDropped()?42:-1),KE(),Kw(n.skillCatalogueUnavailable()?43:-1),KE(),Kw(n.skillRows().length===0?44:45),KE(3),pg("formControl",n.executionModeControl),UI(),KE(),pg("value",n.ExecutionMode.SIMPLE),KE(2),pg("value",n.ExecutionMode.ADVANCED),KE(2),pg("value",n.ExecutionMode.LOOP),KE(2),Kw(n.isLoopMode()?54:-1),KE(7),Kw(n.isPlatformMode?61:-1),KE(2),pg("checked",n.allSubAgentsSelected()),KE(8),Kw(n.namedSubAgentSelectionDropped()?71:-1),KE(),Kw(n.subAgentCandidatesUnavailable()?72:-1),KE(),Kw(n.subAgentRows().length===0?73:74),KE(8),pg("formControl",n.newSubAgentControl),UI(),KE(),pg("disabled",!n.newSubAgentControl.value.trim()),KE(2),pg("hint",n.delegationTimeoutHint())("error",n.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),KE(),pg("formControl",n.delegationTimeoutControl),fg("aria-invalid",n.delegationTimeoutControl.invalid),UI(),KE(),Kw(n.delegationTimeoutControl.value!==null?86:-1),KE(),Kw((e=n.submitError())?87:-1,e),KE(2),pg("disabled",n.form.invalid||n.isSubmitting()),KE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),KE(),Kw(n.isEditMode()?91:-1);}}var z=2e4,qe=class i$1{route=g(W);router=g(F);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(K$1);integrationConfigState=g(O);integrationTypeController=g(J);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,i$1.notBlankValidator]}),instructions:new Te(null,{validators:[bn.maxLength(z)]}),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(true,{nonNullable:true}),loopConfig:new Te(null,{validators:[i$1.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(n){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=yT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=yT(()=>this.executionModeValue()==="LOOP");static maxInstructionsLabel=z.toLocaleString("en-US");instructionsValue=F$1(this.form.controls.instructions.valueChanges,{initialValue:this.form.controls.instructions.value});instructionsLength=yT(()=>(this.instructionsValue()??"").length);instructionsCounter=yT(()=>`${this.instructionsLength().toLocaleString("en-US")} / ${i$1.maxInstructionsLabel} characters`);instructionsError=yT(()=>{let t=this.instructionsLength();return t<=z?null:`Instructions must not exceed ${i$1.maxInstructionsLabel} characters (currently ${t.toLocaleString("en-US")}).`});instructionsFullscreen=zi(false);instructionsTextarea=QB("instructionsTextarea");toggleInstructionsFullscreen(){this.instructionsFullscreen.update(t=>!t),this.instructionsTextarea()?.nativeElement.focus();}closeInstructionsFullscreen(){this.instructionsFullscreen()&&(this.instructionsFullscreen.set(false),this.instructionsTextarea()?.nativeElement.focus());}subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=yT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=yT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=yT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Ne;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=yT(()=>Je({configEnabled:this.builtInRows().some(t=>t.type===We&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=yT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=yT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:n,platformIntegrations:s,builtInTypes:u,skillCatalogue:C,delegationCandidates:T,models:k})=>{this.existingConfig=e,this.applyModelCatalogue(k,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let L=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(L,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(u,e.integrations??void 0)),this.allSubAgentsSelected.set(Ke(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(T,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:n,builtInTypes:s,skillCatalogue:u,delegationCandidates:C,models:T})=>{this.applyModelCatalogue(T,null);let k=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(k,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(u,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),u=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),T=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(u.has(f.name.toLowerCase()))})),k=new Set;for(let f of s){let L=l(f).toLowerCase();C.has(L)||k.has(L)||(k.add(L),T.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return T}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:n,namespace:s})=>[...n,...s]),ne(n=>n.map(s=>s.name).filter(s=>s.length>0)),ne(n=>i$1.dedupeByKey(n)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(n=>{let s=n.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,n){let s=He(e),u=n?.toLowerCase()??null,C=t.filter(_=>{let B=_.toLowerCase();return B!==u||s.has(B)}),T=new Set(C.map(_=>_.toLowerCase())),k=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,L=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==D);for(let _ of L){let B=_.toLowerCase();T.has(B)||f.has(B)||(f.add(B),k.push({selector:_,name:_,unresolved:true,pattern:K(_),grantedByPattern:false,selected:zi(true)}));}return k}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",u=e?.[s],C=e!=null&&s in e,T=Array.isArray(u)?u.join(", "):"";return {config:n,enabled:zi(C),toolsControl:new Te(T,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,u=e?.[n.type],C=s?Array.isArray(u)&&u.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(u)&&u.length>0?u:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===D?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>this.withPatternGrants([...n,{selector:t,name:t,unresolved:true,pattern:K(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(n=>this.withPatternGrants(n.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(n=>n.selected()).map(n=>n.selector);return t.map(n=>n.unresolved?n:x(w({},n),{grantedByPattern:Y(n.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [D];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",u=n.toolsControl.value.trim();t[s]=u===""?null:u.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:n=>{this.isSubmitting.set(false),this.submitError.set(i$1.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;if(typeof n=="string"&&n.trim().length>0)return n;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),u=document.createElement("a");u.href=s,u.download=`${this.existingConfig?.name??"agent"}.yaml`,u.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||i$1)};static \u0275cmp=xw({type:i$1,selectors:[["agentos-agent-config-form"]],viewQuery:function(e,n){e&1&&Sg(n.instructionsTextarea,Ze,5),e&2&&DC();},decls:8,vars:4,consts:[["instructionsTextarea",""],[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],[1,"agent-config-instructions"],[1,"agent-config-instructions__toolbar"],["dsButton","","variant","ghost","type","button",3,"click","keydown.escape"],["label","Instructions","controlId","agent-config-instructions","hintId","agent-config-instructions-hint","errorId","agent-config-instructions-error",3,"hint","error"],["dsControl","","id","agent-config-instructions","rows","20","placeholder","Optional \u2014 system instructions for this agent","aria-describedby","agent-config-instructions-hint agent-config-instructions-error",3,"keydown.escape","formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,n){e&1&&(Is(0,"ds-page")(1,"ds-section-header",1)(2,"button",2),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Agent configs "),ml(),Qw(4,nt,2,1,"a",3),Qw(5,it,2,0,"ds-tag",4),ml(),Qw(6,ot,2,0,"p",5)(7,Kt,94,40,"form",6),ml()),e&2&&(KE(),pg("title",n.isEditMode()?"Edit agent config":"New agent config"),KE(3),Kw(n.isEditMode()?4:-1),KE(),Kw(n.isPlatformMode?5:-1),KE(),Kw(n.isLoading()?6:7));},dependencies:[Kt$1,fd,Mo,Do,Ut$1,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t$1,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],styles:[".agent-config-instructions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.agent-config-instructions[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:24rem}.agent-config-instructions__toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;box-sizing:border-box;padding:1.5rem;background:var(--color-bg, #fff)}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] ds-form-field[_ngcontent-%COMP%]{flex:1;min-height:0}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{flex:1;min-height:0;resize:none}@media(max-width:760px){.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{padding:.75rem}}"]})};export{qe as AgentConfigFormComponent,z as MAX_INSTRUCTIONS_LENGTH};
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DI1Ofx5C.js';import {O}from'./chunk-BXy0XrJ7.js';import {g,W,F,J as we,ai as U,aA as N,z as zi,aB as K$1,aa as J,k as yT,ab as F$1,aC as QB,aD as Ne,M as U$1,a2 as ga,ac as _r,ae as Ny,af as ne,P as x,O as w,x as xw,aw as $t$1,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,aE as Sg,aF as DC,r as fC,s as aC,a as hg,T as VI,u as mf,w as yf,X as UI,c as xg,j as fg,q as Il,l as eC,t as tC,L as Lg,a5 as jg}from'./main-K3GOQJ4U.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt$1,a as fd,M as Mo,D as Do,U as Ut$1,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-P1kjpuYu.js';import'./chunk-C8HHjL6L.js';var D="*";function Ke(i){return (i??[]).some(t=>t.trim()===D)}function He(i){let t=(i??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D).map(e=>e.toLowerCase());return new Set(t)}function K(i){return i.includes(D)}function Qe(i){let t=i.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(i,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D&&K(e)).some(e=>Qe(e)?.test(i)??false)}var We="AGENTOS_CONFIG",Xe=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Je(i){return i.configEnabled&&(i.hasSubAgents||i.integrationTypes.some(t=>Xe.has(t)))}var Ze=["instructionsTextarea"],Ye=(i,t)=>t.value,et=(i,t)=>t.config.id,tt=(i,t)=>t.type,ze=(i,t)=>t.selector;function nt(i,t){if(i&1&&(Is(0,"a",3),UC(1,"View resolved definition \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function it(i,t){i&1&&(Is(0,"ds-tag",4),UC(1,"Platform level"),ml());}function ot(i,t){i&1&&(Is(0,"p",5),UC(1,"Loading\u2026"),ml());}function at(i,t){if(i&1&&(hg(0,"input",18),VI()),i&2){let e=fC(2);pg("formControl",e.modelNameControl),UI();}}function lt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t;pg("ngValue",e.value),KE(),Lg(e.label);}}function rt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function st(i,t){if(i&1&&(Is(0,"optgroup",46),eC(1,rt,2,2,"option",45,Ye),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().aliases);}}function dt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function ct(i,t){if(i&1&&(Is(0,"optgroup",47),eC(1,dt,2,2,"option",45,Ye),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().apiNames);}}function ut(i,t){if(i&1&&(Is(0,"select",19)(1,"option",44),UC(2,"Select a model"),ml(),Qw(3,lt,2,2,"option",45),Qw(4,st,3,0,"optgroup",46),Qw(5,ct,3,0,"optgroup",47),ml(),VI()),i&2){let e,n=fC(2);pg("formControl",n.modelNameControl),UI(),KE(),pg("ngValue",null),KE(2),Kw((e=n.modelOptions().current)?3:-1,e),KE(),Kw(n.modelOptions().aliases.length>0?4:-1),KE(),Kw(n.modelOptions().apiNames.length>0?5:-1);}}function gt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.config.integrationType);}}function mt(i,t){if(i&1&&(hg(0,"input",49),VI()),i&2){let e=fC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),UI();}}function pt(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",27),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleIntegration(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,gt,2,1,"span",48),ml(),Qw(6,mt,1,2,"input",49),ml();}if(i&2){let e=t.$implicit;KE(2),pg("checked",e.enabled()),KE(2),Lg(e.config.name),KE(),Kw(e.config.integrationType?5:-1),KE(),Kw(e.enabled()?6:-1);}}function ft(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ct(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",28),UC(2),Is(3,"span",48),UC(4,"built-in"),ml()(),Is(5,"select",51),Eg("change",function(s){let u=mf(e).$implicit,C=fC(4);return yf(C.setBuiltInState(u,s.target.value))}),Is(6,"option",52),UC(7),ml(),Is(8,"option",53),UC(9,"Enabled"),ml(),Is(10,"option",54),UC(11,"Disabled"),ml()(),Qw(12,ft,2,1,"p",14),Is(13,"p",14),UC(14),ml()();}if(i&2){let e=t.$implicit,n=fC(4);KE(),fg("for","built-in-"+e.type),KE(),Il(" ",e.displayName," "),KE(3),pg("id","built-in-"+e.type)("value",e.state()),KE(2),Lg(n.builtInDefaultLabel(e)),KE(5),Kw(e.state()==="on"&&e.restrictedTools?12:-1),KE(2),Lg(e.description);}}function _t(i,t){if(i&1&&(Is(0,"span",50),UC(1,"Built-in integrations"),ml(),eC(2,Ct,15,7,"div",11,tt)),i&2){let e=fC(3);KE(2),tC(e.builtInRows());}}function bt(i,t){i&1&&(Is(0,"ds-notice",30),UC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function ht(i,t){if(i&1&&(Is(0,"ds-fieldset",25),eC(1,pt,7,4,"div",11,et),Qw(3,_t,4,0),Qw(4,bt,2,0,"ds-notice",30),ml()),i&2){let e=fC(2);KE(),tC(e.integrationRows()),KE(2),Kw(e.builtInRows().length>0?3:-1),KE(),Kw(e.configAgentExposureWarning()?4:-1);}}function yt(i,t){i&1&&UC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function xt(i,t){i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),ml());}function vt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function St(i,t){i&1&&(Is(0,"p",5),UC(1,"No skill available in this scope yet."),ml());}function At(i,t){i&1&&(Is(0,"span",48),UC(1,"platform"),ml());}function wt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Et(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.description);}}function Tt(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSkill(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,At,2,0,"span",48),Qw(6,wt,2,1,"span",48),ml(),Qw(7,Et,2,1,"p",14),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSkillsSelected()),KE(2),Lg(e.name),KE(),Kw(e.platform?5:-1),KE(),Kw(e.unresolved?6:-1),KE(),Kw(e.description?7:-1);}}function kt(i,t){if(i&1&&eC(0,Tt,8,6,"div",11,ze),i&2){let e=fC(2);tC(e.skillRows());}}function It(i,t){if(i&1&&(Is(0,"ds-form-field",34),hg(1,"textarea",56),VI(),Is(2,"p",5),UC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),UC(5,"AgentLoopPayload"),ml(),UC(6,". Leave empty if you always provide the payload at launch. "),ml()()),i&2){let e=fC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),KE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI();}}function Mt(i,t){i&1&&UC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Ft(i,t){if(i&1&&UC(0),i&2){let e=fC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Rt(i,t){if(i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),Qw(5,Ft,1,2),ml()),i&2){let e=fC(2);KE(5),Kw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Nt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function Dt(i,t){i&1&&(Is(0,"p",5),UC(1,"No other agent is available in this scope yet."),ml());}function Lt(i,t){i&1&&(Is(0,"span",48),UC(1,"pattern"),ml());}function Vt(i,t){i&1&&(Is(0,"span",48),UC(1,"via pattern"),ml());}function Pt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ot(i,t){if(i&1){let e=aC();Is(0,"button",59),Eg("click",function(){mf(e);let s=fC().$implicit,u=fC(3);return yf(u.removeSubAgent(s))}),UC(1," \xD7 "),ml();}if(i&2){let e=fC().$implicit;fg("aria-label","Remove "+e.selector);}}function Bt(i,t){if(i&1){let e=aC();Is(0,"div",36)(1,"label",57)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSubAgent(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,Lt,2,0,"span",48)(6,Vt,2,0,"span",48)(7,Pt,2,1,"span",48),ml(),Qw(8,Ot,2,1,"button",58),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSubAgentsSelected()),KE(2),Lg(e.name),KE(),Kw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),KE(3),Kw(e.unresolved?8:-1);}}function $t(i,t){if(i&1&&eC(0,Bt,9,5,"div",36,ze),i&2){let e=fC(2);tC(e.subAgentRows());}}function Ut(i,t){if(i&1){let e=aC();Is(0,"div")(1,"button",60),Eg("click",function(){mf(e);let s=fC(2);return yf(s.useDefaultDelegationTimeout())}),UC(2," Use server default "),ml()();}}function Gt(i,t){i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2&&(KE(),Lg(t));}function jt(i,t){if(i&1){let e=aC();Is(0,"button",61),Eg("click",function(){mf(e);let s=fC(2);return yf(s.exportYaml())}),UC(1),ml();}if(i&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Kt(i,t){if(i&1){let e=aC();Is(0,"form",7),Eg("ngSubmit",function(){mf(e);let s=fC();return yf(s.submit())}),Is(1,"ds-fieldset",8)(2,"ds-form-field",9),hg(3,"input",10),VI(),ml(),Is(4,"div",11)(5,"label",12),hg(6,"input",13),VI(),UC(7," Enabled "),ml(),Is(8,"p",14),UC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",15),hg(11,"input",16),VI(),ml(),Is(12,"ds-form-field",17),Qw(13,at,1,1,"input",18)(14,ut,6,5,"select",19),ml(),Is(15,"div",20)(16,"div",21)(17,"button",22),Eg("click",function(){mf(e);let s=fC();return yf(s.toggleInstructionsFullscreen())})("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),UC(18),ml()(),Is(19,"ds-form-field",23)(20,"textarea",24,0),Eg("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),ml(),VI(),ml()()(),Qw(22,ht,5,2,"ds-fieldset",25),Is(23,"ds-fieldset",26)(24,"p",5),UC(25," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(26,"code"),UC(27,"readSkill"),ml(),UC(28," and "),Is(29,"code"),UC(30,"readSkillResource"),ml(),UC(31," tools; selecting none grants neither. "),Qw(32,yt,1,0),ml(),Is(33,"label",12)(34,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSkills())}),ml(),Is(35,"span",28),UC(36,"Every skill in the catalogue ("),Is(37,"code",29),UC(38,"*"),ml(),UC(39,")"),ml()(),Is(40,"p",14),UC(41," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Qw(42,xt,5,0,"ds-notice",30),Qw(43,vt,2,0,"ds-notice"),Qw(44,St,2,0,"p",5)(45,kt,2,0),ml(),Is(46,"ds-form-field",31)(47,"select",32)(48,"option",33),UC(49,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(50,"option",33),UC(51,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(52,"option",33),UC(53,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),VI(),ml(),Qw(54,It,7,3,"ds-form-field",34),Is(55,"ds-fieldset",35)(56,"p",5),UC(57," The agents this one may delegate to. Selecting at least one grants it the "),Is(58,"code"),UC(59,"DELEGATE__delegate"),ml(),UC(60," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Qw(61,Mt,1,0),ml(),Is(62,"label",12)(63,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSubAgents())}),ml(),Is(64,"span",28),UC(65,"Every agent it can reach ("),Is(66,"code",29),UC(67,"*"),ml(),UC(68,")"),ml()(),Is(69,"p",14),UC(70," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Qw(71,Rt,6,1,"ds-notice",30),Qw(72,Nt,2,0,"ds-notice"),Qw(73,Dt,2,0,"p",5)(74,$t,2,0),Is(75,"p",5),UC(76," Advanced \u2014 add a glob instead of picking a name, for example "),Is(77,"code"),UC(78,"*Fixer"),ml(),UC(79," to cover BugFixer and StoryFixer. "),ml(),Is(80,"div",36)(81,"input",37),Eg("keydown.enter",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),ml(),VI(),Is(82,"button",38),Eg("click",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),UC(83," + "),ml()(),Is(84,"ds-form-field",39),hg(85,"input",40),VI(),Qw(86,Ut,3,0,"div"),ml()(),Qw(87,Gt,2,1,"ds-notice"),Is(88,"ds-form-actions")(89,"button",41),UC(90),ml(),Qw(91,jt,2,2,"button",42),Is(92,"button",43),Eg("click",function(){mf(e);let s=fC();return yf(s.cancel())}),UC(93,"Cancel"),ml()()();}if(i&2){let e,n=fC();pg("formGroup",n.form),KE(3),pg("formControl",n.nameControl),UI(),KE(3),pg("formControl",n.enabledControl),UI(),KE(5),pg("formControl",n.descriptionControl),UI(),KE(2),Kw(n.modelAsFreeText()?13:14),KE(2),xg("agent-config-instructions--fullscreen",n.instructionsFullscreen()),KE(2),fg("aria-pressed",n.instructionsFullscreen()),KE(),Il(" ",n.instructionsFullscreen()?"Exit full screen":"Full screen"," "),KE(),pg("hint",n.instructionsCounter())("error",n.instructionsError()),KE(),pg("formControl",n.instructionsControl),fg("aria-invalid",n.instructionsControl.invalid),UI(),KE(2),Kw(n.integrationRows().length>0||n.builtInRows().length>0?22:-1),KE(10),Kw(n.isPlatformMode?32:-1),KE(2),pg("checked",n.allSkillsSelected()),KE(8),Kw(n.namedSkillSelectionDropped()?42:-1),KE(),Kw(n.skillCatalogueUnavailable()?43:-1),KE(),Kw(n.skillRows().length===0?44:45),KE(3),pg("formControl",n.executionModeControl),UI(),KE(),pg("value",n.ExecutionMode.SIMPLE),KE(2),pg("value",n.ExecutionMode.ADVANCED),KE(2),pg("value",n.ExecutionMode.LOOP),KE(2),Kw(n.isLoopMode()?54:-1),KE(7),Kw(n.isPlatformMode?61:-1),KE(2),pg("checked",n.allSubAgentsSelected()),KE(8),Kw(n.namedSubAgentSelectionDropped()?71:-1),KE(),Kw(n.subAgentCandidatesUnavailable()?72:-1),KE(),Kw(n.subAgentRows().length===0?73:74),KE(8),pg("formControl",n.newSubAgentControl),UI(),KE(),pg("disabled",!n.newSubAgentControl.value.trim()),KE(2),pg("hint",n.delegationTimeoutHint())("error",n.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),KE(),pg("formControl",n.delegationTimeoutControl),fg("aria-invalid",n.delegationTimeoutControl.invalid),UI(),KE(),Kw(n.delegationTimeoutControl.value!==null?86:-1),KE(),Kw((e=n.submitError())?87:-1,e),KE(2),pg("disabled",n.form.invalid||n.isSubmitting()),KE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),KE(),Kw(n.isEditMode()?91:-1);}}var z=2e4,qe=class i$1{route=g(W);router=g(F);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(K$1);integrationConfigState=g(O);integrationTypeController=g(J);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,i$1.notBlankValidator]}),instructions:new Te(null,{validators:[bn.maxLength(z)]}),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(true,{nonNullable:true}),loopConfig:new Te(null,{validators:[i$1.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(n){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=yT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=yT(()=>this.executionModeValue()==="LOOP");static maxInstructionsLabel=z.toLocaleString("en-US");instructionsValue=F$1(this.form.controls.instructions.valueChanges,{initialValue:this.form.controls.instructions.value});instructionsLength=yT(()=>(this.instructionsValue()??"").length);instructionsCounter=yT(()=>`${this.instructionsLength().toLocaleString("en-US")} / ${i$1.maxInstructionsLabel} characters`);instructionsError=yT(()=>{let t=this.instructionsLength();return t<=z?null:`Instructions must not exceed ${i$1.maxInstructionsLabel} characters (currently ${t.toLocaleString("en-US")}).`});instructionsFullscreen=zi(false);instructionsTextarea=QB("instructionsTextarea");toggleInstructionsFullscreen(){this.instructionsFullscreen.update(t=>!t),this.instructionsTextarea()?.nativeElement.focus();}closeInstructionsFullscreen(){this.instructionsFullscreen()&&(this.instructionsFullscreen.set(false),this.instructionsTextarea()?.nativeElement.focus());}subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=yT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=yT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=yT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Ne;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=yT(()=>Je({configEnabled:this.builtInRows().some(t=>t.type===We&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=yT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=yT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:n,platformIntegrations:s,builtInTypes:u,skillCatalogue:C,delegationCandidates:T,models:k})=>{this.existingConfig=e,this.applyModelCatalogue(k,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let L=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(L,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(u,e.integrations??void 0)),this.allSubAgentsSelected.set(Ke(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(T,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:n,builtInTypes:s,skillCatalogue:u,delegationCandidates:C,models:T})=>{this.applyModelCatalogue(T,null);let k=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(k,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(u,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),u=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),T=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(u.has(f.name.toLowerCase()))})),k=new Set;for(let f of s){let L=l(f).toLowerCase();C.has(L)||k.has(L)||(k.add(L),T.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return T}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:n,namespace:s})=>[...n,...s]),ne(n=>n.map(s=>s.name).filter(s=>s.length>0)),ne(n=>i$1.dedupeByKey(n)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(n=>{let s=n.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,n){let s=He(e),u=n?.toLowerCase()??null,C=t.filter(_=>{let B=_.toLowerCase();return B!==u||s.has(B)}),T=new Set(C.map(_=>_.toLowerCase())),k=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,L=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==D);for(let _ of L){let B=_.toLowerCase();T.has(B)||f.has(B)||(f.add(B),k.push({selector:_,name:_,unresolved:true,pattern:K(_),grantedByPattern:false,selected:zi(true)}));}return k}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",u=e?.[s],C=e!=null&&s in e,T=Array.isArray(u)?u.join(", "):"";return {config:n,enabled:zi(C),toolsControl:new Te(T,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,u=e?.[n.type],C=s?Array.isArray(u)&&u.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(u)&&u.length>0?u:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===D?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>this.withPatternGrants([...n,{selector:t,name:t,unresolved:true,pattern:K(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(n=>this.withPatternGrants(n.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(n=>n.selected()).map(n=>n.selector);return t.map(n=>n.unresolved?n:x(w({},n),{grantedByPattern:Y(n.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [D];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",u=n.toolsControl.value.trim();t[s]=u===""?null:u.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:n=>{this.isSubmitting.set(false),this.submitError.set(i$1.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;if(typeof n=="string"&&n.trim().length>0)return n;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),u=document.createElement("a");u.href=s,u.download=`${this.existingConfig?.name??"agent"}.yaml`,u.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||i$1)};static \u0275cmp=xw({type:i$1,selectors:[["agentos-agent-config-form"]],viewQuery:function(e,n){e&1&&Sg(n.instructionsTextarea,Ze,5),e&2&&DC();},decls:8,vars:4,consts:[["instructionsTextarea",""],[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],[1,"agent-config-instructions"],[1,"agent-config-instructions__toolbar"],["dsButton","","variant","ghost","type","button",3,"click","keydown.escape"],["label","Instructions","controlId","agent-config-instructions","hintId","agent-config-instructions-hint","errorId","agent-config-instructions-error",3,"hint","error"],["dsControl","","id","agent-config-instructions","rows","20","placeholder","Optional \u2014 system instructions for this agent","aria-describedby","agent-config-instructions-hint agent-config-instructions-error",3,"keydown.escape","formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,n){e&1&&(Is(0,"ds-page")(1,"ds-section-header",1)(2,"button",2),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Agent configs "),ml(),Qw(4,nt,2,1,"a",3),Qw(5,it,2,0,"ds-tag",4),ml(),Qw(6,ot,2,0,"p",5)(7,Kt,94,40,"form",6),ml()),e&2&&(KE(),pg("title",n.isEditMode()?"Edit agent config":"New agent config"),KE(3),Kw(n.isEditMode()?4:-1),KE(),Kw(n.isPlatformMode?5:-1),KE(),Kw(n.isLoading()?6:7));},dependencies:[Kt$1,fd,Mo,Do,Ut$1,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t$1,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],styles:[".agent-config-instructions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.agent-config-instructions[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:24rem}.agent-config-instructions__toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;box-sizing:border-box;padding:1.5rem;background:var(--color-bg, #fff)}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] ds-form-field[_ngcontent-%COMP%]{flex:1;min-height:0}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{flex:1;min-height:0;resize:none}@media(max-width:760px){.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{padding:.75rem}}"]})};export{qe as AgentConfigFormComponent,z as MAX_INSTRUCTIONS_LENGTH};
@@ -1 +1 @@
1
- import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-KN7JT2CK.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.edit(m))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=fC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.description||"\u2014"," "),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=xw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New prompt"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
1
+ import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-P1kjpuYu.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-K3GOQJ4U.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.edit(m))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=fC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.description||"\u2014"," "),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=xw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New prompt"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
@@ -1,2 +1,2 @@
1
- import {I,n as nt,i as it}from'./chunk-DeZZAjYs.js';import {v}from'./chunk-C4rthJME.js';import {g,W,F,J as we,z as zi,ab as F$1,k as yT,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,l as eC,ar as Jw,T as VI,a as hg,r as fC,X as UI,t as tC,q as Il,ag as Zw,L as Lg,j as fg,u as mf,w as yf}from'./main-KN7JT2CK.js';import {T as Te,b as bn,p as pt,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn}from'./chunk-Dyc2eHCz.js';import'./chunk-KoagtDeJ.js';function Ce(i,t){i&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ye(i,t){if(i&1&&(Is(0,"label",16),hg(1,"input",17),VI(),UC(2),ml()),i&2){let e=t.$implicit,n=fC(3);KE(),pg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),KE(),Il(" ",e.label," ");}}function ge(i,t){if(i&1&&(Is(0,"ds-fieldset",5),eC(1,ye,3,4,"label",16,Zw().trackByScope,true),ml()),i&2){let e=fC(2);pg("disabled",e.isEditMode()),KE(),tC(e.scopeOptions);}}function fe(i,t){if(i&1&&(Is(0,"option",8),UC(1),ml()),i&2){let e=t.$implicit,n=fC(2);pg("value",e),KE(),Lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Is(0,"ds-form-field",18),hg(1,"input",19),VI(),ml()),i&2){let e=fC().$implicit;pg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),KE(),pg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),fg("aria-describedby",e.hint?"as-hint-"+e.key:null),UI();}}function Ae(i,t){if(i&1&&Qw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=fC(3);Kw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Is(0,"ds-fieldset",13),eC(1,Ae,1,1,null,null,Zw().trackByField,true),ml()),i&2){let e=fC(2);pg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),KE(),tC(e.credentialFields());}}function be(i,t){if(i&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let o=fC();return yf(o.submit())}),Qw(1,ge,3,1,"ds-fieldset",5),Is(2,"ds-form-field",6)(3,"select",7),eC(4,fe,2,2,"option",8,Jw),ml(),VI(),ml(),Is(6,"ds-form-field",9),hg(7,"input",10),VI(),ml(),Is(8,"ds-form-field",11),hg(9,"input",12),VI(),ml(),Qw(10,ve,3,1,"ds-fieldset",13),Is(11,"ds-form-actions")(12,"button",14),UC(13),ml(),Is(14,"button",15),Eg("click",function(){mf(e);let o=fC();return yf(o.cancel())}),UC(15,"Cancel"),ml()()();}if(i&2){let e=fC();pg("formGroup",e.form),KE(),Kw(e.isPlatformMode?-1:1),KE(2),pg("formControl",e.authTypeControl),UI(),KE(),tC(e.authTypeOptions),KE(3),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.credentialFields().length>0?10:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",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?zi(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:[bn.required,bn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[bn.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=yT(()=>_e[this.selectedAuthType()]);isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Ff(()=>{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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Auth settings "),ml()(),Qw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),ml()),e&2&&(KE(),pg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),KE(3),Kw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,cn,Kt,fd,Mo,Do,Ut,Qt,Ca,fo,go,Nn,Rn],encapsulation:2})};
1
+ import {I,n as nt,i as it}from'./chunk-CYWAQOjO.js';import {v}from'./chunk-DbPMcsRl.js';import {g,W,F,J as we,z as zi,ab as F$1,k as yT,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,l as eC,ar as Jw,T as VI,a as hg,r as fC,X as UI,t as tC,q as Il,ag as Zw,L as Lg,j as fg,u as mf,w as yf}from'./main-K3GOQJ4U.js';import {T as Te,b as bn,p as pt,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn}from'./chunk-P1kjpuYu.js';import'./chunk-C8HHjL6L.js';function Ce(i,t){i&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ye(i,t){if(i&1&&(Is(0,"label",16),hg(1,"input",17),VI(),UC(2),ml()),i&2){let e=t.$implicit,n=fC(3);KE(),pg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),KE(),Il(" ",e.label," ");}}function ge(i,t){if(i&1&&(Is(0,"ds-fieldset",5),eC(1,ye,3,4,"label",16,Zw().trackByScope,true),ml()),i&2){let e=fC(2);pg("disabled",e.isEditMode()),KE(),tC(e.scopeOptions);}}function fe(i,t){if(i&1&&(Is(0,"option",8),UC(1),ml()),i&2){let e=t.$implicit,n=fC(2);pg("value",e),KE(),Lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Is(0,"ds-form-field",18),hg(1,"input",19),VI(),ml()),i&2){let e=fC().$implicit;pg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),KE(),pg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),fg("aria-describedby",e.hint?"as-hint-"+e.key:null),UI();}}function Ae(i,t){if(i&1&&Qw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=fC(3);Kw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Is(0,"ds-fieldset",13),eC(1,Ae,1,1,null,null,Zw().trackByField,true),ml()),i&2){let e=fC(2);pg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),KE(),tC(e.credentialFields());}}function be(i,t){if(i&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let o=fC();return yf(o.submit())}),Qw(1,ge,3,1,"ds-fieldset",5),Is(2,"ds-form-field",6)(3,"select",7),eC(4,fe,2,2,"option",8,Jw),ml(),VI(),ml(),Is(6,"ds-form-field",9),hg(7,"input",10),VI(),ml(),Is(8,"ds-form-field",11),hg(9,"input",12),VI(),ml(),Qw(10,ve,3,1,"ds-fieldset",13),Is(11,"ds-form-actions")(12,"button",14),UC(13),ml(),Is(14,"button",15),Eg("click",function(){mf(e);let o=fC();return yf(o.cancel())}),UC(15,"Cancel"),ml()()();}if(i&2){let e=fC();pg("formGroup",e.form),KE(),Kw(e.isPlatformMode?-1:1),KE(2),pg("formControl",e.authTypeControl),UI(),KE(),tC(e.authTypeOptions),KE(3),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.credentialFields().length>0?10:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",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?zi(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:[bn.required,bn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[bn.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=yT(()=>_e[this.selectedAuthType()]);isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Ff(()=>{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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Auth settings "),ml()(),Qw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),ml()),e&2&&(KE(),pg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),KE(3),Kw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,cn,Kt,fd,Mo,Do,Ut,Qt,Ca,fo,go,Nn,Rn],encapsulation:2})};
2
2
  export{me as AuthSettingFormComponent};
@@ -1 +1 @@
1
- import {O as O$1}from'./chunk-Bpq2cxDs.js';import {g,F,J as we,ah as _,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,j as fg,u as mf,w as yf}from'./main-KN7JT2CK.js';import {q as k,O as O$2,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dyc2eHCz.js';import'./chunk-KoagtDeJ.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading integrations\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform integrations defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No integrations match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Lg(n.integrationType),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);state=g(O$1);integrationConfigController=g(_);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return r.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New integration"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
1
+ import {O as O$1}from'./chunk-BXy0XrJ7.js';import {g,F,J as we,ah as _,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,j as fg,u as mf,w as yf}from'./main-K3GOQJ4U.js';import {q as k,O as O$2,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-P1kjpuYu.js';import'./chunk-C8HHjL6L.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading integrations\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform integrations defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No integrations match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Lg(n.integrationType),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);state=g(O$1);integrationConfigController=g(_);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return r.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New integration"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
@@ -1 +1 @@
1
- import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-Dyc2eHCz.js';import {g,J as we,W,H as L,z as zi,M as U,x as xw,I as Is,a as hg,S as Eg,Q as Qw,m as ml,T as VI,U as UC,K as KE,R as pg,b as Kw,X as UI,q as Il,a6 as Ee,a7 as Ed,a8 as A,r as fC,s as aC,L as Lg,a9 as Ln,u as mf,w as yf,l as eC,t as tC}from'./main-KN7JT2CK.js';var I=class e{api=g(Ee);isLoading=zi(false);result=zi(null);errorMessage=zi(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(Ed({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=A({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){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&&(Is(0,"p",14),UC(1,"Loading namespaces\u2026"),ml());}function pe(e,t){if(e&1&&(Is(0,"option",17),UC(1),ml()),e&2){let n=t.$implicit;pg("value",n.id),KE(),Lg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),UC(2,"Select a namespace"),ml(),eC(3,pe,2,2,"option",17,de),ml(),VI()),e&2){let n=fC(2);UI(),KE(3),tC(n.namespaces());}}function ue(e,t){if(e&1&&Qw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=fC();Kw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&hg(0,"input",3),e&2){let n=fC();pg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let l=fC();return yf(l.reset())}),UC(1,"Clear result"),ml();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),UC(2),ml()()),e&2&&(KE(2),Lg(t));}function ye(e,t){e&1&&(Is(0,"span",21),UC(1,"Metadata"),ml(),Is(2,"pre",19),UC(3),ml()),e&2&&(KE(3),Lg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Type"),ml(),Is(2,"dd",23),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Message"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),UC(1,"Tool error details"),ml(),Is(2,"dl",22),Qw(3,Ce,4,1),Qw(4,_e,4,1),ml()),e&2){let n=fC();KE(3),Kw(n.errorType?3:-1),KE(),Kw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),UC(3),ml()(),Is(4,"span",21),UC(5,"Output"),ml(),Is(6,"pre",19),UC(7),ml(),Qw(8,ye,4,1),Is(9,"span",21),UC(10,"Structured output"),ml(),Is(11,"pre",19),UC(12),ml(),Qw(13,be,5,2),ml()),e&2){let n,o=t,l=fC();pg("heading","Result \u2014 "+o.toolName),KE(2),pg("variant",o.success?"accent":"outline"),KE(),Lg(o.success?"Success":"Tool error"),KE(4),Lg(o.output),KE(),Kw((n=l.formatMetadata(o.metadata))?8:-1,n),KE(4),Lg(l.formatStructuredOutput(o.structuredOutput)??"null"),KE(),Kw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(L);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=zi([]);namespacesLoading=zi(true);namespaceName=zi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({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&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Is(2,"form",1),Eg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Qw(4,ue,2,1)(5,fe,1,1,"input",3),ml(),Is(6,"ds-form-field",4),hg(7,"input",5),VI(),ml(),Is(8,"ds-form-field",6),hg(9,"input",7),VI(),ml(),Is(10,"ds-form-field",8),hg(11,"textarea",9),VI(),ml(),Is(12,"ds-form-actions")(13,"button",10),UC(14),ml(),Qw(15,ge,2,0,"button",11),ml()(),Qw(16,ve,3,1,"ds-card",12),Qw(17,he,14,7,"ds-card",13),ml()),n&2){let l,v;KE(),pg("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."),KE(),pg("formGroup",o.form),KE(2),Kw(o.isPlatformMode?4:5),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),pg("disabled",o.form.invalid||o.state.isLoading()),KE(),Il(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),KE(),Kw(o.state.result()||o.state.errorMessage()?15:-1),KE(),Kw((l=o.state.errorMessage())?16:-1,l),KE(),Kw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
1
+ import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-P1kjpuYu.js';import {g,J as we,W,H as L,z as zi,M as U,x as xw,I as Is,a as hg,S as Eg,Q as Qw,m as ml,T as VI,U as UC,K as KE,R as pg,b as Kw,X as UI,q as Il,a6 as Ee,a7 as Ed,a8 as A,r as fC,s as aC,L as Lg,a9 as Ln,u as mf,w as yf,l as eC,t as tC}from'./main-K3GOQJ4U.js';var I=class e{api=g(Ee);isLoading=zi(false);result=zi(null);errorMessage=zi(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(Ed({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=A({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){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&&(Is(0,"p",14),UC(1,"Loading namespaces\u2026"),ml());}function pe(e,t){if(e&1&&(Is(0,"option",17),UC(1),ml()),e&2){let n=t.$implicit;pg("value",n.id),KE(),Lg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),UC(2,"Select a namespace"),ml(),eC(3,pe,2,2,"option",17,de),ml(),VI()),e&2){let n=fC(2);UI(),KE(3),tC(n.namespaces());}}function ue(e,t){if(e&1&&Qw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=fC();Kw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&hg(0,"input",3),e&2){let n=fC();pg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let l=fC();return yf(l.reset())}),UC(1,"Clear result"),ml();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),UC(2),ml()()),e&2&&(KE(2),Lg(t));}function ye(e,t){e&1&&(Is(0,"span",21),UC(1,"Metadata"),ml(),Is(2,"pre",19),UC(3),ml()),e&2&&(KE(3),Lg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Type"),ml(),Is(2,"dd",23),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Message"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),UC(1,"Tool error details"),ml(),Is(2,"dl",22),Qw(3,Ce,4,1),Qw(4,_e,4,1),ml()),e&2){let n=fC();KE(3),Kw(n.errorType?3:-1),KE(),Kw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),UC(3),ml()(),Is(4,"span",21),UC(5,"Output"),ml(),Is(6,"pre",19),UC(7),ml(),Qw(8,ye,4,1),Is(9,"span",21),UC(10,"Structured output"),ml(),Is(11,"pre",19),UC(12),ml(),Qw(13,be,5,2),ml()),e&2){let n,o=t,l=fC();pg("heading","Result \u2014 "+o.toolName),KE(2),pg("variant",o.success?"accent":"outline"),KE(),Lg(o.success?"Success":"Tool error"),KE(4),Lg(o.output),KE(),Kw((n=l.formatMetadata(o.metadata))?8:-1,n),KE(4),Lg(l.formatStructuredOutput(o.structuredOutput)??"null"),KE(),Kw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(L);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=zi([]);namespacesLoading=zi(true);namespaceName=zi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({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&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Is(2,"form",1),Eg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Qw(4,ue,2,1)(5,fe,1,1,"input",3),ml(),Is(6,"ds-form-field",4),hg(7,"input",5),VI(),ml(),Is(8,"ds-form-field",6),hg(9,"input",7),VI(),ml(),Is(10,"ds-form-field",8),hg(11,"textarea",9),VI(),ml(),Is(12,"ds-form-actions")(13,"button",10),UC(14),ml(),Qw(15,ge,2,0,"button",11),ml()(),Qw(16,ve,3,1,"ds-card",12),Qw(17,he,14,7,"ds-card",13),ml()),n&2){let l,v;KE(),pg("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."),KE(),pg("formGroup",o.form),KE(2),Kw(o.isPlatformMode?4:5),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),pg("disabled",o.form.invalid||o.state.isLoading()),KE(),Il(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),KE(),Kw(o.state.result()||o.state.errorMessage()?15:-1),KE(),Kw((l=o.state.errorMessage())?16:-1,l),KE(),Kw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -33,5 +33,5 @@
33
33
  <style>:root{--color-bg:#f5f6f8;--color-bg-solid:#f5f6f8;--color-bg-secondary:rgba(255, 255, 255, .7);--color-bg-secondary-rgb:255 255 255;--color-text:#1d1d1f;--color-text-secondary:#6e6e73;--color-text-inverse:#ffffff;--color-text-tertiary:#a1a1a6;--color-primary:#007aff;--color-primary-hover:#0051d5;--color-accent:#8b5cf6;--color-link:#007aff;--color-border:rgba(0, 0, 0, .1);--color-border-light:rgba(40, 40, 40, .08);--color-input-bg:rgba(255, 255, 255, .8);--color-bg-hover:rgba(0, 0, 0, .04);--color-success:#34c759;--color-success-bg:#e3f5e1;--color-error:#ff3b30;--color-warning:#ff9500;--color-info:#5ac8fa;--color-message-user:rgba(0, 122, 255, .1);--color-message-ai:rgba(255, 255, 255, .8);--color-code-bg:rgba(142, 142, 147, .12);--color-code-text:#ff375f;--glass-bg:rgba(255, 255, 255, .72);--glass-border:rgba(255, 255, 255, .18);--glass-shadow:0 8px 32px 0 rgba(31, 38, 135, .15);--glass-backdrop-blur:blur(20px);--color-modal-bg:#ffffff;--color-surface:#ffffff;--color-modal-border:rgba(0, 0, 0, .12);--color-modal-shadow:0 8px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .1);--color-shadow:rgba(0, 0, 0, .08);--color-overlay:rgba(0, 0, 0, .4);--color-surface-hover:var(--color-bg-hover);--color-surface-secondary:rgba(0, 0, 0, .03);--color-surface-muted:rgba(0, 0, 0, .05);--color-divider:rgba(0, 0, 0, .1)}*{box-sizing:border-box}html{color-scheme:light}html{--mat-sys-background:light-dark(#faf9fd, #121316);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f2f0f4, #2f3033);--mat-sys-inverse-primary:light-dark(#abc7ff, #005cbb);--mat-sys-inverse-surface:light-dark(#2f3033, #e3e2e6);--mat-sys-on-background:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#93000a, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #002f65);--mat-sys-on-primary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-primary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-primary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-on-secondary:light-dark(#ffffff, #283041);--mat-sys-on-secondary-container:light-dark(#3e4759, #dae2f9);--mat-sys-on-secondary-fixed:light-dark(#131c2b, #131c2b);--mat-sys-on-secondary-fixed-variant:light-dark(#3e4759, #3e4759);--mat-sys-on-surface:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-surface-variant:light-dark(#44474e, #e0e2ec);--mat-sys-on-tertiary:light-dark(#ffffff, #002f65);--mat-sys-on-tertiary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-tertiary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-tertiary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-outline:light-dark(#74777f, #8e9099);--mat-sys-outline-variant:light-dark(#c4c6d0, #44474e);--mat-sys-primary:light-dark(#005cbb, #abc7ff);--mat-sys-primary-container:light-dark(#d7e3ff, #00458f);--mat-sys-primary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-primary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#565e71, #bec6dc);--mat-sys-secondary-container:light-dark(#dae2f9, #3e4759);--mat-sys-secondary-fixed:light-dark(#dae2f9, #dae2f9);--mat-sys-secondary-fixed-dim:light-dark(#bec6dc, #bec6dc);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#faf9fd, #121316);--mat-sys-surface-bright:light-dark(#faf9fd, #38393c);--mat-sys-surface-container:light-dark(#efedf0, #1f2022);--mat-sys-surface-container-high:light-dark(#e9e7eb, #292a2c);--mat-sys-surface-container-highest:light-dark(#e3e2e6, #343537);--mat-sys-surface-container-low:light-dark(#f4f3f6, #1a1b1f);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0d0e11);--mat-sys-surface-dim:light-dark(#dbd9dd, #121316);--mat-sys-surface-tint:light-dark(#005cbb, #abc7ff);--mat-sys-surface-variant:light-dark(#e0e2ec, #44474e);--mat-sys-tertiary:light-dark(#005cbb, #abc7ff);--mat-sys-tertiary-container:light-dark(#d7e3ff, #00458f);--mat-sys-tertiary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-tertiary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-neutral-variant20:#2d3038;--mat-sys-neutral10:#1a1b1f;--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);--mat-sys-body-large:400 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-line-height:1.5rem;--mat-sys-body-large-size:1rem;--mat-sys-body-large-tracking:.031rem;--mat-sys-body-large-weight:400;--mat-sys-body-medium:400 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-line-height:1.25rem;--mat-sys-body-medium-size:.875rem;--mat-sys-body-medium-tracking:.016rem;--mat-sys-body-medium-weight:400;--mat-sys-body-small:400 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-line-height:1rem;--mat-sys-body-small-size:.75rem;--mat-sys-body-small-tracking:.025rem;--mat-sys-body-small-weight:400;--mat-sys-display-large:400 3.562rem / 4rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-line-height:4rem;--mat-sys-display-large-size:3.562rem;--mat-sys-display-large-tracking:-.016rem;--mat-sys-display-large-weight:400;--mat-sys-display-medium:400 2.812rem / 3.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-line-height:3.25rem;--mat-sys-display-medium-size:2.812rem;--mat-sys-display-medium-tracking:0;--mat-sys-display-medium-weight:400;--mat-sys-display-small:400 2.25rem / 2.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-line-height:2.75rem;--mat-sys-display-small-size:2.25rem;--mat-sys-display-small-tracking:0;--mat-sys-display-small-weight:400;--mat-sys-headline-large:400 2rem / 2.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-line-height:2.5rem;--mat-sys-headline-large-size:2rem;--mat-sys-headline-large-tracking:0;--mat-sys-headline-large-weight:400;--mat-sys-headline-medium:400 1.75rem / 2.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-line-height:2.25rem;--mat-sys-headline-medium-size:1.75rem;--mat-sys-headline-medium-tracking:0;--mat-sys-headline-medium-weight:400;--mat-sys-headline-small:400 1.5rem / 2rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-line-height:2rem;--mat-sys-headline-small-size:1.5rem;--mat-sys-headline-small-tracking:0;--mat-sys-headline-small-weight:400;--mat-sys-label-large:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-line-height:1.25rem;--mat-sys-label-large-size:.875rem;--mat-sys-label-large-tracking:.006rem;--mat-sys-label-large-weight:500;--mat-sys-label-large-weight-prominent:700;--mat-sys-label-medium:500 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-line-height:1rem;--mat-sys-label-medium-size:.75rem;--mat-sys-label-medium-tracking:.031rem;--mat-sys-label-medium-weight:500;--mat-sys-label-medium-weight-prominent:700;--mat-sys-label-small:500 .688rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-line-height:1rem;--mat-sys-label-small-size:.688rem;--mat-sys-label-small-tracking:.031rem;--mat-sys-label-small-weight:500;--mat-sys-title-large:400 1.375rem / 1.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-line-height:1.75rem;--mat-sys-title-large-size:1.375rem;--mat-sys-title-large-tracking:0;--mat-sys-title-large-weight:400;--mat-sys-title-medium:500 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-line-height:1.5rem;--mat-sys-title-medium-size:1rem;--mat-sys-title-medium-tracking:.009rem;--mat-sys-title-medium-weight:500;--mat-sys-title-small:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-line-height:1.25rem;--mat-sys-title-small-size:.875rem;--mat-sys-title-small-tracking:.006rem;--mat-sys-title-small-weight:500;--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px;--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12;--mat-snack-bar-container-shape:transparent;--mat-snack-bar-container-color:transparent;--mat-snack-bar-supporting-text-color:var(--color-text)}html,body{margin:0;padding:0;width:100%;height:100%}body{background:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Segoe UI,Helvetica Neue,Arial,sans-serif;transition:background .3s ease,color .3s ease;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:0!important}</style><link rel="stylesheet" href="styles-MATM6WIR.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-MATM6WIR.css"></noscript></head>
34
34
  <body>
35
35
  <app-root></app-root>
36
- <script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-KN7JT2CK.js" type="module"></script></body>
36
+ <script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-K3GOQJ4U.js" type="module"></script></body>
37
37
  </html>