@whoz-oss/coday-client 0.0.0-workstream-forge.168 → 0.0.0-workstream-forge.169
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-C1sK2c-Q.js → chunk-9BCVk9NQ.js} +1 -1
- package/browser/chunk-9MylQlFX.js +1 -0
- package/browser/{chunk-B9iTyIjx.js → chunk-B6iOc9hF.js} +1 -1
- package/browser/{chunk-CvsXT-vJ.js → chunk-B8I4f-Tr.js} +1 -1
- package/browser/chunk-BAVg53Gi.js +1 -0
- package/browser/{chunk-lSvIXQf2.js → chunk-BB_dA66R.js} +1 -1
- package/browser/{chunk-D2EoaVUV.js → chunk-BDyOxfSx.js} +1 -1
- package/browser/{chunk-_0Pt2eIk.js → chunk-BGhzqfFE.js} +1 -1
- package/browser/{chunk-BPgCdzI3.js → chunk-BMwQO1aF.js} +1 -1
- package/browser/{chunk-BouM_fsr.js → chunk-BSyalGSH.js} +1 -1
- package/browser/{chunk-DHiW57yq.js → chunk-Bfn_agkT.js} +1 -1
- package/browser/{chunk-DF8a0VbT.js → chunk-BksPDz1g.js} +1 -1
- package/browser/{chunk-BiDY3hdR.js → chunk-CCbfhj2G.js} +1 -1
- package/browser/{chunk-Q51xQuHN.js → chunk-CGCJZ64O.js} +1 -1
- package/browser/{chunk-BBo-UAVT.js → chunk-CJHYrcx3.js} +1 -1
- package/browser/{chunk-O3IYxaT5.js → chunk-CXDCRruq.js} +1 -1
- package/browser/{chunk-RK1KcbBd.js → chunk-CgAHFQGb.js} +1 -1
- package/browser/{chunk-CqEBZwT6.js → chunk-CwkXYTZA.js} +1 -1
- package/browser/{chunk-CCxZ6Nxa.js → chunk-CxFvnhVl.js} +1 -1
- package/browser/{chunk-B70nIVb1.js → chunk-D0KyNALN.js} +1 -1
- package/browser/{chunk-Hwtp_Aw7.js → chunk-D1sMiX8H.js} +1 -1
- package/browser/{chunk-DTrqVGw2.js → chunk-D2AQLKBp.js} +1 -1
- package/browser/{chunk-oWHujcVm.js → chunk-D8BdDsLf.js} +1 -1
- package/browser/{chunk-CSZZ0tqo.js → chunk-DB2QUY1u.js} +1 -1
- package/browser/{chunk-DujHz1il.js → chunk-DGErIFJc.js} +3 -3
- package/browser/{chunk-CZr1WGW3.js → chunk-DJo3_Udm.js} +1 -1
- package/browser/{chunk-nvOVuNZe.js → chunk-DJxwfugY.js} +1 -1
- package/browser/{chunk-FFU5aEfv.js → chunk-DOdWgrVq.js} +1 -1
- package/browser/{chunk-CNxoohfy.js → chunk-DT9JiqnH.js} +1 -1
- package/browser/{chunk-DBFd_NaC.js → chunk-DTD__Dn_.js} +1 -1
- package/browser/{chunk-BPpVWGci.js → chunk-DUCp8ptZ.js} +1 -1
- package/browser/{chunk-BPSV4Kat.js → chunk-DglVEB0S.js} +1 -1
- package/browser/{chunk-DUstOozy.js → chunk-DjhKeD1b.js} +1 -1
- package/browser/{chunk-C5Gy8xEx.js → chunk-DpihPg3o.js} +1 -1
- package/browser/{chunk-CkDhB9Hm.js → chunk-DsFj5ou4.js} +1 -1
- package/browser/{chunk-CKYvRgmp.js → chunk-DuNCuAwy.js} +1 -1
- package/browser/{chunk-aP78qE5j.js → chunk-Dvoa2pcH.js} +1 -1
- package/browser/{chunk-Cvo-bXQF.js → chunk-Dz6l4scy.js} +1 -1
- package/browser/{chunk-CeDW92nU.js → chunk-QAL0dGUf.js} +1 -1
- package/browser/{chunk-6XX5oOge.js → chunk-QJCDzExw.js} +1 -1
- package/browser/{chunk-BIbYIDKA.js → chunk-T-MyQ60v.js} +1 -1
- package/browser/{chunk-DjSeJqw5.js → chunk-YAdCsA0W.js} +1 -1
- package/browser/{chunk-BoH6yA2O.js → chunk-iSSo0lPZ.js} +1 -1
- package/browser/{chunk-DLo7hcw9.js → chunk-q29IcxwC.js} +1 -1
- package/browser/{chunk-RUwaaNcd.js → chunk-t7hrk6-r.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-CY35P7WX.js → main-UDKVTVAZ.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-CG_9b-Ij.js +0 -1
- package/browser/chunk-aPozG7uX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {y,$,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,h as bt,L as Ln,W as Wn,V as Vn,i as yn,x as xt,w as wt,c as yt,e as bt$1,u as ut,g as We,_ as _t,j as gt,k as Wn$1}from'./chunk-
|
|
1
|
+
import {y,$,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,h as bt,L as Ln,W as Wn,V as Vn,i as yn,x as xt,w as wt,c as yt,e as bt$1,u as ut,g as We,_ as _t,j as gt,k as Wn$1}from'./chunk-DGErIFJc.js';import {g,I as Ie,W,G,U as Ui,x as U,m as mw,D as Ds,l as lg,N as mg,P as Pw,a as pl,Q as SI,M as MC,j as jE,J as ug,L as Lw,T as MI,v as vl,Z as Ae,_ as yd,$ as x,X as Xw,q as qw,O as Og,a0 as On,k as df,n as ff,V as Vw,H as Hw}from'./main-UDKVTVAZ.js';var I=class e{api=g(Ae);isLoading=Ui(false);result=Ui(null);errorMessage=Ui(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(yd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof On){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Ds(0,"p",14),MC(1,"Loading namespaces\u2026"),pl());}function pe(e,t){if(e&1&&(Ds(0,"option",17),MC(1),pl()),e&2){let n=t.$implicit;ug("value",n.id),jE(),Og(n.name);}}function ce(e,t){if(e&1&&(Ds(0,"select",15)(1,"option",16),MC(2,"Select a namespace"),pl(),Vw(3,pe,2,2,"option",17,de),pl(),SI()),e&2){let n=Xw(2);MI(),jE(3),Hw(n.namespaces());}}function ue(e,t){if(e&1&&Pw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=Xw();Lw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&lg(0,"input",3),e&2){let n=Xw();ug("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let l=Xw();return ff(l.reset())}),MC(1,"Clear result"),pl();}}function ve(e,t){e&1&&(Ds(0,"ds-card",12)(1,"pre",19),MC(2),pl()()),e&2&&(jE(2),Og(t));}function ye(e,t){e&1&&(Ds(0,"span",21),MC(1,"Metadata"),pl(),Ds(2,"pre",19),MC(3),pl()),e&2&&(jE(3),Og(t));}function Ce(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Type"),pl(),Ds(2,"dd",23),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.errorType);}}function _e(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Message"),pl(),Ds(2,"dd"),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.errorMessage);}}function be(e,t){if(e&1&&(Ds(0,"span",21),MC(1,"Tool error details"),pl(),Ds(2,"dl",22),Pw(3,Ce,4,1),Pw(4,_e,4,1),pl()),e&2){let n=Xw();jE(3),Lw(n.errorType?3:-1),jE(),Lw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Ds(0,"ds-card",13)(1,"div")(2,"ds-tag",20),MC(3),pl()(),Ds(4,"span",21),MC(5,"Output"),pl(),Ds(6,"pre",19),MC(7),pl(),Pw(8,ye,4,1),Ds(9,"span",21),MC(10,"Structured output"),pl(),Ds(11,"pre",19),MC(12),pl(),Pw(13,be,5,2),pl()),e&2){let n,o=t,l=Xw();ug("heading","Result \u2014 "+o.toolName),jE(2),ug("variant",o.success?"accent":"outline"),jE(),Og(o.success?"Success":"Tool error"),jE(4),Og(o.output),jE(),Lw((n=l.formatMetadata(o.metadata))?8:-1,n),jE(4),Og(l.formatStructuredOutput(o.structuredOutput)??"null"),jE(),Lw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(Ie);route=g(W);namespaceController=g(G);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Ui([]);namespacesLoading=Ui(true);namespaceName=Ui(null);form=new $({namespaceId:new vt("",{nonNullable:true,validators:[ve$1.required]}),userId:new vt("",{nonNullable:true}),toolName:new vt("",{nonNullable:true,validators:[ve$1.required]}),payload:new vt("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Ds(2,"form",1),mg("ngSubmit",function(){return o.submit()}),Ds(3,"ds-form-field",2),Pw(4,ue,2,1)(5,fe,1,1,"input",3),pl(),Ds(6,"ds-form-field",4),lg(7,"input",5),SI(),pl(),Ds(8,"ds-form-field",6),lg(9,"input",7),SI(),pl(),Ds(10,"ds-form-field",8),lg(11,"textarea",9),SI(),pl(),Ds(12,"ds-form-actions")(13,"button",10),MC(14),pl(),Pw(15,ge,2,0,"button",11),pl()(),Pw(16,ve,3,1,"ds-card",12),Pw(17,he,14,7,"ds-card",13),pl()),n&2){let l,v;jE(),ug("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),jE(),ug("formGroup",o.form),jE(2),Lw(o.isPlatformMode?4:5),jE(3),MI(),jE(2),MI(),jE(2),MI(),jE(2),ug("disabled",o.form.invalid||o.state.isLoading()),jE(),vl(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),jE(),Lw(o.state.result()||o.state.errorMessage()?15:-1),jE(),Lw((l=o.state.errorMessage())?16:-1,l),jE(),Lw((v=o.state.result())?17:-1,v);}},dependencies:[Kn,zn,Zn,Xn,Ye,bt,Ln,Wn,Vn,yn,xt,wt,yt,bt$1,ut,We,_t,gt,Wn$1],encapsulation:2})};export{re as ToolInvokeComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-t7hrk6-r.js';import {v}from'./chunk-BMwQO1aF.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,av as ne,a8 as fa,a3 as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-UDKVTVAZ.js';import {A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O as O$1}from'./chunk-DGErIFJc.js';import'./chunk-BAVg53Gi.js';var H=(i,e)=>e.key;function U(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function z(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI providers\u2026"),pl());}function J(i,e){i&1&&(Ds(0,"p",5),MC(1,"No AI providers available."),pl());}function Q(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI providers match the current filter."),pl());}function W(i,e){i&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function X(i,e){if(i&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.duplicate(d))}),MC(1," Duplicate "),pl();}if(i&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Y(i,e){if(i&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let d=Xw(2).$implicit,c=Xw(2);return ff(c.edit(d))}),MC(1," Edit "),pl();}if(i&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(i,e){if(i&1){let t=qw();Pw(0,Y,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(d.key))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,r=Xw(2);Lw(r.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",r.deletion);}}function ee(i,e){i&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function te(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,W,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,X,2,1,"button",20),Pw(13,Z,2,4)(14,ee,2,0,"button",21),pl()()()),i&2){let t=e.$implicit,r=Xw(2);jE(2),Og(t.config.name),jE(2),Og(t.config.apiType),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(r.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"API type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,te,15,7,"tr",9,H),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var G=class i{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=A();rowFilter=F$1(this.rows,e=>[e.config.name,e.config.apiType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,r,d){return e.map((c,K)=>({key:`${t}:${c.id??K}`,config:c,scope:t,scopeLabel:r,canMutate:d}))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-ai-providers-all-scopes"]],decls:9,vars:3,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return r.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New AI provider"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,z,2,0,"p",4)(6,J,2,0,"p",5)(7,Q,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.rows().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O$1],encapsulation:2})};export{G as AiProvidersAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,y,$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,d as dn,L as Ln,W as Wn,q as qt,b as pn,V as Vn,x as xt,w as wt,c as yt,e as bt,g as We,_ as _t}from'./chunk-
|
|
1
|
+
import {f,y,$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,d as dn,L as Ln,W as Wn,q as qt,b as pn,V as Vn,x as xt,w as wt,c as yt,e as bt,g as We,_ as _t}from'./chunk-DGErIFJc.js';import {g,W,F,G,I as Ie,K as KC,U as Ui,A as Af,x as U,z as w,C as x,m as mw,D as Ds,l as lg,P as Pw,a as pl,J as ug,j as jE,L as Lw,M as MC,q as qw,N as mg,Q as SI,X as Xw,T as MI,e as cg,v as vl,k as df,n as ff}from'./main-UDKVTVAZ.js';var ne=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function re(i){return ne.test(i)}function ee(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||re(e)?null:{absolutePath:true}}}function ae(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ie(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Xw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),SI(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),SI(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),SI(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),SI(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),SI(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),SI(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let oe=Xw();return ff(oe.onMaxToolRoundsInput(p))}),pl(),SI(),pl(),Ds(17,"ds-form-actions")(18,"button",21),MC(19),pl(),Ds(20,"button",22),mg("click",function(){df(e);let p=Xw();return ff(p.cancel())}),MC(21,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(2),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.externalIdControl),MI(),jE(2),ug("formControl",e.defaultAgentNameControl),MI(),jE(2),ug("formControl",e.configPathControl),MI(),jE(),ug("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),jE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),MI(),jE(),ug("hint",e.runCostThresholdHint()),jE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),MI(),jE(),ug("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),jE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var le=1,se=2147483647,te=class i{route=g(W);router=g(F);namespaceController=g(G);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=KC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=KC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=KC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=KC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt("",{nonNullable:true}),configPath:new vt("",{nonNullable:true}),sharedExchangePath:new vt("",{nonNullable:true,validators:[ee(()=>this.canEditSharedExchangePath())]}),externalId:new vt("",{nonNullable:true}),defaultAgentName:new vt("",{nonNullable:true}),runCostThreshold:new vt(null),maxToolRounds:new vt(null,{validators:[ve.min(le),ve.max(se),ve.pattern(/^\d+$/)]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,ae,2,0,"p",2)(3,ie,22,19,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),jE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),jE(),Lw(u.isLoading()?2:3));},dependencies:[Kn,zn,Ye,dn,Ln,Wn,qt,pn,Vn,xt,wt,yt,bt,We,_t],encapsulation:2})};export{te as NamespaceFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DOdWgrVq.js';import {I as s,A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O}from'./chunk-DGErIFJc.js';import {g,W,F,I as Ie,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,av as ne$1,x as U,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,am as kg,q as qw,k as df,n as ff,e as cg}from'./main-UDKVTVAZ.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function ee(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading skills\u2026"),pl());}function te(n,e){n&1&&(Ds(0,"p",5),MC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),pl());}function ne(n,e){n&1&&(Ds(0,"p",4),MC(1,"No skills match the current filter."),pl());}function ie(n,e){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let t=Xw().$implicit;jE(),kg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Ds(0,"ds-tag",20),MC(1,"Read-only"),pl());}function oe(n,e){n&1&&(Ds(0,"ds-tag",21),MC(1,"SKILL.md"),pl());}function le(n,e){if(n&1){let t=qw();Ds(0,"button",25),mg("click",function(){df(t);let d=Xw(2).$implicit,c=Xw(2);return ff(c.edit(d))}),MC(1,"Edit"),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=qw();Ds(0,"button",25),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.inspect(d))}),MC(1," View "),pl(),Pw(2,le,2,1,"button",26);}if(n&2){let t=Xw().$implicit,a=Xw(2);cg("aria-label","View "+t.skill.name),jE(2),Lw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",27),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.requestDelete(d))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);ug("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,ie,2,2,"span",14),pl(),Ds(5,"td",15),MC(6),pl(),Ds(7,"td",16),MC(8),pl(),Ds(9,"td",17)(10,"div",18)(11,"ds-tag",19),MC(12),pl(),Pw(13,ae,2,0,"ds-tag",20),Pw(14,oe,2,0,"ds-tag",21),pl()(),Ds(15,"td",22)(16,"div",23),Pw(17,re,3,2),Pw(18,se,1,3,"agentos-row-delete-action",24),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(3),Og(t.skill.name),jE(),Lw(t.namedByAgents>0?4:-1),jE(2),vl(" ",t.skill.description||"\u2014"," "),jE(2),Og(a.resourceCount(t.skill)),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?13:-1),jE(),Lw(t.skill.readOnly?14:-1),jE(3),Lw(a.deletion.confirmingId()!==t.key?17:-1),jE(),Lw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Resources"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ce,19,10,"tr",9,Y),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.skillState.listPlatform().pipe(da(()=>Cr([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Cr([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),da(()=>Cr([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New skill"),pl()(),Pw(4,Z,2,1,"p",3),Pw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O],encapsulation:2})};export{Q as NamespaceSkillsComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-BPgCdzI3.js';import {R,q,J}from'./chunk-D2EoaVUV.js';import {g,W,F,I as Ie,U as Ui,a2 as F$1,K as KC,A as Af,x as U,C as x,z as w,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,q as qw,V as Vw,a5 as Bw,Q as SI,l as lg,X as Xw,T as MI,H as Hw,v as vl,a4 as kw,O as Og,e as cg,k as df,n as ff}from'./main-CY35P7WX.js';import {v as vt,a as ve$1,$,x as xt,w as wt,c as yt,l as ht,e as bt,g as We,_ as _t,m as ft,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,h as bt$1,n as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-DujHz1il.js';import'./chunk-aPozG7uX.js';function Ce(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ye(i,t){if(i&1&&(Ds(0,"label",16),lg(1,"input",17),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(3);jE(),ug("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Ds(0,"ds-fieldset",5),Vw(1,ye,3,4,"label",16,kw().trackByScope,true),pl()),i&2){let e=Xw(2);ug("disabled",e.isEditMode()),jE(),Hw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Ds(0,"option",8),MC(1),pl()),i&2){let e=t.$implicit,n=Xw(2);ug("value",e),jE(),Og(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Ds(0,"ds-form-field",18),lg(1,"input",19),SI(),pl()),i&2){let e=Xw().$implicit;ug("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),jE(),ug("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),cg("aria-describedby",e.hint?"as-hint-"+e.key:null),MI();}}function Ae(i,t){if(i&1&&Pw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=Xw(3);Lw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Ds(0,"ds-fieldset",13),Vw(1,Ae,1,1,null,null,kw().trackByField,true),pl()),i&2){let e=Xw(2);ug("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),jE(),Hw(e.credentialFields());}}function be(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let o=Xw();return ff(o.submit())}),Pw(1,ge,3,1,"ds-fieldset",5),Ds(2,"ds-form-field",6)(3,"select",7),Vw(4,fe,2,2,"option",8,Bw),pl(),SI(),pl(),Ds(6,"ds-form-field",9),lg(7,"input",10),SI(),pl(),Ds(8,"ds-form-field",11),lg(9,"input",12),SI(),pl(),Pw(10,ve,3,1,"ds-fieldset",13),Ds(11,"ds-form-actions")(12,"button",14),MC(13),pl(),Ds(14,"button",15),mg("click",function(){df(e);let o=Xw();return ff(o.cancel())}),MC(15,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(),Lw(e.isPlatformMode?-1:1),jE(2),ug("formControl",e.authTypeControl),MI(),jE(),Hw(e.authTypeOptions),jE(3),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.credentialFields().length>0?10:-1),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Ui(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve$1.required,ve$1.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve$1.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=KC(()=>_e[this.selectedAuthType()]);isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Af(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Auth settings "),pl()(),Pw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit auth setting":"New auth setting"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[xt,wt,yt,ht,bt,We,_t,ft,Kn,zn,Zn,Xn,Ye,bt$1,fn,Ln,Wn,pn,Vn],encapsulation:2})};
|
|
1
|
+
import {v}from'./chunk-BMwQO1aF.js';import {R,q,J}from'./chunk-BDyOxfSx.js';import {g,W,F,I as Ie,U as Ui,a2 as F$1,K as KC,A as Af,x as U,C as x,z as w,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,q as qw,V as Vw,a5 as Bw,Q as SI,l as lg,X as Xw,T as MI,H as Hw,v as vl,a4 as kw,O as Og,e as cg,k as df,n as ff}from'./main-UDKVTVAZ.js';import {v as vt,a as ve$1,$,x as xt,w as wt,c as yt,l as ht,e as bt,g as We,_ as _t,m as ft,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,h as bt$1,n as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-DGErIFJc.js';import'./chunk-BAVg53Gi.js';function Ce(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ye(i,t){if(i&1&&(Ds(0,"label",16),lg(1,"input",17),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(3);jE(),ug("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Ds(0,"ds-fieldset",5),Vw(1,ye,3,4,"label",16,kw().trackByScope,true),pl()),i&2){let e=Xw(2);ug("disabled",e.isEditMode()),jE(),Hw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Ds(0,"option",8),MC(1),pl()),i&2){let e=t.$implicit,n=Xw(2);ug("value",e),jE(),Og(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Ds(0,"ds-form-field",18),lg(1,"input",19),SI(),pl()),i&2){let e=Xw().$implicit;ug("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),jE(),ug("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),cg("aria-describedby",e.hint?"as-hint-"+e.key:null),MI();}}function Ae(i,t){if(i&1&&Pw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=Xw(3);Lw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Ds(0,"ds-fieldset",13),Vw(1,Ae,1,1,null,null,kw().trackByField,true),pl()),i&2){let e=Xw(2);ug("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),jE(),Hw(e.credentialFields());}}function be(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let o=Xw();return ff(o.submit())}),Pw(1,ge,3,1,"ds-fieldset",5),Ds(2,"ds-form-field",6)(3,"select",7),Vw(4,fe,2,2,"option",8,Bw),pl(),SI(),pl(),Ds(6,"ds-form-field",9),lg(7,"input",10),SI(),pl(),Ds(8,"ds-form-field",11),lg(9,"input",12),SI(),pl(),Pw(10,ve,3,1,"ds-fieldset",13),Ds(11,"ds-form-actions")(12,"button",14),MC(13),pl(),Ds(14,"button",15),mg("click",function(){df(e);let o=Xw();return ff(o.cancel())}),MC(15,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(),Lw(e.isPlatformMode?-1:1),jE(2),ug("formControl",e.authTypeControl),MI(),jE(),Hw(e.authTypeOptions),jE(3),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.credentialFields().length>0?10:-1),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Ui(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve$1.required,ve$1.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve$1.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=KC(()=>_e[this.selectedAuthType()]);isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Af(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Auth settings "),pl()(),Pw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit auth setting":"New auth setting"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[xt,wt,yt,ht,bt,We,_t,ft,Kn,zn,Zn,Xn,Ye,bt$1,fn,Ln,Wn,pn,Vn],encapsulation:2})};
|
|
2
2
|
export{me as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-iSSo0lPZ.js';import {A as A$1,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O as O$1}from'./chunk-DGErIFJc.js';import {g,F,I as Ie,U as Ui,x as U$1,ab as Ee,ag as Se,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,k as df,n as ff,e as cg}from'./main-UDKVTVAZ.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let e=Xw();jE(),Og(e.deletion.error());}}function B(n,t){n&1&&(Ds(0,"p",4),MC(1,"Loading scheduled prompts\u2026"),pl());}function j(n,t){n&1&&(Ds(0,"p",5),MC(1,"No platform scheduled prompts defined yet."),pl());}function W(n,t){n&1&&(Ds(0,"p",4),MC(1,"No scheduled prompts match the current filter."),pl());}function H(n,t){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.description);}}function O(n,t){if(n&1){let e=qw();Ds(0,"button",21),mg("click",function(){df(e);let s=Xw().$implicit,c=Xw(2);return ff(c.toggle(s))}),MC(1),pl(),Ds(2,"button",21),mg("click",function(){df(e);let s=Xw().$implicit,c=Xw(2);return ff(c.edit(s))}),MC(3,"Edit"),pl();}if(n&2){let e=Xw().$implicit;jE(),Og(e.enabled?"Disable":"Enable"),jE(),cg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=qw();Ds(0,"agentos-row-delete-action",22),mg("deleteRequested",function(){df(e);let s=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(s.id))})("deleteConfirmed",function(){df(e);let s=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(s))})("deleteCancelled",function(){df(e);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let e=Xw().$implicit,i=Xw(2);ug("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,H,2,1,"span",14),pl(),Ds(5,"td",15),MC(6),pl(),Ds(7,"td",16)(8,"ds-tag",17),MC(9),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,O,4,2),Pw(13,Y,1,3,"agentos-row-delete-action",20),pl()()()),n&2){let e=t.$implicit,i=Xw(2);jE(3),Og(e.name),jE(),Lw(e.description?4:-1),jE(2),Og(i.scheduleLabel(e)),jE(2),ug("variant",e.enabled?"accent":"outline"),jE(),Og(e.enabled?"Enabled":"Disabled"),jE(3),Lw(i.deletion.confirmingId()!==e.id?12:-1),jE(),Lw(e.id?13:-1);}}function G(n,t){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Schedule"),pl(),Ds(8,"th",10),MC(9,"Status"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,z,14,7,"tr",9,M),pl()()()),n&2){let e=Xw();jE(14),Hw(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(Ie);state=g(c);prompts=Ui([]);isLoading=Ui(true);deletion=A$1();rowFilter=F$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Ee.WEEK?"week":"month",s=e.unit===Ee.WEEK&&e.days?.length?` (${e.days.map(c=>Se[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["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","Platform 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","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return i.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New scheduled prompt"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-BMwQO1aF.js';import {O}from'./chunk-B8I4f-Tr.js';import {g,W as W$1,F,I as Ie,G,U as Ui,x as U$1,av as ne$1,a8 as fa,a3 as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,J as ug,j as jE,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-UDKVTVAZ.js';import {A,r as F$1,g as We,w as wt,s as qn,k as Wn,E,O as O$1}from'./chunk-DGErIFJc.js';import'./chunk-BAVg53Gi.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function X(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function Z(n,e){n&1&&(Ds(0,"p",5),MC(1,"No integrations available."),pl());}function ee(n,e){n&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function te(n,e){n&1&&(Ds(0,"ds-tag",20),MC(1,"YAML"),pl(),Ds(2,"ds-tag",21),MC(3,"Read-only"),pl());}function ne(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw().$implicit,c=Xw(2);return ff(c.view(s))}),MC(1,"View"),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(3).$implicit,c=Xw(2);return ff(c.edit(s))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(3).$implicit;cg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.duplicate(s))}),MC(1," Duplicate "),pl(),Pw(2,ie,2,1,"button",19);}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Duplicate "+t.config.name),jE(2),Lw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",25),mg("deleteRequested",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw(2).$implicit,c=Xw(2);return ff(c.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(4);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Xw(2).$implicit,a=Xw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Ds(0,"button",24),MC(1,"Inherited"),pl());}function le(n,e){if(n&1&&(Pw(0,oe,3,2),Pw(1,ae,1,3,"agentos-row-delete-action",23),Pw(2,re,2,0,"button",24)),n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),Lw(t.canDelete?1:-1),jE(),Lw(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,te,4,0),pl()(),Ds(10,"td",17)(11,"div",18),Pw(12,ne,2,1,"button",19)(13,le,3,3),pl()()()),n&2){let t=e.$implicit;jE(2),Og(t.config.name),jE(2),vl(" ",t.config.integrationType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),vl(" ",t.scopeLabel," "),jE(),Lw(t.source==="FILESYSTEM"?9:-1),jE(3),Lw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,se,14,6,"tr",9,Q),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceApi=g(G);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=Ui("this namespace");isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=A();rowFilter=F$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,W,2,1,"p",3),Pw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(ug("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,Wn,E,O$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {A,r as F$1,g as We,w as wt,s as qn,E,O}from'./chunk-
|
|
1
|
+
import {A,r as F$1,g as We,w as wt,s as qn,E,O}from'./chunk-DGErIFJc.js';import {g,F,I as Ie,aj as k$1,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-UDKVTVAZ.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function U(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI providers\u2026"),pl());}function j(i,e){i&1&&(Ds(0,"p",5),MC(1,"No platform AI providers defined yet."),pl());}function K(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI providers match the current filter."),pl());}function H(i,e){if(i&1){let t=qw();Ds(0,"button",19),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.edit(s))}),MC(1," Edit "),pl();}if(i&2){let t=Xw().$implicit;cg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=qw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(s.id))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,r=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16),Pw(9,H,2,1,"button",17),Pw(10,z,1,3,"agentos-row-delete-action",18),pl()()()),i&2){let t=e.$implicit,r=Xw(2);jE(2),Og(t.name),jE(2),Og(t.apiType),jE(2),Og(t.baseUrl||"\u2014"),jE(3),Lw(r.deletion.confirmingId()!==t.id?9:-1),jE(),Lw(t.id?10:-1);}}function J(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"API type"),pl(),Ds(8,"th",10),MC(9,"Base URL"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,G,11,5,"tr",9,B),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(Ie);aiProviderController=g(k$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();providers=Ui([]);rowFilter=F$1(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New AI provider"),pl()(),Pw(4,M,2,1,"p",3),Pw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O],encapsulation:2})};export{k as PlatformAiProvidersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-
|
|
1
|
+
import {O as O$1}from'./chunk-B8I4f-Tr.js';import {g,F,I as Ie,a6 as D,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-UDKVTVAZ.js';import {A as A$1,r as F$1,g as We,w as wt,s as qn,E,O as O$2}from'./chunk-DGErIFJc.js';import'./chunk-BAVg53Gi.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),MC(1),pl()),t&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform integrations defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function z(t,e){if(t&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.edit(d))}),MC(1,"Edit"),pl();}if(t&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(t&2){let n=Xw().$implicit,r=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Xw(2);jE(2),Og(n.name),jE(2),Og(n.integrationType),jE(3),Lw(r.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);state=g(O$1);integrationConfigController=g(D);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A$1();configs=Ui([]);rowFilter=F$1(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=mw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,A,2,1,"p",3),Pw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O$2],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {aR as A,aS as z$1}from'./main-
|
|
1
|
+
import {aR as A,aS as z$1}from'./main-UDKVTVAZ.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 {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-DGErIFJc.js';import {g,W,t as Xm,u as y,m as mw,h as hl,M as MC,b as gl,j as jE,O as Og}from'./main-UDKVTVAZ.js';var A=class r{route=g(W);http=g(Xm);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=mw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(hl(0,"p",0),MC(1),gl()),t&2&&(jE(),Og(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {A,r as F$1,g as We,w as wt,s as qn,E,O as O$1}from'./chunk-
|
|
1
|
+
import {A,r as F$1,g as We,w as wt,s as qn,E,O as O$1}from'./chunk-DGErIFJc.js';import {g,F,I as Ie,ak as N,aj as k,a7 as wr,U as Ui,a8 as fa,an as wy,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,k as df,n as ff,v as vl,e as cg}from'./main-UDKVTVAZ.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(Ds(0,"p",3),MC(1),pl()),o&2){let e=Xw();jE(),Og(e.deletion.error());}}function U(o,t){o&1&&(Ds(0,"p",4),MC(1,"Loading AI models\u2026"),pl());}function z(o,t){o&1&&(Ds(0,"p",5),MC(1,"No platform AI models defined yet."),pl());}function G(o,t){o&1&&(Ds(0,"p",4),MC(1,"No AI models match the current filter."),pl());}function J(o,t){if(o&1){let e=qw();Ds(0,"button",21),mg("click",function(){df(e);let r=Xw().$implicit,m=Xw(2);return ff(m.edit(r))}),MC(1,"Edit"),pl();}if(o&2){let e=Xw().$implicit;cg("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=qw();Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15),MC(8),pl(),Ds(9,"td",16),MC(10),pl(),Ds(11,"td",17)(12,"div",18),Pw(13,J,2,1,"button",19),Ds(14,"agentos-row-delete-action",20),mg("deleteRequested",function(){let r=df(e).$implicit,m=Xw(2);return ff(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=df(e).$implicit,m=Xw(2);return ff(m.confirmDelete(r))})("deleteCancelled",function(){df(e);let r=Xw(2);return ff(r.deletion.cancel())}),pl()()()();}if(o&2){let e=t.$implicit,a=Xw(2);jE(2),Og(e.title),jE(2),Og(e.providerName),jE(2),vl(" ",e.model.apiModelName," "),jE(2),Og(e.model.priority),jE(2),vl(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),jE(3),Lw(a.deletion.confirmingId()!==e.key?13:-1),jE(),ug("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Provider"),pl(),Ds(8,"th",10),MC(9,"API model name"),pl(),Ds(10,"th",10),MC(11,"Priority"),pl(),Ds(12,"th",10),MC(13,"Reasoning effort"),pl(),Ds(14,"th",10)(15,"span",11),MC(16,"Actions"),pl()()()(),Ds(17,"tbody",8),Vw(18,O,15,9,"tr",9,K),pl()()()),o&2){let e=Xw();jE(18),Hw(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(Ie);aiModelController=g(N);aiProviderController=g(k);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),wy([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let a=new Map(e.map(r=>[r.id??"",r.name]));this.rows.set(t.map((r,m)=>({key:r.id??`model:${m}`,model:r,title:r.alias??r.apiModelName,providerName:a.get(r.aiProviderId)??r.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,a){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New AI model"),pl()(),Pw(4,H,2,1,"p",3),Pw(5,U,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,Q,20,0,"div",6)),e&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O$1],encapsulation:2})};export{j as PlatformAiModelsComponent};
|