@whoz-oss/coday-client 0.0.0-workstream-forge.253 → 0.0.0-workstream-forge.256

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 (51) hide show
  1. package/browser/{chunk-CIr1xkM7.js → chunk-3LrWBzrF.js} +1 -1
  2. package/browser/{chunk-DvRawlbU.js → chunk-7p42eTQE.js} +1 -1
  3. package/browser/{chunk-B9auxcFn.js → chunk-B0YWgYUz.js} +1 -1
  4. package/browser/{chunk-CfZRxQD1.js → chunk-B4oSnH6q.js} +1 -1
  5. package/browser/{chunk-CUJxxcVR.js → chunk-BByf0AaZ.js} +1 -1
  6. package/browser/chunk-BE-UpkfJ.js +1 -0
  7. package/browser/{chunk-B8id5BCX.js → chunk-BEGeHvbU.js} +1 -1
  8. package/browser/{chunk-CxA_xqW_.js → chunk-BJ-aqn_T.js} +1 -1
  9. package/browser/{chunk-aycY_ip-.js → chunk-BKhlmnMI.js} +1 -1
  10. package/browser/{chunk-BKdHqvrx.js → chunk-BL3wnbf2.js} +1 -1
  11. package/browser/{chunk-D7g02i9Y.js → chunk-BXDGxrbm.js} +1 -1
  12. package/browser/{chunk-D7hL0BBZ.js → chunk-BduQv2OD.js} +1 -1
  13. package/browser/{chunk-DI92LX4c.js → chunk-BiY5nHbl.js} +1 -1
  14. package/browser/{chunk-OblIjDXe.js → chunk-Bxl-W5rv.js} +1 -1
  15. package/browser/{chunk-_oXbiQ1y.js → chunk-C4XRMKqd.js} +1 -1
  16. package/browser/{chunk-Cn01h5n9.js → chunk-C6WfP1id.js} +1 -1
  17. package/browser/{chunk-6PgBoN-T.js → chunk-C6mk1TXU.js} +1 -1
  18. package/browser/{chunk-HtmwgODm.js → chunk-C80imceV.js} +1 -1
  19. package/browser/{chunk-Dwf5lQGo.js → chunk-CBB_i9zm.js} +1 -1
  20. package/browser/{chunk-FWD9NFbg.js → chunk-CWxtFbYp.js} +1 -1
  21. package/browser/{chunk-CSKtdDpE.js → chunk-CZ6YsQnn.js} +1 -1
  22. package/browser/{chunk-IHekMYOY.js → chunk-CaSrm-yj.js} +1 -1
  23. package/browser/{chunk-BHGXa4Jk.js → chunk-CbELThsL.js} +1 -1
  24. package/browser/{chunk-D4eJc3W1.js → chunk-Cck7m2qM.js} +1 -1
  25. package/browser/{chunk-N28VXTjy.js → chunk-CjF3kh6X.js} +1 -1
  26. package/browser/{chunk-C9tesIt3.js → chunk-ClmH7wru.js} +1 -1
  27. package/browser/{chunk-BrPYAXps.js → chunk-CmNMnl1X.js} +1 -1
  28. package/browser/{chunk-BXxiZ-ch.js → chunk-CrljCfTT.js} +1 -1
  29. package/browser/{chunk-a5BmxDG0.js → chunk-CsMJN87z.js} +1 -1
  30. package/browser/{chunk-CF4gtYrV.js → chunk-Cw-HKK2W.js} +1 -1
  31. package/browser/{chunk-POnNwWp0.js → chunk-D61AUiEX.js} +1 -1
  32. package/browser/{chunk-BPiV6rjO.js → chunk-DARQ9uHM.js} +1 -1
  33. package/browser/{chunk-BFkNzGvf.js → chunk-DF7k_FKN.js} +1 -1
  34. package/browser/{chunk-nTODHMVM.js → chunk-DGm40OPY.js} +1 -1
  35. package/browser/{chunk-ROlDzTu9.js → chunk-DH3KwJPn.js} +1 -1
  36. package/browser/{chunk-4QPnXZGI.js → chunk-DI1Jsft5.js} +1 -1
  37. package/browser/{chunk-Bl4JILoJ.js → chunk-DLuLiHuX.js} +1 -1
  38. package/browser/{chunk-D4PKaYXM.js → chunk-DQ6_qIZF.js} +1 -1
  39. package/browser/{chunk-UDd9uaqS.js → chunk-DVnreUZp.js} +1 -1
  40. package/browser/{chunk-Dm-C0-9-.js → chunk-DWro011L.js} +1 -1
  41. package/browser/{chunk-BGLIJwXG.js → chunk-DglDAX_u.js} +1 -1
  42. package/browser/{chunk-TphGc3H4.js → chunk-DyMrL6Ee.js} +1 -1
  43. package/browser/{chunk-Bm5g68MQ.js → chunk-FMElf1Kh.js} +1 -1
  44. package/browser/{chunk-BNfS9gqG.js → chunk-Wkqwvdp3.js} +1 -1
  45. package/browser/{chunk-DoX_Nvew.js → chunk-p_4THMZn.js} +1 -1
  46. package/browser/chunk-zs4CYUQt.js +674 -0
  47. package/browser/index.html +1 -1
  48. package/browser/{main-PZMWRMRC.js → main-DZHLOK7A.js} +1 -1
  49. package/package.json +1 -1
  50. package/browser/chunk-0rWkqE7F.js +0 -674
  51. package/browser/chunk-m1ylN0EP.js +0 -1
@@ -1 +1 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-N28VXTjy.js';import {O}from'./chunk-OblIjDXe.js';import {g,W,t as F$1,K as we,ag as U,ay as N,$ as $i,az as Q,a8 as _,o as oT,a9 as F$2,aA as Me,U as U$1,a2 as ha,aa as br,ac as by,ad as ne,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,T as AI,n as lg,u as Dl,q as $w,z as zw,F as Fg,w as pf,x as hf,as as Pg}from'./main-PZMWRMRC.js';import {N as A,p as pt$1,T as Te,g as gn,Q as E,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,v as yn,U as Ut,a as po,h as ho,Z as Zr,Y as Yr,A as An,O as On,b as hn,c as fn,u as un,o as dn,d as cn,D as pn,e as at$1,i as sn,t as an,l as Fo}from'./chunk-0rWkqE7F.js';import'./chunk-m1ylN0EP.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Es(0,"a",2),AC(1,"View resolved definition \u2192"),hl()),n&2){let e=tC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function Qe(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),NI()),n&2){let e=tC(2);dg("formControl",e.modelNameControl),AI();}}function et(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t;dg("ngValue",e.value),VE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Es(0,"optgroup",42),$w(1,tt,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Es(0,"optgroup",43),$w(1,it,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Es(0,"select",18)(1,"option",40),AC(2,"Select a model"),hl(),Bw(3,et,2,2,"option",41),Bw(4,nt,3,0,"optgroup",42),Bw(5,ot,3,0,"optgroup",43),hl(),NI()),n&2){let e,i=tC(2);dg("formControl",i.modelNameControl),AI(),VE(),dg("ngValue",null),VE(2),Vw((e=i.modelOptions().current)?3:-1,e),VE(),Vw(i.modelOptions().aliases.length>0?4:-1),VE(),Vw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),NI()),n&2){let e=tC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),AI();}}function st(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleIntegration(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,lt,2,1,"span",44),hl(),Bw(6,rt,1,2,"input",45),hl();}if(n&2){let e=t.$implicit;VE(2),dg("checked",e.enabled()),VE(2),Fg(e.config.name),VE(),Vw(e.config.integrationType?5:-1),VE(),Vw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Dl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",24),AC(2),Es(3,"span",44),AC(4,"built-in"),hl()(),Es(5,"select",47),vg("change",function(s){let c=pf(e).$implicit,C=tC(4);return hf(C.setBuiltInState(c,s.target.value))}),Es(6,"option",48),AC(7),hl(),Es(8,"option",49),AC(9,"Enabled"),hl(),Es(10,"option",50),AC(11,"Disabled"),hl()(),Bw(12,dt,2,1,"p",13),Es(13,"p",13),AC(14),hl()();}if(n&2){let e=t.$implicit,i=tC(4);VE(),lg("for","built-in-"+e.type),VE(),Dl(" ",e.displayName," "),VE(3),dg("id","built-in-"+e.type)("value",e.state()),VE(2),Fg(i.builtInDefaultLabel(e)),VE(5),Vw(e.state()==="on"&&e.restrictedTools?12:-1),VE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Es(0,"span",46),AC(1,"Built-in integrations"),hl(),$w(2,ct,15,7,"div",10,qe)),n&2){let e=tC(3);VE(2),zw(e.builtInRows());}}function ut(n,t){n&1&&(Es(0,"ds-notice",26),AC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),hl());}function gt(n,t){if(n&1&&(Es(0,"ds-fieldset",21),$w(1,st,7,4,"div",10,Ye),Bw(3,mt,4,0),Bw(4,ut,2,0,"ds-notice",26),hl()),n&2){let e=tC(2);VE(),zw(e.integrationRows()),VE(2),Vw(e.builtInRows().length>0?3:-1),VE(),Vw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&AC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),hl());}function Ct(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function _t(n,t){n&1&&(Es(0,"p",4),AC(1,"No skill available in this scope yet."),hl());}function bt(n,t){n&1&&(Es(0,"span",44),AC(1,"platform"),hl());}function ht(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSkill(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,bt,2,0,"span",44),Bw(6,ht,2,1,"span",44),hl(),Bw(7,yt,2,1,"p",13),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),VE(2),Fg(e.name),VE(),Vw(e.platform?5:-1),VE(),Vw(e.unresolved?6:-1),VE(),Vw(e.description?7:-1);}}function xt(n,t){if(n&1&&$w(0,vt,8,6,"div",10,We),n&2){let e=tC(2);zw(e.skillRows());}}function St(n,t){if(n&1&&(Es(0,"ds-form-field",30),fg(1,"textarea",52),NI(),Es(2,"p",4),AC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Es(4,"code"),AC(5,"AgentLoopPayload"),hl(),AC(6,". Leave empty if you always provide the payload at launch. "),hl()()),n&2){let e=tC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),VE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),AI();}}function At(n,t){n&1&&AC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&AC(0),n&2){let e=tC(3);Pg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),Bw(5,wt,1,2),hl()),n&2){let e=tC(2);VE(5),Vw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function kt(n,t){n&1&&(Es(0,"p",4),AC(1,"No other agent is available in this scope yet."),hl());}function It(n,t){n&1&&(Es(0,"span",44),AC(1,"pattern"),hl());}function Rt(n,t){n&1&&(Es(0,"span",44),AC(1,"via pattern"),hl());}function Mt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Qw();Es(0,"button",55),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(3);return hf(c.removeSubAgent(s))}),AC(1," \xD7 "),hl();}if(n&2){let e=tC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Qw();Es(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSubAgent(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),hl(),Bw(8,Ft,2,1,"button",54),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),VE(2),Fg(e.name),VE(),Vw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),VE(3),Vw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&$w(0,Nt,9,5,"div",32,We),n&2){let e=tC(2);zw(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Qw();Es(0,"div")(1,"button",56),vg("click",function(){pf(e);let s=tC(2);return hf(s.useDefaultDelegationTimeout())}),AC(2," Use server default "),hl()();}}function Vt(n,t){n&1&&(Es(0,"ds-notice"),AC(1),hl()),n&2&&(VE(),Fg(t));}function Pt(n,t){if(n&1){let e=Qw();Es(0,"button",57),vg("click",function(){pf(e);let s=tC(2);return hf(s.exportYaml())}),AC(1),hl();}if(n&2){let e=tC(2);dg("disabled",e.isExporting()),VE(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let s=tC();return hf(s.submit())}),Es(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),NI(),hl(),Es(4,"div",10)(5,"label",11),fg(6,"input",12),NI(),AC(7," Enabled "),hl(),Es(8,"p",13),AC(9,"Disabled agents are excluded from namespace resolution."),hl()(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"ds-form-field",16),Bw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),hl(),Es(15,"ds-form-field",19),fg(16,"textarea",20),NI(),hl()(),Bw(17,gt,5,2,"ds-fieldset",21),Es(18,"ds-fieldset",22)(19,"p",4),AC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Es(21,"code"),AC(22,"readSkill"),hl(),AC(23," and "),Es(24,"code"),AC(25,"readSkillResource"),hl(),AC(26," tools; selecting none grants neither. "),Bw(27,pt,1,0),hl(),Es(28,"label",11)(29,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSkills())}),hl(),Es(30,"span",24),AC(31,"Every skill in the catalogue ("),Es(32,"code",25),AC(33,"*"),hl(),AC(34,")"),hl()(),Es(35,"p",13),AC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),hl(),Bw(37,ft,5,0,"ds-notice",26),Bw(38,Ct,2,0,"ds-notice"),Bw(39,_t,2,0,"p",4)(40,xt,2,0),hl(),Es(41,"ds-form-field",27)(42,"select",28)(43,"option",29),AC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),hl(),Es(45,"option",29),AC(46,"ADVANCED \u2014 Multi-step reasoning loop"),hl(),Es(47,"option",29),AC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),hl()(),NI(),hl(),Bw(49,St,7,3,"ds-form-field",30),Es(50,"ds-fieldset",31)(51,"p",4),AC(52," The agents this one may delegate to. Selecting at least one grants it the "),Es(53,"code"),AC(54,"DELEGATE__delegate"),hl(),AC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Bw(56,At,1,0),hl(),Es(57,"label",11)(58,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSubAgents())}),hl(),Es(59,"span",24),AC(60,"Every agent it can reach ("),Es(61,"code",25),AC(62,"*"),hl(),AC(63,")"),hl()(),Es(64,"p",13),AC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),hl(),Bw(66,Et,6,1,"ds-notice",26),Bw(67,Tt,2,0,"ds-notice"),Bw(68,kt,2,0,"p",4)(69,Dt,2,0),Es(70,"p",4),AC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Es(72,"code"),AC(73,"*Fixer"),hl(),AC(74," to cover BugFixer and StoryFixer. "),hl(),Es(75,"div",32)(76,"input",33),vg("keydown.enter",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),hl(),NI(),Es(77,"button",34),vg("click",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),AC(78," + "),hl()(),Es(79,"ds-form-field",35),fg(80,"input",36),NI(),Bw(81,Lt,3,0,"div"),hl()(),Bw(82,Vt,2,1,"ds-notice"),Es(83,"ds-form-actions")(84,"button",37),AC(85),hl(),Bw(86,Pt,2,2,"button",38),Es(87,"button",39),vg("click",function(){pf(e);let s=tC();return hf(s.cancel())}),AC(88,"Cancel"),hl()()();}if(n&2){let e,i=tC();dg("formGroup",i.form),VE(3),dg("formControl",i.nameControl),AI(),VE(3),dg("formControl",i.enabledControl),AI(),VE(5),dg("formControl",i.descriptionControl),AI(),VE(2),Vw(i.modelAsFreeText()?13:14),VE(3),dg("formControl",i.instructionsControl),AI(),VE(),Vw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),VE(10),Vw(i.isPlatformMode?27:-1),VE(2),dg("checked",i.allSkillsSelected()),VE(8),Vw(i.namedSkillSelectionDropped()?37:-1),VE(),Vw(i.skillCatalogueUnavailable()?38:-1),VE(),Vw(i.skillRows().length===0?39:40),VE(3),dg("formControl",i.executionModeControl),AI(),VE(),dg("value",i.ExecutionMode.SIMPLE),VE(2),dg("value",i.ExecutionMode.ADVANCED),VE(2),dg("value",i.ExecutionMode.LOOP),VE(2),Vw(i.isLoopMode()?49:-1),VE(7),Vw(i.isPlatformMode?56:-1),VE(2),dg("checked",i.allSubAgentsSelected()),VE(8),Vw(i.namedSubAgentSelectionDropped()?66:-1),VE(),Vw(i.subAgentCandidatesUnavailable()?67:-1),VE(),Vw(i.subAgentRows().length===0?68:69),VE(8),dg("formControl",i.newSubAgentControl),AI(),VE(),dg("disabled",!i.newSubAgentControl.value.trim()),VE(2),dg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),VE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),AI(),VE(),Vw(i.delegationTimeoutControl.value!==null?81:-1),VE(),Vw((e=i.submitError())?82:-1,e),VE(2),dg("disabled",i.form.invalid||i.isSubmitting()),VE(),Dl(" ",i.isEditMode()?"Save changes":"Create"," "),VE(),Vw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=$i(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[gn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[gn.min(1),gn.max(2147483647),gn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=oT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=oT(()=>this.executionModeValue()==="LOOP");subAgentRows=$i([]);allSubAgentsSelected=$i(false);subAgentCandidatesUnavailable=$i(false);namedSubAgentSelectionDropped=oT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=oT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=oT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);isExporting=$i(false);submitError=$i(null);ExecutionMode=Me;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=$i([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=oT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=$i({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=$i(false);modelAsFreeText=oT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=$i([]);skillRows=$i([]);allSkillsSelected=$i(false);skillCatalogueUnavailable=$i(false);namedSkillSelectionDropped=oT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ha(()=>br(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),by({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){by({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ha(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),br([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:$i(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:$i(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):br([]);return by({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ha(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),br([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:$i(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:$i(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ha(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:$i(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:$i(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:$i(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return i.cancel()}),AC(3," \u2190 Agent configs "),hl(),Bw(4,ze,2,1,"a",2),Bw(5,Xe,2,0,"ds-tag",3),hl(),Bw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),hl()),e&2&&(VE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),VE(3),Vw(i.isEditMode()?4:-1),VE(),Vw(i.isPlatformMode?5:-1),VE(),Vw(i.isLoading()?6:7));},dependencies:[qt,md,Co,Mo,Ht,Fn,yn,Ut,po,ho,Zr,Yr,An,On,$t,hn,fn,un,dn,cn,pn,at$1,sn,an,Fo],encapsulation:2})};export{Ke as AgentConfigFormComponent};
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CjF3kh6X.js';import {O}from'./chunk-Bxl-W5rv.js';import {g,W,t as F$1,K as we,ag as U,ay as N,$ as $i,az as Q,a8 as _,o as oT,a9 as F$2,aA as Me,U as U$1,a2 as ha,aa as br,ac as by,ad as ne,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,T as AI,n as lg,u as Dl,q as $w,z as zw,F as Fg,w as pf,x as hf,as as Pg}from'./main-DZHLOK7A.js';import {N as A,p as pt$1,T as Te,g as gn,Q as E,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,v as yn,U as Ut,a as po,h as ho,Z as Zr,Y as Yr,A as An,O as On,b as hn,c as fn,u as un,o as dn,d as cn,D as pn,e as at$1,i as sn,t as an,l as Fo}from'./chunk-zs4CYUQt.js';import'./chunk-BE-UpkfJ.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Es(0,"a",2),AC(1,"View resolved definition \u2192"),hl()),n&2){let e=tC();dg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function Qe(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function Ze(n,t){if(n&1&&(fg(0,"input",17),NI()),n&2){let e=tC(2);dg("formControl",e.modelNameControl),AI();}}function et(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t;dg("ngValue",e.value),VE(),Fg(e.label);}}function tt(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function nt(n,t){if(n&1&&(Es(0,"optgroup",42),$w(1,tt,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Es(0,"option",41),AC(1),hl()),n&2){let e=t.$implicit;dg("ngValue",e.value),VE(),Fg(e.label);}}function ot(n,t){if(n&1&&(Es(0,"optgroup",43),$w(1,it,2,2,"option",41,je),hl()),n&2){let e=tC(3);VE(),zw(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Es(0,"select",18)(1,"option",40),AC(2,"Select a model"),hl(),Bw(3,et,2,2,"option",41),Bw(4,nt,3,0,"optgroup",42),Bw(5,ot,3,0,"optgroup",43),hl(),NI()),n&2){let e,i=tC(2);dg("formControl",i.modelNameControl),AI(),VE(),dg("ngValue",null),VE(2),Vw((e=i.modelOptions().current)?3:-1,e),VE(),Vw(i.modelOptions().aliases.length>0?4:-1),VE(),Vw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.config.integrationType);}}function rt(n,t){if(n&1&&(fg(0,"input",45),NI()),n&2){let e=tC().$implicit;dg("formControl",e.toolsControl),lg("aria-label","Tools of "+e.config.name),AI();}}function st(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",23),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleIntegration(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,lt,2,1,"span",44),hl(),Bw(6,rt,1,2,"input",45),hl();}if(n&2){let e=t.$implicit;VE(2),dg("checked",e.enabled()),VE(2),Fg(e.config.name),VE(),Vw(e.config.integrationType?5:-1),VE(),Vw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Dl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",24),AC(2),Es(3,"span",44),AC(4,"built-in"),hl()(),Es(5,"select",47),vg("change",function(s){let c=pf(e).$implicit,C=tC(4);return hf(C.setBuiltInState(c,s.target.value))}),Es(6,"option",48),AC(7),hl(),Es(8,"option",49),AC(9,"Enabled"),hl(),Es(10,"option",50),AC(11,"Disabled"),hl()(),Bw(12,dt,2,1,"p",13),Es(13,"p",13),AC(14),hl()();}if(n&2){let e=t.$implicit,i=tC(4);VE(),lg("for","built-in-"+e.type),VE(),Dl(" ",e.displayName," "),VE(3),dg("id","built-in-"+e.type)("value",e.state()),VE(2),Fg(i.builtInDefaultLabel(e)),VE(5),Vw(e.state()==="on"&&e.restrictedTools?12:-1),VE(2),Fg(e.description);}}function mt(n,t){if(n&1&&(Es(0,"span",46),AC(1,"Built-in integrations"),hl(),$w(2,ct,15,7,"div",10,qe)),n&2){let e=tC(3);VE(2),zw(e.builtInRows());}}function ut(n,t){n&1&&(Es(0,"ds-notice",26),AC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),hl());}function gt(n,t){if(n&1&&(Es(0,"ds-fieldset",21),$w(1,st,7,4,"div",10,Ye),Bw(3,mt,4,0),Bw(4,ut,2,0,"ds-notice",26),hl()),n&2){let e=tC(2);VE(),zw(e.integrationRows()),VE(2),Vw(e.builtInRows().length>0?3:-1),VE(),Vw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&AC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),hl());}function Ct(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function _t(n,t){n&1&&(Es(0,"p",4),AC(1,"No skill available in this scope yet."),hl());}function bt(n,t){n&1&&(Es(0,"span",44),AC(1,"platform"),hl());}function ht(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Es(0,"p",13),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.description);}}function vt(n,t){if(n&1){let e=Qw();Es(0,"div",10)(1,"label",11)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSkill(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,bt,2,0,"span",44),Bw(6,ht,2,1,"span",44),hl(),Bw(7,yt,2,1,"p",13),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSkillsSelected()),VE(2),Fg(e.name),VE(),Vw(e.platform?5:-1),VE(),Vw(e.unresolved?6:-1),VE(),Vw(e.description?7:-1);}}function xt(n,t){if(n&1&&$w(0,vt,8,6,"div",10,We),n&2){let e=tC(2);zw(e.skillRows());}}function St(n,t){if(n&1&&(Es(0,"ds-form-field",30),fg(1,"textarea",52),NI(),Es(2,"p",4),AC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Es(4,"code"),AC(5,"AgentLoopPayload"),hl(),AC(6,". Leave empty if you always provide the payload at launch. "),hl()()),n&2){let e=tC(2);dg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),VE(),dg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),AI();}}function At(n,t){n&1&&AC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&AC(0),n&2){let e=tC(3);Pg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Es(0,"ds-notice",26),AC(1," Saving with this on replaces the selection below with "),Es(2,"code",25),AC(3,"*"),hl(),AC(4,". "),Bw(5,wt,1,2),hl()),n&2){let e=tC(2);VE(5),Vw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Es(0,"ds-notice"),AC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),hl());}function kt(n,t){n&1&&(Es(0,"p",4),AC(1,"No other agent is available in this scope yet."),hl());}function It(n,t){n&1&&(Es(0,"span",44),AC(1,"pattern"),hl());}function Rt(n,t){n&1&&(Es(0,"span",44),AC(1,"via pattern"),hl());}function Mt(n,t){if(n&1&&(Es(0,"span",44),AC(1),hl()),n&2){let e=tC(4);VE(),Dl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Qw();Es(0,"button",55),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(3);return hf(c.removeSubAgent(s))}),AC(1," \xD7 "),hl();}if(n&2){let e=tC().$implicit;lg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Qw();Es(0,"div",32)(1,"label",53)(2,"input",51),vg("change",function(){let s=pf(e).$implicit,c=tC(3);return hf(c.toggleSubAgent(s))}),hl(),Es(3,"span",24),AC(4),hl(),Bw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),hl(),Bw(8,Ft,2,1,"button",54),hl();}if(n&2){let e=t.$implicit,i=tC(3);VE(2),dg("checked",e.selected())("disabled",i.allSubAgentsSelected()),VE(2),Fg(e.name),VE(),Vw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),VE(3),Vw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&$w(0,Nt,9,5,"div",32,We),n&2){let e=tC(2);zw(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Qw();Es(0,"div")(1,"button",56),vg("click",function(){pf(e);let s=tC(2);return hf(s.useDefaultDelegationTimeout())}),AC(2," Use server default "),hl()();}}function Vt(n,t){n&1&&(Es(0,"ds-notice"),AC(1),hl()),n&2&&(VE(),Fg(t));}function Pt(n,t){if(n&1){let e=Qw();Es(0,"button",57),vg("click",function(){pf(e);let s=tC(2);return hf(s.exportYaml())}),AC(1),hl();}if(n&2){let e=tC(2);dg("disabled",e.isExporting()),VE(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let s=tC();return hf(s.submit())}),Es(1,"ds-fieldset",7)(2,"ds-form-field",8),fg(3,"input",9),NI(),hl(),Es(4,"div",10)(5,"label",11),fg(6,"input",12),NI(),AC(7," Enabled "),hl(),Es(8,"p",13),AC(9,"Disabled agents are excluded from namespace resolution."),hl()(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"ds-form-field",16),Bw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),hl(),Es(15,"ds-form-field",19),fg(16,"textarea",20),NI(),hl()(),Bw(17,gt,5,2,"ds-fieldset",21),Es(18,"ds-fieldset",22)(19,"p",4),AC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Es(21,"code"),AC(22,"readSkill"),hl(),AC(23," and "),Es(24,"code"),AC(25,"readSkillResource"),hl(),AC(26," tools; selecting none grants neither. "),Bw(27,pt,1,0),hl(),Es(28,"label",11)(29,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSkills())}),hl(),Es(30,"span",24),AC(31,"Every skill in the catalogue ("),Es(32,"code",25),AC(33,"*"),hl(),AC(34,")"),hl()(),Es(35,"p",13),AC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),hl(),Bw(37,ft,5,0,"ds-notice",26),Bw(38,Ct,2,0,"ds-notice"),Bw(39,_t,2,0,"p",4)(40,xt,2,0),hl(),Es(41,"ds-form-field",27)(42,"select",28)(43,"option",29),AC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),hl(),Es(45,"option",29),AC(46,"ADVANCED \u2014 Multi-step reasoning loop"),hl(),Es(47,"option",29),AC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),hl()(),NI(),hl(),Bw(49,St,7,3,"ds-form-field",30),Es(50,"ds-fieldset",31)(51,"p",4),AC(52," The agents this one may delegate to. Selecting at least one grants it the "),Es(53,"code"),AC(54,"DELEGATE__delegate"),hl(),AC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Bw(56,At,1,0),hl(),Es(57,"label",11)(58,"input",23),vg("change",function(){pf(e);let s=tC();return hf(s.toggleAllSubAgents())}),hl(),Es(59,"span",24),AC(60,"Every agent it can reach ("),Es(61,"code",25),AC(62,"*"),hl(),AC(63,")"),hl()(),Es(64,"p",13),AC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),hl(),Bw(66,Et,6,1,"ds-notice",26),Bw(67,Tt,2,0,"ds-notice"),Bw(68,kt,2,0,"p",4)(69,Dt,2,0),Es(70,"p",4),AC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Es(72,"code"),AC(73,"*Fixer"),hl(),AC(74," to cover BugFixer and StoryFixer. "),hl(),Es(75,"div",32)(76,"input",33),vg("keydown.enter",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),hl(),NI(),Es(77,"button",34),vg("click",function(){pf(e);let s=tC();return hf(s.addSubAgent())}),AC(78," + "),hl()(),Es(79,"ds-form-field",35),fg(80,"input",36),NI(),Bw(81,Lt,3,0,"div"),hl()(),Bw(82,Vt,2,1,"ds-notice"),Es(83,"ds-form-actions")(84,"button",37),AC(85),hl(),Bw(86,Pt,2,2,"button",38),Es(87,"button",39),vg("click",function(){pf(e);let s=tC();return hf(s.cancel())}),AC(88,"Cancel"),hl()()();}if(n&2){let e,i=tC();dg("formGroup",i.form),VE(3),dg("formControl",i.nameControl),AI(),VE(3),dg("formControl",i.enabledControl),AI(),VE(5),dg("formControl",i.descriptionControl),AI(),VE(2),Vw(i.modelAsFreeText()?13:14),VE(3),dg("formControl",i.instructionsControl),AI(),VE(),Vw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),VE(10),Vw(i.isPlatformMode?27:-1),VE(2),dg("checked",i.allSkillsSelected()),VE(8),Vw(i.namedSkillSelectionDropped()?37:-1),VE(),Vw(i.skillCatalogueUnavailable()?38:-1),VE(),Vw(i.skillRows().length===0?39:40),VE(3),dg("formControl",i.executionModeControl),AI(),VE(),dg("value",i.ExecutionMode.SIMPLE),VE(2),dg("value",i.ExecutionMode.ADVANCED),VE(2),dg("value",i.ExecutionMode.LOOP),VE(2),Vw(i.isLoopMode()?49:-1),VE(7),Vw(i.isPlatformMode?56:-1),VE(2),dg("checked",i.allSubAgentsSelected()),VE(8),Vw(i.namedSubAgentSelectionDropped()?66:-1),VE(),Vw(i.subAgentCandidatesUnavailable()?67:-1),VE(),Vw(i.subAgentRows().length===0?68:69),VE(8),dg("formControl",i.newSubAgentControl),AI(),VE(),dg("disabled",!i.newSubAgentControl.value.trim()),VE(2),dg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),VE(),dg("formControl",i.delegationTimeoutControl),lg("aria-invalid",i.delegationTimeoutControl.invalid),AI(),VE(),Vw(i.delegationTimeoutControl.value!==null?81:-1),VE(),Vw((e=i.submitError())?82:-1,e),VE(2),dg("disabled",i.form.invalid||i.isSubmitting()),VE(),Dl(" ",i.isEditMode()?"Save changes":"Create"," "),VE(),Vw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=$i(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[gn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[gn.min(1),gn.max(2147483647),gn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=oT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=oT(()=>this.executionModeValue()==="LOOP");subAgentRows=$i([]);allSubAgentsSelected=$i(false);subAgentCandidatesUnavailable=$i(false);namedSubAgentSelectionDropped=oT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=oT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=oT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);isExporting=$i(false);submitError=$i(null);ExecutionMode=Me;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=$i([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=oT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=$i({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=$i(false);modelAsFreeText=oT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=$i([]);skillRows=$i([]);allSkillsSelected=$i(false);skillCatalogueUnavailable=$i(false);namedSkillSelectionDropped=oT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ha(()=>br(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),by({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){by({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ha(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),br([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:$i(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:$i(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):br([]);return by({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ha(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),br([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:$i(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:$i(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ha(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:$i(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:$i(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:$i(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return i.cancel()}),AC(3," \u2190 Agent configs "),hl(),Bw(4,ze,2,1,"a",2),Bw(5,Xe,2,0,"ds-tag",3),hl(),Bw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),hl()),e&2&&(VE(),dg("title",i.isEditMode()?"Edit agent config":"New agent config"),VE(3),Vw(i.isEditMode()?4:-1),VE(),Vw(i.isPlatformMode?5:-1),VE(),Vw(i.isLoading()?6:7));},dependencies:[qt,md,Co,Mo,Ht,Fn,yn,Ut,po,ho,Zr,Yr,An,On,$t,hn,fn,un,dn,cn,pn,at$1,sn,an,Fo],encapsulation:2})};export{Ke as AgentConfigFormComponent};
@@ -1 +1 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-N28VXTjy.js';import {I as s,b as hn,c as fn,r as rn,D as pn,e as at,n as ln,l as Fo,J as Pi,K as On}from'./chunk-0rWkqE7F.js';import {g,W,t as F,K as we,$ as $i,o as oT,U,ac as by,a2 as ha,aa as br,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,i as Vw,v as tC,P as dg,Q as Qw,f as fg,av as QC,F as Fg,u as Dl,aw as XC,q as $w,z as zw,ao as Uw,w as pf,x as hf,ax as YD}from'./main-PZMWRMRC.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Es(0,"a",2),AC(1,"Edit skill \u2192"),hl()),e&2){let n=tC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function te(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function ne(e,t){e&1&&(Es(0,"ds-notice"),AC(1,"Failed to load skill."),hl());}function ie(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Created by"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Last updated"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(Bw(0,ie,4,1),Bw(1,oe,4,1)),e&2){let n=tC();Vw(n.createdBy?0:-1),VE(),Vw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Es(0,"p",4),AC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),hl());}function se(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function re(e,t){e&1&&(Es(0,"ds-notice"),AC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),hl());}function de(e,t){e&1&&(Es(0,"p",4),AC(1,"No agent references this skill."),hl());}function ce(e,t){e&1&&(Es(0,"ds-tag",15),AC(1,"platform agent"),hl());}function me(e,t){e&1&&(Es(0,"ds-tag",15),AC(1,"via *"),hl());}function pe(e,t){if(e&1&&(Es(0,"li",13)(1,"span",14),AC(2),hl(),Bw(3,ce,2,0,"ds-tag",15),Bw(4,me,2,0,"ds-tag",15),hl()),e&2){let n=t.$implicit;VE(2),Fg(n.name),VE(),Vw(n.platform?3:-1),VE(),Vw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Es(0,"ul",12),$w(1,pe,5,3,"li",13,Y),hl(),Es(3,"p",4),AC(4," An agent listed "),Es(5,"code"),AC(6,"via *"),hl(),AC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),hl()),e&2){let n=tC(2);VE(),zw(n.consumers());}}function _e(e,t){e&1&&(Es(0,"p",4),AC(1,"No resources bundled with this skill."),hl());}function ge(e,t){if(e&1){let n=Qw();Es(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=pf(n).$implicit,g=tC(3);return hf(g.toggleResource(r))}),Es(2,"pre",17),AC(3),hl()()();}if(e&2){let n=t.$implicit,o=tC(3);VE(),dg("heading",n)("open",o.isResourceExpanded(n)),VE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Es(0,"ul",12),$w(1,ge,4,3,"li",null,Uw),hl()),e&2){let n=tC(2);VE(),zw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Qw();Es(0,"ds-card",5)(1,"dl",6)(2,"dt"),AC(3,"Name"),hl(),Es(4,"dd",7),AC(5),hl(),Es(6,"dt"),AC(7,"Description"),hl(),Es(8,"dd"),AC(9),hl(),Es(10,"dt"),AC(11,"Scope"),hl(),Es(12,"dd"),AC(13),hl(),Es(14,"dt"),AC(15,"Storage"),hl(),Es(16,"dd")(17,"ds-tag",8),AC(18),hl()(),Bw(19,ae,2,2),hl()(),Es(20,"ds-card",9),Bw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),hl(),Es(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){pf(n);let r=tC();return hf(r.toggleBody())}),fg(28,"div",11),QC(29,"agentosMarkdown"),hl()(),Es(30,"ds-card",9),Bw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),hl();}if(e&2){let n=t,o=tC();VE(5),Fg(n.name),VE(4),Fg(n.description),VE(4),Fg(n.namespaceId?"Namespace":"Platform"),VE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),VE(),Dl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),VE(),Vw(o.isFilesystemBacked()?-1:19),VE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),VE(),Vw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),VE(6),dg("open",!o.bodyCollapsed()),VE(),dg("innerHTML",XC(29,12,n.body),YD),VE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),VE(),Vw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);skill=$i(null);bodyCollapsed=$i(false);expandedResources=$i(new Set);resourcePaths=oT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=oT(()=>this.skill()?.readOnly===true);consumers=$i([]);consumersUnavailable=$i(false);consumersLoading=$i(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),AC(3,"\u2190 Skills"),hl(),Bw(4,Z,2,1,"a",2),Bw(5,ee,2,0,"ds-tag",3),hl(),Bw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),hl()),n&2){let r;VE(4),Vw(o.skill()&&!o.isFilesystemBacked()?4:-1),VE(),Vw(o.isPlatformMode?5:-1),VE(),Vw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Fo,Pi,On],encapsulation:2})};export{X as SkillInspectComponent};
1
+ import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CjF3kh6X.js';import {I as s,b as hn,c as fn,r as rn,D as pn,e as at,n as ln,l as Fo,J as Pi,K as On}from'./chunk-zs4CYUQt.js';import {g,W,t as F,K as we,$ as $i,o as oT,U,ac as by,a2 as ha,aa as br,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,i as Vw,v as tC,P as dg,Q as Qw,f as fg,av as QC,F as Fg,u as Dl,aw as XC,q as $w,z as zw,ao as Uw,w as pf,x as hf,ax as YD}from'./main-DZHLOK7A.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Es(0,"a",2),AC(1,"Edit skill \u2192"),hl()),e&2){let n=tC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function te(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function ne(e,t){e&1&&(Es(0,"ds-notice"),AC(1,"Failed to load skill."),hl());}function ie(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Created by"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Es(0,"dt"),AC(1,"Last updated"),hl(),Es(2,"dd"),AC(3),hl()),e&2){let n=tC(2);VE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(Bw(0,ie,4,1),Bw(1,oe,4,1)),e&2){let n=tC();Vw(n.createdBy?0:-1),VE(),Vw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Es(0,"p",4),AC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),hl());}function se(e,t){e&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function re(e,t){e&1&&(Es(0,"ds-notice"),AC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),hl());}function de(e,t){e&1&&(Es(0,"p",4),AC(1,"No agent references this skill."),hl());}function ce(e,t){e&1&&(Es(0,"ds-tag",15),AC(1,"platform agent"),hl());}function me(e,t){e&1&&(Es(0,"ds-tag",15),AC(1,"via *"),hl());}function pe(e,t){if(e&1&&(Es(0,"li",13)(1,"span",14),AC(2),hl(),Bw(3,ce,2,0,"ds-tag",15),Bw(4,me,2,0,"ds-tag",15),hl()),e&2){let n=t.$implicit;VE(2),Fg(n.name),VE(),Vw(n.platform?3:-1),VE(),Vw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Es(0,"ul",12),$w(1,pe,5,3,"li",13,Y),hl(),Es(3,"p",4),AC(4," An agent listed "),Es(5,"code"),AC(6,"via *"),hl(),AC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),hl()),e&2){let n=tC(2);VE(),zw(n.consumers());}}function _e(e,t){e&1&&(Es(0,"p",4),AC(1,"No resources bundled with this skill."),hl());}function ge(e,t){if(e&1){let n=Qw();Es(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=pf(n).$implicit,g=tC(3);return hf(g.toggleResource(r))}),Es(2,"pre",17),AC(3),hl()()();}if(e&2){let n=t.$implicit,o=tC(3);VE(),dg("heading",n)("open",o.isResourceExpanded(n)),VE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Es(0,"ul",12),$w(1,ge,4,3,"li",null,Uw),hl()),e&2){let n=tC(2);VE(),zw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Qw();Es(0,"ds-card",5)(1,"dl",6)(2,"dt"),AC(3,"Name"),hl(),Es(4,"dd",7),AC(5),hl(),Es(6,"dt"),AC(7,"Description"),hl(),Es(8,"dd"),AC(9),hl(),Es(10,"dt"),AC(11,"Scope"),hl(),Es(12,"dd"),AC(13),hl(),Es(14,"dt"),AC(15,"Storage"),hl(),Es(16,"dd")(17,"ds-tag",8),AC(18),hl()(),Bw(19,ae,2,2),hl()(),Es(20,"ds-card",9),Bw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),hl(),Es(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){pf(n);let r=tC();return hf(r.toggleBody())}),fg(28,"div",11),QC(29,"agentosMarkdown"),hl()(),Es(30,"ds-card",9),Bw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),hl();}if(e&2){let n=t,o=tC();VE(5),Fg(n.name),VE(4),Fg(n.description),VE(4),Fg(n.namespaceId?"Namespace":"Platform"),VE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),VE(),Dl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),VE(),Vw(o.isFilesystemBacked()?-1:19),VE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),VE(),Vw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),VE(6),dg("open",!o.bodyCollapsed()),VE(),dg("innerHTML",XC(29,12,n.body),YD),VE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),VE(),Vw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);skill=$i(null);bodyCollapsed=$i(false);expandedResources=$i(new Set);resourcePaths=oT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=oT(()=>this.skill()?.readOnly===true);consumers=$i([]);consumersUnavailable=$i(false);consumersLoading=$i(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),AC(3,"\u2190 Skills"),hl(),Bw(4,Z,2,1,"a",2),Bw(5,ee,2,0,"ds-tag",3),hl(),Bw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),hl()),n&2){let r;VE(4),Vw(o.skill()&&!o.isFilesystemBacked()?4:-1),VE(),Vw(o.isPlatformMode?5:-1),VE(),Vw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Fo,Pi,On],encapsulation:2})};export{X as SkillInspectComponent};
@@ -1 +1 @@
1
- import {p as pt,T as Te,g as gn,b as hn,c as fn,u as un,o as dn,d as cn,e as at,i as sn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,v as yn,U as Ut,a as po,h as ho,Z as Zr,Y as Yr,A as An,O as On,w as wa}from'./chunk-0rWkqE7F.js';import {g,W,t as F,K as we,aq as k,ap as F$1,a9 as F$2,a2 as ha,aa as br,ar as Ne,o as oT,$ as $i,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,f as fg,S as NI,q as $w,ao as Uw,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,as as Pg,w as pf,x as hf}from'./main-PZMWRMRC.js';function he(r,t){r&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ve(r,t){if(r&1&&fg(0,"input",6),r&2){let e=tC(2);dg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Es(0,"option",44),AC(1),hl()),r&2){let e=t.$implicit;dg("value",e.id),VE(),Pg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Es(0,"select",7)(1,"option",43),AC(2,"Select provider"),hl(),$w(3,ye,2,3,"option",44,Lw().trackByProvider,true),hl(),NI()),r&2){let e=tC(2);dg("formControl",e.aiProviderIdControl),AI(),VE(3),zw(e.providers());}}function xe(r,t){if(r&1&&(Es(0,"option",25),AC(1),hl()),r&2){let e=t.$implicit;dg("ngValue",e),VE(),Fg(e.toLowerCase());}}function _e(r,t){r&1&&(Es(0,"p",2),AC(1,"Not supported yet for Anthropic and Gemini providers."),hl());}function Me(r,t){r&1&&(Es(0,"p",2),AC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),hl());}function Ee(r,t){r&1&&(Es(0,"p",26),AC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),hl());}function Ae(r,t){if(r&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let u=tC();return hf(u.submit())}),Es(1,"ds-form-field",5),Bw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),hl(),Es(4,"ds-form-field",8),fg(5,"input",9),NI(),hl(),Es(6,"ds-form-field",10),fg(7,"input",11),NI(),hl(),Es(8,"ds-form-field",12),fg(9,"input",13),NI(),hl(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"div",16)(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19),fg(16,"input",20),NI(),hl()(),Es(17,"ds-form-field",21),fg(18,"input",22),NI(),hl(),Es(19,"ds-form-field",23)(20,"select",24)(21,"option",25),AC(22,"Provider default"),hl(),$w(23,xe,2,2,"option",25,Uw),hl(),NI(),Bw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Bw(27,Ee,2,0,"p",26),hl(),Es(28,"div",27)(29,"label",28),fg(30,"input",29),NI(),Es(31,"span",30),AC(32,"Supports advanced execution"),hl()(),Es(33,"p",31),AC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),hl()(),Es(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),fg(38,"input",34),NI(),hl(),Es(39,"ds-form-field",35),fg(40,"input",36),NI(),hl()(),Es(41,"div",16)(42,"ds-form-field",37),fg(43,"input",38),NI(),hl(),Es(44,"ds-form-field",39),fg(45,"input",40),NI(),hl()()(),Es(46,"ds-form-actions")(47,"button",41),AC(48),hl(),Es(49,"button",42),vg("click",function(){pf(e);let u=tC();return hf(u.cancel())}),AC(50,"Cancel"),hl()()();}if(r&2){let e=tC();dg("formGroup",e.form),VE(2),Vw(e.isEditMode()?2:3),VE(3),dg("formControl",e.apiModelNameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.aliasControl),AI(),VE(2),dg("formControl",e.priorityControl),AI(),VE(3),dg("formControl",e.temperatureControl),AI(),VE(2),dg("formControl",e.contextWindowControl),AI(),VE(2),dg("formControl",e.maxCompletionTokensControl),AI(),VE(2),dg("formControl",e.reasoningEffortControl),AI(),VE(),dg("ngValue",null),VE(2),zw(e.reasoningEffortOptions),VE(2),Vw(e.reasoningEffortUnsupported()?25:26),VE(2),Vw(e.temperatureMayConflictWithEffort()?27:-1),VE(3),dg("formControl",e.supportsAdvancedExecutionControl),AI(),VE(5),dg("formGroup",e.pricingGroup),VE(3),AI(),VE(2),AI(),VE(3),AI(),VE(2),AI(),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ha(()=>br([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[gn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=oT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=oT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);selectedProviderLabel=oT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Of(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Dw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return c.cancel()}),AC(3," \u2190 AI models "),hl()(),Bw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),hl()),e&2&&(VE(),dg("title",c.isEditMode()?"Edit AI model":"New AI model"),VE(3),Vw(c.isLoading()?4:5));},dependencies:[hn,fn,un,dn,cn,at,sn,qt,md,Co,Mo,Ht,Fn,yn,Ut,po,ho,Zr,Yr,An,On,wa],encapsulation:2})};export{ge as AiModelFormComponent};
1
+ import {p as pt,T as Te,g as gn,b as hn,c as fn,u as un,o as dn,d as cn,e as at,i as sn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,v as yn,U as Ut,a as po,h as ho,Z as Zr,Y as Yr,A as An,O as On,w as wa}from'./chunk-zs4CYUQt.js';import {g,W,t as F,K as we,aq as k,ap as F$1,a9 as F$2,a2 as ha,aa as br,ar as Ne,o as oT,$ as $i,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,f as fg,S as NI,q as $w,ao as Uw,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,as as Pg,w as pf,x as hf}from'./main-DZHLOK7A.js';function he(r,t){r&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ve(r,t){if(r&1&&fg(0,"input",6),r&2){let e=tC(2);dg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Es(0,"option",44),AC(1),hl()),r&2){let e=t.$implicit;dg("value",e.id),VE(),Pg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Es(0,"select",7)(1,"option",43),AC(2,"Select provider"),hl(),$w(3,ye,2,3,"option",44,Lw().trackByProvider,true),hl(),NI()),r&2){let e=tC(2);dg("formControl",e.aiProviderIdControl),AI(),VE(3),zw(e.providers());}}function xe(r,t){if(r&1&&(Es(0,"option",25),AC(1),hl()),r&2){let e=t.$implicit;dg("ngValue",e),VE(),Fg(e.toLowerCase());}}function _e(r,t){r&1&&(Es(0,"p",2),AC(1,"Not supported yet for Anthropic and Gemini providers."),hl());}function Me(r,t){r&1&&(Es(0,"p",2),AC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),hl());}function Ee(r,t){r&1&&(Es(0,"p",26),AC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),hl());}function Ae(r,t){if(r&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let u=tC();return hf(u.submit())}),Es(1,"ds-form-field",5),Bw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),hl(),Es(4,"ds-form-field",8),fg(5,"input",9),NI(),hl(),Es(6,"ds-form-field",10),fg(7,"input",11),NI(),hl(),Es(8,"ds-form-field",12),fg(9,"input",13),NI(),hl(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"div",16)(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19),fg(16,"input",20),NI(),hl()(),Es(17,"ds-form-field",21),fg(18,"input",22),NI(),hl(),Es(19,"ds-form-field",23)(20,"select",24)(21,"option",25),AC(22,"Provider default"),hl(),$w(23,xe,2,2,"option",25,Uw),hl(),NI(),Bw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Bw(27,Ee,2,0,"p",26),hl(),Es(28,"div",27)(29,"label",28),fg(30,"input",29),NI(),Es(31,"span",30),AC(32,"Supports advanced execution"),hl()(),Es(33,"p",31),AC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),hl()(),Es(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),fg(38,"input",34),NI(),hl(),Es(39,"ds-form-field",35),fg(40,"input",36),NI(),hl()(),Es(41,"div",16)(42,"ds-form-field",37),fg(43,"input",38),NI(),hl(),Es(44,"ds-form-field",39),fg(45,"input",40),NI(),hl()()(),Es(46,"ds-form-actions")(47,"button",41),AC(48),hl(),Es(49,"button",42),vg("click",function(){pf(e);let u=tC();return hf(u.cancel())}),AC(50,"Cancel"),hl()()();}if(r&2){let e=tC();dg("formGroup",e.form),VE(2),Vw(e.isEditMode()?2:3),VE(3),dg("formControl",e.apiModelNameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.aliasControl),AI(),VE(2),dg("formControl",e.priorityControl),AI(),VE(3),dg("formControl",e.temperatureControl),AI(),VE(2),dg("formControl",e.contextWindowControl),AI(),VE(2),dg("formControl",e.maxCompletionTokensControl),AI(),VE(2),dg("formControl",e.reasoningEffortControl),AI(),VE(),dg("ngValue",null),VE(2),zw(e.reasoningEffortOptions),VE(2),Vw(e.reasoningEffortUnsupported()?25:26),VE(2),Vw(e.temperatureMayConflictWithEffort()?27:-1),VE(3),dg("formControl",e.supportsAdvancedExecutionControl),AI(),VE(5),dg("formGroup",e.pricingGroup),VE(3),AI(),VE(2),AI(),VE(3),AI(),VE(2),AI(),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ha(()=>br([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[gn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=oT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=oT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);selectedProviderLabel=oT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Of(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Dw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return c.cancel()}),AC(3," \u2190 AI models "),hl()(),Bw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),hl()),e&2&&(VE(),dg("title",c.isEditMode()?"Edit AI model":"New AI model"),VE(3),Vw(c.isLoading()?4:5));},dependencies:[hn,fn,un,dn,cn,at,sn,qt,md,Co,Mo,Ht,Fn,yn,Ut,po,ho,Zr,Yr,An,On,wa],encapsulation:2})};export{ge as AiModelFormComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-N28VXTjy.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,t as F,K as we,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function A(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading skills\u2026"),hl());}function H(i,e){i&1&&(Es(0,"p",5),AC(1,"No platform skills defined yet."),hl());}function U(i,e){i&1&&(Es(0,"p",4),AC(1,"No skills match the current filter."),hl());}function z(i,e){i&1&&(Es(0,"ds-tag",15),AC(1,"SKILL.md"),hl());}function G(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC(2).$implicit,m=tC(2);return hf(m.edit(d))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.inspect(d))}),AC(1,"View"),hl(),Bw(2,G,2,1,"button",22);}if(i&2){let t=tC().$implicit;lg("aria-label","View "+t.name),VE(2),Vw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Qw();Es(0,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,l=tC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),AC(4),hl(),Bw(5,z,2,0,"ds-tag",15),hl()(),Es(6,"td",16),AC(7),hl(),Es(8,"td",17),AC(9),hl(),Es(10,"td",18)(11,"div",19),Bw(12,J,3,2),Bw(13,Q,1,3,"agentos-row-delete-action",20),hl()()()),i&2){let t=e.$implicit,l=tC(2);VE(4),Fg(t.name),VE(),Vw(t.readOnly?5:-1),VE(2),Dl(" ",t.description||"\u2014"," "),VE(2),Fg(l.resourceCount(t)),VE(3),Vw(l.deletion.confirmingId()!==t.id?12:-1),VE(),Vw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Resources"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,W,14,6,"tr",9,K),hl()()()),i&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();skills=$i([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return l.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return l.openCreateForm()}),AC(3,"New skill"),hl()(),Bw(4,O,2,1,"p",3),Bw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(VE(),dg("query",l.rowFilter.query()),VE(3),Vw(l.deletion.error()?4:-1),VE(),Vw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
1
+ import {o}from'./chunk-CjF3kh6X.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-zs4CYUQt.js';import {g,t as F,K as we,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-DZHLOK7A.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function A(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading skills\u2026"),hl());}function H(i,e){i&1&&(Es(0,"p",5),AC(1,"No platform skills defined yet."),hl());}function U(i,e){i&1&&(Es(0,"p",4),AC(1,"No skills match the current filter."),hl());}function z(i,e){i&1&&(Es(0,"ds-tag",15),AC(1,"SKILL.md"),hl());}function G(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC(2).$implicit,m=tC(2);return hf(m.edit(d))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.inspect(d))}),AC(1,"View"),hl(),Bw(2,G,2,1,"button",22);}if(i&2){let t=tC().$implicit;lg("aria-label","View "+t.name),VE(2),Vw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Qw();Es(0,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,l=tC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),AC(4),hl(),Bw(5,z,2,0,"ds-tag",15),hl()(),Es(6,"td",16),AC(7),hl(),Es(8,"td",17),AC(9),hl(),Es(10,"td",18)(11,"div",19),Bw(12,J,3,2),Bw(13,Q,1,3,"agentos-row-delete-action",20),hl()()()),i&2){let t=e.$implicit,l=tC(2);VE(4),Fg(t.name),VE(),Vw(t.readOnly?5:-1),VE(2),Dl(" ",t.description||"\u2014"," "),VE(2),Fg(l.resourceCount(t)),VE(3),Vw(l.deletion.confirmingId()!==t.id?12:-1),VE(),Vw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Resources"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,W,14,6,"tr",9,K),hl()()()),i&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();skills=$i([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return l.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return l.openCreateForm()}),AC(3,"New skill"),hl()(),Bw(4,O,2,1,"p",3),Bw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(VE(),dg("query",l.rowFilter.query()),VE(3),Vw(l.deletion.error()?4:-1),VE(),Vw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
@@ -1 +1 @@
1
- import {f,y,p as pt,T as Te,g as gn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,U as Ut,a as po,h as ho,Z as Zr,A as An,O as On,b as hn,c as fn,u as un,d as cn,e as at,i as sn}from'./chunk-0rWkqE7F.js';import {g,W,t as F,I as J,K as we,o as oT,$ as $i,O as Of,U,L as w,N as x,D as Dw,E as Es,f as fg,a as Bw,c as hl,P as dg,d as VE,i as Vw,b as AC,Q as Qw,R as vg,S as NI,q as $w,v as tC,T as AI,n as lg,z as zw,u as Dl,F as Fg,w as pf,x as hf}from'./main-PZMWRMRC.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),AC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=tC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),NI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),NI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),NI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),NI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),NI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),NI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=tC();return hf(se.onMaxToolRoundsInput(p))}),hl(),NI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),$w(19,he,2,2,"option",23,ce),hl(),NI(),hl(),Es(21,"ds-form-actions")(22,"button",24),AC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=tC();return hf(p.cancel())}),AC(25,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(2),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.externalIdControl),AI(),VE(2),dg("formControl",e.defaultAgentNameControl),AI(),VE(2),dg("formControl",e.configPathControl),AI(),VE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),VE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),AI(),VE(),dg("hint",e.runCostThresholdHint()),VE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),AI(),VE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),VE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),AI(),VE(2),dg("formControl",e.adminCaseListingControl),AI(),VE(),zw(e.adminCaseListingOptions),VE(3),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=oT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=oT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=oT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=oT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[gn.min(fe),gn.max(ge),gn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),VE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),VE(),Vw(u.isLoading()?2:3));},dependencies:[qt,md,Co,Mo,Ht,Fn,Ut,po,ho,Zr,An,On,hn,fn,un,cn,at,sn],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
1
+ import {f,y,p as pt,T as Te,g as gn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,U as Ut,a as po,h as ho,Z as Zr,A as An,O as On,b as hn,c as fn,u as un,d as cn,e as at,i as sn}from'./chunk-zs4CYUQt.js';import {g,W,t as F,I as J,K as we,o as oT,$ as $i,O as Of,U,L as w,N as x,D as Dw,E as Es,f as fg,a as Bw,c as hl,P as dg,d as VE,i as Vw,b as AC,Q as Qw,R as vg,S as NI,q as $w,v as tC,T as AI,n as lg,z as zw,u as Dl,F as Fg,w as pf,x as hf}from'./main-DZHLOK7A.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),AC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=tC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),NI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),NI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),NI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),NI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),NI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),NI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=tC();return hf(se.onMaxToolRoundsInput(p))}),hl(),NI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),$w(19,he,2,2,"option",23,ce),hl(),NI(),hl(),Es(21,"ds-form-actions")(22,"button",24),AC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=tC();return hf(p.cancel())}),AC(25,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(2),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.externalIdControl),AI(),VE(2),dg("formControl",e.defaultAgentNameControl),AI(),VE(2),dg("formControl",e.configPathControl),AI(),VE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),VE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),AI(),VE(),dg("hint",e.runCostThresholdHint()),VE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),AI(),VE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),VE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),AI(),VE(2),dg("formControl",e.adminCaseListingControl),AI(),VE(),zw(e.adminCaseListingOptions),VE(3),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=oT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=oT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=oT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=oT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[gn.min(fe),gn.max(ge),gn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),VE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),VE(),Vw(u.isLoading()?2:3));},dependencies:[qt,md,Co,Mo,Ht,Fn,Ut,po,ho,Zr,An,On,hn,fn,un,cn,at,sn],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
@@ -1 +1 @@
1
- import {z as k$1,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,W as W$1,t as F,K as we,aq as k,ap as F$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function W(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading AI models\u2026"),hl());}function X(i,e){i&1&&(Es(0,"p",5),AC(1,"No AI models configured."),hl());}function Y(i,e){i&1&&(Es(0,"p",4),AC(1,"No AI models match the current filter."),hl());}function Z(i,e){i&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function ee(i,e){if(i&1){let t=Qw();Es(0,"button",24),vg("click",function(){pf(t);let s=tC(2).$implicit,m=tC(2);return hf(m.edit(s))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit,n=tC(2);lg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Qw();Bw(0,ee,2,1,"button",22),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,n=tC(2);Vw(n.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Es(0,"button",21),AC(1,"Inherited"),hl());}function ne(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),AC(10),hl(),Bw(11,Z,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),Bw(14,te,2,4)(15,ie,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,n=tC(2);VE(2),Fg(n.title(t)),VE(2),Fg(t.providerName),VE(2),Dl(" ",t.model.apiModelName," "),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?11:-1),VE(3),Vw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Provider"),hl(),Es(8,"th",10),AC(9,"API model name"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ne,16,7,"tr",9,G),hl()()()),i&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k$1();rows=$i([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ha(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(ga(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return by({namespace:br(e),platform:br(t),providers:br(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(ha(()=>br([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,n){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return n.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),AC(3,"New AI model"),hl()(),Bw(4,Q,2,1,"p",3),Bw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(VE(),dg("query",n.rowFilter.query()),VE(3),Vw(n.deletion.error()?4:-1),VE(),Vw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
1
+ import {z as k$1,j as O,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-zs4CYUQt.js';import {g,W as W$1,t as F,K as we,aq as k,ap as F$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-DZHLOK7A.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function W(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading AI models\u2026"),hl());}function X(i,e){i&1&&(Es(0,"p",5),AC(1,"No AI models configured."),hl());}function Y(i,e){i&1&&(Es(0,"p",4),AC(1,"No AI models match the current filter."),hl());}function Z(i,e){i&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function ee(i,e){if(i&1){let t=Qw();Es(0,"button",24),vg("click",function(){pf(t);let s=tC(2).$implicit,m=tC(2);return hf(m.edit(s))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit,n=tC(2);lg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Qw();Bw(0,ee,2,1,"button",22),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=tC().$implicit,m=tC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,n=tC(2);Vw(n.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Es(0,"button",21),AC(1,"Inherited"),hl());}function ne(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14),AC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),AC(10),hl(),Bw(11,Z,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),Bw(14,te,2,4)(15,ie,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,n=tC(2);VE(2),Fg(n.title(t)),VE(2),Fg(t.providerName),VE(2),Dl(" ",t.model.apiModelName," "),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?11:-1),VE(3),Vw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Provider"),hl(),Es(8,"th",10),AC(9,"API model name"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ne,16,7,"tr",9,G),hl()()()),i&2){let t=tC();VE(16),zw(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k$1();rows=$i([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ha(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(ga(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return by({namespace:br(e),platform:br(t),providers:br(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(ha(()=>br([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,n){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return n.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),AC(3,"New AI model"),hl()(),Bw(4,Q,2,1,"p",3),Bw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(VE(),dg("query",n.rowFilter.query()),VE(3),Vw(n.deletion.error()?4:-1),VE(),Vw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
@@ -1 +1 @@
1
- import {E as m,z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,W as W$1,t as F,K as we,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function G(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading prompts\u2026"),hl());}function O(n,e){n&1&&(Es(0,"p",5),AC(1,"No prompts available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),AC(1,"No prompts match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",17),AC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Qw();Es(0,"button",23),vg("click",function(){pf(t);let l=tC(2).$implicit,m=tC(2);return hf(m.edit(l))}),AC(1," Edit "),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=Qw();Bw(0,X,2,1,"button",21),Es(1,"agentos-row-delete-action",22),vg("deleteRequested",function(){pf(t);let l=tC().$implicit,m=tC(2);return hf(m.deletion.request(l.key))})("deleteConfirmed",function(){pf(t);let l=tC().$implicit,m=tC(2);return hf(m.confirmDelete(l))})("deleteCancelled",function(){pf(t);let l=tC(3);return hf(l.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,i=tC(2);Vw(i.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Es(0,"button",20),AC(1,"Inherited"),hl());}function ee(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),AC(8),hl(),Bw(9,W,2,0,"ds-tag",17),hl()(),Es(10,"td",18)(11,"div",19),Bw(12,Y,2,4)(13,Z,2,0,"button",20),hl()()()),n&2){let t=e.$implicit;VE(2),Fg(t.prompt.name),VE(2),Dl(" ",t.prompt.description||"\u2014"," "),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?9:-1),VE(3),Vw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,ee,14,6,"tr",9,U),hl()()()),n&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({platform:this.promptState.listPlatform().pipe(ha(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return i.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New prompt"),hl()(),Bw(4,z,2,1,"p",3),Bw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
1
+ import {E as m,z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-zs4CYUQt.js';import {g,W as W$1,t as F,K as we,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-DZHLOK7A.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let t=tC();VE(),Fg(t.deletion.error());}}function G(n,e){n&1&&(Es(0,"p",4),AC(1,"Loading prompts\u2026"),hl());}function O(n,e){n&1&&(Es(0,"p",5),AC(1,"No prompts available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),AC(1,"No prompts match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",17),AC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Qw();Es(0,"button",23),vg("click",function(){pf(t);let l=tC(2).$implicit,m=tC(2);return hf(m.edit(l))}),AC(1," Edit "),hl();}if(n&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=Qw();Bw(0,X,2,1,"button",21),Es(1,"agentos-row-delete-action",22),vg("deleteRequested",function(){pf(t);let l=tC().$implicit,m=tC(2);return hf(m.deletion.request(l.key))})("deleteConfirmed",function(){pf(t);let l=tC().$implicit,m=tC(2);return hf(m.confirmDelete(l))})("deleteCancelled",function(){pf(t);let l=tC(3);return hf(l.deletion.cancel())}),hl();}if(n&2){let t=tC().$implicit,i=tC(2);Vw(i.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Es(0,"button",20),AC(1,"Inherited"),hl());}function ee(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),AC(8),hl(),Bw(9,W,2,0,"ds-tag",17),hl()(),Es(10,"td",18)(11,"div",19),Bw(12,Y,2,4)(13,Z,2,0,"button",20),hl()()()),n&2){let t=e.$implicit;VE(2),Fg(t.prompt.name),VE(2),Dl(" ",t.prompt.description||"\u2014"," "),VE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),VE(),Fg(t.scope==="platform"?"Platform":"Namespace"),VE(),Vw(t.scope==="platform"?9:-1),VE(3),Vw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,ee,14,6,"tr",9,U),hl()()()),n&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({platform:this.promptState.listPlatform().pipe(ha(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return i.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New prompt"),hl()(),Bw(4,z,2,1,"p",3),Bw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
@@ -1 +1 @@
1
- import {j as O$1,e as at,c as fn,k as ko,l as Fo,P}from'./chunk-0rWkqE7F.js';import {g,K as we,Y as W,Z as Tr,$ as $i,o as oT,a0 as Be,a1 as ga,a2 as ha,a3 as rn,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,q as $w,v as tC,z as zw,u as Dl,F as Fg}from'./main-PZMWRMRC.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Es(0,"p",10),AC(1,"Loading the configuration failed. Try refreshing."),hl());}function V(e,t){e&1&&(Es(0,"p",11),AC(1,"Loading configuration\u2026"),hl());}function j(e,t){e&1&&(Es(0,"p",12),AC(1,"The service reported no settings."),hl());}function O(e,t){e&1&&(Es(0,"p",11),AC(1,"No settings match the current filters."),hl());}function Y(e,t){e&1&&(Es(0,"ds-tag",22),AC(1,"on"),hl());}function z(e,t){e&1&&(Es(0,"ds-tag",20),AC(1,"off"),hl());}function H(e,t){if(e&1&&(Es(0,"ds-tag",20),AC(1),hl()),e&2){let i=tC().$implicit;VE(),Fg(i.display.text);}}function G(e,t){if(e&1&&(Es(0,"ds-tag",23),AC(1),hl()),e&2){let i=tC().$implicit;VE(),Fg(i.display.text);}}function J(e,t){if(e&1&&(Es(0,"span",24),AC(1),hl()),e&2){let i=tC().$implicit;VE(),Fg(i.display.text);}}function K(e,t){if(e&1&&(Es(0,"tr",16)(1,"td",18),AC(2),hl(),Es(3,"td",19)(4,"ds-tag",20),AC(5),hl()(),Es(6,"td",21),Bw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),hl(),Es(12,"td",25),AC(13),hl()()),e&2){let i,a=t.$implicit,m=tC(2);VE(2),Dl(" ",a.entry.key," "),VE(3),Dl(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),VE(2),Vw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),VE(6),Dl(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Es(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),AC(5,"Setting"),hl(),Es(6,"th",17),AC(7,"Source"),hl(),Es(8,"th",17),AC(9,"Value"),hl(),Es(10,"th",17),AC(11,"Description"),hl()()(),Es(12,"tbody",15),$w(13,K,14,4,"tr",16,U),hl()()()),e&2){let i=tC();VE(13),zw(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new Tr(void 0);isLoading=$i(true);loadError=$i(false);rows=$i([]);source=$i("ALL");status=$i("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=oT(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Be;constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(ha(()=>(this.loadError.set(true),this.isLoading.set(false),rn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.reload()}),AC(3,"Refresh"),hl()(),Es(4,"div",3)(5,"select",4),vg("change",function(c){return a.source.set(c.target.value)}),Es(6,"option",5),AC(7,"All sources"),hl(),Es(8,"option",6),AC(9,"Environment variables"),hl(),Es(10,"option",6),AC(11,"Spring properties"),hl()(),Es(12,"select",7),vg("change",function(c){return a.status.set(c.target.value)}),Es(13,"option",5),AC(14,"Set and unset"),hl(),Es(15,"option",8),AC(16,"Set only"),hl(),Es(17,"option",9),AC(18,"Unset only"),hl()()(),Bw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(VE(),dg("query",a.rowFilter.query()),VE(4),dg("value",a.source()),VE(3),dg("value",a.Source.ENVIRONMENT),VE(2),dg("value",a.Source.PROPERTY),VE(2),dg("value",a.status()),VE(7),Vw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,fn,ko,Fo,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
1
+ import {j as O$1,e as at,c as fn,k as ko,l as Fo,P}from'./chunk-zs4CYUQt.js';import {g,K as we,Y as W,Z as Tr,$ as $i,o as oT,a0 as Be,a1 as ga,a2 as ha,a3 as rn,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,q as $w,v as tC,z as zw,u as Dl,F as Fg}from'./main-DZHLOK7A.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Es(0,"p",10),AC(1,"Loading the configuration failed. Try refreshing."),hl());}function V(e,t){e&1&&(Es(0,"p",11),AC(1,"Loading configuration\u2026"),hl());}function j(e,t){e&1&&(Es(0,"p",12),AC(1,"The service reported no settings."),hl());}function O(e,t){e&1&&(Es(0,"p",11),AC(1,"No settings match the current filters."),hl());}function Y(e,t){e&1&&(Es(0,"ds-tag",22),AC(1,"on"),hl());}function z(e,t){e&1&&(Es(0,"ds-tag",20),AC(1,"off"),hl());}function H(e,t){if(e&1&&(Es(0,"ds-tag",20),AC(1),hl()),e&2){let i=tC().$implicit;VE(),Fg(i.display.text);}}function G(e,t){if(e&1&&(Es(0,"ds-tag",23),AC(1),hl()),e&2){let i=tC().$implicit;VE(),Fg(i.display.text);}}function J(e,t){if(e&1&&(Es(0,"span",24),AC(1),hl()),e&2){let i=tC().$implicit;VE(),Fg(i.display.text);}}function K(e,t){if(e&1&&(Es(0,"tr",16)(1,"td",18),AC(2),hl(),Es(3,"td",19)(4,"ds-tag",20),AC(5),hl()(),Es(6,"td",21),Bw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),hl(),Es(12,"td",25),AC(13),hl()()),e&2){let i,a=t.$implicit,m=tC(2);VE(2),Dl(" ",a.entry.key," "),VE(3),Dl(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),VE(2),Vw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),VE(6),Dl(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Es(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),AC(5,"Setting"),hl(),Es(6,"th",17),AC(7,"Source"),hl(),Es(8,"th",17),AC(9,"Value"),hl(),Es(10,"th",17),AC(11,"Description"),hl()()(),Es(12,"tbody",15),$w(13,K,14,4,"tr",16,U),hl()()()),e&2){let i=tC();VE(13),zw(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new Tr(void 0);isLoading=$i(true);loadError=$i(false);rows=$i([]);source=$i("ALL");status=$i("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=oT(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Be;constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(ha(()=>(this.loadError.set(true),this.isLoading.set(false),rn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.reload()}),AC(3,"Refresh"),hl()(),Es(4,"div",3)(5,"select",4),vg("change",function(c){return a.source.set(c.target.value)}),Es(6,"option",5),AC(7,"All sources"),hl(),Es(8,"option",6),AC(9,"Environment variables"),hl(),Es(10,"option",6),AC(11,"Spring properties"),hl()(),Es(12,"select",7),vg("change",function(c){return a.status.set(c.target.value)}),Es(13,"option",5),AC(14,"Set and unset"),hl(),Es(15,"option",8),AC(16,"Set only"),hl(),Es(17,"option",9),AC(18,"Unset only"),hl()()(),Bw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(VE(),dg("query",a.rowFilter.query()),VE(4),dg("value",a.source()),VE(3),dg("value",a.Source.ENVIRONMENT),VE(2),dg("value",a.Source.PROPERTY),VE(2),dg("value",a.status()),VE(7),Vw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,fn,ko,Fo,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-DvRawlbU.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-0rWkqE7F.js';import {g,W,t as F,K as we,$ as $i,ac as by,a2 as ha,aa as br,U,N as x,L as w,ai as ke,al as We,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,Q as Qw,w as pf,x as hf,n as lg}from'./main-PZMWRMRC.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let e=tC();VE(),Fg(e.deletion.error());}}function Y(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading scheduled prompts\u2026"),hl());}function z(n,t){n&1&&(Es(0,"p",5),AC(1,"No scheduled prompts available."),hl());}function G(n,t){n&1&&(Es(0,"p",4),AC(1,"No scheduled prompts match the current filter."),hl());}function Q(n,t){if(n&1&&(Es(0,"span",14),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.prompt.description);}}function X(n,t){n&1&&(Es(0,"ds-tag",20),AC(1,"Read-only"),hl());}function Z(n,t){if(n&1){let e=Qw();Es(0,"button",25),vg("click",function(){pf(e);let l=tC(2).$implicit,p=tC(2);return hf(p.toggle(l))}),AC(1),hl(),Es(2,"button",25),vg("click",function(){pf(e);let l=tC(2).$implicit,p=tC(2);return hf(p.edit(l))}),AC(3," Edit "),hl();}if(n&2){let e=tC(2).$implicit;VE(),Fg(e.prompt.enabled?"Disable":"Enable"),VE(),lg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=Qw();Bw(0,Z,4,2),Es(1,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(e);let l=tC().$implicit,p=tC(2);return hf(p.deletion.request(l.key))})("deleteConfirmed",function(){pf(e);let l=tC().$implicit,p=tC(2);return hf(p.confirmDelete(l))})("deleteCancelled",function(){pf(e);let l=tC(3);return hf(l.deletion.cancel())}),hl();}if(n&2){let e=tC().$implicit,i=tC(2);Vw(i.deletion.confirmingId()!==e.key?0:-1),VE(),dg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Es(0,"button",23),AC(1,"Inherited"),hl());}function ne(n,t){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),AC(3),hl(),Bw(4,Q,2,1,"span",14),hl(),Es(5,"td",15),AC(6),hl(),Es(7,"td",16)(8,"ds-tag",17),AC(9),hl()(),Es(10,"td",18)(11,"div",19)(12,"ds-tag",17),AC(13),hl(),Bw(14,X,2,0,"ds-tag",20),hl()(),Es(15,"td",21)(16,"div",22),Bw(17,ee,2,4)(18,te,2,0,"button",23),hl()()()),n&2){let e=t.$implicit,i=tC(2);VE(3),Fg(e.prompt.name),VE(),Vw(e.prompt.description?4:-1),VE(2),Fg(i.scheduleLabel(e.prompt)),VE(2),dg("variant",e.prompt.enabled?"accent":"outline"),VE(),Fg(e.prompt.enabled?"Enabled":"Disabled"),VE(3),dg("variant",e.scope==="platform"?"neutral":"accent"),VE(),Fg(e.scope==="platform"?"Platform":"Namespace"),VE(),Vw(e.scope==="platform"?14:-1),VE(3),Vw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Schedule"),hl(),Es(8,"th",10),AC(9,"Status"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ne,19,9,"tr",9,J),hl()()()),n&2){let e=tC();VE(16),zw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=$i([]);isLoading=$i(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){by({platform:this.state.listPlatform().pipe(ha(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===ke.WEEK?"week":"month",l=e.unit===ke.WEEK&&e.days?.length?` (${e.days.map(p=>We[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(p){return i.rowFilter.query.set(p)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New scheduled prompt"),hl()(),Bw(4,O,2,1,"p",3),Bw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
1
+ import {c}from'./chunk-7p42eTQE.js';import {z as k,j as O$1,e as at,c as fn,k as ko,l as Fo,P,B as P$1}from'./chunk-zs4CYUQt.js';import {g,W,t as F,K as we,$ as $i,ac as by,a2 as ha,aa as br,U,N as x,L as w,ai as ke,al as We,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,Q as Qw,w as pf,x as hf,n as lg}from'./main-DZHLOK7A.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let e=tC();VE(),Fg(e.deletion.error());}}function Y(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading scheduled prompts\u2026"),hl());}function z(n,t){n&1&&(Es(0,"p",5),AC(1,"No scheduled prompts available."),hl());}function G(n,t){n&1&&(Es(0,"p",4),AC(1,"No scheduled prompts match the current filter."),hl());}function Q(n,t){if(n&1&&(Es(0,"span",14),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.prompt.description);}}function X(n,t){n&1&&(Es(0,"ds-tag",20),AC(1,"Read-only"),hl());}function Z(n,t){if(n&1){let e=Qw();Es(0,"button",25),vg("click",function(){pf(e);let l=tC(2).$implicit,p=tC(2);return hf(p.toggle(l))}),AC(1),hl(),Es(2,"button",25),vg("click",function(){pf(e);let l=tC(2).$implicit,p=tC(2);return hf(p.edit(l))}),AC(3," Edit "),hl();}if(n&2){let e=tC(2).$implicit;VE(),Fg(e.prompt.enabled?"Disable":"Enable"),VE(),lg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=Qw();Bw(0,Z,4,2),Es(1,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(e);let l=tC().$implicit,p=tC(2);return hf(p.deletion.request(l.key))})("deleteConfirmed",function(){pf(e);let l=tC().$implicit,p=tC(2);return hf(p.confirmDelete(l))})("deleteCancelled",function(){pf(e);let l=tC(3);return hf(l.deletion.cancel())}),hl();}if(n&2){let e=tC().$implicit,i=tC(2);Vw(i.deletion.confirmingId()!==e.key?0:-1),VE(),dg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Es(0,"button",23),AC(1,"Inherited"),hl());}function ne(n,t){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),AC(3),hl(),Bw(4,Q,2,1,"span",14),hl(),Es(5,"td",15),AC(6),hl(),Es(7,"td",16)(8,"ds-tag",17),AC(9),hl()(),Es(10,"td",18)(11,"div",19)(12,"ds-tag",17),AC(13),hl(),Bw(14,X,2,0,"ds-tag",20),hl()(),Es(15,"td",21)(16,"div",22),Bw(17,ee,2,4)(18,te,2,0,"button",23),hl()()()),n&2){let e=t.$implicit,i=tC(2);VE(3),Fg(e.prompt.name),VE(),Vw(e.prompt.description?4:-1),VE(2),Fg(i.scheduleLabel(e.prompt)),VE(2),dg("variant",e.prompt.enabled?"accent":"outline"),VE(),Fg(e.prompt.enabled?"Enabled":"Disabled"),VE(3),dg("variant",e.scope==="platform"?"neutral":"accent"),VE(),Fg(e.scope==="platform"?"Platform":"Namespace"),VE(),Vw(e.scope==="platform"?14:-1),VE(3),Vw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Schedule"),hl(),Es(8,"th",10),AC(9,"Status"),hl(),Es(10,"th",10),AC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),AC(14,"Actions"),hl()()()(),Es(15,"tbody",8),$w(16,ne,19,9,"tr",9,J),hl()()()),n&2){let e=tC();VE(16),zw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=$i([]);isLoading=$i(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){by({platform:this.state.listPlatform().pipe(ha(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===ke.WEEK?"week":"month",l=e.unit===ke.WEEK&&e.days?.length?` (${e.days.map(p=>We[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Dw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(p){return i.rowFilter.query.set(p)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New scheduled prompt"),hl()(),Bw(4,O,2,1,"p",3),Bw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,fn,ko,Fo,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};