@whoz-oss/coday-client 0.0.0-workstream-forge.165 → 0.0.0-workstream-forge.167
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.
- package/3rdpartylicenses.txt +5 -5
- package/browser/chunk--XNStJOR.js +1 -0
- package/browser/chunk-2sJZBgBg.js +1 -0
- package/browser/chunk-8oVC_8Qw.js +1 -0
- package/browser/chunk-9rt8_xma.js +668 -0
- package/browser/chunk-AC0REe-b.js +1 -0
- package/browser/chunk-BAptlk47.js +1 -0
- package/browser/chunk-BC6KL4NC.js +1 -0
- package/browser/chunk-BFcnXuqC.js +1 -0
- package/browser/{chunk-0VeqXZ9d.js → chunk-BHQcx05f.js} +1 -1
- package/browser/chunk-BO-pRnkz.js +2 -0
- package/browser/chunk-BanvPMff.js +1 -0
- package/browser/chunk-Bc-9I7gt.js +1 -0
- package/browser/chunk-BeEOpA_m.js +1 -0
- package/browser/chunk-BlB0nlUH.js +1 -0
- package/browser/chunk-BpcaAECQ.js +1 -0
- package/browser/chunk-CCarxXt4.js +1 -0
- package/browser/chunk-CLZmXDf_.js +1 -0
- package/browser/{chunk-COXl1FiZ.js → chunk-CNKxgGRV.js} +1 -1
- package/browser/chunk-CZ3gfqaG.js +1 -0
- package/browser/chunk-CadyOb-x.js +1 -0
- package/browser/chunk-CbZEFcU-.js +1 -0
- package/browser/chunk-CsPXzWtr.js +1 -0
- package/browser/chunk-CxBQYSqJ.js +1 -0
- package/browser/chunk-D2jWL6uo.js +1 -0
- package/browser/chunk-D7GuQJXr.js +2 -0
- package/browser/chunk-D86Ut1MG.js +1 -0
- package/browser/chunk-DGsoqCw1.js +1 -0
- package/browser/chunk-DLFQsnsW.js +1 -0
- package/browser/chunk-DQRJ1K2T.js +1 -0
- package/browser/chunk-DQyX_75B.js +1 -0
- package/browser/chunk-DUOMFboa.js +2 -0
- package/browser/chunk-DUbCE4UP.js +1 -0
- package/browser/{chunk-BSqHjzXQ.js → chunk-DYeEsEJd.js} +1 -1
- package/browser/chunk-DegMF1SI.js +1 -0
- package/browser/chunk-Dt0l9iMh.js +1 -0
- package/browser/chunk-DuzRNLRe.js +1 -0
- package/browser/chunk-E_gZEXVL.js +1 -0
- package/browser/chunk-H1Fy397q.js +1 -0
- package/browser/chunk-KQOMZcAw.js +1 -0
- package/browser/chunk-PPseWd3f.js +1 -0
- package/browser/chunk-Rsb_gKCl.js +1 -0
- package/browser/chunk-UmxO5UIC.js +1 -0
- package/browser/chunk-WG-9XP-6.js +1 -0
- package/browser/chunk-vKNByqrC.js +1 -0
- package/browser/chunk-zJlmuu9d.js +1 -0
- package/browser/index.html +2 -2
- package/browser/main-HI6C6EDY.js +564 -0
- package/browser/styles-MKNSQU7Y.css +1 -0
- package/package.json +1 -1
- package/browser/chunk-2HHZ3LC4.js +0 -1
- package/browser/chunk-8AFIbDZU.js +0 -1
- package/browser/chunk-APy1T-1u.js +0 -1
- package/browser/chunk-B5ePzsIu.js +0 -1
- package/browser/chunk-BB8Lzhwo.js +0 -1
- package/browser/chunk-BEEjS55d.js +0 -1
- package/browser/chunk-BJSbfkDj.js +0 -1
- package/browser/chunk-BONtS7al.js +0 -2
- package/browser/chunk-BQblY_Kv.js +0 -1
- package/browser/chunk-BcLZGu2F.js +0 -1
- package/browser/chunk-Bf8bCumD.js +0 -1
- package/browser/chunk-BqrOxZdE.js +0 -1
- package/browser/chunk-BxXzXgnw.js +0 -1
- package/browser/chunk-C4KCDgok.js +0 -1
- package/browser/chunk-C7QOV3yc.js +0 -2
- package/browser/chunk-CG1SJzmH.js +0 -1
- package/browser/chunk-CGnbW-VY.js +0 -1
- package/browser/chunk-CS1tczfK.js +0 -1
- package/browser/chunk-CTCRh-DP.js +0 -1
- package/browser/chunk-CXv7Ai08.js +0 -1
- package/browser/chunk-CcuY-VZC.js +0 -1
- package/browser/chunk-ClI63nto.js +0 -1
- package/browser/chunk-CnRe9SoM.js +0 -1
- package/browser/chunk-Cs89O_uQ.js +0 -1
- package/browser/chunk-CxLl2FLQ.js +0 -1
- package/browser/chunk-D5UFWtax.js +0 -1
- package/browser/chunk-DGRsoYx_.js +0 -1
- package/browser/chunk-DXSN6VYs.js +0 -1
- package/browser/chunk-DdWF9OO6.js +0 -1
- package/browser/chunk-Dga8qADW.js +0 -2
- package/browser/chunk-DzLt2p-b.js +0 -1
- package/browser/chunk-EmHExSnw.js +0 -1
- package/browser/chunk-Go1_Zu5R.js +0 -1
- package/browser/chunk-PCe11EaT.js +0 -1
- package/browser/chunk-THLjXVP8.js +0 -1
- package/browser/chunk-UMiCRMsh.js +0 -1027
- package/browser/chunk-cKHTB9X6.js +0 -1
- package/browser/chunk-cz67d1ar.js +0 -2
- package/browser/chunk-dkiNkKfC.js +0 -1
- package/browser/chunk-fAeW8v1H.js +0 -1
- package/browser/chunk-gX9pSFmE.js +0 -1
- package/browser/chunk-sUX4ZlTt.js +0 -1
- package/browser/main-BNXY3UWS.js +0 -564
- package/browser/styles-MRPXDMCX.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BHQcx05f.js';import {O}from'./chunk-PPseWd3f.js';import {g,W,F,I as Ie$1,a9 as $,as as U,U as Ui,at as Y,a1 as W$1,K as KC,a2 as F$1,au as we,x as U$1,af as da,a3 as Cr,ae as Ty,av as ne,C as x,z as w,m as mw,ao as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,O as Og,L as Lw,X as Xw,J as ug,q as qw,l as lg,Q as SI,T as MI,e as cg,v as vl,V as Vw,H as Hw,k as df,n as ff,am as kg}from'./main-HI6C6EDY.js';import {$ as $$1,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye$1,d as dn,F as Ft,h as bt$1,L as Ln,W as Wn,q as qt,H as Lt,b as pn,V as Vn}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';var I="*";function Ee(i){return (i??[]).some(t=>t.trim()===I)}function ke(i){let t=(i??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==I).map(e=>e.toLowerCase());return new Set(t)}function G(i){return i.includes(I)}function De(i){let t=i.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${t}$`,"i")}function H(i,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==I&&G(e)).some(e=>De(e).test(i))}var Te="AGENTOS_CONFIG",Me=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ie(i){return i.configEnabled&&(i.hasSubAgents||i.integrationTypes.some(t=>Me.has(t)))}var Ne=(i,t)=>t.config.id,Le=(i,t)=>t.type,Fe=(i,t)=>t.selector;function Ve(i,t){if(i&1&&(Ds(0,"a",5),MC(1,"View resolved definition \u2192"),pl()),i&2){let e=Xw();ug("routerLink",e.inspectRoute());}}function Pe(i,t){i&1&&(Ds(0,"span",6),MC(1,"Platform level"),pl());}function Oe(i,t){i&1&&(Ds(0,"p",7),MC(1,"Loading\u2026"),pl());}function Be(i,t){if(i&1&&(Ds(0,"span",57),MC(1),pl()),i&2){let e=Xw().$implicit;jE(),Og(e.config.integrationType);}}function $e(i,t){if(i&1&&(lg(0,"input",58),SI()),i&2){let e=Xw().$implicit;ug("formControl",e.toolsControl),MI();}}function Ge(i,t){if(i&1){let e=qw();Ds(0,"div",52)(1,"label",54)(2,"input",55),mg("change",function(){let s=df(e).$implicit,d=Xw(3);return ff(d.toggleIntegration(s))}),pl(),Ds(3,"span",56),MC(4),pl(),Pw(5,Be,2,1,"span",57),pl(),Pw(6,$e,1,1,"input",58),pl();}if(i&2){let e=t.$implicit;jE(2),ug("checked",e.enabled()),jE(2),Og(e.config.name),jE(),Lw(e.config.integrationType?5:-1),jE(),Lw(e.enabled()?6:-1);}}function Ue(i,t){if(i&1&&(Ds(0,"p",64),MC(1),pl()),i&2){let e=Xw().$implicit;jE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function We(i,t){if(i&1){let e=qw();Ds(0,"div",52)(1,"label",54)(2,"span",56),MC(3),pl(),Ds(4,"span",57),MC(5,"built-in"),pl()(),Ds(6,"select",60),mg("change",function(s){let d=df(e).$implicit,C=Xw(4);return ff(C.setBuiltInState(d,s.target.value))}),Ds(7,"option",61),MC(8),pl(),Ds(9,"option",62),MC(10,"Enabled"),pl(),Ds(11,"option",63),MC(12,"Disabled"),pl()(),Pw(13,Ue,2,1,"p",64),Ds(14,"p",65),MC(15),pl()();}if(i&2){let e=t.$implicit,n=Xw(4);jE(),cg("for","built-in-"+e.type),jE(2),Og(e.displayName),jE(3),ug("id","built-in-"+e.type)("value",e.state()),jE(2),Og(n.builtInDefaultLabel(e)),jE(5),Lw(e.state()==="on"&&e.restrictedTools?13:-1),jE(2),Og(e.description);}}function je(i,t){if(i&1&&(Ds(0,"p",59),MC(1,"Built-in integrations"),pl(),Vw(2,We,16,7,"div",52,Le)),i&2){let e=Xw(3);jE(2),Hw(e.builtInRows());}}function Ke(i,t){i&1&&(Ds(0,"p",53),MC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),pl());}function Je(i,t){if(i&1&&(Ds(0,"fieldset",20)(1,"legend",22),MC(2,"Integrations"),pl(),Ds(3,"p",51),MC(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),pl(),Vw(5,Ge,7,4,"div",52,Ne),Pw(7,je,4,0),Pw(8,Ke,2,0,"p",53),pl()),i&2){let e=Xw(2);jE(5),Hw(e.integrationRows()),jE(2),Lw(e.builtInRows().length>0?7:-1),jE(),Lw(e.configAgentExposureWarning()?8:-1);}}function He(i,t){i&1&&MC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function Ye(i,t){i&1&&(Ds(0,"p",29),MC(1," Saving with this on replaces the selection below with "),Ds(2,"code",24),MC(3,"*"),pl(),MC(4,". "),pl());}function qe(i,t){i&1&&(Ds(0,"p",29),MC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function ze(i,t){i&1&&(Ds(0,"p",30),MC(1,"No skill available in this scope yet."),pl());}function Xe(i,t){i&1&&(Ds(0,"span",69),MC(1,"platform"),pl());}function Qe(i,t){if(i&1&&(Ds(0,"span",70),MC(1),pl()),i&2){let e=Xw(4);jE(),vl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Ze(i,t){if(i&1&&(Ds(0,"p",71),MC(1),pl()),i&2){let e=Xw().$implicit;jE(),Og(e.description);}}function et(i,t){if(i&1){let e=qw();Ds(0,"div",66)(1,"label",67)(2,"input",68),mg("change",function(){let s=df(e).$implicit,d=Xw(3);return ff(d.toggleSkill(s))}),pl(),Ds(3,"span",27),MC(4),pl(),Pw(5,Xe,2,0,"span",69),Pw(6,Qe,2,1,"span",70),pl(),Pw(7,Ze,2,1,"p",71),pl();}if(i&2){let e=t.$implicit,n=Xw(3);jE(2),ug("checked",e.selected())("disabled",n.allSkillsSelected()),jE(2),Og(e.name),jE(),Lw(e.platform?5:-1),jE(),Lw(e.unresolved?6:-1),jE(),Lw(e.description?7:-1);}}function tt(i,t){if(i&1&&Vw(0,et,8,6,"div",66,Fe),i&2){let e=Xw(2);Hw(e.skillRows());}}function nt(i,t){i&1&&(Ds(0,"p",74),MC(1,"Invalid JSON \u2014 please fix the syntax."),pl());}function it(i,t){if(i&1&&(Ds(0,"div",10)(1,"label",72),MC(2,"Loop configuration (JSON)"),pl(),lg(3,"textarea",73),SI(),Pw(4,nt,2,0,"p",74),Ds(5,"p",28),MC(6," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Ds(7,"code",24),MC(8,"AgentLoopPayload"),pl(),MC(9,". Leave empty if you always provide the payload at launch. "),pl()()),i&2){let e=Xw(2);jE(3),ug("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),MI(),jE(),Lw(e.loopConfigControl.invalid&&e.loopConfigControl.touched?4:-1);}}function ot(i,t){i&1&&MC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function at(i,t){i&1&&(Ds(0,"p",29),MC(1," Saving with this on replaces the selection below with "),Ds(2,"code",24),MC(3,"*"),pl(),MC(4,". "),pl());}function lt(i,t){i&1&&(Ds(0,"p",29),MC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function rt(i,t){i&1&&(Ds(0,"p",30),MC(1,"No other agent is available in this scope yet."),pl());}function st(i,t){i&1&&(Ds(0,"span",69),MC(1,"pattern"),pl());}function dt(i,t){i&1&&(Ds(0,"span",69),MC(1,"via pattern"),pl());}function ct(i,t){if(i&1&&(Ds(0,"span",70),MC(1),pl()),i&2){let e=Xw(4);jE(),vl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function gt(i,t){if(i&1){let e=qw();Ds(0,"button",76),mg("click",function(){df(e);let s=Xw().$implicit,d=Xw(3);return ff(d.removeSubAgent(s))}),MC(1," \u{1F5D1} "),pl();}}function mt(i,t){if(i&1){let e=qw();Ds(0,"div",66)(1,"label",67)(2,"input",68),mg("change",function(){let s=df(e).$implicit,d=Xw(3);return ff(d.toggleSubAgent(s))}),pl(),Ds(3,"span",27),MC(4),pl(),Pw(5,st,2,0,"span",69)(6,dt,2,0,"span",69)(7,ct,2,1,"span",70),Pw(8,gt,2,0,"button",75),pl()();}if(i&2){let e=t.$implicit,n=Xw(3);jE(2),ug("checked",e.selected())("disabled",n.allSubAgentsSelected()),jE(2),Og(e.name),jE(),Lw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),jE(3),Lw(e.unresolved?8:-1);}}function ut(i,t){if(i&1&&Vw(0,mt,9,5,"div",66,Fe),i&2){let e=Xw(2);Hw(e.subAgentRows());}}function pt(i,t){if(i&1&&MC(0),i&2){let e=Xw(2);kg(" : ",e.defaultDelegationTimeoutSeconds()," s (",e.defaultDelegationTimeoutSeconds()/60," min) ");}}function ft(i,t){i&1&&(Ds(0,"p",44),MC(1," Enter a valid positive whole number of seconds, or leave empty to inherit the server default. "),pl());}function _t(i,t){if(i&1){let e=qw();Ds(0,"button",77),mg("click",function(){df(e);let s=Xw(2);return ff(s.useDefaultDelegationTimeout())}),MC(1," Use server default "),pl();}}function Ct(i,t){i&1&&(Ds(0,"p",46),MC(1),pl()),i&2&&(jE(),Og(t));}function bt(i,t){if(i&1){let e=qw();Ds(0,"button",78),mg("click",function(){df(e);let s=Xw(2);return ff(s.exportYaml())}),MC(1),pl();}if(i&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ht(i,t){if(i&1){let e=qw();Ds(0,"form",9),mg("ngSubmit",function(){df(e);let s=Xw();return ff(s.submit())}),Ds(1,"div",10)(2,"label",11),MC(3,"Name "),Ds(4,"span",12),MC(5,"*"),pl()(),lg(6,"input",13),SI(),pl(),Ds(7,"div",10)(8,"label",14),MC(9,"Description"),pl(),lg(10,"input",15),SI(),pl(),Ds(11,"div",10)(12,"label",16),MC(13,"Model name"),pl(),lg(14,"input",17),SI(),pl(),Ds(15,"div",10)(16,"label",18),MC(17,"Instructions"),pl(),lg(18,"textarea",19),SI(),pl(),Pw(19,Je,9,2,"fieldset",20),Ds(20,"fieldset",21)(21,"legend",22),MC(22,"Skills"),pl(),Ds(23,"p",23),MC(24," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Ds(25,"code",24),MC(26,"readSkill"),pl(),MC(27," and "),Ds(28,"code",24),MC(29,"readSkillResource"),pl(),MC(30," tools; selecting none grants neither. "),Pw(31,He,1,0),pl(),Ds(32,"label",25)(33,"input",26),mg("change",function(){df(e);let s=Xw();return ff(s.toggleAllSkills())}),pl(),Ds(34,"span",27),MC(35," Every skill in the catalogue ("),Ds(36,"code",24),MC(37,"*"),pl(),MC(38,") "),pl()(),Ds(39,"p",28),MC(40," Resolved at run time, so skills added later are granted too, without editing this agent. "),pl(),Pw(41,Ye,5,0,"p",29),Pw(42,qe,2,0,"p",29),Pw(43,ze,2,0,"p",30)(44,tt,2,0),pl(),Ds(45,"div",10)(46,"label",31),MC(47,"Execution mode"),pl(),Ds(48,"select",32)(49,"option",33),MC(50,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),Ds(51,"option",33),MC(52,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),Ds(53,"option",33),MC(54,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),SI(),Ds(55,"p",28),MC(56,' 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. '),pl()(),Pw(57,it,10,3,"div",10),Ds(58,"div",10)(59,"label",34),lg(60,"input",35),SI(),Ds(61,"span",36),MC(62,"Enabled"),pl()(),Ds(63,"p",37),MC(64,"Disabled agents are excluded from namespace resolution."),pl()(),Ds(65,"fieldset",21)(66,"legend",22),MC(67,"Sub-agents"),pl(),Ds(68,"p",23),MC(69," The agents this one may delegate to. Selecting at least one grants it the "),Ds(70,"code",24),MC(71,"DELEGATE__delegate"),pl(),MC(72," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Pw(73,ot,1,0),pl(),Ds(74,"label",25)(75,"input",26),mg("change",function(){df(e);let s=Xw();return ff(s.toggleAllSubAgents())}),pl(),Ds(76,"span",27),MC(77," Every agent it can reach ("),Ds(78,"code",24),MC(79,"*"),pl(),MC(80,") "),pl()(),Ds(81,"p",28),MC(82," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),pl(),Pw(83,at,5,0,"p",29),Pw(84,lt,2,0,"p",29),Pw(85,rt,2,0,"p",30)(86,ut,2,0),Ds(87,"p",28),MC(88," Advanced \u2014 add a glob instead of picking a name, for example "),Ds(89,"code",24),MC(90,"*Fixer"),pl(),MC(91," to cover BugFixer and StoryFixer. "),pl(),Ds(92,"div",38)(93,"input",39),mg("keydown.enter",function(){df(e);let s=Xw();return ff(s.addSubAgent())}),pl(),SI(),Ds(94,"button",40),mg("click",function(){df(e);let s=Xw();return ff(s.addSubAgent())}),MC(95," + "),pl()()(),Ds(96,"div",10)(97,"label",41),MC(98,"Delegation timeout (seconds)"),pl(),Ds(99,"p",42),MC(100," 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 "),Pw(101,pt,1,2),MC(102," . "),pl(),lg(103,"input",43),SI(),Pw(104,ft,2,0,"p",44),Pw(105,_t,2,0,"button",45),pl(),Pw(106,Ct,2,1,"p",46),Ds(107,"div",47)(108,"button",48),MC(109),pl(),Pw(110,bt,2,2,"button",49),Ds(111,"button",50),mg("click",function(){df(e);let s=Xw();return ff(s.cancel())}),MC(112,"Cancel"),pl()()();}if(i&2){let e,n=Xw();ug("formGroup",n.form),jE(6),ug("formControl",n.nameControl),MI(),jE(4),ug("formControl",n.descriptionControl),MI(),jE(4),ug("formControl",n.modelNameControl),MI(),jE(4),ug("formControl",n.instructionsControl),MI(),jE(),Lw(n.integrationRows().length>0||n.builtInRows().length>0?19:-1),jE(12),Lw(n.isPlatformMode?31:-1),jE(2),ug("checked",n.allSkillsSelected()),jE(8),Lw(n.namedSkillSelectionDropped()?41:-1),jE(),Lw(n.skillCatalogueUnavailable()?42:-1),jE(),Lw(n.skillRows().length===0?43:44),jE(5),ug("formControl",n.executionModeControl),MI(),jE(),ug("value",n.ExecutionMode.SIMPLE),jE(2),ug("value",n.ExecutionMode.ADVANCED),jE(2),ug("value",n.ExecutionMode.LOOP),jE(4),Lw(n.isLoopMode()?57:-1),jE(3),ug("formControl",n.enabledControl),MI(),jE(13),Lw(n.isPlatformMode?73:-1),jE(2),ug("checked",n.allSubAgentsSelected()),jE(8),Lw(n.namedSubAgentSelectionDropped()?83:-1),jE(),Lw(n.subAgentCandidatesUnavailable()?84:-1),jE(),Lw(n.subAgentRows().length===0?85:86),jE(8),ug("formControl",n.newSubAgentControl),MI(),jE(),ug("disabled",!n.newSubAgentControl.value.trim()),jE(7),Lw(n.defaultDelegationTimeoutSeconds()!==null?101:-1),jE(2),ug("formControl",n.delegationTimeoutControl),cg("aria-invalid",n.delegationTimeoutControl.invalid),MI(),jE(),Lw(n.delegationTimeoutControl.invalid?104:-1),jE(),Lw(n.delegationTimeoutControl.value!==null?105:-1),jE(),Lw((e=n.submitError())?106:-1,e),jE(2),ug("disabled",n.form.invalid||n.isSubmitting()),jE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),jE(),Lw(n.isEditMode()?110:-1);}}var Re=class i$1{route=g(W);router=g(F);destroyRef=g(Ie$1);agentConfigController=g($);defaultsController=g(U);defaultDelegationTimeoutSeconds=Ui(null);exportService=g(Y);integrationConfigState=g(O);integrationTypeController=g(W$1);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),modelName:new vt(null),instructions:new vt(null),executionMode:new vt("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new vt(null,{validators:[ve.min(1),ve.max(2147483647),ve.pattern(/^\d+$/)]}),enabled:new vt(false,{nonNullable:true}),loopConfig:new vt(null,{validators:[i$1.jsonValidator]})});static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(n){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=KC(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=KC(()=>this.executionModeValue()==="LOOP");subAgentRows=Ui([]);allSubAgentsSelected=Ui(false);subAgentCandidatesUnavailable=Ui(false);namedSubAgentSelectionDropped=KC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));hasAnySubAgent=KC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new vt("",{nonNullable:true});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);submitError=Ui(null);ExecutionMode=we;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Ui([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=KC(()=>Ie({configEnabled:this.builtInRows().some(t=>t.type===Te&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));integrationRows=Ui([]);skillRows=Ui([]);allSkillsSelected=Ui(false);skillCatalogueUnavailable=Ui(false);namedSkillSelectionDropped=KC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),da(()=>Cr(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ty({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Cr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:n,platformIntegrations:s,builtInTypes:d,skillCatalogue:C,delegationCandidates:y})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let R=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(R),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 _=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(_,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(d,e.integrations??void 0)),this.allSubAgentsSelected.set(Ee(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(y,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ty({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Cr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:n,builtInTypes:s,skillCatalogue:d,delegationCandidates:C})=>{let y=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(y,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(d,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(da(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Cr([]))))}buildSkillRows(t,e){let s=(e??[]).map(_=>_.trim()).filter(_=>_.length>0).filter(_=>_!==r),d=i(s),C=new Set(t.map(_=>_.name.toLowerCase())),y=t.map(_=>({selector:_.name,name:_.name,description:_.description,platform:_.namespaceId==null,unresolved:false,selected:Ui(d.has(_.name.toLowerCase()))})),R=new Set;for(let _ of s){let p=l(_).toLowerCase();C.has(p)||R.has(p)||(R.add(p),y.push({selector:_,name:_,description:"",platform:false,unresolved:true,selected:Ui(true)}));}return y}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);return (this.namespaceId?Ty({namespace:this.agentConfigController.listByParentAgentConfig(this.namespaceId,false),platform:t}).pipe(ne(({namespace:n,platform:s})=>[...s,...n])):t).pipe(ne(n=>n.map(s=>s.name).filter(s=>s.length>0)),ne(n=>[...new Set(n)]),da(n=>(console.error("[agent-config-form] failed to load the delegation candidates",n),this.subAgentCandidatesUnavailable.set(true),Cr([]))))}buildSubAgentRows(t,e,n){let s=t.filter(p=>p!==n),d=ke(e),C=new Set(s.map(p=>p.toLowerCase())),y=s.map(p=>({selector:p,name:p,unresolved:false,pattern:false,grantedByPattern:H(p,e),selected:Ui(d.has(p.toLowerCase()))})),R=new Set,_=(e??[]).map(p=>p.trim()).filter(p=>p.length>0&&p!==I);for(let p of _){let U=p.toLowerCase();C.has(U)||R.has(U)||(R.add(U),y.push({selector:p,name:p,unresolved:true,pattern:G(p),grantedByPattern:false,selected:Ui(true)}));}return y}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),da(t=>(console.error("[agent-config-form] failed to load integration types",t),Cr([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",d=e?.[s],C=e!=null&&s in e,y=Array.isArray(d)?d.join(", "):"";return {config:n,enabled:Ui(C),toolsControl:new vt(y,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,d=e?.[n.type],C=s?Array.isArray(d)&&d.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:Ui(C),restrictedTools:Array.isArray(d)&&d.length>0?d:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===I?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>i$1.withPatternGrants([...n,{selector:t,name:t,unresolved:true,pattern:G(t),grantedByPattern:false,selected:Ui(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(n=>i$1.withPatternGrants(n.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>i$1.withPatternGrants(e));}static withPatternGrants(t){let e=t.filter(n=>n.selected()).map(n=>n.selector);return t.map(n=>n.unresolved?n:x(w({},n),{grantedByPattern:H(n.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t);}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [I];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",d=n.toolsControl.value.trim();t[s]=d===""?null:d.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:n=>{this.isSubmitting.set(false),this.submitError.set(i$1.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;return typeof n=="string"&&n.trim().length>0?n:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),d=document.createElement("a");d.href=s,d.download=`${this.existingConfig?.name??"agent"}.yaml`,d.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||i$1)};static \u0275cmp=mw({type:i$1,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__skills"],[1,"agent-config-form__label"],[1,"agent-config-form__skills-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__skill-all"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked"],[1,"agent-config-form__skill-name"],[1,"agent-config-form__field-hint"],["role","alert",1,"agent-config-form__skills-warning"],[1,"agent-config-form__skills-empty"],["for","agent-config-execution-mode",1,"agent-config-form__label"],["id","agent-config-execution-mode",1,"agent-config-form__select",3,"formControl"],[3,"value"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],["for","delegation-timeout",1,"agent-config-form__label"],["id","delegation-timeout-hint",1,"agent-config-form__field-hint"],["id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",1,"agent-config-form__input",3,"formControl"],["id","delegation-timeout-error","role","alert",1,"agent-config-form__field-hint"],["type","button",1,"agent-config-form__sub-agent-btn"],["role","alert",1,"agent-config-form__submit-error"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],["role","note",1,"agent-config-form__integration-warning"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__skill-row"],[1,"agent-config-form__skill-toggle"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked","disabled"],[1,"agent-config-form__skill-badge"],[1,"agent-config-form__skill-badge","agent-config-form__skill-badge--unresolved"],[1,"agent-config-form__skill-desc"],["for","agent-config-loop-config",1,"agent-config-form__label"],["id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",1,"agent-config-form__textarea","agent-config-form__textarea--mono",3,"placeholder","formControl"],["role","alert",1,"agent-config-form__field-error"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__sub-agent-btn",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(Ds(0,"div",0)(1,"header",1)(2,"button",2),mg("click",function(){return n.cancel()}),Ds(3,"span",3),MC(4,"\u2190"),pl(),MC(5," Agent Configs "),pl(),Ds(6,"h1",4),MC(7),pl(),Pw(8,Ve,2,1,"a",5),Pw(9,Pe,2,0,"span",6),pl(),Pw(10,Oe,2,0,"p",7)(11,ht,113,33,"form",8),pl()),e&2&&(jE(7),Og(n.isEditMode()?"Edit agent config":"New agent config"),jE(),Lw(n.isEditMode()?8:-1),jE(),Lw(n.isPlatformMode?9:-1),jE(),Lw(n.isLoading()?10:11));},dependencies:[Kn,zn,Zn,Xn,Ye$1,dn,Ft,bt$1,Ln,Wn,qt,Lt,pn,Vn,$t],encapsulation:2})};export{Re as AgentConfigFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BHQcx05f.js';import {I as s,x as xt,w as wt,u as ut,C as Ct,g as We,j as gt,k as Wn,N as Nn,J as On}from'./chunk-9rt8_xma.js';import {g,W,F,I as Ie,U as Ui,K as KC,x as U,ae as Ty,af as da,a3 as Cr,m as mw,ao as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,L as Lw,X as Xw,J as ug,q as qw,l as lg,ap as $C,O as Og,v as vl,aq as GC,V as Vw,H as Hw,a5 as Bw,k as df,n as ff,ar as ZD}from'./main-HI6C6EDY.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Ds(0,"a",2),MC(1,"Edit skill \u2192"),pl()),e&2){let n=Xw();ug("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Ds(0,"ds-tag",3),MC(1,"Platform level"),pl());}function te(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function ne(e,t){e&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load skill."),pl());}function ie(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Created by"),pl(),Ds(2,"dd"),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.createdBy);}}function oe(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Last updated"),pl(),Ds(2,"dd"),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.updatedOn);}}function ae(e,t){if(e&1&&(Pw(0,ie,4,1),Pw(1,oe,4,1)),e&2){let n=Xw();Lw(n.createdBy?0:-1),jE(),Lw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Ds(0,"p",4),MC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),pl());}function se(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function re(e,t){e&1&&(Ds(0,"ds-notice"),MC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),pl());}function de(e,t){e&1&&(Ds(0,"p",4),MC(1,"No agent references this skill."),pl());}function ce(e,t){e&1&&(Ds(0,"ds-tag",15),MC(1,"platform agent"),pl());}function me(e,t){e&1&&(Ds(0,"ds-tag",15),MC(1,"via *"),pl());}function pe(e,t){if(e&1&&(Ds(0,"li",13)(1,"span",14),MC(2),pl(),Pw(3,ce,2,0,"ds-tag",15),Pw(4,me,2,0,"ds-tag",15),pl()),e&2){let n=t.$implicit;jE(2),Og(n.name),jE(),Lw(n.platform?3:-1),jE(),Lw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Ds(0,"ul",12),Vw(1,pe,5,3,"li",13,Y),pl(),Ds(3,"p",4),MC(4," An agent listed "),Ds(5,"code"),MC(6,"via *"),pl(),MC(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. "),pl()),e&2){let n=Xw(2);jE(),Hw(n.consumers());}}function _e(e,t){e&1&&(Ds(0,"p",4),MC(1,"No resources bundled with this skill."),pl());}function ge(e,t){if(e&1){let n=qw();Ds(0,"li")(1,"ds-disclosure",16),mg("toggled",function(){let r=df(n).$implicit,g=Xw(3);return ff(g.toggleResource(r))}),Ds(2,"pre",17),MC(3),pl()()();}if(e&2){let n=t.$implicit,o=Xw(3);jE(),ug("heading",n)("open",o.isResourceExpanded(n)),jE(2),Og(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Ds(0,"ul",12),Vw(1,ge,4,3,"li",null,Bw),pl()),e&2){let n=Xw(2);jE(),Hw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=qw();Ds(0,"ds-card",5)(1,"dl",6)(2,"dt"),MC(3,"Name"),pl(),Ds(4,"dd",7),MC(5),pl(),Ds(6,"dt"),MC(7,"Description"),pl(),Ds(8,"dd"),MC(9),pl(),Ds(10,"dt"),MC(11,"Scope"),pl(),Ds(12,"dd"),MC(13),pl(),Ds(14,"dt"),MC(15,"Storage"),pl(),Ds(16,"dd")(17,"ds-tag",8),MC(18),pl()(),Pw(19,ae,2,2),pl()(),Ds(20,"ds-card",9),Pw(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),pl(),Ds(26,"ds-card")(27,"ds-disclosure",10),mg("toggled",function(){df(n);let r=Xw();return ff(r.toggleBody())}),lg(28,"div",11),$C(29,"agentosMarkdown"),pl()(),Ds(30,"ds-card",9),Pw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),pl();}if(e&2){let n=t,o=Xw();jE(5),Og(n.name),jE(4),Og(n.description),jE(4),Og(n.namespaceId?"Namespace":"Platform"),jE(4),ug("variant",o.isFilesystemBacked()?"outline":"neutral"),jE(),vl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),jE(),Lw(o.isFilesystemBacked()?-1:19),jE(),ug("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),jE(),Lw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),jE(6),ug("open",!o.bodyCollapsed()),jE(),ug("innerHTML",GC(29,12,n.body),ZD),jE(2),ug("heading","Resources ("+o.resourcePaths().length+")"),jE(),Lw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);skill=Ui(null);bodyCollapsed=Ui(false);expandedResources=Ui(new Set);resourcePaths=KC(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=KC(()=>this.skill()?.readOnly===true);consumers=Ui([]);consumersUnavailable=Ui(false);consumersLoading=Ui(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),Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Cr([])))}).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=mw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.back()}),MC(3,"\u2190 Skills"),pl(),Pw(4,Z,2,1,"a",2),Pw(5,ee,2,0,"ds-tag",3),pl(),Pw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),pl()),n&2){let r;jE(4),Lw(o.skill()&&!o.isFilesystemBacked()?4:-1),jE(),Lw(o.isPlatformMode?5:-1),jE(),Lw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,xt,wt,ut,Ct,We,gt,Wn,Nn,On],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-BFcnXuqC.js';import {v}from'./chunk-CsPXzWtr.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,av as ne,a8 as fa,a3 as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-HI6C6EDY.js';import {A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O as O$1}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';var H=(i,e)=>e.key;function U(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function z(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI providers\u2026"),pl());}function J(i,e){i&1&&(Ds(0,"p",5),MC(1,"No AI providers available."),pl());}function Q(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI providers match the current filter."),pl());}function W(i,e){i&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function X(i,e){if(i&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.duplicate(d))}),MC(1," Duplicate "),pl();}if(i&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Y(i,e){if(i&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let d=Xw(2).$implicit,c=Xw(2);return ff(c.edit(d))}),MC(1," Edit "),pl();}if(i&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(i,e){if(i&1){let t=qw();Pw(0,Y,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(d.key))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,r=Xw(2);Lw(r.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",r.deletion);}}function ee(i,e){i&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function te(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,W,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,X,2,1,"button",20),Pw(13,Z,2,4)(14,ee,2,0,"button",21),pl()()()),i&2){let t=e.$implicit,r=Xw(2);jE(2),Og(t.config.name),jE(2),Og(t.config.apiType),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(r.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"API type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,te,15,7,"tr",9,H),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var G=class i{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=A();rowFilter=F$1(this.rows,e=>[e.config.name,e.config.apiType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,r,d){return e.map((c,K)=>({key:`${t}:${c.id??K}`,config:c,scope:t,scopeLabel:r,canMutate:d}))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-ai-providers-all-scopes"]],decls:9,vars:3,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type",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"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return r.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New AI provider"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,z,2,0,"p",4)(6,J,2,0,"p",5)(7,Q,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.rows().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O$1],encapsulation:2})};export{G as AiProvidersAllScopesComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {v}from'./chunk-CsPXzWtr.js';import {R}from'./chunk--XNStJOR.js';import {O}from'./chunk-PPseWd3f.js';import {g,W,F,I as Ie$1,a1 as W$1,a2 as F$1,a3 as Cr,U as Ui,K as KC,A as Af,x as U,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,q as qw,V as Vw,a4 as kw,Q as SI,l as lg,a5 as Bw,X as Xw,H as Hw,T as MI,v as vl,O as Og,k as df,n as ff}from'./main-HI6C6EDY.js';import {$,v as vt,a as ve$1,x as xt,w as wt,c as yt,l as ht,e as bt,u as ut,g as We,_ as _t,m as ft,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,F as Ft,h as bt$1,n as fn,L as Ln,W as Wn,b as pn,V as Vn,o as ot}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';function fe(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function Ce(i,t){if(i&1&&(Ds(0,"label",6),lg(1,"input",22),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(2);jE(),ug("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ye(i,t){if(i&1&&(Ds(0,"option",10),MC(1),pl()),i&2){let e=t.$implicit;ug("value",e.type),jE(),Og(e.displayName);}}function ve(i,t){if(i&1&&(Ds(0,"option",10),MC(1),pl()),i&2){let e=t.$implicit;ug("value",e),jE(),Og(e);}}function be(i,t){if(i&1&&(Ds(0,"div",18)(1,"label",6),lg(2,"input",23),SI(),MC(3," Grant automatically "),pl(),Ds(4,"p",2),MC(5),pl()()),i&2){let e=Xw(2);jE(2),ug("formControl",e.autoGrantControl),MI(),jE(3),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Se(i,t){if(i&1){let e=qw();Ds(0,"ds-card")(1,"ds-json-schema-form",24),mg("valueChange",function(s){df(e);let c=Xw(2);return ff(c.onParamsChange(s))}),pl()();}if(i&2){let e=Xw(2);jE(),ug("schema",t)("value",e.initialParams());}}function _e(i,t){if(i&1){let e=qw();Ds(0,"button",25),mg("click",function(){df(e);let s=Xw(2);return ff(s.exportYaml())}),MC(1),pl();}if(i&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function xe(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let s=Xw();return ff(s.submit())}),Ds(1,"ds-fieldset",5),Vw(2,Ce,3,4,"label",6,kw().trackByScope,true),pl(),Ds(4,"ds-form-field",7)(5,"select",8)(6,"option",9),MC(7,"Select type"),pl(),Vw(8,ye,2,2,"option",10,kw().trackByType,true),pl(),SI(),pl(),Ds(10,"ds-form-field",11),lg(11,"input",12),SI(),pl(),Ds(12,"ds-form-field",13),lg(13,"textarea",14),SI(),pl(),Ds(14,"ds-form-field",15)(15,"select",16)(16,"option",17),MC(17,"None"),pl(),Vw(18,ve,2,2,"option",10,Bw),pl(),SI(),pl(),Pw(20,be,6,2,"div",18),Pw(21,Se,2,2,"ds-card"),Ds(22,"ds-form-actions")(23,"button",19),MC(24),pl(),Pw(25,_e,2,2,"button",20),Ds(26,"button",21),mg("click",function(){df(e);let s=Xw();return ff(s.cancel())}),MC(27,"Cancel"),pl()()();}if(i&2){let e,n=Xw();ug("formGroup",n.form),jE(),ug("disabled",n.isEditMode()),jE(),Hw(n.scopeOptions),jE(3),ug("formControl",n.typeControl),MI(),jE(3),Hw(n.integrationTypes()),jE(3),ug("formControl",n.nameControl),MI(),jE(2),ug("formControl",n.descriptionControl),MI(),jE(2),ug("formControl",n.authSettingNameControl),MI(),jE(),ug("ngValue",null),jE(2),Hw(n.availableAuthSettings()),jE(2),Lw(n.isAutoGrantable()?20:-1),jE(),Lw((e=n.schema())?21:-1,e),jE(2),ug("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),jE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),jE(),Lw(n.isEditMode()?25:-1);}}var Ie=new Set(["platform","namespace","userOnNs","userGlobal"]),w=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ge=class i{route=g(W);router=g(F);destroyRef=g(Ie$1);state=g(O);integrationTypeController=g(W$1);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?Cr(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new $({name:new vt("",{nonNullable:true,validators:[ve$1.required,ve$1.minLength(1)]}),description:new vt(null),type:new vt("",{nonNullable:true,validators:[ve$1.required]}),scope:new vt("namespace",{nonNullable:true}),autoGrant:new vt(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);scopeOptions=[{value:"platform",label:w.platform},{value:"namespace",label:w.namespace},{value:"userOnNs",label:w.userOnNs},{value:"userGlobal",label:w.userGlobal}];authSettingNameControl=new vt(null);availableAuthSettings=Ui([]);paramsValue=Ui(null);initialParams=Ui(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=KC(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=KC(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=KC(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Af(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(he=>{this.loadAuthSettingsForScope(he);});let c=e.get("template");c&&this.hydrateFromTemplate(c);}parseScope(t){return t&&Ie.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(c=>c.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"integration"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to integrations",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Scope",3,"disabled"],["dsCheck",""],["label","Type","controlId","integration-type","required",""],["dsControl","","id","integration-type",3,"formControl"],["value","","disabled",""],[3,"value"],["label","Name","controlId","integration-name","required",""],["dsControl","","id","integration-name","type","text","placeholder","Integration name","autocomplete","off",3,"formControl"],["label","Description","controlId","integration-description"],["dsControl","","id","integration-description","placeholder","Optional description","rows","3",3,"formControl"],["label","Auth Setting","controlId","integration-auth-setting"],["dsControl","","id","integration-auth-setting",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["type","radio",3,"value","formControl","disabled"],["type","checkbox",3,"formControl"],[3,"valueChange","schema","value"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Integrations "),pl()(),Pw(4,fe,2,0,"p",2)(5,xe,28,12,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit integration":"New integration"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[xt,wt,yt,ht,bt,ut,We,_t,ft,Kn,zn,Zn,Xn,Ye,Ft,bt$1,fn,Ln,Wn,pn,Vn,ot],encapsulation:2})};export{ge as IntegrationFormComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {v}from'./chunk-CsPXzWtr.js';import {R,q,J}from'./chunk--XNStJOR.js';import {g,W,F,I as Ie,U as Ui,a2 as F$1,K as KC,A as Af,x as U,C as x,z as w,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,q as qw,V as Vw,a5 as Bw,Q as SI,l as lg,X as Xw,T as MI,H as Hw,v as vl,a4 as kw,O as Og,e as cg,k as df,n as ff}from'./main-HI6C6EDY.js';import {v as vt,a as ve$1,$,x as xt,w as wt,c as yt,l as ht,e as bt,g as We,_ as _t,m as ft,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,h as bt$1,n as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';function Ce(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ye(i,t){if(i&1&&(Ds(0,"label",16),lg(1,"input",17),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(3);jE(),ug("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Ds(0,"ds-fieldset",5),Vw(1,ye,3,4,"label",16,kw().trackByScope,true),pl()),i&2){let e=Xw(2);ug("disabled",e.isEditMode()),jE(),Hw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Ds(0,"option",8),MC(1),pl()),i&2){let e=t.$implicit,n=Xw(2);ug("value",e),jE(),Og(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Ds(0,"ds-form-field",18),lg(1,"input",19),SI(),pl()),i&2){let e=Xw().$implicit;ug("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),jE(),ug("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),cg("aria-describedby",e.hint?"as-hint-"+e.key:null),MI();}}function Ae(i,t){if(i&1&&Pw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=Xw(3);Lw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Ds(0,"ds-fieldset",13),Vw(1,Ae,1,1,null,null,kw().trackByField,true),pl()),i&2){let e=Xw(2);ug("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),jE(),Hw(e.credentialFields());}}function be(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let o=Xw();return ff(o.submit())}),Pw(1,ge,3,1,"ds-fieldset",5),Ds(2,"ds-form-field",6)(3,"select",7),Vw(4,fe,2,2,"option",8,Bw),pl(),SI(),pl(),Ds(6,"ds-form-field",9),lg(7,"input",10),SI(),pl(),Ds(8,"ds-form-field",11),lg(9,"input",12),SI(),pl(),Pw(10,ve,3,1,"ds-fieldset",13),Ds(11,"ds-form-actions")(12,"button",14),MC(13),pl(),Ds(14,"button",15),mg("click",function(){df(e);let o=Xw();return ff(o.cancel())}),MC(15,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(),Lw(e.isPlatformMode?-1:1),jE(2),ug("formControl",e.authTypeControl),MI(),jE(),Hw(e.authTypeOptions),jE(3),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.credentialFields().length>0?10:-1),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Ui(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve$1.required,ve$1.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve$1.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=KC(()=>_e[this.selectedAuthType()]);isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Af(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Auth settings "),pl()(),Pw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit auth setting":"New auth setting"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[xt,wt,yt,ht,bt,We,_t,ft,Kn,zn,Zn,Xn,Ye,bt$1,fn,Ln,Wn,pn,Vn],encapsulation:2})};
|
|
2
|
+
export{me as AuthSettingFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-CNKxgGRV.js';import {$ as $$1,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,h as bt,L as Ln,W as Wn,q as qt,b as pn,V as Vn,x as xt,w as wt,c as yt,l as ht,e as bt$1,C as Ct,g as We,_ as _t,m as ft}from'./chunk-9rt8_xma.js';import {g,W,F,I as Ie$1,a9 as $,aa as Oe$1,ab as Ee$1,U as Ui,ac as Ve$1,a2 as F$1,ad as md,K as KC,ae as Ty,x as U,af as da,a3 as Cr,C as x,z as w,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,v as vl,L as Lw,q as qw,l as lg,Q as SI,V as Vw,X as Xw,T as MI,H as Hw,O as Og,k as df,n as ff,o as oh}from'./main-HI6C6EDY.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function _e(n,t){if(n&1&&(Ds(0,"ds-form-field",9),lg(1,"input",38),pl()),n&2){let e=Xw(2);jE(),ug("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Ds(0,"a",39),MC(1,"Add an agent config"),pl(),MC(2," first. ")),n&2){let e=Xw(3);ug("href","/agentos/"+e.namespaceId+"/agent-configs/new",oh);}}function xe(n,t){if(n&1&&(Ds(0,"ds-form-field",10)(1,"p",2),MC(2," No agent configs available in this scope yet. "),Pw(3,Se,3,1),pl()()),n&2){let e=Xw(2);jE(3),Lw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Ds(0,"option",17),MC(1),pl()),n&2){let e=t.$implicit;ug("value",e.id),jE(),Og(e.name);}}function De(n,t){if(n&1&&(Ds(0,"ds-form-field",11)(1,"select",40)(2,"option",41),MC(3,"Select an agent config\u2026"),pl(),Vw(4,Ee,2,2,"option",17,ve),pl(),SI(),pl()),n&2){let e=Xw(2);ug("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),jE(),ug("formControl",e.agentConfigIdControl),MI(),jE(3),Hw(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Ds(0,"option",17),MC(1),pl()),n&2){let e=t.$implicit;ug("value",e.value),jE(),Og(e.label);}}function Ne(n,t){if(n&1){let e=qw();Ds(0,"label",31)(1,"input",43),mg("change",function(){let f=df(e).$implicit,h=Xw(3);return ff(h.toggleDay(f.value))}),pl(),MC(2),pl();}if(n&2){let e=t.$implicit,l=Xw(3);jE(),ug("checked",l.isDaySelected(e.value)),jE(),vl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Ds(0,"ds-form-field",18)(1,"div",42),Vw(2,Ne,3,2,"label",31,V),pl()()),n&2){let e=Xw(2);jE(2),Hw(e.dayOptions);}}function Me(n,t){if(n&1&&(Ds(0,"option",17),MC(1),pl()),n&2){let e=t.$implicit;ug("value",e.value),jE(),Og(e.label);}}function Pe(n,t){if(n&1&&(Ds(0,"ds-form-field",28),lg(1,"input",44),SI(),pl()),n&2){let e=Xw(2);ug("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),jE(),ug("formControl",e.endDateControl),MI();}}function we(n,t){if(n&1&&(Ds(0,"ds-form-field",29),lg(1,"input",45),SI(),pl()),n&2){let e=Xw(2);ug("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),jE(),ug("formControl",e.occurrenceCountControl),MI();}}function Fe(n,t){if(n&1&&(Ds(0,"ds-notice"),MC(1),pl()),n&2){let e=Xw(2);jE(),Og(e.errorMessage());}}function Oe(n,t){if(n&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let f=Xw();return ff(f.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"input",8),SI(),pl(),Pw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Ds(8,"ds-form-field",12),lg(9,"textarea",13),SI(),pl(),Ds(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Vw(13,Te,2,2,"option",17,V),pl(),SI(),pl(),Pw(15,Ie,4,0,"ds-form-field",18),Ds(16,"ds-form-field",19)(17,"div",20),lg(18,"input",21),SI(),Ds(19,"span",22),MC(20,"UTC"),pl()()()(),Ds(21,"ds-fieldset",23)(22,"ds-form-field",24),lg(23,"input",25),SI(),pl(),Ds(24,"ds-form-field",26)(25,"select",27),Vw(26,Me,2,2,"option",17,V),pl(),SI(),pl(),Pw(28,Pe,2,2,"ds-form-field",28),Pw(29,we,2,2,"ds-form-field",29),pl(),Ds(30,"div",30)(31,"label",31),lg(32,"input",32),SI(),MC(33," Enabled "),pl(),Ds(34,"p",33),MC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),pl()(),Ds(36,"ds-form-field",34),lg(37,"textarea",35),SI(),pl(),Pw(38,Fe,2,1,"ds-notice"),Ds(39,"ds-form-actions")(40,"button",36),MC(41),pl(),Ds(42,"button",37),mg("click",function(){df(e);let f=Xw();return ff(f.cancel())}),MC(43,"Cancel"),pl()()();}if(n&2){let e=Xw();ug("formGroup",e.form),jE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),jE(),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),jE(3),ug("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),jE(),ug("formControl",e.promptContentControl),MI(),jE(3),ug("formControl",e.unitControl),MI(),jE(),Hw(e.schedulerUnits),jE(2),Lw(e.showDayFilter()?15:-1),jE(),ug("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),jE(2),ug("formControl",e.timeUtcControl),MI(),jE(4),ug("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),jE(),ug("formControl",e.startDateControl),MI(),jE(2),ug("formControl",e.endTypeControl),MI(),jE(),Hw(e.endTypes),jE(2),Lw(e.showEndDate()?28:-1),jE(),Lw(e.showOccurrenceCount()?29:-1),jE(3),ug("formControl",e.enabledControl),MI(),jE(4),ug("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),jE(),ug("formControl",e.externalMetadataJsonControl),MI(),jE(),Lw(e.errorMessage()?38:-1),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(Ie$1);state=g(c);agentConfigController=g($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve$1.required]}),description:new vt(null),agentConfigId:new vt("",{nonNullable:true,validators:[ve$1.required]}),promptContent:new vt("",{nonNullable:true,validators:[ve$1.required]}),unit:new vt(Ee$1.WEEK,{nonNullable:true,validators:[ve$1.required]}),days:new vt([],{nonNullable:true}),timeUtc:new vt("09:00",{nonNullable:true,validators:[ve$1.required,ve$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new vt("",{nonNullable:true,validators:[ve$1.required]}),endType:new vt(Oe$1.NEVER,{nonNullable:true,validators:[ve$1.required]}),endDate:new vt(null),occurrenceCount:new vt(null),enabled:new vt(true,{nonNullable:true}),externalMetadataJson:new vt("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);errorMessage=Ui(null);SchedulerUnit=Ee$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ee$1.WEEK,label:"Week(s)"},{value:Ee$1.MONTH,label:"Month(s)"}];endTypes=[{value:Oe$1.NEVER,label:"Never"},{value:Oe$1.ON_DATE,label:"On date"},{value:Oe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(md(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(md(this.endTypeControl.value)));showDayFilter=KC(()=>this.unitSignal()===Ee$1.WEEK);showEndDate=KC(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=KC(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=Ui([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),Ty({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(da(()=>Cr([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Oe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Oe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return l.cancel()}),MC(3),pl()(),Pw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),pl()),e&2&&(jE(),ug("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),jE(2),vl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),jE(),Lw(l.isLoading()?4:5));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn,qt,pn,Vn,xt,wt,yt,ht,bt$1,Ct,We,_t,ft],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Oe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Oe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {aR as A,aS as z$1}from'./main-HI6C6EDY.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
|
|
2
2
|
`});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
|
|
3
3
|
`?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
|
|
4
4
|
`&&(E.last=l.length==0||l[0].tag==`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a8 as fa,af as da,a3 as Cr,ay as Uy}from'./main-HI6C6EDY.js';function i(t,o,p){return t.pipe(fa(()=>o().pipe(da(()=>Cr(p)))),Uy({bufferSize:1,refCount:true}))}export{i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O}from'./chunk-9rt8_xma.js';import {g,W as W$1,F,I as Ie,a9 as $,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-HI6C6EDY.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function z(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading agent configs\u2026"),pl());}function G(n,e){n&1&&(Ds(0,"p",5),MC(1,"No agent configs available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),MC(1,"No agent configs match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",18),MC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,d=Xw(2);return ff(d.launch(s))}),MC(1," Launch "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,d=Xw(2);return ff(d.edit(s))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.inspect(s))}),MC(1," Inspect "),pl(),Pw(2,X,2,1,"button",23),Pw(3,Y,2,1,"button",23);}if(n&2){let t=Xw().$implicit,i=Xw(2);cg("aria-label","Inspect "+t.config.name),jE(2),Lw(i.canLaunch(t)?2:-1),jE(),Lw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,i=Xw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16)(9,"ds-tag",17),MC(10),pl(),Pw(11,W,2,0,"ds-tag",18),pl()(),Ds(12,"td",19)(13,"div",20),Pw(14,Z,4,3),Pw(15,ee,1,3,"agentos-row-delete-action",21),pl()()()),n&2){let t=e.$implicit,i=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.description||"\u2014"," "),jE(2),Og(i.mode(t)),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?11:-1),jE(3),Lw(i.deletion.confirmingId()!==t.key?14:-1),jE(),Lw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Execution mode"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,te,16,8,"tr",9,J),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);controller=g($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(da(()=>Cr([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return i.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New agent config"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-PPseWd3f.js';import {g,W,I as Ie,U as Ui,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,X as Xw,O as Og}from'./main-HI6C6EDY.js';import {x as xt,w as wt,u as ut,C as Ct,j as gt,k as Wn}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';function O(r,e){r&1&&(Ds(0,"p",1),MC(1,"Loading integration\u2026"),pl());}function T(r,e){r&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load this integration configuration."),pl());}function L(r,e){r&1&&(Ds(0,"div",3)(1,"ds-tag",9),MC(2,"YAML"),pl(),Ds(3,"ds-tag",10),MC(4,"Read-only"),pl()());}function k(r,e){if(r&1&&(Ds(0,"ds-card",2),Pw(1,L,5,0,"div",3),Ds(2,"dl",4)(3,"dt"),MC(4,"Name"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"Type"),pl(),Ds(9,"dd",5),MC(10),pl(),Ds(11,"dt"),MC(12,"Description"),pl(),Ds(13,"dd"),MC(14),pl(),Ds(15,"dt"),MC(16,"Scope"),pl(),Ds(17,"dd"),MC(18),pl(),Ds(19,"dt"),MC(20,"Source"),pl(),Ds(21,"dd"),MC(22),pl(),Ds(23,"dt"),MC(24,"Auto grant"),pl(),Ds(25,"dd"),MC(26),pl(),Ds(27,"dt"),MC(28,"Auth setting"),pl(),Ds(29,"dd"),MC(30),pl()()(),Ds(31,"ds-card",6)(32,"p",7),MC(33,"Sensitive values are always redacted."),pl(),Ds(34,"pre",8),MC(35),pl()()),r&2){let o=e,a=Xw();jE(),Lw(a.source()==="FILESYSTEM"?1:-1),jE(5),Og(o.name),jE(4),Og(o.integrationType),jE(4),Og(o.description||"\u2014"),jE(4),Og(a.scopeOf(o)),jE(4),Og(a.source()),jE(4),Og(o.autoGrant?"Enabled":"Disabled"),jE(4),Og(o.authSettingName||"None"),jE(5),Og(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(Ie);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Ui(true);hasError=Ui(false);config=Ui(null);source=Ui("NEO4J");parameters=Ui("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=mw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Pw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),pl()),o&2){let m;jE(2),Lw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[xt,wt,ut,Ct,gt,Wn],encapsulation:2})};export{V as IntegrationConfigViewComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f,y,$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,d as dn,L as Ln,W as Wn,q as qt,b as pn,V as Vn,x as xt,w as wt,c as yt,e as bt,g as We,_ as _t}from'./chunk-9rt8_xma.js';import {g,W,F,G,I as Ie,K as KC,U as Ui,A as Af,x as U,z as w,C as x,m as mw,D as Ds,l as lg,P as Pw,a as pl,J as ug,j as jE,L as Lw,M as MC,q as qw,N as mg,Q as SI,X as Xw,T as MI,e as cg,v as vl,k as df,n as ff}from'./main-HI6C6EDY.js';var ne=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function re(i){return ne.test(i)}function ee(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||re(e)?null:{absolutePath:true}}}function ae(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ie(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Xw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),SI(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),SI(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),SI(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),SI(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),SI(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),SI(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let oe=Xw();return ff(oe.onMaxToolRoundsInput(p))}),pl(),SI(),pl(),Ds(17,"ds-form-actions")(18,"button",21),MC(19),pl(),Ds(20,"button",22),mg("click",function(){df(e);let p=Xw();return ff(p.cancel())}),MC(21,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(2),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.externalIdControl),MI(),jE(2),ug("formControl",e.defaultAgentNameControl),MI(),jE(2),ug("formControl",e.configPathControl),MI(),jE(),ug("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),jE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),MI(),jE(),ug("hint",e.runCostThresholdHint()),jE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),MI(),jE(),ug("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),jE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var le=1,se=2147483647,te=class i{route=g(W);router=g(F);namespaceController=g(G);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=KC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=KC(()=>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=KC(()=>{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=KC(()=>{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 $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt("",{nonNullable:true}),configPath:new vt("",{nonNullable:true}),sharedExchangePath:new vt("",{nonNullable:true,validators:[ee(()=>this.canEditSharedExchangePath())]}),externalId:new vt("",{nonNullable:true}),defaultAgentName:new vt("",{nonNullable:true}),runCostThreshold:new vt(null),maxToolRounds:new vt(null,{validators:[ve.min(le),ve.max(se),ve.pattern(/^\d+$/)]})});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}maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{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.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}),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=mw({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"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,ae,2,0,"p",2)(3,ie,22,19,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),jE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),jE(),Lw(u.isLoading()?2:3));},dependencies:[Kn,zn,Ye,dn,Ln,Wn,qt,pn,Vn,xt,wt,yt,bt,We,_t],encapsulation:2})};export{te as NamespaceFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {O as O$1}from'./chunk-PPseWd3f.js';import {g,F,I as Ie,a6 as D,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-HI6C6EDY.js';import {A as A$1,r as F$1,g as We,w as wt,s as qn,E,O as O$2}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),MC(1),pl()),t&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform integrations defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function z(t,e){if(t&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.edit(d))}),MC(1,"Edit"),pl();}if(t&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(t&2){let n=Xw().$implicit,r=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Xw(2);jE(2),Og(n.name),jE(2),Og(n.integrationType),jE(3),Lw(r.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);state=g(O$1);integrationConfigController=g(D);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A$1();configs=Ui([]);rowFilter=F$1(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=mw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,A,2,1,"p",3),Pw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O$2],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {A,r as F$1,g as We,w as wt,s as qn,E,O as O$1}from'./chunk-9rt8_xma.js';import {g,F,I as Ie,a9 as $,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-HI6C6EDY.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function K(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading agent configs\u2026"),pl());}function H(n,e){n&1&&(Ds(0,"p",5),MC(1,"No platform agent configs defined yet."),pl());}function U(n,e){n&1&&(Ds(0,"p",4),MC(1,"No agent configs match the current filter."),pl());}function z(n,e){if(n&1){let t=qw();Ds(0,"button",19),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.inspect(d))}),MC(1," Inspect "),pl(),Ds(2,"button",19),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.edit(d))}),MC(3,"Edit"),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Inspect "+t.name),jE(2),cg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(d.id))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15),MC(8),pl(),Ds(9,"td",16)(10,"div",17),Pw(11,z,4,2),Pw(12,G,1,3,"agentos-row-delete-action",18),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.name),jE(2),vl(" ",t.description||"\u2014"," "),jE(2),Og(t.modelName||"\u2014"),jE(2),Og(a.mode(t)),jE(3),Lw(a.deletion.confirmingId()!==t.id?11:-1),jE(),Lw(t.id?12:-1);}}function O(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Model"),pl(),Ds(10,"th",10),MC(11,"Execution mode"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,J,13,6,"tr",9,B),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(Ie);agentConfigController=g($);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();configs=Ui([]);rowFilter=F$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New agent config"),pl()(),Pw(4,j,2,1,"p",3),Pw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {i}from'./chunk-DegMF1SI.js';import {y}from'./chunk-9rt8_xma.js';import {g,a6 as D,aA as me,a7 as wr,an as wy,a8 as fa,af as da,a3 as Cr,av as ne,ay as Uy,_ as yd,$ as x}from'./main-HI6C6EDY.js';var u=s=>s,N="none",w="me",O=class s{nsController=g(D);exportService=g(me);userState=g(y);refresh$=new wr(void 0);namespaceId$=new wr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([e])=>{let n=this.loadPlatformConfigs().pipe(da(()=>Cr([]))),t=this.loadUserConfigs("global").pipe(da(()=>Cr([])));return e?wy([n,this.loadNamespaceConfigs(e).pipe(da(()=>Cr([]))),this.loadUserConfigs(e).pipe(da(()=>Cr([]))),t]).pipe(ne(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):wy([n,t]).pipe(ne(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Uy({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):Cr([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(yd(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(yd(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(yd(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(yd(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(yd(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O}from'./chunk-9rt8_xma.js';import {g,W as W$1,F,I as Ie,ak as N,aj as k,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,x as U,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-HI6C6EDY.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function W(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI models\u2026"),pl());}function X(i,e){i&1&&(Ds(0,"p",5),MC(1,"No AI models configured."),pl());}function Y(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI models match the current filter."),pl());}function Z(i,e){i&1&&(Ds(0,"ds-tag",18),MC(1,"Read-only"),pl());}function ee(i,e){if(i&1){let t=qw();Ds(0,"button",24),mg("click",function(){df(t);let s=Xw(2).$implicit,m=Xw(2);return ff(m.edit(s))}),MC(1,"Edit"),pl();}if(i&2){let t=Xw(2).$implicit,n=Xw(2);cg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=qw();Pw(0,ee,2,1,"button",22),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,n=Xw(2);Lw(n.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function ne(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16)(9,"ds-tag",17),MC(10),pl(),Pw(11,Z,2,0,"ds-tag",18),pl()(),Ds(12,"td",19)(13,"div",20),Pw(14,te,2,4)(15,ie,2,0,"button",21),pl()()()),i&2){let t=e.$implicit,n=Xw(2);jE(2),Og(n.title(t)),jE(2),Og(t.providerName),jE(2),vl(" ",t.model.apiModelName," "),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?11:-1),jE(3),Lw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Provider"),pl(),Ds(8,"th",10),MC(9,"API model name"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ne,16,7,"tr",9,G),pl()()()),i&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(Ie);aiModelController=g(N);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(da(()=>Cr([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(fa(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return Ty({namespace:Cr(e),platform:Cr(t),providers:Cr(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(da(()=>Cr([])))})})))));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=mw({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&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return n.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return n.openCreateForm()}),MC(3,"New AI model"),pl()(),Pw(4,Q,2,1,"p",3),Pw(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&&(jE(),ug("query",n.rowFilter.query()),jE(3),Lw(n.deletion.error()?4:-1),jE(),Lw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O],encapsulation:2})};export{z as NamespaceAiModelsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {A,r as F$1,g as We,w as wt,s as qn,E,O}from'./chunk-9rt8_xma.js';import {g,F,I as Ie,aj as k$1,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-HI6C6EDY.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function U(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI providers\u2026"),pl());}function j(i,e){i&1&&(Ds(0,"p",5),MC(1,"No platform AI providers defined yet."),pl());}function K(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI providers match the current filter."),pl());}function H(i,e){if(i&1){let t=qw();Ds(0,"button",19),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.edit(s))}),MC(1," Edit "),pl();}if(i&2){let t=Xw().$implicit;cg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=qw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(s.id))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,r=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16),Pw(9,H,2,1,"button",17),Pw(10,z,1,3,"agentos-row-delete-action",18),pl()()()),i&2){let t=e.$implicit,r=Xw(2);jE(2),Og(t.name),jE(2),Og(t.apiType),jE(2),Og(t.baseUrl||"\u2014"),jE(3),Lw(r.deletion.confirmingId()!==t.id?9:-1),jE(),Lw(t.id?10:-1);}}function J(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"API type"),pl(),Ds(8,"th",10),MC(9,"Base URL"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,G,11,5,"tr",9,B),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(Ie);aiProviderController=g(k$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();providers=Ui([]);rowFilter=F$1(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New AI provider"),pl()(),Pw(4,M,2,1,"p",3),Pw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O],encapsulation:2})};export{k as PlatformAiProvidersComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-CsPXzWtr.js';import {R}from'./chunk--XNStJOR.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,av as ne$1,a8 as fa,a3 as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-HI6C6EDY.js';import {A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O}from'./chunk-9rt8_xma.js';import'./chunk-DegMF1SI.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function J(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function Q(n,e){n&1&&(Ds(0,"p",5),MC(1,"No auth settings available."),pl());}function W(n,e){n&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function X(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.duplicate(c))}),MC(1," Duplicate "),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw(2).$implicit,d=Xw(2);return ff(d.edit(c))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function ee(n,e){if(n&1){let t=qw();Pw(0,Z,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(c.key))})("deleteConfirmed",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(c))})("deleteCancelled",function(){df(t);let c=Xw(3);return ff(c.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function te(n,e){n&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function ne(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,X,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,1,"button",20),Pw(13,ee,2,4)(14,te,2,0,"button",21),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.authType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(a.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ne,15,7,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var K=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=A();rowFilter=F$1(this.rows,e=>[e.config.name,e.config.authType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,a,c){return e.map((d,H)=>({key:`${t}:${d.id??H}`,config:d,scope:t,scopeLabel:a,canMutate:c}))}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-auth-settings-all-scopes"]],decls:9,vars:3,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return a.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New auth setting"),pl()(),Pw(4,z,2,1,"p",3),Pw(5,J,2,0,"p",4)(6,Q,2,0,"p",5)(7,W,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O],encapsulation:2})};export{K as AuthSettingsAllScopesComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {x as xt,w as wt,u as ut,C as Ct,g as We,j as gt,N as Nn,J as On}from'./chunk-9rt8_xma.js';import {g,W as W$1,F,I as Ie,a9 as $,U as Ui,K as KC,x as U,m as mw,ao as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,S as Sg,v as vl,V as Vw,H as Hw,q as qw,l as lg,ap as $C,aq as GC,k as df,n as ff,ar as ZD}from'./main-HI6C6EDY.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Ds(0,"p",3),MC(1,"Loading\u2026"),pl());}function Q(t,n){t&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load agent definition."),pl());}function W(t,n){if(t&1&&(Ds(0,"dt"),MC(1,"User context"),pl(),Ds(2,"dd",6),MC(3),pl()),t&2){let e=Xw();jE(3),Og(e.userId);}}function X(t,n){if(t&1){let e=qw();Ds(0,"ds-card")(1,"ds-disclosure",12),mg("toggled",function(){df(e);let m=Xw(2);return ff(m.toggleSystemPrompt())}),Ds(2,"pre",13),MC(3),pl()()();}if(t&2){let e=Xw(),r=Xw();jE(),ug("open",!r.systemPromptCollapsed()),jE(2),Og(e.systemPrompt);}}function Y(t,n){if(t&1){let e=qw();Ds(0,"ds-card")(1,"ds-disclosure",14),mg("toggled",function(){df(e);let m=Xw(2);return ff(m.toggleInstructions())}),Ds(2,"pre",13),MC(3),pl()()();}if(t&2){let e=Xw(),r=Xw();jE(),ug("open",!r.instructionsCollapsed()),jE(2),Og(e.instructions);}}function Z(t,n){t&1&&(Ds(0,"p",3),MC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function ee(t,n){t&1&&(Ds(0,"span",17),MC(1,"platform"),pl());}function te(t,n){t&1&&(Ds(0,"span",17),MC(1,"SKILL.md"),pl());}function ne(t,n){if(t&1&&(Ds(0,"li",15)(1,"span")(2,"span",16),MC(3),pl(),Pw(4,ee,2,0,"span",17),Pw(5,te,2,0,"span",17),pl(),Ds(6,"p",3),MC(7),pl()()),t&2){let e=n.$implicit;jE(3),Og(e.name),jE(),Lw(e.namespaceId?-1:4),jE(),Lw(e.readOnly?5:-1),jE(2),Og(e.description);}}function ie(t,n){if(t&1&&(Ds(0,"ul",11),Vw(1,ne,8,4,"li",15,j),pl()),t&2){let e=Xw(2);jE(),Hw(e.resolvedSkills());}}function oe(t,n){t&1&&(Ds(0,"p",3),MC(1,"No tools available for this agent."),pl());}function ae(t,n){if(t&1&&(lg(0,"div",19),$C(1,"agentosMarkdown")),t&2){let e=Xw().$implicit;ug("innerHTML",GC(1,1,e.description),ZD);}}function de(t,n){if(t&1){let e=qw();Ds(0,"li")(1,"ds-disclosure",18),mg("toggled",function(){let m=df(e).$implicit,U=Xw(3);return ff(U.toggleTool(m))}),Pw(2,ae,2,3,"div",19),Ds(3,"pre",20),MC(4),pl()()();}if(t&2){let e=n.$implicit,r=Xw(3);jE(),ug("heading",e.name)("open",r.isToolExpanded(e)),jE(),Lw(e.description?2:-1),jE(2),Og(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Ds(0,"ul",11),Vw(1,de,5,4,"li",null,z),pl()),t&2){let e=Xw();jE(),Hw(e.tools);}}function se(t,n){if(t&1&&(Ds(0,"ds-card",4)(1,"dl",5)(2,"dt"),MC(3,"Name"),pl(),Ds(4,"dd"),MC(5),pl(),Ds(6,"dt"),MC(7,"Resolved model"),pl(),Ds(8,"dd",6),MC(9),pl(),Ds(10,"dt"),MC(11,"Provider"),pl(),Ds(12,"dd"),MC(13),pl(),Ds(14,"dt",7),MC(15,"Execution mode"),pl(),Ds(16,"dd",8)(17,"span",9),MC(18),pl()(),Pw(19,W,4,1),pl()(),Pw(20,X,4,2,"ds-card"),Pw(21,Y,4,2,"ds-card"),Ds(22,"ds-card",10),Pw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),pl(),Ds(25,"ds-card",10),Pw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),pl()),t&2){let e=n,r=Xw();jE(5),Og(e.name),jE(4),Og(e.resolvedModelApiName),jE(4),Og(e.resolvedProviderName),jE(4),Sg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),jE(),vl(" ",e.executionMode," "),jE(),Lw(e.userId?19:-1),jE(),Lw(e.systemPrompt?20:-1),jE(),Lw(e.instructions?21:-1),jE(),ug("heading","Skills ("+r.resolvedSkills().length+")"),jE(),Lw(r.resolvedSkills().length===0?23:24),jE(2),ug("heading","Tools ("+e.tools.length+")"),jE(),Lw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(Ie);agentConfigController=g($);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);definition=Ui(null);expandedTools=Ui(new Set);resolvedSkills=KC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Ui(true);instructionsCollapsed=Ui(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let r=new Set(e);return r.has(n.name)?r.delete(n.name):r.add(n.name),r});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=mw({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,r){if(e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.back()}),MC(3," \u2190 Agent configs "),pl(),Ds(4,"a",2),MC(5,"Edit config \u2192"),pl()(),Pw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),pl()),e&2){let m;jE(4),ug("routerLink",r.editRoute()),jE(2),Lw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,xt,wt,ut,Ct,We,gt,Nn,On],encapsulation:2})};export{K as AgentConfigInspectComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BHQcx05f.js';import {I as s,A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O}from'./chunk-9rt8_xma.js';import {g,W,F,I as Ie,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,av as ne$1,x as U,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,am as kg,q as qw,k as df,n as ff,e as cg}from'./main-HI6C6EDY.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function ee(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading skills\u2026"),pl());}function te(n,e){n&1&&(Ds(0,"p",5),MC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),pl());}function ne(n,e){n&1&&(Ds(0,"p",4),MC(1,"No skills match the current filter."),pl());}function ie(n,e){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let t=Xw().$implicit;jE(),kg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Ds(0,"ds-tag",20),MC(1,"Read-only"),pl());}function oe(n,e){n&1&&(Ds(0,"ds-tag",21),MC(1,"SKILL.md"),pl());}function le(n,e){if(n&1){let t=qw();Ds(0,"button",25),mg("click",function(){df(t);let d=Xw(2).$implicit,c=Xw(2);return ff(c.edit(d))}),MC(1,"Edit"),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=qw();Ds(0,"button",25),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.inspect(d))}),MC(1," View "),pl(),Pw(2,le,2,1,"button",26);}if(n&2){let t=Xw().$implicit,a=Xw(2);cg("aria-label","View "+t.skill.name),jE(2),Lw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",27),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.requestDelete(d))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);ug("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,ie,2,2,"span",14),pl(),Ds(5,"td",15),MC(6),pl(),Ds(7,"td",16),MC(8),pl(),Ds(9,"td",17)(10,"div",18)(11,"ds-tag",19),MC(12),pl(),Pw(13,ae,2,0,"ds-tag",20),Pw(14,oe,2,0,"ds-tag",21),pl()(),Ds(15,"td",22)(16,"div",23),Pw(17,re,3,2),Pw(18,se,1,3,"agentos-row-delete-action",24),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(3),Og(t.skill.name),jE(),Lw(t.namedByAgents>0?4:-1),jE(2),vl(" ",t.skill.description||"\u2014"," "),jE(2),Og(a.resourceCount(t.skill)),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?13:-1),jE(),Lw(t.skill.readOnly?14:-1),jE(3),Lw(a.deletion.confirmingId()!==t.key?17:-1),jE(),Lw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Resources"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ce,19,10,"tr",9,Y),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.skillState.listPlatform().pipe(da(()=>Cr([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Cr([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),da(()=>Cr([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New skill"),pl()(),Pw(4,Z,2,1,"p",3),Pw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O],encapsulation:2})};export{Q as NamespaceSkillsComponent};
|