@whoz-oss/coday-client 0.0.0-workstream-forge.201 → 0.0.0-workstream-forge.204
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-_FIOLiYh.js → chunk-06r80pO9.js} +1 -1
- package/browser/{chunk-oj4c6uAi.js → chunk-4j3XQws2.js} +1 -1
- package/browser/{chunk-D8dC5epc.js → chunk-BJDs9gyo.js} +1 -1
- package/browser/{chunk-Cn4W5so0.js → chunk-BLAi8-AH.js} +1 -1
- package/browser/{chunk-Dw8GzIql.js → chunk-BULaSedZ.js} +1 -1
- package/browser/{chunk-C3MZTR8U.js → chunk-BbxJcgkD.js} +1 -1
- package/browser/{chunk-Cj3b_Qix.js → chunk-BjWRad4i.js} +1 -1
- package/browser/{chunk-BkWwMt8v.js → chunk-BlT9aAnX.js} +1 -1
- package/browser/{chunk-Df3qhzjA.js → chunk-Bo2DjBi6.js} +1 -1
- package/browser/{chunk-BSDUgftL.js → chunk-BrPnYn04.js} +1 -1
- package/browser/{chunk-CaxaxhOa.js → chunk-BspzeE1k.js} +1 -1
- package/browser/{chunk-CQi9YhmS.js → chunk-Bxu7LsYO.js} +1 -1
- package/browser/{chunk-DnZCKmfw.js → chunk-C2gby904.js} +1 -1
- package/browser/{chunk-BpiMHsf1.js → chunk-C90canit.js} +1 -1
- package/browser/{chunk-BfU222B7.js → chunk-CA-gmqLK.js} +1 -1
- package/browser/{chunk-xIogN9Vx.js → chunk-CDvD6jGh.js} +1 -1
- package/browser/{chunk-BvVO_93V.js → chunk-CHX9K5YU.js} +1 -1
- package/browser/{chunk-BHWtc4IC.js → chunk-CLsQ-Qj2.js} +1 -1
- package/browser/chunk-CQZDxK4J.js +1 -0
- package/browser/{chunk-Bjt2f04h.js → chunk-CQkK3pZv.js} +1 -1
- package/browser/{chunk-DanxWOkc.js → chunk-CS1D6IqE.js} +1 -1
- package/browser/{chunk-CvaAqsbw.js → chunk-CU5VTmsN.js} +1 -1
- package/browser/{chunk-WhkS8yjl.js → chunk-CXONvlNS.js} +1 -1
- package/browser/{chunk-B4p-fNyR.js → chunk-C_jGLVKk.js} +1 -1
- package/browser/chunk-Cq4k0Mf8.js +670 -0
- package/browser/{chunk-D5xSgJnG.js → chunk-Cx8YHfi-.js} +1 -1
- package/browser/{chunk-Do6N4aSH.js → chunk-D4LNa82l.js} +1 -1
- package/browser/{chunk-DMR_R6mw.js → chunk-D5NB1BF_.js} +1 -1
- package/browser/{chunk-C-Dz3TPb.js → chunk-D5XtMXVy.js} +1 -1
- package/browser/{chunk-SVJT5q4W.js → chunk-DBmtA_en.js} +1 -1
- package/browser/{chunk-BiEA3aQE.js → chunk-DDmCHZzr.js} +1 -1
- package/browser/{chunk-XzG0IFaC.js → chunk-DKSd6hBk.js} +1 -1
- package/browser/{chunk-CHupz_GU.js → chunk-DNED6AOD.js} +1 -1
- package/browser/{chunk-C6jJRCiO.js → chunk-DV-Eelxi.js} +1 -1
- package/browser/{chunk-_6yCeVu7.js → chunk-DjYnv-0F.js} +1 -1
- package/browser/{chunk-D2nQYaQh.js → chunk-DlluG4SU.js} +1 -1
- package/browser/{chunk-CYLw2oN0.js → chunk-DvxsvoBS.js} +1 -1
- package/browser/{chunk-BIYmUvfG.js → chunk-Oq3ZvW7J.js} +1 -1
- package/browser/{chunk-Cv_vef3m.js → chunk-UIQNJ87R.js} +1 -1
- package/browser/{chunk-D9sUF55R.js → chunk-bqhgjnlz.js} +1 -1
- package/browser/{chunk-D-yDhjOP.js → chunk-g7uSi0Xp.js} +1 -1
- package/browser/{chunk-zJXn33wx.js → chunk-hWg7zi7S.js} +1 -1
- package/browser/{chunk-TgdOFY-g.js → chunk-k_VZl2u9.js} +1 -1
- package/browser/{chunk-Y_xtT3ze.js → chunk-lFcHhl6c.js} +1 -1
- package/browser/{chunk-D-Jx5Mdg.js → chunk-s_xyr0FP.js} +1 -1
- package/browser/{chunk-B9q-_3rm.js → chunk-wtijUwLT.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-2IBYD645.js → main-CEEMKDJT.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-DxKo0dCS.js +0 -670
- package/browser/chunk-gjFAR1Z5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k$1,O,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k$1,O,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import {g,F,I as Ie,ap as F$1,$ as wr,U as Ui,a1 as fa,E as U$1,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,q as qw,f as cg,r as df,s as ff}from'./main-CEEMKDJT.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(F$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k$1();providers=Ui([]);rowFilter=O(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:[at,hn,Io,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {aY as A,aZ as z$1}from'./main-
|
|
1
|
+
import {aY as A,aZ as z$1}from'./main-CEEMKDJT.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
|
|
2
2
|
`});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
|
|
3
3
|
`?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
|
|
4
4
|
`&&(E.last=l.length==0||l[0].tag==`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-Oq3ZvW7J.js';import {z as k,O as O$1,g as at,h as hn,I as Io,j as ko,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import {g,F,I as Ie,$ as wr,U as Ui,a1 as fa,E as U$1,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,v as vl,q as qw,r as df,s as ff,f as cg}from'./main-CEEMKDJT.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function A(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading skills\u2026"),pl());}function H(i,e){i&1&&(Ds(0,"p",5),MC(1,"No platform skills defined yet."),pl());}function U(i,e){i&1&&(Ds(0,"p",4),MC(1,"No skills match the current filter."),pl());}function z(i,e){i&1&&(Ds(0,"ds-tag",15),MC(1,"SKILL.md"),pl());}function G(i,e){if(i&1){let t=qw();Ds(0,"button",21),mg("click",function(){df(t);let d=Xw(2).$implicit,m=Xw(2);return ff(m.edit(d))}),MC(1,"Edit"),pl();}if(i&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=qw();Ds(0,"button",21),mg("click",function(){df(t);let d=Xw().$implicit,m=Xw(2);return ff(m.inspect(d))}),MC(1,"View"),pl(),Pw(2,G,2,1,"button",22);}if(i&2){let t=Xw().$implicit;cg("aria-label","View "+t.name),jE(2),Lw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=qw();Ds(0,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,l=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),MC(4),pl(),Pw(5,z,2,0,"ds-tag",15),pl()(),Ds(6,"td",16),MC(7),pl(),Ds(8,"td",17),MC(9),pl(),Ds(10,"td",18)(11,"div",19),Pw(12,J,3,2),Pw(13,Q,1,3,"agentos-row-delete-action",20),pl()()()),i&2){let t=e.$implicit,l=Xw(2);jE(4),Og(t.name),jE(),Lw(t.readOnly?5:-1),jE(2),vl(" ",t.description||"\u2014"," "),jE(2),Og(l.resourceCount(t)),jE(3),Lw(l.deletion.confirmingId()!==t.id?12:-1),jE(),Lw(!t.readOnly&&t.id?13:-1);}}function X(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,"Description"),pl(),Ds(8,"th",10),MC(9,"Resources"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,W,14,6,"tr",9,K),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(Ie);skillState=g(o);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();skills=Ui([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return l.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return l.openCreateForm()}),MC(3,"New skill"),pl()(),Pw(4,O,2,1,"p",3),Pw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(jE(),ug("query",l.rowFilter.query()),jE(3),Lw(l.deletion.error()?4:-1),jE(),Lw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-
|
|
1
|
+
import {O as O$1}from'./chunk-bqhgjnlz.js';import {g,F,I as Ie,af as G$1,$ as wr,U as Ui,a1 as fa,E as U$1,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,q as qw,f as cg,r as df,s as ff}from'./main-CEEMKDJT.js';import {z as k,O as O$2,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import'./chunk-CQZDxK4J.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(G$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();configs=Ui([]);rowFilter=O$2(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:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-Oq3ZvW7J.js';import {J as s,z as k,O,g as at,h as hn,I as Io,j as ko,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import {g,W,F,I as Ie,$ as wr,U as Ui,a1 as fa,ac as Ty,a2 as da,aa as Cr,ad as ne$1,E as U,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,v as vl,as as kg,q as qw,r as df,s as ff,f as cg}from'./main-CEEMKDJT.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=k();rows=Ui([]);rowFilter=O(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:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-CvaAqsbw.js';import {I,n as nt,i as it}from'./chunk-C6jJRCiO.js';import {g,W,F,I as Ie,U as Ui,a9 as F$1,K as KC,o as Af,E as U,N as x,G as w,m as mw,D as Ds,R as mg,M as MC,a as pl,P as Pw,j as jE,Q as ug,L as Lw,q as qw,i as Vw,ao as Bw,T as SI,l as lg,X as Xw,Y as MI,H as Hw,v as vl,ae as kw,O as Og,f as cg,r as df,s as ff}from'./main-2IBYD645.js';import {T as Te,a as fn,p as pt,c as pn,h as hn,d as cn,r as ln,e as dn,g as at,i as an,t as rn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,w as pa,m as mo,b as po,V as Vn,A as An}from'./chunk-DxKo0dCS.js';import'./chunk-gjFAR1Z5.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(I);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=nt;authTypeLabel=it;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[fn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=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:[pn,hn,cn,ln,dn,at,an,rn,Ut,nd,bo,xo,Lt,Gt,pa,mo,po,Vn,An],encapsulation:2})};
|
|
1
|
+
import {v}from'./chunk-CU5VTmsN.js';import {I,n as nt,i as it}from'./chunk-DV-Eelxi.js';import {g,W,F,I as Ie,U as Ui,a9 as F$1,K as KC,o as Af,E as U,N as x,G as w,m as mw,D as Ds,R as mg,M as MC,a as pl,P as Pw,j as jE,Q as ug,L as Lw,q as qw,i as Vw,ao as Bw,T as SI,l as lg,X as Xw,Y as MI,H as Hw,v as vl,ae as kw,O as Og,f as cg,r as df,s as ff}from'./main-CEEMKDJT.js';import {T as Te,a as fn,p as pt,c as pn,h as hn,d as cn,r as ln,e as dn,g as at,i as an,t as rn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,w as pa,m as mo,b as po,V as Vn,A as An}from'./chunk-Cq4k0Mf8.js';import'./chunk-CQZDxK4J.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(I);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=nt;authTypeLabel=it;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[fn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=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:[pn,hn,cn,ln,dn,at,an,rn,Ut,nd,bo,xo,Lt,Gt,pa,mo,po,Vn,An],encapsulation:2})};
|
|
2
2
|
export{me as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {D as m,p as pt,E as Bt,T as Te,a as fn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,b as po,V as Vn,A as An,v as va,F as go,_ as _o,c as pn,h as hn,d as cn,r as ln,e as dn,C as mn,g as at,i as an}from'./chunk-DxKo0dCS.js';import {g,W,F,I as Ie,ag as U,U as Ui,E as U$1,a2 as da,aa as Cr,N as x,G as w,m as mw,D as Ds,R as mg,M as MC,a as pl,P as Pw,j as jE,Q as ug,v as vl,L as Lw,q as qw,l as lg,T as SI,i as Vw,am as jw,X as Xw,Y as MI,O as Og,H as Hw,f as cg,r as df,s as ff}from'./main-2IBYD645.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function fe(o,t){if(o&1&&(Ds(0,"ds-form-field",20),lg(1,"input",22),pl()),o&2){let e=Xw(3);jE(),ug("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Ds(0,"option",24),MC(1),pl()),o&2){let e=t.$implicit;ug("ngValue",e.id),jE(),Og(e.name);}}function Ce(o,t){if(o&1&&(Ds(0,"ds-form-field",21)(1,"select",23)(2,"option",24),MC(3,"\u2014 None \u2014"),pl(),Vw(4,ge,2,2,"option",24,ce),pl(),SI(),pl()),o&2){let e=Xw(3);jE(),ug("formControl",e.agentConfigIdControl),MI(),jE(),ug("ngValue",null),jE(2),Hw(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Pw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=Xw(2);Lw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Ds(0,"p",2),MC(1,"No parameters defined."),pl());}function he(o,t){if(o&1){let e=qw();Ds(0,"div",11)(1,"div",25)(2,"ds-form-field",26),lg(3,"input",27),SI(),pl(),Ds(4,"ds-form-field",28),lg(5,"input",29),SI(),pl(),Ds(6,"ds-form-field",30),lg(7,"input",31),SI(),pl()(),Ds(8,"button",32),mg("click",function(){let d=df(e).$index,m=Xw(2);return ff(m.removeParameter(d))}),MC(9," \xD7 "),pl()();}if(o&2){let e=t.$implicit,r=t.$index;ug("formGroupName",r),jE(2),ug("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),jE(),ug("id","param-name-"+r),MI(),jE(),ug("controlId","param-desc-"+r),jE(),ug("id","param-desc-"+r),MI(),jE(),ug("controlId","param-default-"+r),jE(),ug("id","param-default-"+r),MI();}}function _e(o,t){if(o&1){let e=qw();Ds(0,"div",14)(1,"span",33),MC(2),pl(),Ds(3,"ds-form-field",34),lg(4,"textarea",35),SI(),pl(),Ds(5,"button",36),mg("click",function(){let d=df(e).$index,m=Xw(2);return ff(m.removeContentEntry(d))}),MC(6," \xD7 "),pl()();}if(o&2){let e=t.$implicit,r=t.$index,d=Xw(2);jE(2),Og(r+1),jE(),ug("error",e.invalid&&e.touched?"Content entry must not be blank.":null),jE(),ug("formControlName",r),cg("aria-label","Content entry "+(r+1)),MI(),jE(),ug("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Ds(0,"ds-notice"),MC(1),pl()),o&2){let e=Xw(2);jE(),Og(e.errorMessage());}}function be(o,t){if(o&1){let e=qw();Ds(0,"button",37),mg("click",function(){df(e);let d=Xw(2);return ff(d.exportYaml())}),MC(1),pl();}if(o&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let d=Xw();return ff(d.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"input",8),SI(),pl(),Pw(5,ye,2,1),Ds(6,"ds-fieldset",9)(7,"p",2),MC(8," Each parameter must have a name and a default value. Use "),Ds(9,"code"),MC(10),pl(),MC(11," in content entries to reference them. "),pl(),Ds(12,"div",10),Pw(13,ve,2,0,"p",2),Vw(14,he,10,8,"div",11,jw),Ds(16,"div")(17,"button",12),mg("click",function(){df(e);let d=Xw();return ff(d.addParameter())}),MC(18,"+ Add parameter"),pl()()()(),Ds(19,"ds-fieldset",13)(20,"p",2),MC(21," Each content entry is a command. Use "),Ds(22,"code"),MC(23,"@AgentName"),pl(),MC(24," to target an agent, "),Ds(25,"code"),MC(26,"/promptName param1 param2"),pl(),MC(27," to call another prompt, and "),Ds(28,"code"),MC(29),pl(),MC(30," for parameter placeholders. "),pl(),Ds(31,"div",10),Vw(32,_e,7,5,"div",14,jw),Ds(34,"div")(35,"button",12),mg("click",function(){df(e);let d=Xw();return ff(d.addContentEntry())}),MC(36,"+ Add content entry"),pl()()()(),Pw(37,xe,2,1,"ds-notice"),Ds(38,"ds-form-field",15),lg(39,"textarea",16),SI(),pl(),Ds(40,"ds-form-actions")(41,"button",17),MC(42),pl(),Pw(43,be,2,2,"button",18),Ds(44,"button",19),mg("click",function(){df(e);let d=Xw();return ff(d.cancel())}),MC(45,"Cancel"),pl()()();}if(o&2){let e=Xw();ug("formGroup",e.form),jE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),jE(),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.availableAgentConfigs().length>0?5:-1),jE(5),Og(e.paramPlaceholderSyntax),jE(2),ug("formArrayName","parameters"),jE(),Lw(e.parametersArray.length===0?13:-1),jE(),Hw(e.parametersArray.controls),jE(15),Og(e.paramPlaceholderSyntax),jE(2),ug("formArrayName","content"),jE(),Hw(e.contentArray.controls),jE(5),Lw(e.errorMessage()?37:-1),jE(),ug("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),jE(),ug("formControl",e.externalMetadataJsonControl),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),jE(),Lw(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(Ie);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Bt([this.createContentControl()],{validators:[fn.required]}),parameters:new Bt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);errorMessage=Ui(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Ui([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),da(()=>Cr([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),da(()=>Cr([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[fn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value",3,"controlId"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.cancel()}),MC(3),pl()(),Pw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),pl()),e&2&&(jE(),ug("title",r.isEditMode()?"Edit prompt":"New prompt"),jE(2),vl(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),jE(),Lw(r.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,Vn,An,va,go,_o,pn,hn,cn,ln,dn,mn,at,an],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
|
|
1
|
+
import {D as m,p as pt,E as Bt,T as Te,a as fn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,b as po,V as Vn,A as An,v as va,F as go,_ as _o,c as pn,h as hn,d as cn,r as ln,e as dn,C as mn,g as at,i as an}from'./chunk-Cq4k0Mf8.js';import {g,W,F,I as Ie,ag as U,U as Ui,E as U$1,a2 as da,aa as Cr,N as x,G as w,m as mw,D as Ds,R as mg,M as MC,a as pl,P as Pw,j as jE,Q as ug,v as vl,L as Lw,q as qw,l as lg,T as SI,i as Vw,am as jw,X as Xw,Y as MI,O as Og,H as Hw,f as cg,r as df,s as ff}from'./main-CEEMKDJT.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function fe(o,t){if(o&1&&(Ds(0,"ds-form-field",20),lg(1,"input",22),pl()),o&2){let e=Xw(3);jE(),ug("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Ds(0,"option",24),MC(1),pl()),o&2){let e=t.$implicit;ug("ngValue",e.id),jE(),Og(e.name);}}function Ce(o,t){if(o&1&&(Ds(0,"ds-form-field",21)(1,"select",23)(2,"option",24),MC(3,"\u2014 None \u2014"),pl(),Vw(4,ge,2,2,"option",24,ce),pl(),SI(),pl()),o&2){let e=Xw(3);jE(),ug("formControl",e.agentConfigIdControl),MI(),jE(),ug("ngValue",null),jE(2),Hw(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Pw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=Xw(2);Lw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Ds(0,"p",2),MC(1,"No parameters defined."),pl());}function he(o,t){if(o&1){let e=qw();Ds(0,"div",11)(1,"div",25)(2,"ds-form-field",26),lg(3,"input",27),SI(),pl(),Ds(4,"ds-form-field",28),lg(5,"input",29),SI(),pl(),Ds(6,"ds-form-field",30),lg(7,"input",31),SI(),pl()(),Ds(8,"button",32),mg("click",function(){let d=df(e).$index,m=Xw(2);return ff(m.removeParameter(d))}),MC(9," \xD7 "),pl()();}if(o&2){let e=t.$implicit,r=t.$index;ug("formGroupName",r),jE(2),ug("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),jE(),ug("id","param-name-"+r),MI(),jE(),ug("controlId","param-desc-"+r),jE(),ug("id","param-desc-"+r),MI(),jE(),ug("controlId","param-default-"+r),jE(),ug("id","param-default-"+r),MI();}}function _e(o,t){if(o&1){let e=qw();Ds(0,"div",14)(1,"span",33),MC(2),pl(),Ds(3,"ds-form-field",34),lg(4,"textarea",35),SI(),pl(),Ds(5,"button",36),mg("click",function(){let d=df(e).$index,m=Xw(2);return ff(m.removeContentEntry(d))}),MC(6," \xD7 "),pl()();}if(o&2){let e=t.$implicit,r=t.$index,d=Xw(2);jE(2),Og(r+1),jE(),ug("error",e.invalid&&e.touched?"Content entry must not be blank.":null),jE(),ug("formControlName",r),cg("aria-label","Content entry "+(r+1)),MI(),jE(),ug("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Ds(0,"ds-notice"),MC(1),pl()),o&2){let e=Xw(2);jE(),Og(e.errorMessage());}}function be(o,t){if(o&1){let e=qw();Ds(0,"button",37),mg("click",function(){df(e);let d=Xw(2);return ff(d.exportYaml())}),MC(1),pl();}if(o&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let d=Xw();return ff(d.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"input",8),SI(),pl(),Pw(5,ye,2,1),Ds(6,"ds-fieldset",9)(7,"p",2),MC(8," Each parameter must have a name and a default value. Use "),Ds(9,"code"),MC(10),pl(),MC(11," in content entries to reference them. "),pl(),Ds(12,"div",10),Pw(13,ve,2,0,"p",2),Vw(14,he,10,8,"div",11,jw),Ds(16,"div")(17,"button",12),mg("click",function(){df(e);let d=Xw();return ff(d.addParameter())}),MC(18,"+ Add parameter"),pl()()()(),Ds(19,"ds-fieldset",13)(20,"p",2),MC(21," Each content entry is a command. Use "),Ds(22,"code"),MC(23,"@AgentName"),pl(),MC(24," to target an agent, "),Ds(25,"code"),MC(26,"/promptName param1 param2"),pl(),MC(27," to call another prompt, and "),Ds(28,"code"),MC(29),pl(),MC(30," for parameter placeholders. "),pl(),Ds(31,"div",10),Vw(32,_e,7,5,"div",14,jw),Ds(34,"div")(35,"button",12),mg("click",function(){df(e);let d=Xw();return ff(d.addContentEntry())}),MC(36,"+ Add content entry"),pl()()()(),Pw(37,xe,2,1,"ds-notice"),Ds(38,"ds-form-field",15),lg(39,"textarea",16),SI(),pl(),Ds(40,"ds-form-actions")(41,"button",17),MC(42),pl(),Pw(43,be,2,2,"button",18),Ds(44,"button",19),mg("click",function(){df(e);let d=Xw();return ff(d.cancel())}),MC(45,"Cancel"),pl()()();}if(o&2){let e=Xw();ug("formGroup",e.form),jE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),jE(),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.availableAgentConfigs().length>0?5:-1),jE(5),Og(e.paramPlaceholderSyntax),jE(2),ug("formArrayName","parameters"),jE(),Lw(e.parametersArray.length===0?13:-1),jE(),Hw(e.parametersArray.controls),jE(15),Og(e.paramPlaceholderSyntax),jE(2),ug("formArrayName","content"),jE(),Hw(e.contentArray.controls),jE(5),Lw(e.errorMessage()?37:-1),jE(),ug("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),jE(),ug("formControl",e.externalMetadataJsonControl),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),jE(),Lw(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(Ie);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Bt([this.createContentControl()],{validators:[fn.required]}),parameters:new Bt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);errorMessage=Ui(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Ui([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),da(()=>Cr([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),da(()=>Cr([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[fn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value",3,"controlId"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.cancel()}),MC(3),pl()(),Pw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),pl()),e&2&&(jE(),ug("title",r.isEditMode()?"Edit prompt":"New prompt"),jE(2),vl(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),jE(),Lw(r.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,Vn,An,va,go,_o,pn,hn,cn,ln,dn,mn,at,an],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-C_jGLVKk.js';import {z as k,O as O$1,g as at,h as hn,I as Io,j as ko,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import {g,W,F,I as Ie,U as Ui,ac as Ty,a2 as da,aa as Cr,E as U,N as x,G as w,ai as Ue,al as Fe,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,q as qw,r as df,s as ff,f as cg}from'./main-CEEMKDJT.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let e=Xw();jE(),Og(e.deletion.error());}}function Y(n,t){n&1&&(Ds(0,"p",4),MC(1,"Loading scheduled prompts\u2026"),pl());}function z(n,t){n&1&&(Ds(0,"p",5),MC(1,"No scheduled prompts available."),pl());}function G(n,t){n&1&&(Ds(0,"p",4),MC(1,"No scheduled prompts match the current filter."),pl());}function Q(n,t){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.prompt.description);}}function X(n,t){n&1&&(Ds(0,"ds-tag",20),MC(1,"Read-only"),pl());}function Z(n,t){if(n&1){let e=qw();Ds(0,"button",25),mg("click",function(){df(e);let l=Xw(2).$implicit,p=Xw(2);return ff(p.toggle(l))}),MC(1),pl(),Ds(2,"button",25),mg("click",function(){df(e);let l=Xw(2).$implicit,p=Xw(2);return ff(p.edit(l))}),MC(3," Edit "),pl();}if(n&2){let e=Xw(2).$implicit;jE(),Og(e.prompt.enabled?"Disable":"Enable"),jE(),cg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=qw();Pw(0,Z,4,2),Ds(1,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(e);let l=Xw().$implicit,p=Xw(2);return ff(p.deletion.request(l.key))})("deleteConfirmed",function(){df(e);let l=Xw().$implicit,p=Xw(2);return ff(p.confirmDelete(l))})("deleteCancelled",function(){df(e);let l=Xw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let e=Xw().$implicit,i=Xw(2);Lw(i.deletion.confirmingId()!==e.key?0:-1),jE(),ug("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Ds(0,"button",23),MC(1,"Inherited"),pl());}function ne(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,Q,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)(12,"ds-tag",17),MC(13),pl(),Pw(14,X,2,0,"ds-tag",20),pl()(),Ds(15,"td",21)(16,"div",22),Pw(17,ee,2,4)(18,te,2,0,"button",23),pl()()()),n&2){let e=t.$implicit,i=Xw(2);jE(3),Og(e.prompt.name),jE(),Lw(e.prompt.description?4:-1),jE(2),Og(i.scheduleLabel(e.prompt)),jE(2),ug("variant",e.prompt.enabled?"accent":"outline"),jE(),Og(e.prompt.enabled?"Enabled":"Disabled"),jE(3),ug("variant",e.scope==="platform"?"neutral":"accent"),jE(),Og(e.scope==="platform"?"Platform":"Namespace"),jE(),Lw(e.scope==="platform"?14:-1),jE(3),Lw(e.scope==="namespace"?17:18);}}function ie(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),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ne,19,9,"tr",9,J),pl()()()),n&2){let e=Xw();jE(16),Hw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(Ie);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Ui([]);isLoading=Ui(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ty({platform:this.state.listPlatform().pipe(da(()=>Cr([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===Ue.WEEK?"week":"month",l=e.unit===Ue.WEEK&&e.days?.length?` (${e.days.map(p=>Fe[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return i.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New scheduled prompt"),pl()(),Pw(4,O,2,1,"p",3),Pw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-CQZDxK4J.js';import {y}from'./chunk-Cq4k0Mf8.js';import {g,aE as Z,$ as wr,at as wy,a1 as fa,a2 as da,aa as Cr,ad as ne,aD as Uy,N as x,G as w$1,a5 as yd,aF as Mr,aG as Ot,aH as sn,a6 as x$1}from'./main-CEEMKDJT.js';var nt=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],it={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},R="none",w="me",b=2e3,M=15e4,P=3,L={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},k={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function B(i){let t=L[i.authType];return t?x(w$1({},i),{authType:t}):i}function m(i){return U(i)}function f(i){return i.map(U)}function U(i){let t=i;if(typeof t.authType=="string"){let e=k[t.authType];if(e)return x(w$1({},t),{authType:e})}return i}function H(i,t){return t===null?true:i!==void 0&&Date.parse(i)>Date.parse(t)}var I=class i$1{controller=g(Z);userState=g(y);refresh$=new wr(void 0);namespaceId$=new wr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([t])=>{let e=this.loadPlatformSettings().pipe(da(()=>Cr([])));return t?wy([e,this.loadNamespaceSettings(t).pipe(da(()=>Cr([]))),this.loadUserSettings(t).pipe(da(()=>Cr([]))),this.loadUserSettings("global").pipe(da(()=>Cr([])))]).pipe(ne(([n,o,r,h])=>({platform:n,namespace:o,userOnNs:r,userGlobal:h}))):wy([e,this.loadNamespaceSettings("").pipe(da(()=>Cr([]))),this.loadUserSettings("global").pipe(da(()=>Cr([])))]).pipe(ne(([n,o,r])=>({platform:n,namespace:o,userOnNs:[],userGlobal:r})))}),Uy({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?R:t;return this.controller.listAuthSetting(e,w).pipe(ne(n=>f(n)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(R).pipe(ne(t=>f(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ne(e=>f(e))):Cr([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ne(n=>m(n)))}create(t,e,n){let r=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!r)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(n===void 0||n===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!n)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let h=B(x(w$1({},t),{namespaceId:e==="namespace"||e==="userOnNs"?n??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?r:void 0}));return this.controller.createAuthSetting(h).pipe(ne(A=>m(A)),yd(()=>this.refresh()))}update(t,e,n){let o=B(x(w$1({},e),{namespaceId:n.namespaceId,userId:n.userId,authType:n.authType}));return this.controller.updateAuthSetting(t,o).pipe(ne(r=>m(r)),yd(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(yd(()=>this.refresh()))}getConnection(t,e){return this.controller.getConnectionAuthSetting(t,e)}resetCredential(t,e){return this.controller.resetMyCredentialAuthSetting(t,e)}connect(t,e,n,o){return this.getConnection(t,e).pipe(fa(r=>this.controller.connectAuthSetting(t,e).pipe(yd(h=>n(h.authorizationUrl)),fa(()=>this.awaitNewConnection(t,e,r.connected?r.connectedAt??null:null,o)))))}awaitNewConnection(t,e,n,o){let r=0,h=0;return Mr(b,b).pipe(fa(()=>this.getConnection(t,e).pipe(da(()=>Cr(null)))),ne(A=>(r++,A?.connected&&H(A.connectedAt,n)?"connected":r*b>=M?"timeout":o()&&++h>=P?"abandoned":null)),Ot(A=>A!==null),sn(1))}static \u0275fac=function(e){return new(e||i$1)};static \u0275prov=x$1({token:i$1,factory:i$1.\u0275fac,providedIn:"root"})};export{I,it as i,nt as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import {g,F,I as Ie,ag as U$1,$ as wr,U as Ui,a1 as fa,E as U$2,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,v as vl,q as qw,r as df,s as ff,f as cg}from'./main-CEEMKDJT.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function K(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading agent configs\u2026"),pl());}function H(n,e){n&1&&(Ds(0,"p",5),MC(1,"No platform agent configs defined yet."),pl());}function U(n,e){n&1&&(Ds(0,"p",4),MC(1,"No agent configs match the current filter."),pl());}function z(n,e){if(n&1){let t=qw();Ds(0,"button",19),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.inspect(d))}),MC(1," Inspect "),pl(),Ds(2,"button",19),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.edit(d))}),MC(3,"Edit"),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Inspect "+t.name),jE(2),cg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(d.id))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15),MC(8),pl(),Ds(9,"td",16)(10,"div",17),Pw(11,z,4,2),Pw(12,G,1,3,"agentos-row-delete-action",18),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.name),jE(2),vl(" ",t.description||"\u2014"," "),jE(2),Og(t.modelName||"\u2014"),jE(2),Og(a.mode(t)),jE(3),Lw(a.deletion.confirmingId()!==t.id?11:-1),jE(),Lw(t.id?12:-1);}}function O(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Model"),pl(),Ds(10,"th",10),MC(11,"Execution mode"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,J,13,6,"tr",9,B),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(Ie);agentConfigController=g(U$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();configs=Ui([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New agent config"),pl()(),Pw(4,j,2,1,"p",3),Pw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {D as m,z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-
|
|
1
|
+
import {D as m,z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import {g,F,I as Ie,$ as wr,U as Ui,a1 as fa,E as U$1,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,v as vl,q as qw,f as cg,r as df,s as ff}from'./main-CEEMKDJT.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 prompts\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform prompts defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No prompts 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 m=Xw().$implicit,p=Xw(2);return ff(p.edit(m))}),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 m=Xw().$implicit,p=Xw(2);return ff(p.deletion.request(m.id))})("deleteConfirmed",function(){df(n);let m=Xw().$implicit,p=Xw(2);return ff(p.confirmDelete(m))})("deleteCancelled",function(){df(n);let m=Xw(3);return ff(m.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),vl(" ",n.description||"\u2014"," "),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,"Description"),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);promptState=g(m);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();prompts=Ui([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=mw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return r.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New prompt"),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.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {I as I$1}from'./chunk-
|
|
1
|
+
import {I as I$1}from'./chunk-DV-Eelxi.js';import {g,F,I as Ie,$ as wr,U as Ui,a1 as fa,E as U$1,m as mw,D as Ds,R as mg,a as pl,M as MC,P as Pw,j as jE,Q as ug,L as Lw,X as Xw,O as Og,i as Vw,H as Hw,v as vl,q as qw,f as cg,r as df,s as ff}from'./main-CEEMKDJT.js';import {z as k,O as O$1,g as at,h as hn,I as Io,P,B as P$1}from'./chunk-Cq4k0Mf8.js';import'./chunk-CQZDxK4J.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Ds(0,"p",3),MC(1),pl()),e&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function H(e,t){e&1&&(Ds(0,"p",5),MC(1,"No platform auth settings defined yet."),pl());}function U(e,t){e&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function z(e,t){if(e&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.onEdit(d))}),MC(1," Edit "),pl();}if(e&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(e,t){if(e&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.onDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(e&2){let n=Xw().$implicit,a=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&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()()()),e&2){let n=t.$implicit,a=Xw(2);jE(2),Og(n.name),jE(2),vl(" ",n.authType," "),jE(3),Lw(a.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(e,t){if(e&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,B),pl()()()),e&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(Ie);state=g(I$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=k();settings=Ui([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","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,a){n&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 auth setting"),pl()(),Pw(4,j,2,1,"p",3),Pw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,aK as ue,a6 as x}from'./main-
|
|
1
|
+
import {g,aK as ue,a6 as x}from'./main-CEEMKDJT.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
|