@whoz-oss/coday-client 0.0.0-workstream-forge.292 → 0.0.0-workstream-forge.294
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/browser/{chunk-C8dzSVll.js → chunk-8XyNS78o.js} +1 -1
- package/browser/{chunk-D_MSb5U1.js → chunk-9l3CfInB.js} +1 -1
- package/browser/{chunk-BeDMQYUj.js → chunk-9wvyLHuk.js} +1 -1
- package/browser/{chunk-BGfYpG80.js → chunk-B42ywiOW.js} +1 -1
- package/browser/{chunk-Bq2qEzzh.js → chunk-B5JsB4XI.js} +1 -1
- package/browser/{chunk-pIZJ1UXc.js → chunk-BHTuNMop.js} +1 -1
- package/browser/{chunk-JlPUirZe.js → chunk-BIkPktdf.js} +1 -1
- package/browser/{chunk-E4xSMSTK.js → chunk-BJGcsBm7.js} +1 -1
- package/browser/{chunk-BGUWxVzX.js → chunk-BM0VZISu.js} +1 -1
- package/browser/{chunk-B9EAh65r.js → chunk-BMhgEzMc.js} +1 -1
- package/browser/chunk-BNT94xkt.js +1 -0
- package/browser/{chunk-DE5dbQ6O.js → chunk-BP7l1804.js} +1 -1
- package/browser/chunk-BY4pYYCq.js +855 -0
- package/browser/{chunk-Coa8wPTA.js → chunk-BZmi7l-J.js} +1 -1
- package/browser/{chunk-CIyeXOAN.js → chunk-BaXKtzjd.js} +1 -1
- package/browser/{chunk-B_L10LB3.js → chunk-BibOnln8.js} +1 -1
- package/browser/{chunk-BhqTVNWr.js → chunk-BtTk4lBd.js} +1 -1
- package/browser/{chunk-D4mCdiQl.js → chunk-Bu0mFMKp.js} +1 -1
- package/browser/{chunk-BGoe3L9a.js → chunk-Bvdz5sFR.js} +1 -1
- package/browser/{chunk-DLmW-iJx.js → chunk-BweVOo8c.js} +1 -1
- package/browser/{chunk-G3yuV0iA.js → chunk-By5ToOHd.js} +1 -1
- package/browser/{chunk-B9OoRE-e.js → chunk-CBQlusyZ.js} +1 -1
- package/browser/{chunk-BLXGjUSf.js → chunk-CJ4vPhs4.js} +1 -1
- package/browser/{chunk-cMs14lb0.js → chunk-CZLbKUEE.js} +1 -1
- package/browser/{chunk-CLmLRr0q.js → chunk-CdBOn66B.js} +1 -1
- package/browser/{chunk-BiNNsu0D.js → chunk-ClvOUHzO.js} +1 -1
- package/browser/{chunk-DV4g9JR7.js → chunk-Cqm5BJv_.js} +1 -1
- package/browser/{chunk-mmHImWIw.js → chunk-DIe7xrW1.js} +1 -1
- package/browser/{chunk-DeOnEkmJ.js → chunk-DSwZ2lJp.js} +1 -1
- package/browser/{chunk-CGcZ4leA.js → chunk-DUQtHd5Q.js} +1 -1
- package/browser/chunk-DVwHMZjr.js +1 -0
- package/browser/{chunk-CwDR4eyG.js → chunk-DfkhqlKG.js} +1 -1
- package/browser/{chunk-JqPHtq3G.js → chunk-Dh9AMc9f.js} +1 -1
- package/browser/{chunk-DQB2Rcks.js → chunk-DjrS7piD.js} +1 -1
- package/browser/{chunk-CVa8Ojjw.js → chunk-Djrqlsja.js} +1 -1
- package/browser/{chunk-CH9yQi2P.js → chunk-DlUTCVia.js} +1 -1
- package/browser/{chunk-t1c_9t3J.js → chunk-Dp8Qtax9.js} +1 -1
- package/browser/{chunk-DgcyYZa3.js → chunk-DvDLDjpo.js} +1 -1
- package/browser/{chunk-CzjoP1xS.js → chunk-Dwi6o0t0.js} +1 -1
- package/browser/{chunk-DfDXAuak.js → chunk-EV6Gb91d.js} +1 -1
- package/browser/{chunk-C9IYsvTQ.js → chunk-GlRgl5dB.js} +1 -1
- package/browser/{chunk-DPpeVgWK.js → chunk-QA5UvRgp.js} +1 -1
- package/browser/{chunk-Bpbg8KtV.js → chunk-h1DwHzOw.js} +1 -1
- package/browser/{chunk-HQfPhZH_.js → chunk-hSQhyXAK.js} +1 -1
- package/browser/{chunk-EzYfTxcU.js → chunk-nfwj1uBg.js} +1 -1
- package/browser/{chunk-bJVnH8Ji.js → chunk-zOYWk0nL.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-I6AKL2SO.js → main-WIKPRSWZ.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-CQgzuGuE.js +0 -1
- package/browser/chunk-DiMH_tLM.js +0 -855
- package/browser/chunk-DqL0RhqL.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-CJ4vPhs4.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-BY4pYYCq.js';import {g,W,F,H as we,z as zi,ac as Ny,a2 as ga,aa as _r,M as U,P as x,O as w,ai as ke,al as Ge,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-WIKPRSWZ.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function Y(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function z(n,t){n&1&&(Is(0,"p",5),UC(1,"No scheduled prompts available."),ml());}function G(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function Q(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.prompt.description);}}function X(n,t){n&1&&(Is(0,"ds-tag",20),UC(1,"Read-only"),ml());}function Z(n,t){if(n&1){let e=aC();Is(0,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.toggle(l))}),UC(1),ml(),Is(2,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.edit(l))}),UC(3," Edit "),ml();}if(n&2){let e=fC(2).$implicit;KE(),Lg(e.prompt.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=aC();Qw(0,Z,4,2),Is(1,"agentos-row-delete-action",24),Eg("deleteRequested",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.deletion.request(l.key))})("deleteConfirmed",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.confirmDelete(l))})("deleteCancelled",function(){mf(e);let l=fC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);Kw(i.deletion.confirmingId()!==e.key?0:-1),KE(),pg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Is(0,"button",23),UC(1,"Inherited"),ml());}function ne(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,Q,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19)(12,"ds-tag",17),UC(13),ml(),Qw(14,X,2,0,"ds-tag",20),ml()(),Is(15,"td",21)(16,"div",22),Qw(17,ee,2,4)(18,te,2,0,"button",23),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.prompt.name),KE(),Kw(e.prompt.description?4:-1),KE(2),Lg(i.scheduleLabel(e.prompt)),KE(2),pg("variant",e.prompt.enabled?"accent":"outline"),KE(),Lg(e.prompt.enabled?"Enabled":"Disabled"),KE(3),pg("variant",e.scope==="platform"?"neutral":"accent"),KE(),Lg(e.scope==="platform"?"Platform":"Namespace"),KE(),Kw(e.scope==="platform"?14:-1),KE(3),Kw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10),UC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,ne,19,9,"tr",9,J),ml()()()),n&2){let e=fC();KE(16),tC(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ny({platform:this.state.listPlatform().pipe(ga(()=>_r([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===ke.WEEK?"week":"month",l=e.unit===ke.WEEK&&e.days?.length?` (${e.days.map(p=>Ge[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return i.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,O,2,1,"p",3),Qw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {aZ as A,a_ as z$1}from'./main-
|
|
1
|
+
import {aZ as A,a_ as z$1}from'./main-WIKPRSWZ.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==`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-B_L10LB3.js';import {O}from'./chunk-DPpeVgWK.js';import {g,W,F as F$1,H as we,ag as U,ay as N,z as zi,az as Q,a8 as _,k as yT,a9 as F$2,aA as $e$1,M as U$1,a2 as ga,aa as _r,ac as Ny,ad as ne,P as x,O as w,x as xw,au as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,s as aC,a as hg,T as VI,X as UI,j as fg,q as Il,l as eC,t as tC,L as Lg,u as mf,w as yf,as as jg}from'./main-I6AKL2SO.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-DiMH_tLM.js';import'./chunk-DqL0RhqL.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),UC(1,"View resolved definition \u2192"),ml()),n&2){let e=fC();pg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function Qe(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function Ze(n,t){if(n&1&&(hg(0,"input",17),VI()),n&2){let e=fC(2);pg("formControl",e.modelNameControl),UI();}}function et(n,t){if(n&1&&(Is(0,"option",41),UC(1),ml()),n&2){let e=t;pg("ngValue",e.value),KE(),Lg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),UC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),eC(1,tt,2,2,"option",41,je),ml()),n&2){let e=fC(3);KE(),tC(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),UC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),eC(1,it,2,2,"option",41,je),ml()),n&2){let e=fC(3);KE(),tC(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),UC(2,"Select a model"),ml(),Qw(3,et,2,2,"option",41),Qw(4,nt,3,0,"optgroup",42),Qw(5,ot,3,0,"optgroup",43),ml(),VI()),n&2){let e,i=fC(2);pg("formControl",i.modelNameControl),UI(),KE(),pg("ngValue",null),KE(2),Kw((e=i.modelOptions().current)?3:-1,e),KE(),Kw(i.modelOptions().aliases.length>0?4:-1),KE(),Kw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.config.integrationType);}}function rt(n,t){if(n&1&&(hg(0,"input",45),VI()),n&2){let e=fC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),UI();}}function st(n,t){if(n&1){let e=aC();Is(0,"div",10)(1,"label",11)(2,"input",23),Eg("change",function(){let s=mf(e).$implicit,c=fC(3);return yf(c.toggleIntegration(s))}),ml(),Is(3,"span",24),UC(4),ml(),Qw(5,lt,2,1,"span",44),ml(),Qw(6,rt,1,2,"input",45),ml();}if(n&2){let e=t.$implicit;KE(2),pg("checked",e.enabled()),KE(2),Lg(e.config.name),KE(),Kw(e.config.integrationType?5:-1),KE(),Kw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=aC();Is(0,"div",10)(1,"label",24),UC(2),Is(3,"span",44),UC(4,"built-in"),ml()(),Is(5,"select",47),Eg("change",function(s){let c=mf(e).$implicit,C=fC(4);return yf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),UC(7),ml(),Is(8,"option",49),UC(9,"Enabled"),ml(),Is(10,"option",50),UC(11,"Disabled"),ml()(),Qw(12,dt,2,1,"p",13),Is(13,"p",13),UC(14),ml()();}if(n&2){let e=t.$implicit,i=fC(4);KE(),fg("for","built-in-"+e.type),KE(),Il(" ",e.displayName," "),KE(3),pg("id","built-in-"+e.type)("value",e.state()),KE(2),Lg(i.builtInDefaultLabel(e)),KE(5),Kw(e.state()==="on"&&e.restrictedTools?12:-1),KE(2),Lg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),UC(1,"Built-in integrations"),ml(),eC(2,ct,15,7,"div",10,qe)),n&2){let e=fC(3);KE(2),tC(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),UC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),eC(1,st,7,4,"div",10,Ye),Qw(3,mt,4,0),Qw(4,ut,2,0,"ds-notice",26),ml()),n&2){let e=fC(2);KE(),tC(e.integrationRows()),KE(2),Kw(e.builtInRows().length>0?3:-1),KE(),Kw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&UC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),UC(3,"*"),ml(),UC(4,". "),ml());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),UC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function _t(n,t){n&1&&(Is(0,"p",4),UC(1,"No skill available in this scope yet."),ml());}function bt(n,t){n&1&&(Is(0,"span",44),UC(1,"platform"),ml());}function ht(n,t){if(n&1&&(Is(0,"span",44),UC(1),ml()),n&2){let e=fC(4);KE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.description);}}function vt(n,t){if(n&1){let e=aC();Is(0,"div",10)(1,"label",11)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=fC(3);return yf(c.toggleSkill(s))}),ml(),Is(3,"span",24),UC(4),ml(),Qw(5,bt,2,0,"span",44),Qw(6,ht,2,1,"span",44),ml(),Qw(7,yt,2,1,"p",13),ml();}if(n&2){let e=t.$implicit,i=fC(3);KE(2),pg("checked",e.selected())("disabled",i.allSkillsSelected()),KE(2),Lg(e.name),KE(),Kw(e.platform?5:-1),KE(),Kw(e.unresolved?6:-1),KE(),Kw(e.description?7:-1);}}function xt(n,t){if(n&1&&eC(0,vt,8,6,"div",10,We),n&2){let e=fC(2);tC(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),hg(1,"textarea",52),VI(),Is(2,"p",4),UC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),UC(5,"AgentLoopPayload"),ml(),UC(6,". Leave empty if you always provide the payload at launch. "),ml()()),n&2){let e=fC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),KE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI();}}function At(n,t){n&1&&UC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&UC(0),n&2){let e=fC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),UC(3,"*"),ml(),UC(4,". "),Qw(5,wt,1,2),ml()),n&2){let e=fC(2);KE(5),Kw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),UC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function kt(n,t){n&1&&(Is(0,"p",4),UC(1,"No other agent is available in this scope yet."),ml());}function It(n,t){n&1&&(Is(0,"span",44),UC(1,"pattern"),ml());}function Rt(n,t){n&1&&(Is(0,"span",44),UC(1,"via pattern"),ml());}function Mt(n,t){if(n&1&&(Is(0,"span",44),UC(1),ml()),n&2){let e=fC(4);KE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=aC();Is(0,"button",55),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(3);return yf(c.removeSubAgent(s))}),UC(1," \xD7 "),ml();}if(n&2){let e=fC().$implicit;fg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=aC();Is(0,"div",32)(1,"label",53)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=fC(3);return yf(c.toggleSubAgent(s))}),ml(),Is(3,"span",24),UC(4),ml(),Qw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),ml(),Qw(8,Ft,2,1,"button",54),ml();}if(n&2){let e=t.$implicit,i=fC(3);KE(2),pg("checked",e.selected())("disabled",i.allSubAgentsSelected()),KE(2),Lg(e.name),KE(),Kw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),KE(3),Kw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&eC(0,Nt,9,5,"div",32,We),n&2){let e=fC(2);tC(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=aC();Is(0,"div")(1,"button",56),Eg("click",function(){mf(e);let s=fC(2);return yf(s.useDefaultDelegationTimeout())}),UC(2," Use server default "),ml()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2&&(KE(),Lg(t));}function Pt(n,t){if(n&1){let e=aC();Is(0,"button",57),Eg("click",function(){mf(e);let s=fC(2);return yf(s.exportYaml())}),UC(1),ml();}if(n&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=aC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let s=fC();return yf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),hg(3,"input",9),VI(),ml(),Is(4,"div",10)(5,"label",11),hg(6,"input",12),VI(),UC(7," Enabled "),ml(),Is(8,"p",13),UC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"ds-form-field",16),Qw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),ml(),Is(15,"ds-form-field",19),hg(16,"textarea",20),VI(),ml()(),Qw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),UC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),UC(22,"readSkill"),ml(),UC(23," and "),Is(24,"code"),UC(25,"readSkillResource"),ml(),UC(26," tools; selecting none grants neither. "),Qw(27,pt,1,0),ml(),Is(28,"label",11)(29,"input",23),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSkills())}),ml(),Is(30,"span",24),UC(31,"Every skill in the catalogue ("),Is(32,"code",25),UC(33,"*"),ml(),UC(34,")"),ml()(),Is(35,"p",13),UC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Qw(37,ft,5,0,"ds-notice",26),Qw(38,Ct,2,0,"ds-notice"),Qw(39,_t,2,0,"p",4)(40,xt,2,0),ml(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),UC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(45,"option",29),UC(46,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(47,"option",29),UC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),VI(),ml(),Qw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),UC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),UC(54,"DELEGATE__delegate"),ml(),UC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Qw(56,At,1,0),ml(),Is(57,"label",11)(58,"input",23),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSubAgents())}),ml(),Is(59,"span",24),UC(60,"Every agent it can reach ("),Is(61,"code",25),UC(62,"*"),ml(),UC(63,")"),ml()(),Is(64,"p",13),UC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Qw(66,Et,6,1,"ds-notice",26),Qw(67,Tt,2,0,"ds-notice"),Qw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),UC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),UC(73,"*Fixer"),ml(),UC(74," to cover BugFixer and StoryFixer. "),ml(),Is(75,"div",32)(76,"input",33),Eg("keydown.enter",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),ml(),VI(),Is(77,"button",34),Eg("click",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),UC(78," + "),ml()(),Is(79,"ds-form-field",35),hg(80,"input",36),VI(),Qw(81,Lt,3,0,"div"),ml()(),Qw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),UC(85),ml(),Qw(86,Pt,2,2,"button",38),Is(87,"button",39),Eg("click",function(){mf(e);let s=fC();return yf(s.cancel())}),UC(88,"Cancel"),ml()()();}if(n&2){let e,i=fC();pg("formGroup",i.form),KE(3),pg("formControl",i.nameControl),UI(),KE(3),pg("formControl",i.enabledControl),UI(),KE(5),pg("formControl",i.descriptionControl),UI(),KE(2),Kw(i.modelAsFreeText()?13:14),KE(3),pg("formControl",i.instructionsControl),UI(),KE(),Kw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),KE(10),Kw(i.isPlatformMode?27:-1),KE(2),pg("checked",i.allSkillsSelected()),KE(8),Kw(i.namedSkillSelectionDropped()?37:-1),KE(),Kw(i.skillCatalogueUnavailable()?38:-1),KE(),Kw(i.skillRows().length===0?39:40),KE(3),pg("formControl",i.executionModeControl),UI(),KE(),pg("value",i.ExecutionMode.SIMPLE),KE(2),pg("value",i.ExecutionMode.ADVANCED),KE(2),pg("value",i.ExecutionMode.LOOP),KE(2),Kw(i.isLoopMode()?49:-1),KE(7),Kw(i.isPlatformMode?56:-1),KE(2),pg("checked",i.allSubAgentsSelected()),KE(8),Kw(i.namedSubAgentSelectionDropped()?66:-1),KE(),Kw(i.subAgentCandidatesUnavailable()?67:-1),KE(),Kw(i.subAgentRows().length===0?68:69),KE(8),pg("formControl",i.newSubAgentControl),UI(),KE(),pg("disabled",!i.newSubAgentControl.value.trim()),KE(2),pg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),KE(),pg("formControl",i.delegationTimeoutControl),fg("aria-invalid",i.delegationTimeoutControl.invalid),UI(),KE(),Kw(i.delegationTimeoutControl.value!==null?81:-1),KE(),Kw((e=i.submitError())?82:-1,e),KE(2),pg("disabled",i.form.invalid||i.isSubmitting()),KE(),Il(" ",i.isEditMode()?"Save changes":"Create"," "),KE(),Kw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=yT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=yT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=yT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=yT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=yT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=$e$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=yT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=yT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=yT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return i.cancel()}),UC(3," \u2190 Agent configs "),ml(),Qw(4,ze,2,1,"a",2),Qw(5,Xe,2,0,"ds-tag",3),ml(),Qw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),ml()),e&2&&(KE(),pg("title",i.isEditMode()?"Edit agent config":"New agent config"),KE(3),Kw(i.isEditMode()?4:-1),KE(),Kw(i.isPlatformMode?5:-1),KE(),Kw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
|
|
1
|
+
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BibOnln8.js';import {O}from'./chunk-QA5UvRgp.js';import {g,W,F as F$1,H as we,ag as U,ay as N,z as zi,az as Q,a8 as _,k as yT,a9 as F$2,aA as $e$1,M as U$1,a2 as ga,aa as _r,ac as Ny,ad as ne,P as x,O as w,x as xw,au as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,s as aC,a as hg,T as VI,X as UI,j as fg,q as Il,l as eC,t as tC,L as Lg,u as mf,w as yf,as as jg}from'./main-WIKPRSWZ.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-BY4pYYCq.js';import'./chunk-BNT94xkt.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),UC(1,"View resolved definition \u2192"),ml()),n&2){let e=fC();pg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function Qe(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function Ze(n,t){if(n&1&&(hg(0,"input",17),VI()),n&2){let e=fC(2);pg("formControl",e.modelNameControl),UI();}}function et(n,t){if(n&1&&(Is(0,"option",41),UC(1),ml()),n&2){let e=t;pg("ngValue",e.value),KE(),Lg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),UC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),eC(1,tt,2,2,"option",41,je),ml()),n&2){let e=fC(3);KE(),tC(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),UC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),eC(1,it,2,2,"option",41,je),ml()),n&2){let e=fC(3);KE(),tC(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),UC(2,"Select a model"),ml(),Qw(3,et,2,2,"option",41),Qw(4,nt,3,0,"optgroup",42),Qw(5,ot,3,0,"optgroup",43),ml(),VI()),n&2){let e,i=fC(2);pg("formControl",i.modelNameControl),UI(),KE(),pg("ngValue",null),KE(2),Kw((e=i.modelOptions().current)?3:-1,e),KE(),Kw(i.modelOptions().aliases.length>0?4:-1),KE(),Kw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.config.integrationType);}}function rt(n,t){if(n&1&&(hg(0,"input",45),VI()),n&2){let e=fC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),UI();}}function st(n,t){if(n&1){let e=aC();Is(0,"div",10)(1,"label",11)(2,"input",23),Eg("change",function(){let s=mf(e).$implicit,c=fC(3);return yf(c.toggleIntegration(s))}),ml(),Is(3,"span",24),UC(4),ml(),Qw(5,lt,2,1,"span",44),ml(),Qw(6,rt,1,2,"input",45),ml();}if(n&2){let e=t.$implicit;KE(2),pg("checked",e.enabled()),KE(2),Lg(e.config.name),KE(),Kw(e.config.integrationType?5:-1),KE(),Kw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=aC();Is(0,"div",10)(1,"label",24),UC(2),Is(3,"span",44),UC(4,"built-in"),ml()(),Is(5,"select",47),Eg("change",function(s){let c=mf(e).$implicit,C=fC(4);return yf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),UC(7),ml(),Is(8,"option",49),UC(9,"Enabled"),ml(),Is(10,"option",50),UC(11,"Disabled"),ml()(),Qw(12,dt,2,1,"p",13),Is(13,"p",13),UC(14),ml()();}if(n&2){let e=t.$implicit,i=fC(4);KE(),fg("for","built-in-"+e.type),KE(),Il(" ",e.displayName," "),KE(3),pg("id","built-in-"+e.type)("value",e.state()),KE(2),Lg(i.builtInDefaultLabel(e)),KE(5),Kw(e.state()==="on"&&e.restrictedTools?12:-1),KE(2),Lg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),UC(1,"Built-in integrations"),ml(),eC(2,ct,15,7,"div",10,qe)),n&2){let e=fC(3);KE(2),tC(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),UC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),eC(1,st,7,4,"div",10,Ye),Qw(3,mt,4,0),Qw(4,ut,2,0,"ds-notice",26),ml()),n&2){let e=fC(2);KE(),tC(e.integrationRows()),KE(2),Kw(e.builtInRows().length>0?3:-1),KE(),Kw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&UC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),UC(3,"*"),ml(),UC(4,". "),ml());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),UC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function _t(n,t){n&1&&(Is(0,"p",4),UC(1,"No skill available in this scope yet."),ml());}function bt(n,t){n&1&&(Is(0,"span",44),UC(1,"platform"),ml());}function ht(n,t){if(n&1&&(Is(0,"span",44),UC(1),ml()),n&2){let e=fC(4);KE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.description);}}function vt(n,t){if(n&1){let e=aC();Is(0,"div",10)(1,"label",11)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=fC(3);return yf(c.toggleSkill(s))}),ml(),Is(3,"span",24),UC(4),ml(),Qw(5,bt,2,0,"span",44),Qw(6,ht,2,1,"span",44),ml(),Qw(7,yt,2,1,"p",13),ml();}if(n&2){let e=t.$implicit,i=fC(3);KE(2),pg("checked",e.selected())("disabled",i.allSkillsSelected()),KE(2),Lg(e.name),KE(),Kw(e.platform?5:-1),KE(),Kw(e.unresolved?6:-1),KE(),Kw(e.description?7:-1);}}function xt(n,t){if(n&1&&eC(0,vt,8,6,"div",10,We),n&2){let e=fC(2);tC(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),hg(1,"textarea",52),VI(),Is(2,"p",4),UC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),UC(5,"AgentLoopPayload"),ml(),UC(6,". Leave empty if you always provide the payload at launch. "),ml()()),n&2){let e=fC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),KE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI();}}function At(n,t){n&1&&UC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&UC(0),n&2){let e=fC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),UC(3,"*"),ml(),UC(4,". "),Qw(5,wt,1,2),ml()),n&2){let e=fC(2);KE(5),Kw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),UC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function kt(n,t){n&1&&(Is(0,"p",4),UC(1,"No other agent is available in this scope yet."),ml());}function It(n,t){n&1&&(Is(0,"span",44),UC(1,"pattern"),ml());}function Rt(n,t){n&1&&(Is(0,"span",44),UC(1,"via pattern"),ml());}function Mt(n,t){if(n&1&&(Is(0,"span",44),UC(1),ml()),n&2){let e=fC(4);KE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=aC();Is(0,"button",55),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(3);return yf(c.removeSubAgent(s))}),UC(1," \xD7 "),ml();}if(n&2){let e=fC().$implicit;fg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=aC();Is(0,"div",32)(1,"label",53)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=fC(3);return yf(c.toggleSubAgent(s))}),ml(),Is(3,"span",24),UC(4),ml(),Qw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),ml(),Qw(8,Ft,2,1,"button",54),ml();}if(n&2){let e=t.$implicit,i=fC(3);KE(2),pg("checked",e.selected())("disabled",i.allSubAgentsSelected()),KE(2),Lg(e.name),KE(),Kw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),KE(3),Kw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&eC(0,Nt,9,5,"div",32,We),n&2){let e=fC(2);tC(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=aC();Is(0,"div")(1,"button",56),Eg("click",function(){mf(e);let s=fC(2);return yf(s.useDefaultDelegationTimeout())}),UC(2," Use server default "),ml()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2&&(KE(),Lg(t));}function Pt(n,t){if(n&1){let e=aC();Is(0,"button",57),Eg("click",function(){mf(e);let s=fC(2);return yf(s.exportYaml())}),UC(1),ml();}if(n&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=aC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let s=fC();return yf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),hg(3,"input",9),VI(),ml(),Is(4,"div",10)(5,"label",11),hg(6,"input",12),VI(),UC(7," Enabled "),ml(),Is(8,"p",13),UC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"ds-form-field",16),Qw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),ml(),Is(15,"ds-form-field",19),hg(16,"textarea",20),VI(),ml()(),Qw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),UC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),UC(22,"readSkill"),ml(),UC(23," and "),Is(24,"code"),UC(25,"readSkillResource"),ml(),UC(26," tools; selecting none grants neither. "),Qw(27,pt,1,0),ml(),Is(28,"label",11)(29,"input",23),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSkills())}),ml(),Is(30,"span",24),UC(31,"Every skill in the catalogue ("),Is(32,"code",25),UC(33,"*"),ml(),UC(34,")"),ml()(),Is(35,"p",13),UC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Qw(37,ft,5,0,"ds-notice",26),Qw(38,Ct,2,0,"ds-notice"),Qw(39,_t,2,0,"p",4)(40,xt,2,0),ml(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),UC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(45,"option",29),UC(46,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(47,"option",29),UC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),VI(),ml(),Qw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),UC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),UC(54,"DELEGATE__delegate"),ml(),UC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Qw(56,At,1,0),ml(),Is(57,"label",11)(58,"input",23),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSubAgents())}),ml(),Is(59,"span",24),UC(60,"Every agent it can reach ("),Is(61,"code",25),UC(62,"*"),ml(),UC(63,")"),ml()(),Is(64,"p",13),UC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Qw(66,Et,6,1,"ds-notice",26),Qw(67,Tt,2,0,"ds-notice"),Qw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),UC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),UC(73,"*Fixer"),ml(),UC(74," to cover BugFixer and StoryFixer. "),ml(),Is(75,"div",32)(76,"input",33),Eg("keydown.enter",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),ml(),VI(),Is(77,"button",34),Eg("click",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),UC(78," + "),ml()(),Is(79,"ds-form-field",35),hg(80,"input",36),VI(),Qw(81,Lt,3,0,"div"),ml()(),Qw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),UC(85),ml(),Qw(86,Pt,2,2,"button",38),Is(87,"button",39),Eg("click",function(){mf(e);let s=fC();return yf(s.cancel())}),UC(88,"Cancel"),ml()()();}if(n&2){let e,i=fC();pg("formGroup",i.form),KE(3),pg("formControl",i.nameControl),UI(),KE(3),pg("formControl",i.enabledControl),UI(),KE(5),pg("formControl",i.descriptionControl),UI(),KE(2),Kw(i.modelAsFreeText()?13:14),KE(3),pg("formControl",i.instructionsControl),UI(),KE(),Kw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),KE(10),Kw(i.isPlatformMode?27:-1),KE(2),pg("checked",i.allSkillsSelected()),KE(8),Kw(i.namedSkillSelectionDropped()?37:-1),KE(),Kw(i.skillCatalogueUnavailable()?38:-1),KE(),Kw(i.skillRows().length===0?39:40),KE(3),pg("formControl",i.executionModeControl),UI(),KE(),pg("value",i.ExecutionMode.SIMPLE),KE(2),pg("value",i.ExecutionMode.ADVANCED),KE(2),pg("value",i.ExecutionMode.LOOP),KE(2),Kw(i.isLoopMode()?49:-1),KE(7),Kw(i.isPlatformMode?56:-1),KE(2),pg("checked",i.allSubAgentsSelected()),KE(8),Kw(i.namedSubAgentSelectionDropped()?66:-1),KE(),Kw(i.subAgentCandidatesUnavailable()?67:-1),KE(),Kw(i.subAgentRows().length===0?68:69),KE(8),pg("formControl",i.newSubAgentControl),UI(),KE(),pg("disabled",!i.newSubAgentControl.value.trim()),KE(2),pg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),KE(),pg("formControl",i.delegationTimeoutControl),fg("aria-invalid",i.delegationTimeoutControl.invalid),UI(),KE(),Kw(i.delegationTimeoutControl.value!==null?81:-1),KE(),Kw((e=i.submitError())?82:-1,e),KE(2),pg("disabled",i.form.invalid||i.isSubmitting()),KE(),Il(" ",i.isEditMode()?"Save changes":"Create"," "),KE(),Kw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=yT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=yT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=yT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=yT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=yT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=$e$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=yT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=yT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=yT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return i.cancel()}),UC(3," \u2190 Agent configs "),ml(),Qw(4,ze,2,1,"a",2),Qw(5,Xe,2,0,"ds-tag",3),ml(),Qw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),ml()),e&2&&(KE(),pg("title",i.isEditMode()?"Edit agent config":"New agent config"),KE(3),Kw(i.isEditMode()?4:-1),KE(),Kw(i.isPlatformMode?5:-1),KE(),Kw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-QA5UvRgp.js';import {g,W,H as we,z as zi,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,r as fC,L as Lg}from'./main-WIKPRSWZ.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-BY4pYYCq.js';import'./chunk-BNT94xkt.js';function O(r,e){r&1&&(Is(0,"p",1),UC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),UC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),UC(2,"YAML"),ml(),Is(3,"ds-tag",10),UC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Qw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),UC(4,"Name"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"Type"),ml(),Is(9,"dd",5),UC(10),ml(),Is(11,"dt"),UC(12,"Description"),ml(),Is(13,"dd"),UC(14),ml(),Is(15,"dt"),UC(16,"Scope"),ml(),Is(17,"dd"),UC(18),ml(),Is(19,"dt"),UC(20,"Source"),ml(),Is(21,"dd"),UC(22),ml(),Is(23,"dt"),UC(24,"Auto grant"),ml(),Is(25,"dd"),UC(26),ml(),Is(27,"dt"),UC(28,"Auth setting"),ml(),Is(29,"dd"),UC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),UC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),UC(35),ml()()),r&2){let o=e,a=fC();KE(),Kw(a.source()==="FILESYSTEM"?1:-1),KE(5),Lg(o.name),KE(4),Lg(o.integrationType),KE(4),Lg(o.description||"\u2014"),KE(4),Lg(a.scopeOf(o)),KE(4),Lg(a.source()),KE(4),Lg(o.autoGrant?"Enabled":"Disabled"),KE(4),Lg(o.authSettingName||"None"),KE(5),Lg(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(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");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=xw({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&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Qw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;KE(2),Kw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BibOnln8.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as c}from'./chunk-BY4pYYCq.js';import {g,W,F,H as we,z as zi,k as yT,M as U,ac as Ny,a2 as ga,aa as _r,x as xw,au as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,b as Kw,r as fC,R as pg,s as aC,a as hg,av as uT,L as Lg,q as Il,aw as dT,l as eC,t as tC,ao as Jw,u as mf,w as yf,ax as iE}from'./main-WIKPRSWZ.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Is(0,"a",2),UC(1,"Edit skill \u2192"),ml()),e&2){let n=fC();pg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function te(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function ne(e,t){e&1&&(Is(0,"ds-notice"),UC(1,"Failed to load skill."),ml());}function ie(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Created by"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.createdBy);}}function oe(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Last updated"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Qw(0,ie,4,1),Qw(1,oe,4,1)),e&2){let n=fC();Kw(n.createdBy?0:-1),KE(),Kw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Is(0,"p",4),UC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),ml());}function se(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(e,t){e&1&&(Is(0,"ds-notice"),UC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),ml());}function de(e,t){e&1&&(Is(0,"p",4),UC(1,"No agent references this skill."),ml());}function ce(e,t){e&1&&(Is(0,"ds-tag",15),UC(1,"platform agent"),ml());}function me(e,t){e&1&&(Is(0,"ds-tag",15),UC(1,"via *"),ml());}function pe(e,t){if(e&1&&(Is(0,"li",13)(1,"span",14),UC(2),ml(),Qw(3,ce,2,0,"ds-tag",15),Qw(4,me,2,0,"ds-tag",15),ml()),e&2){let n=t.$implicit;KE(2),Lg(n.name),KE(),Kw(n.platform?3:-1),KE(),Kw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Is(0,"ul",12),eC(1,pe,5,3,"li",13,Y),ml(),Is(3,"p",4),UC(4," An agent listed "),Is(5,"code"),UC(6,"via *"),ml(),UC(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. "),ml()),e&2){let n=fC(2);KE(),tC(n.consumers());}}function _e(e,t){e&1&&(Is(0,"p",4),UC(1,"No resources bundled with this skill."),ml());}function ge(e,t){if(e&1){let n=aC();Is(0,"li")(1,"ds-disclosure",16),Eg("toggled",function(){let r=mf(n).$implicit,g=fC(3);return yf(g.toggleResource(r))}),Is(2,"pre",17),UC(3),ml()()();}if(e&2){let n=t.$implicit,o=fC(3);KE(),pg("heading",n)("open",o.isResourceExpanded(n)),KE(2),Lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Is(0,"ul",12),eC(1,ge,4,3,"li",null,Jw),ml()),e&2){let n=fC(2);KE(),tC(n.resourcePaths());}}function fe(e,t){if(e&1){let n=aC();Is(0,"ds-card",5)(1,"dl",6)(2,"dt"),UC(3,"Name"),ml(),Is(4,"dd",7),UC(5),ml(),Is(6,"dt"),UC(7,"Description"),ml(),Is(8,"dd"),UC(9),ml(),Is(10,"dt"),UC(11,"Scope"),ml(),Is(12,"dd"),UC(13),ml(),Is(14,"dt"),UC(15,"Storage"),ml(),Is(16,"dd")(17,"ds-tag",8),UC(18),ml()(),Qw(19,ae,2,2),ml()(),Is(20,"ds-card",9),Qw(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),ml(),Is(26,"ds-card")(27,"ds-disclosure",10),Eg("toggled",function(){mf(n);let r=fC();return yf(r.toggleBody())}),hg(28,"div",11),uT(29,"agentosMarkdown"),ml()(),Is(30,"ds-card",9),Qw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),ml();}if(e&2){let n=t,o=fC();KE(5),Lg(n.name),KE(4),Lg(n.description),KE(4),Lg(n.namespaceId?"Namespace":"Platform"),KE(4),pg("variant",o.isFilesystemBacked()?"outline":"neutral"),KE(),Il(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),KE(),Kw(o.isFilesystemBacked()?-1:19),KE(),pg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),KE(),Kw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),KE(6),pg("open",!o.bodyCollapsed()),KE(),pg("innerHTML",dT(29,12,n.body),iE),KE(2),pg("heading","Resources ("+o.resourcePaths().length+")"),KE(),Kw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);skill=zi(null);bodyCollapsed=zi(false);expandedResources=zi(new Set);resourcePaths=yT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=yT(()=>this.skill()?.readOnly===true);consumers=zi([]);consumersUnavailable=zi(false);consumersLoading=zi(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),Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.back()}),UC(3,"\u2190 Skills"),ml(),Qw(4,Z,2,1,"a",2),Qw(5,ee,2,0,"ds-tag",3),ml(),Qw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),ml()),n&2){let r;KE(4),Kw(o.skill()&&!o.isFilesystemBacked()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,c],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {O as O$1}from'./chunk-BweVOo8c.js';import {O}from'./chunk-QA5UvRgp.js';import {I}from'./chunk-9l3CfInB.js';import {g,H as we$1,z as zi,k as yT,a9 as F,at as _y,ad as ne,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,s as aC,S as Eg,r as fC,R as pg,T as VI,l as eC,L as Lg,X as UI,t as tC,q as Il,ae as Zw,u as mf,w as yf,aL as EC,P as x,O as w}from'./main-WIKPRSWZ.js';import {y,J as k,L as K,X as a,p as pt,T as Te$1,$ as v,a0 as V,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,a1 as gn,h as hn,i as at,u as un,m as mn,a2 as ji,F as Ni,a3 as m,a4 as S}from'./chunk-BY4pYYCq.js';import'./chunk-BNT94xkt.js';var Ce=(o,e)=>e.value,be=(o,e)=>e.title;function xe(o,e){o&1&&(Is(0,"p",3),UC(1,"Loading\u2026"),ml());}function Se(o,e){if(o&1&&(Is(0,"option",31),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Ee(o,e){if(o&1&&(Is(0,"option",31),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Te(o,e){if(o&1){let t=aC();Is(0,"form",19),Eg("ngSubmit",function(){mf(t);let s=fC(2);return yf(s.save())}),Is(1,"ds-group",20)(2,"dl",21)(3,"dt"),UC(4,"Email"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"External ID"),ml(),Is(9,"dd"),UC(10),ml()()(),Is(11,"ds-group",22)(12,"ds-form-field",23),hg(13,"input",24),VI(),ml(),Is(14,"ds-form-field",25),hg(15,"input",26),VI(),ml(),Is(16,"ds-form-field",27),hg(17,"textarea",28),VI(),ml(),Is(18,"ds-form-field",29)(19,"select",30),eC(20,Se,2,2,"option",31,Ce),ml(),VI(),ml(),Is(22,"ds-form-field",32)(23,"select",33),eC(24,Ee,2,2,"option",31,Ce),ml(),VI(),ml()(),Is(26,"ds-form-actions")(27,"button",34),UC(28),ml(),Is(29,"button",35),Eg("click",function(){mf(t);let s=fC(2);return yf(s.cancelEditing())}),UC(30,"Cancel"),ml()()();}if(o&2){let t=fC(),l=fC();pg("formGroup",l.form),KE(6),Lg(t.email),KE(4),Lg(t.externalId),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),UI(),KE(),tC(l.languageOptions),KE(3),UI(),KE(),tC(l.promptCacheTtlOptions),KE(3),pg("disabled",l.isSaving()),KE(),Il(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function De(o,e){o&1&&(Is(0,"p",3),UC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),ml());}function Pe(o,e){if(o&1){let t=aC();Is(0,"span",44),UC(1,"Delete?"),ml(),Is(2,"button",45),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(5);return yf(m.confirmDelete(s))}),UC(3,"Confirm"),ml(),Is(4,"button",46),Eg("click",function(){mf(t);let s=fC(6);return yf(s.cancelDelete())}),UC(5,"Cancel"),ml();}}function Ue(o,e){if(o&1){let t=aC();Is(0,"button",46),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(5);return yf(m.armDelete(s))}),UC(1,"Delete"),ml();}}function we(o,e){if(o&1&&(Is(0,"li",40)(1,"span",41),UC(2),ml(),Is(3,"span",42),UC(4),ml(),Qw(5,Pe,6,0)(6,Ue,2,0,"button",43),ml()),o&2){let t=e.$implicit,l=fC(5);KE(2),Lg(t.name),KE(2),Lg(t.subtitle),KE(),Kw(l.isPendingDelete(t)?5:6);}}function Ve(o,e){if(o&1&&(Is(0,"span",38),UC(1),ml(),Is(2,"ul",39),eC(3,we,7,3,"li",40,Zw().trackEntry,true),ml()),o&2){let t=e.$implicit;KE(),Lg(t.title),KE(2),tC(t.entries);}}function Ie(o,e){if(o&1&&eC(0,Ve,5,1,null,null,be),o&2){let t=fC(3);tC(t.recapSections());}}function Ne(o,e){if(o&1){let t=aC();Is(0,"ds-group",20)(1,"dl",21)(2,"dt"),UC(3,"Email"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"External ID"),ml(),Is(8,"dd"),UC(9),ml()()(),Is(10,"ds-group",22)(11,"dl",21)(12,"dt"),UC(13,"First name"),ml(),Is(14,"dd"),UC(15),ml(),Is(16,"dt"),UC(17,"Last name"),ml(),Is(18,"dd"),UC(19),ml(),Is(20,"dt"),UC(21,"Bio"),ml(),Is(22,"dd"),UC(23),ml(),Is(24,"dt"),UC(25,"Language"),ml(),Is(26,"dd"),UC(27),ml(),Is(28,"dt"),UC(29,"Prompt cache"),ml(),Is(30,"dd"),UC(31),ml()()(),Is(32,"ds-form-actions")(33,"button",36),Eg("click",function(){mf(t);let s=fC(2);return yf(s.startEditing())}),UC(34,"Edit profile"),ml()(),Is(35,"ds-disclosure",37),Eg("toggled",function(){mf(t);let s=fC(2);return yf(s.toggleOverrides())}),Qw(36,De,2,0,"p",3)(37,Ie,2,0),ml();}if(o&2){let t=fC(),l=fC();KE(5),Lg(t.email),KE(4),Lg(t.externalId),KE(6),Lg(t.firstname||"\u2014"),KE(4),Lg(t.lastname||"\u2014"),KE(4),Lg(t.bio||"\u2014"),KE(4),Lg(t.preferredLanguage||"\u2014"),KE(4),Lg(l.promptCacheTtlLabel()),KE(4),pg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),KE(),Kw(l.recap().total===0?36:37);}}function Me(o,e){if(o&1){let t=aC();Is(0,"ds-group",4)(1,"ds-form-field",5)(2,"ds-segmented",6),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setThemeVariant(s))}),ml()(),Is(3,"ds-form-field",7)(4,"ds-segmented",8),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setTheme(s))}),ml()()(),Is(5,"ds-group",9)(6,"ds-form-field",10)(7,"ds-segmented",11),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setEnterKeyBehavior(s))}),ml()()(),Is(8,"ds-group",12)(9,"ds-form-field",13)(10,"ds-segmented",14),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setShowTechnical(s))}),ml()()(),Is(11,"ds-group",15)(12,"ds-form-field",16)(13,"input",17,0),Eg("change",function(){mf(t);let s=EC(14),m=fC();return yf(m.setIdeUrlTemplate(s.value))}),ml()()(),Qw(15,Te,31,5,"form",18)(16,Ne,38,10);}if(o&2){let t=fC();KE(),pg("hint",t.activeVariantDescription()),KE(),pg("options",t.themeVariantOptions)("value",t.themeVariant()),KE(),pg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),KE(),pg("options",t.modeOptions())("value",t.shownMode()),KE(3),pg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),KE(3),pg("options",t.showTechnicalOptions)("value",t.showTechnical()),KE(3),pg("value",t.ideUrlTemplate()),KE(2),Kw(t.isEditing()?15:16);}}function Fe(o,e){o&1&&(Is(0,"p",3),UC(1,"Unable to load profile."),ml());}var ye=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(K);isEditing=zi(false);isLoading=zi(false);isSaving=zi(false);isOverridesExpanded=zi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=yT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=yT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=yT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=yT(()=>m(this.themeVariant()).label);activeVariantDescription=yT(()=>m(this.themeVariant()).description);modeOptions=yT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=yT(()=>this.modeOverridden()?S(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];ideUrlTemplate=this.preferencesPort.ideUrlTemplate;languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];promptCacheTtlOptions=[{value:"STANDARD",label:"Standard"},{value:"EXTENDED",label:"Extended"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true}),promptCacheTtl:new Te$1("STANDARD",{nonNullable:true})});promptCacheTtlLabel=yT(()=>{let e=this.currentUser()?.promptCacheTtl??"STANDARD";return this.promptCacheTtlOptions.find(t=>t.value===e)?.label??e});recap=F(_y([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),N=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:N,total:s.length+m.length+N.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=yT(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){v(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !V(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}setIdeUrlTemplate(e){this.preferencesPort.setIdeUrlTemplate(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0,promptCacheTtl:this.form.controls.promptCacheTtl.value}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=zi(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??"",promptCacheTtl:e.promptCacheTtl??"STANDARD"});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["urlTemplateInput",""],["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],["heading","IDE links"],["label","IDE URL template","controlId","ide-url-template","hint","Opens a file in IntelliJ IDEA. {file} is the URL-encoded absolute path, {line} and {column} the position."],["dsControl","","id","ide-url-template","type","text",3,"change","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["label","Prompt cache","controlId","up-promptCacheTtl","hintId","up-promptCacheTtl-hint","hint","Extended keeps the conversation cached through longer pauses (Claude models via Requesty: 1 hour instead of 5 minutes; each cache write costs more). Other models keep their provider's default."],["dsControl","","id","up-promptCacheTtl","aria-describedby","up-promptCacheTtl-hint","formControlName","promptCacheTtl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Is(0,"ds-page",1),hg(1,"ds-section-header",2),Qw(2,xe,2,0,"p",3)(3,Me,17,12)(4,Fe,2,0,"p",3),ml()),t&2){let s;KE(2),Kw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,gn,hn,at,un,mn,ji,Ni],encapsulation:2})};export{ye as UserProfileComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-DiMH_tLM.js';import {g,W,F,H as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Fe,k as yT,z as zi,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,a as hg,T as VI,l as eC,ao as Jw,r as fC,X as UI,t as tC,q as Il,ae as Zw,L as Lg,as as jg,u as mf,w as yf}from'./main-I6AKL2SO.js';function he(r,t){r&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=fC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),UC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),KE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),UC(2,"Select provider"),ml(),eC(3,ye,2,3,"option",44,Zw().trackByProvider,true),ml(),VI()),r&2){let e=fC(2);pg("formControl",e.aiProviderIdControl),UI(),KE(3),tC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),UC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),KE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),UC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),UC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),UC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=fC();return yf(u.submit())}),Is(1,"ds-form-field",5),Qw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),VI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),VI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),VI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),VI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),VI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),VI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),UC(22,"Provider default"),ml(),eC(23,xe,2,2,"option",25,Jw),ml(),VI(),Qw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Qw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),VI(),Is(31,"span",30),UC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),UC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),VI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),VI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),VI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),VI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),UC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=fC();return yf(u.cancel())}),UC(50,"Cancel"),ml()()();}if(r&2){let e=fC();pg("formGroup",e.form),KE(2),Kw(e.isEditMode()?2:3),KE(3),pg("formControl",e.apiModelNameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.aliasControl),UI(),KE(2),pg("formControl",e.priorityControl),UI(),KE(3),pg("formControl",e.temperatureControl),UI(),KE(2),pg("formControl",e.contextWindowControl),UI(),KE(2),pg("formControl",e.maxCompletionTokensControl),UI(),KE(2),pg("formControl",e.reasoningEffortControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.reasoningEffortOptions),KE(2),Kw(e.reasoningEffortUnsupported()?25:26),KE(2),Kw(e.temperatureMayConflictWithEffort()?27:-1),KE(3),pg("formControl",e.supportsAdvancedExecutionControl),UI(),KE(5),pg("formGroup",e.pricingGroup),KE(3),UI(),KE(2),UI(),KE(3),UI(),KE(2),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Fe);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=yT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=yT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=yT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),UC(3," \u2190 AI models "),ml()(),Qw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(KE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),KE(3),Kw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
1
|
+
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-BY4pYYCq.js';import {g,W,F,H as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Fe,k as yT,z as zi,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,a as hg,T as VI,l as eC,ao as Jw,r as fC,X as UI,t as tC,q as Il,ae as Zw,L as Lg,as as jg,u as mf,w as yf}from'./main-WIKPRSWZ.js';function he(r,t){r&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=fC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),UC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),KE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),UC(2,"Select provider"),ml(),eC(3,ye,2,3,"option",44,Zw().trackByProvider,true),ml(),VI()),r&2){let e=fC(2);pg("formControl",e.aiProviderIdControl),UI(),KE(3),tC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),UC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),KE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),UC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),UC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),UC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=fC();return yf(u.submit())}),Is(1,"ds-form-field",5),Qw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),VI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),VI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),VI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),VI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),VI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),VI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),UC(22,"Provider default"),ml(),eC(23,xe,2,2,"option",25,Jw),ml(),VI(),Qw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Qw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),VI(),Is(31,"span",30),UC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),UC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),VI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),VI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),VI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),VI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),UC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=fC();return yf(u.cancel())}),UC(50,"Cancel"),ml()()();}if(r&2){let e=fC();pg("formGroup",e.form),KE(2),Kw(e.isEditMode()?2:3),KE(3),pg("formControl",e.apiModelNameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.aliasControl),UI(),KE(2),pg("formControl",e.priorityControl),UI(),KE(3),pg("formControl",e.temperatureControl),UI(),KE(2),pg("formControl",e.contextWindowControl),UI(),KE(2),pg("formControl",e.maxCompletionTokensControl),UI(),KE(2),pg("formControl",e.reasoningEffortControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.reasoningEffortOptions),KE(2),Kw(e.reasoningEffortUnsupported()?25:26),KE(2),Kw(e.temperatureMayConflictWithEffort()?27:-1),KE(3),pg("formControl",e.supportsAdvancedExecutionControl),UI(),KE(5),pg("formGroup",e.pricingGroup),KE(3),UI(),KE(2),UI(),KE(3),UI(),KE(2),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Fe);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=yT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=yT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=yT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),UC(3," \u2190 AI models "),ml()(),Qw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(KE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),KE(3),Kw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-BY4pYYCq.js';import {g,W as W$1,F,H as we,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-WIKPRSWZ.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let t=fC();KE(),Lg(t.deletion.error());}}function G(n,e){n&1&&(Is(0,"p",4),UC(1,"Loading prompts\u2026"),ml());}function O(n,e){n&1&&(Is(0,"p",5),UC(1,"No prompts available."),ml());}function Q(n,e){n&1&&(Is(0,"p",4),UC(1,"No prompts match the current filter."),ml());}function W(n,e){n&1&&(Is(0,"ds-tag",17),UC(1,"Read-only"),ml());}function X(n,e){if(n&1){let t=aC();Is(0,"button",23),Eg("click",function(){mf(t);let l=fC(2).$implicit,m=fC(2);return yf(m.edit(l))}),UC(1," Edit "),ml();}if(n&2){let t=fC(2).$implicit;fg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=aC();Qw(0,X,2,1,"button",21),Is(1,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(t);let l=fC().$implicit,m=fC(2);return yf(m.deletion.request(l.key))})("deleteConfirmed",function(){mf(t);let l=fC().$implicit,m=fC(2);return yf(m.confirmDelete(l))})("deleteCancelled",function(){mf(t);let l=fC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let t=fC().$implicit,i=fC(2);Kw(i.deletion.confirmingId()!==t.key?0:-1),KE(),pg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Is(0,"button",20),UC(1,"Inherited"),ml());}function ee(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15)(7,"ds-tag",16),UC(8),ml(),Qw(9,W,2,0,"ds-tag",17),ml()(),Is(10,"td",18)(11,"div",19),Qw(12,Y,2,4)(13,Z,2,0,"button",20),ml()()()),n&2){let t=e.$implicit;KE(2),Lg(t.prompt.name),KE(2),Il(" ",t.prompt.description||"\u2014"," "),KE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),KE(),Lg(t.scope==="platform"?"Platform":"Namespace"),KE(),Kw(t.scope==="platform"?9:-1),KE(3),Kw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Scope"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,ee,14,6,"tr",9,U),ml()()()),n&2){let t=fC();KE(14),tC(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({platform:this.promptState.listPlatform().pipe(ga(()=>_r([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return i.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New prompt"),ml()(),Qw(4,z,2,1,"p",3),Qw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BibOnln8.js';import {B as s,q as k,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-BY4pYYCq.js';import {g,W,F,H as we,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,ad as ne$1,M as U,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,as as jg,s as aC,u as mf,w as yf,j as fg}from'./main-WIKPRSWZ.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let t=fC();KE(),Lg(t.deletion.error());}}function ee(n,e){n&1&&(Is(0,"p",4),UC(1,"Loading skills\u2026"),ml());}function te(n,e){n&1&&(Is(0,"p",5),UC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),ml());}function ne(n,e){n&1&&(Is(0,"p",4),UC(1,"No skills match the current filter."),ml());}function ie(n,e){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let t=fC().$implicit;KE(),jg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Is(0,"ds-tag",20),UC(1,"Read-only"),ml());}function oe(n,e){n&1&&(Is(0,"ds-tag",21),UC(1,"SKILL.md"),ml());}function le(n,e){if(n&1){let t=aC();Is(0,"button",25),Eg("click",function(){mf(t);let d=fC(2).$implicit,c=fC(2);return yf(c.edit(d))}),UC(1,"Edit"),ml();}if(n&2){let t=fC(2).$implicit;fg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=aC();Is(0,"button",25),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.inspect(d))}),UC(1," View "),ml(),Qw(2,le,2,1,"button",26);}if(n&2){let t=fC().$implicit,a=fC(2);fg("aria-label","View "+t.skill.name),KE(2),Kw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=aC();Is(0,"agentos-row-delete-action",27),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.requestDelete(d))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=fC().$implicit,a=fC(2);pg("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,ie,2,2,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16),UC(8),ml(),Is(9,"td",17)(10,"div",18)(11,"ds-tag",19),UC(12),ml(),Qw(13,ae,2,0,"ds-tag",20),Qw(14,oe,2,0,"ds-tag",21),ml()(),Is(15,"td",22)(16,"div",23),Qw(17,re,3,2),Qw(18,se,1,3,"agentos-row-delete-action",24),ml()()()),n&2){let t=e.$implicit,a=fC(2);KE(3),Lg(t.skill.name),KE(),Kw(t.namedByAgents>0?4:-1),KE(2),Il(" ",t.skill.description||"\u2014"," "),KE(2),Lg(a.resourceCount(t.skill)),KE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),KE(),Lg(t.scope==="platform"?"Platform":"Namespace"),KE(),Kw(t.scope==="platform"?13:-1),KE(),Kw(t.skill.readOnly?14:-1),KE(3),Kw(a.deletion.confirmingId()!==t.key?17:-1),KE(),Kw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Resources"),ml(),Is(10,"th",10),UC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,ce,19,10,"tr",9,Y),ml()()()),n&2){let t=fC();KE(16),tC(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({platform:this.skillState.listPlatform().pipe(ga(()=>_r([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),ga(()=>_r([])))}))),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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New skill"),ml()(),Qw(4,Z,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
|