@whoz-oss/coday-client 0.0.0-workstream-forge.285 → 0.0.0-workstream-forge.288
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +52 -0
- package/browser/{chunk-Cnq159eN.js → chunk--N43m_5o.js} +1 -1
- package/browser/{chunk-D-9iMQv_.js → chunk-ARX7xO57.js} +1 -1
- package/browser/{chunk-DLUw6xZL.js → chunk-B0gKv16w.js} +1 -1
- package/browser/{chunk-Bj2SgFTY.js → chunk-B84wcmlL.js} +1 -1
- package/browser/{chunk-Deoyp47K.js → chunk-BAW_bOac.js} +1 -1
- package/browser/{chunk-BpRfgEmz.js → chunk-BNV6A7zQ.js} +1 -1
- package/browser/chunk-BSz21_Vu.js +1 -0
- package/browser/{chunk-BGaBu_yG.js → chunk-BWCkWdmU.js} +1 -1
- package/browser/{chunk-DCU0O5Ka.js → chunk-BZ7MHHlT.js} +1 -1
- package/browser/{chunk-CX2QtdIw.js → chunk-BbgQs8ay.js} +1 -1
- package/browser/{chunk-BRhWdEcv.js → chunk-Bc30sqfv.js} +1 -1
- package/browser/{chunk-DNO_UKkx.js → chunk-BgfuCnTj.js} +1 -1
- package/browser/chunk-BtNRYep-.js +16 -0
- package/browser/{chunk-C3n9w6Vo.js → chunk-Bw2kVgKL.js} +1 -1
- package/browser/{chunk-BsMXvlMY.js → chunk-By9Xd-3K.js} +1 -1
- package/browser/{chunk-BQrs6HKm.js → chunk-BzrVRPNK.js} +1 -1
- package/browser/{chunk-D7CYFO8e.js → chunk-C8EjYY3L.js} +1 -1
- package/browser/{chunk-UivSyOHl.js → chunk-CBHdjoSo.js} +1 -1
- package/browser/{chunk-DT7DFzXk.js → chunk-CGhT80Z4.js} +1 -1
- package/browser/{chunk-BWZH94Ql.js → chunk-CT-NYgHo.js} +1 -1
- package/browser/{chunk-BozaX28A.js → chunk-CWBuB3TV.js} +1 -1
- package/browser/{chunk-BuXYpWqH.js → chunk-CWRaz0m6.js} +1 -1
- package/browser/{chunk-DC3rgpMh.js → chunk-CfJrOSzi.js} +1 -1
- package/browser/{chunk-VqtB1BzG.js → chunk-Ch_tCQDO.js} +1 -1
- package/browser/{chunk-ByMpO_2J.js → chunk-CknQyFqR.js} +1 -1
- package/browser/{chunk-9lPOnBh7.js → chunk-CqXT8Tpx.js} +1 -1
- package/browser/chunk-CqeuplQz.js +1 -0
- package/browser/{chunk-Ca-YJxkj.js → chunk-D-F4_F5P.js} +1 -1
- package/browser/{chunk-BvWC7yF9.js → chunk-D0PFoBR9.js} +1 -1
- package/browser/{chunk-BU4BNqKl.js → chunk-DJblpySR.js} +1 -1
- package/browser/{chunk-DXhOdsyd.js → chunk-DLffGFin.js} +1 -1
- package/browser/chunk-DNpsnpVA.js +690 -0
- package/browser/{chunk-CHXLjpvB.js → chunk-DT4fihVQ.js} +1 -1
- package/browser/chunk-DTHI-QLx.js +61 -0
- package/browser/{chunk-DYFgJfm3.js → chunk-DUVTlyRi.js} +1 -1
- package/browser/{chunk-KqBRRBxT.js → chunk-D_KNMuBZ.js} +1 -1
- package/browser/{chunk-E7h9aRjY.js → chunk-DaMifMs9.js} +1 -1
- package/browser/chunk-DdMcbWCx.js +1 -0
- package/browser/{chunk-DpaqV0I8.js → chunk-Dkderx1H.js} +1 -1
- package/browser/{chunk-CimgVrmo.js → chunk-Dnbp1gjx.js} +1 -1
- package/browser/{chunk-Ch9IS2VK.js → chunk-DqNu3dCC.js} +1 -1
- package/browser/{chunk-waXaFQA6.js → chunk-Dxv38Ish.js} +1 -1
- package/browser/{chunk-C6jMH6l0.js → chunk-H7KUSNF6.js} +1 -1
- package/browser/{chunk-DaKshFXh.js → chunk-I4zoVvDE.js} +1 -1
- package/browser/{chunk-B4IxKhfN.js → chunk-JWkB7UsB.js} +1 -1
- package/browser/{chunk-CfcxICq5.js → chunk-dhcgEEkx.js} +1 -1
- package/browser/{chunk-DoEqcxIp.js → chunk-lsjaR1SF.js} +1 -1
- package/browser/chunk-pXoj-NgV.js +1 -0
- package/browser/index.html +1 -1
- package/browser/{main-OLEL3JTU.js → main-IUUK3O6C.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-Bx5RArn6.js +0 -1
- package/browser/chunk-C7Y0YglE.js +0 -1
- package/browser/chunk-CFyknSSV.js +0 -1
- package/browser/chunk-DaMEeyR0.js +0 -1
- package/browser/chunk-anaDHfEv.js +0 -680
|
@@ -1 +1 @@
|
|
|
1
|
-
import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-
|
|
1
|
+
import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-DNpsnpVA.js';import {g,K as we,W,G as J,z as zi,U,N as Nw,I as Is,a as hg,R as Eg,Y as Yw,m as ml,S as BI,H as HC,Q as QE,P as pg,b as Qw,T as HI,o as Il,a4 as we$1,a5 as Ed,a6 as A,p as dC,s as sC,L as Lg,a7 as Ln,q as mf,r as yf,J as Jw,k as eC}from'./main-IUUK3O6C.js';var I=class e{api=g(we$1);isLoading=zi(false);result=zi(null);errorMessage=zi(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(Ed({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=A({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Is(0,"p",14),HC(1,"Loading namespaces\u2026"),ml());}function pe(e,t){if(e&1&&(Is(0,"option",17),HC(1),ml()),e&2){let n=t.$implicit;pg("value",n.id),QE(),Lg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),HC(2,"Select a namespace"),ml(),Jw(3,pe,2,2,"option",17,de),ml(),BI()),e&2){let n=dC(2);HI(),QE(3),eC(n.namespaces());}}function ue(e,t){if(e&1&&Yw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=dC();Qw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&hg(0,"input",3),e&2){let n=dC();pg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=sC();Is(0,"button",18),Eg("click",function(){mf(n);let l=dC();return yf(l.reset())}),HC(1,"Clear result"),ml();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),HC(2),ml()()),e&2&&(QE(2),Lg(t));}function ye(e,t){e&1&&(Is(0,"span",21),HC(1,"Metadata"),ml(),Is(2,"pre",19),HC(3),ml()),e&2&&(QE(3),Lg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Type"),ml(),Is(2,"dd",23),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Message"),ml(),Is(2,"dd"),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),HC(1,"Tool error details"),ml(),Is(2,"dl",22),Yw(3,Ce,4,1),Yw(4,_e,4,1),ml()),e&2){let n=dC();QE(3),Qw(n.errorType?3:-1),QE(),Qw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),HC(3),ml()(),Is(4,"span",21),HC(5,"Output"),ml(),Is(6,"pre",19),HC(7),ml(),Yw(8,ye,4,1),Is(9,"span",21),HC(10,"Structured output"),ml(),Is(11,"pre",19),HC(12),ml(),Yw(13,be,5,2),ml()),e&2){let n,o=t,l=dC();pg("heading","Result \u2014 "+o.toolName),QE(2),pg("variant",o.success?"accent":"outline"),QE(),Lg(o.success?"Success":"Tool error"),QE(4),Lg(o.output),QE(),Qw((n=l.formatMetadata(o.metadata))?8:-1,n),QE(4),Lg(l.formatStructuredOutput(o.structuredOutput)??"null"),QE(),Qw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=zi([]);namespacesLoading=zi(true);namespaceName=zi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Nw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Is(2,"form",1),Eg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Yw(4,ue,2,1)(5,fe,1,1,"input",3),ml(),Is(6,"ds-form-field",4),hg(7,"input",5),BI(),ml(),Is(8,"ds-form-field",6),hg(9,"input",7),BI(),ml(),Is(10,"ds-form-field",8),hg(11,"textarea",9),BI(),ml(),Is(12,"ds-form-actions")(13,"button",10),HC(14),ml(),Yw(15,ge,2,0,"button",11),ml()(),Yw(16,ve,3,1,"ds-card",12),Yw(17,he,14,7,"ds-card",13),ml()),n&2){let l,v;QE(),pg("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),QE(),pg("formGroup",o.form),QE(2),Qw(o.isPlatformMode?4:5),QE(3),HI(),QE(2),HI(),QE(2),HI(),QE(2),pg("disabled",o.form.invalid||o.state.isLoading()),QE(),Il(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),QE(),Qw(o.state.result()||o.state.errorMessage()?15:-1),QE(),Qw((l=o.state.errorMessage())?16:-1,l),QE(),Qw((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function B(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);}return e}function v(e,r){return Array(r+1).join(e)}function P(e){return e.replace(/^\n*/,"")}function L(e){for(var r=e.length;r>0&&e[r-1]===`
|
|
2
|
+
`;)r--;return e.substring(0,r)}var x=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function A(e){return N(e,x)}var k=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function C(e){return N(e,k)}function M(e){return b(e,k)}var R=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function I(e){return N(e,R)}function H(e){return b(e,R)}function N(e,r){return r.indexOf(e.nodeName)>=0}function b(e,r){return e.getElementsByTagName&&r.some(function(t){return e.getElementsByTagName(t).length})}var s={};s.paragraph={filter:"p",replacement:function(e){return `
|
|
3
|
+
|
|
4
|
+
`+e+`
|
|
5
|
+
|
|
6
|
+
`}};s.lineBreak={filter:"br",replacement:function(e,r,t){return t.br+`
|
|
7
|
+
`}};s.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,r,t){var n=Number(r.nodeName.charAt(1));if(t.headingStyle==="setext"&&n<3){var i=v(n===1?"=":"-",e.length);return `
|
|
8
|
+
|
|
9
|
+
`+e+`
|
|
10
|
+
`+i+`
|
|
11
|
+
|
|
12
|
+
`}else return `
|
|
13
|
+
|
|
14
|
+
`+v("#",n)+" "+e+`
|
|
15
|
+
|
|
16
|
+
`}};s.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),`
|
|
17
|
+
|
|
18
|
+
`+e+`
|
|
19
|
+
|
|
20
|
+
`}};s.list={filter:["ul","ol"],replacement:function(e,r){var t=r.parentNode;return t.nodeName==="LI"&&t.lastElementChild===r?`
|
|
21
|
+
`+e:`
|
|
22
|
+
|
|
23
|
+
`+e+`
|
|
24
|
+
|
|
25
|
+
`}};s.listItem={filter:"li",replacement:function(e,r,t){e=e.replace(/^\n+/,"").replace(/\n+$/,`
|
|
26
|
+
`).replace(/\n/gm,`
|
|
27
|
+
`);var n=t.bulletListMarker+" ",i=r.parentNode;if(i.nodeName==="OL"){var a=i.getAttribute("start"),f=Array.prototype.indexOf.call(i.children,r);n=(a?Number(a)+f:f+1)+". ";}return n+e+(r.nextSibling&&!/\n$/.test(e)?`
|
|
28
|
+
`:"")}};s.indentedCodeBlock={filter:function(e,r){return r.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,r,t){return `
|
|
29
|
+
|
|
30
|
+
`+r.firstChild.textContent.replace(/\n/g,`
|
|
31
|
+
`)+`
|
|
32
|
+
|
|
33
|
+
`}};s.fencedCodeBlock={filter:function(e,r){return r.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,r,t){for(var n=r.firstChild.getAttribute("class")||"",i=(n.match(/language-(\S+)/)||[null,""])[1],a=r.firstChild.textContent,f=t.fence.charAt(0),u=3,l=new RegExp("^"+f+"{3,}","gm"),o;o=l.exec(a);)o[0].length>=u&&(u=o[0].length+1);var c=v(f,u);return `
|
|
34
|
+
|
|
35
|
+
`+c+i+`
|
|
36
|
+
`+a.replace(/\n$/,"")+`
|
|
37
|
+
`+c+`
|
|
38
|
+
|
|
39
|
+
`}};s.horizontalRule={filter:"hr",replacement:function(e,r,t){return `
|
|
40
|
+
|
|
41
|
+
`+t.hr+`
|
|
42
|
+
|
|
43
|
+
`}};s.inlineLink={filter:function(e,r){return r.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,r){var t=r.getAttribute("href");t&&(t=t.replace(/([()])/g,"\\$1"));var n=h(r.getAttribute("title"));return n&&(n=' "'+n.replace(/"/g,'\\"')+'"'),"["+e+"]("+t+n+")"}};s.referenceLink={filter:function(e,r){return r.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,r,t){var n=r.getAttribute("href"),i=h(r.getAttribute("title"));i&&(i=' "'+i+'"');var a,f;switch(t.linkReferenceStyle){case "collapsed":a="["+e+"][]",f="["+e+"]: "+n+i;break;case "shortcut":a="["+e+"]",f="["+e+"]: "+n+i;break;default:var u=this.references.length+1;a="["+e+"]["+u+"]",f="["+u+"]: "+n+i;}return this.references.push(f),a},references:[],append:function(e){var r="";return this.references.length&&(r=`
|
|
44
|
+
|
|
45
|
+
`+this.references.join(`
|
|
46
|
+
`)+`
|
|
47
|
+
|
|
48
|
+
`,this.references=[]),r}};s.emphasis={filter:["em","i"],replacement:function(e,r,t){return e.trim()?t.emDelimiter+e+t.emDelimiter:""}};s.strong={filter:["strong","b"],replacement:function(e,r,t){return e.trim()?t.strongDelimiter+e+t.strongDelimiter:""}};s.code={filter:function(e){var r=e.previousSibling||e.nextSibling,t=e.parentNode.nodeName==="PRE"&&!r;return e.nodeName==="CODE"&&!t},replacement:function(e){if(!e)return "";e=e.replace(/\r?\n|\r/g," ");for(var r=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",t="`",n=e.match(/`+/gm)||[];n.indexOf(t)!==-1;)t=t+"`";return t+r+e+r+t}};s.image={filter:"img",replacement:function(e,r){var t=h(r.getAttribute("alt")),n=r.getAttribute("src")||"",i=h(r.getAttribute("title")),a=i?' "'+i+'"':"";return n?"":""}};function h(e){return e?e.replace(/(\n+\s*)+/g,`
|
|
49
|
+
`):""}function S(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var r in e.rules)this.array.push(e.rules[r]);}S.prototype={add:function(e,r){this.array.unshift(r);},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement});},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return ""}});},forNode:function(e){if(e.isBlank)return this.blankRule;var r;return (r=m(this.array,e,this.options))||(r=m(this._keep,e,this.options))||(r=m(this._remove,e,this.options))?r:this.defaultRule},forEach:function(e){for(var r=0;r<this.array.length;r++)e(this.array[r],r);}};function m(e,r,t){for(var n=0;n<e.length;n++){var i=e[n];if(F(i,r,t))return i}}function F(e,r,t){var n=e.filter;if(typeof n=="string"){if(n===r.nodeName.toLowerCase())return true}else if(Array.isArray(n)){if(n.indexOf(r.nodeName.toLowerCase())>-1)return true}else if(typeof n=="function"){if(n.call(e,r,t))return true}else throw new TypeError("`filter` needs to be a string, array, or function")}function $(e){var r=e.element,t=e.isBlock,n=e.isVoid,i=e.isPre||function(w){return w.nodeName==="PRE"};if(!(!r.firstChild||i(r))){for(var a=null,f=false,u=null,l=E(u,r,i);l!==r;){if(l.nodeType===3||l.nodeType===4){var o=l.data.replace(/[ \r\n\t]+/g," ");if((!a||/ $/.test(a.data))&&!f&&o[0]===" "&&(o=o.substr(1)),!o){l=d(l);continue}l.data=o,a=l;}else if(l.nodeType===1)t(l)||l.nodeName==="BR"?(a&&(a.data=a.data.replace(/ $/,"")),a=null,f=false):n(l)||i(l)?(a=null,f=true):a&&(f=false);else {l=d(l);continue}var c=E(u,l,i);u=l,l=c;}a&&(a.data=a.data.replace(/ $/,""),a.data||d(a));}}function d(e){var r=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),r}function E(e,r,t){return e&&e.parentNode===r||t(r)?r.nextSibling||r.parentNode:r.firstChild||r.nextSibling||r.parentNode}var y=typeof window<"u"?window:{};function V(){var e=y.DOMParser,r=false;try{new e().parseFromString("","text/html")&&(r=!0);}catch(t){}return r}function U(){var e=function(){};return W()?e.prototype.parseFromString=function(r){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(r),t.close(),t}:e.prototype.parseFromString=function(r){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(r),t.close(),t},e}function W(){var e=false;try{document.implementation.createHTMLDocument("").open();}catch(r){y.ActiveXObject&&(e=true);}return e}var _=V()?y.DOMParser:U();function j(e,r){var t;if(typeof e=="string"){var n=G().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");t=n.getElementById("turndown-root");}else t=e.cloneNode(true);return $({element:t,isBlock:A,isVoid:C,isPre:r.preformattedCode?X:null}),t}var g;function G(){return g=g||new _,g}function X(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function K(e,r){return e.isBlock=A(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Y(e),e.flankingWhitespace=q(e,r),e}function Y(e){return !C(e)&&!I(e)&&/^\s*$/i.test(e.textContent)&&!M(e)&&!H(e)}function q(e,r){if(e.isBlock||r.preformattedCode&&e.isCode)return {leading:"",trailing:""};var t=z(e.textContent);return t.leadingAscii&&T("left",e,r)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&T("right",e,r)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function z(e){var r=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return {leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]}}function T(e,r,t){var n,i,a;return e==="left"?(n=r.previousSibling,i=/ $/):(n=r.nextSibling,i=/^ /),n&&(n.nodeType===3?a=i.test(n.nodeValue):t.preformattedCode&&n.nodeName==="CODE"?a=false:n.nodeType===1&&!A(n)&&(a=i.test(n.textContent))),a}var Q=Array.prototype.reduce,J=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function p(e){if(!(this instanceof p))return new p(e);var r={rules:s,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:false,blankReplacement:function(t,n){return n.isBlock?`
|
|
50
|
+
|
|
51
|
+
`:""},keepReplacement:function(t,n){return n.isBlock?`
|
|
52
|
+
|
|
53
|
+
`+n.outerHTML+`
|
|
54
|
+
|
|
55
|
+
`:n.outerHTML},defaultReplacement:function(t,n){return n.isBlock?`
|
|
56
|
+
|
|
57
|
+
`+t+`
|
|
58
|
+
|
|
59
|
+
`:t}};this.options=B({},r,e),this.rules=new S(this.options);}p.prototype={turndown:function(e){if(!re(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return "";var r=O.call(this,new j(e,this.options));return Z.call(this,r)},use:function(e){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.use(e[r]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,r){return this.rules.add(e,r),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return J.reduce(function(r,t){return r.replace(t[0],t[1])},e)}};function O(e){var r=this;return Q.call(e.childNodes,function(t,n){n=new K(n,r.options);var i="";return n.nodeType===3?i=n.isCode?n.nodeValue:r.escape(n.nodeValue):n.nodeType===1&&(i=ee.call(r,n)),D(t,i)},"")}function Z(e){var r=this;return this.rules.forEach(function(t){typeof t.append=="function"&&(e=D(e,t.append(r.options)));}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function ee(e){var r=this.rules.forNode(e),t=O.call(this,e),n=e.flankingWhitespace;return (n.leading||n.trailing)&&(t=t.trim()),n.leading+r.replacement(t,e,this.options)+n.trailing}function D(e,r){var t=L(e),n=P(r),i=Math.max(e.length-t.length,r.length-n.length),a=`
|
|
60
|
+
|
|
61
|
+
`.substring(0,i);return t+a+n}function re(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}var te=p;export{te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-DLffGFin.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-DNpsnpVA.js';import {g,F,K as we,$ as Sr,z as zi,a1 as ma,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-IUUK3O6C.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Is(0,"p",3),HC(1),ml()),i&2){let t=dC();QE(),Lg(t.deletion.error());}}function A(i,e){i&1&&(Is(0,"p",4),HC(1,"Loading skills\u2026"),ml());}function H(i,e){i&1&&(Is(0,"p",5),HC(1,"No platform skills defined yet."),ml());}function U(i,e){i&1&&(Is(0,"p",4),HC(1,"No skills match the current filter."),ml());}function z(i,e){i&1&&(Is(0,"ds-tag",15),HC(1,"SKILL.md"),ml());}function G(i,e){if(i&1){let t=sC();Is(0,"button",21),Eg("click",function(){mf(t);let d=dC(2).$implicit,m=dC(2);return yf(m.edit(d))}),HC(1,"Edit"),ml();}if(i&2){let t=dC(2).$implicit;fg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=sC();Is(0,"button",21),Eg("click",function(){mf(t);let d=dC().$implicit,m=dC(2);return yf(m.inspect(d))}),HC(1,"View"),ml(),Yw(2,G,2,1,"button",22);}if(i&2){let t=dC().$implicit;fg("aria-label","View "+t.name),QE(2),Qw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=sC();Is(0,"agentos-row-delete-action",23),Eg("deleteRequested",function(){mf(t);let d=dC().$implicit,m=dC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=dC().$implicit,m=dC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=dC(3);return yf(d.deletion.cancel())}),ml();}if(i&2){let t=dC().$implicit,l=dC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),HC(4),ml(),Yw(5,z,2,0,"ds-tag",15),ml()(),Is(6,"td",16),HC(7),ml(),Is(8,"td",17),HC(9),ml(),Is(10,"td",18)(11,"div",19),Yw(12,J,3,2),Yw(13,Q,1,3,"agentos-row-delete-action",20),ml()()()),i&2){let t=e.$implicit,l=dC(2);QE(4),Lg(t.name),QE(),Qw(t.readOnly?5:-1),QE(2),Il(" ",t.description||"\u2014"," "),QE(2),Lg(l.resourceCount(t)),QE(3),Qw(l.deletion.confirmingId()!==t.id?12:-1),QE(),Qw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Resources"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,W,14,6,"tr",9,K),ml()()()),i&2){let t=dC();QE(14),eC(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();skills=zi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=Nw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return l.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return l.openCreateForm()}),HC(3,"New skill"),ml()(),Yw(4,O,2,1,"p",3),Yw(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&&(QE(),pg("query",l.rowFilter.query()),QE(3),Qw(l.deletion.error()?4:-1),QE(),Qw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {ab as N,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un}from'./chunk-
|
|
1
|
+
import {ab as N,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un}from'./chunk-DNpsnpVA.js';import {g,W,F,aV as D,ag as U,K as we,z as zi,U as U$1,B,aW as Dy,N as Nw,I as Is,R as Eg,H as HC,m as ml,a as hg,Y as Yw,Q as QE,P as pg,b as Qw,o as Il,p as dC,L as Lg}from'./main-IUUK3O6C.js';function P(l,t){if(l&1&&(Is(0,"ds-notice"),HC(1),ml()),l&2){let n=dC();QE(),Lg(n.launchError());}}var T=class l{route=g(W);router=g(F);caseController=g(D);caseState=g(N);agentConfigController=g(U);destroyRef=g(we);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=zi("");launchError=zi(null);isLaunching=zi(false);isLoading=zi(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.resolvedAgentConfig=t,t.loopConfig!=null&&this.payloadJson.set(JSON.stringify(t.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let t=this.resolvedAgentConfig??(yield Dy(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield Dy(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield Dy(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(t){console.error("[AgentConfigLaunch] Failed to launch loop agent",t),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=Nw({type:l,selectors:[["agentos-agent-config-launch"]],decls:17,vars:6,consts:[["title","Launch loop agent"],["dsButton","","variant","ghost","type","button","title","Back to agent config",3,"click"],[1,"ds-hint"],["label","Loop configuration (read-only)","controlId","agent-loop-payload"],["dsControl","","mono","","id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",3,"value","disabled"],["dsButton","","variant","primary","type","button",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(n,e){n&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return e.back()}),HC(3," \u2190 Edit agent config "),ml()(),Is(4,"p",2),HC(5," The loop configuration below is read from "),Is(6,"code"),HC(7,"AgentConfig.loopConfig"),ml(),HC(8," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),ml(),Is(9,"ds-form-field",3),hg(10,"textarea",4),ml(),Yw(11,P,2,1,"ds-notice"),Is(12,"ds-form-actions")(13,"button",5),Eg("click",function(){return e.launch()}),HC(14),ml(),Is(15,"button",6),Eg("click",function(){return e.back()}),HC(16,"Cancel"),ml()()()),n&2&&(QE(10),pg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),QE(),Qw(e.launchError()?11:-1),QE(2),pg("disabled",e.isLaunching()),QE(),Il(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),QE(),pg("disabled",e.isLaunching()));},dependencies:[vn,yn,fn,hn,_n,at,un],encapsulation:2})};export{T as AgentConfigLaunchComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {I}from'./chunk-Ca-YJxkj.js';import {g,W,aX as L,K as we,z as zi,j as mT,aY as Ue,ac as Ny,U,a2 as ga,aa as _r,N as Nw,I as Is,a as hg,Y as Yw,m as ml,R as Eg,Q as QE,b as Qw,P as pg,H as HC,s as sC,S as BI,J as Jw,p as dC,T as HI,k as eC,o as Il,as as jg,q as mf,r as yf,L as Lg}from'./main-OLEL3JTU.js';import {a6 as gd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,c as fo,a8 as _a,ac as Bi,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-anaDHfEv.js';import'./chunk-C7Y0YglE.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Is(0,"p",1),HC(1,"Loading\u2026"),ml());}function se(i,t){if(i&1&&(Is(0,"ds-notice"),HC(1),ml()),i&2){let e=dC(2);QE(),Lg(e.errorMessage());}}function re(i,t){if(i&1){let e=sC();Is(0,"div")(1,"button",23),Eg("click",function(){mf(e);let s=dC(2);return yf(s.retryLoad())}),HC(2,"Retry loading"),ml()();}}function ce(i,t){if(i&1&&(hg(0,"br"),HC(1)),i&2){let e=dC(3);QE(),Il("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Is(0,"ds-notice",3),HC(1),Yw(2,ce,2,1),ml()),i&2){let e=dC(2);pg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),QE(),Il(" Repository: ",e.checkoutStatus()," "),QE(),Qw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Is(0,"option",12),HC(1),ml()),i&2){let e=t.$implicit,c=dC(2);pg("value",e.id),QE(),jg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Is(0,"p",13),HC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),ml());}function pe(i,t){if(i&1){let e=sC();Is(0,"button",24),Eg("click",function(){mf(e);let s=dC(2);return yf(s.remove())}),HC(1," Remove association "),ml();}if(i&2){let e=dC(2);pg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=sC();Yw(0,se,2,1,"ds-notice"),Yw(1,re,3,0,"div"),Yw(2,de,3,3,"ds-notice",3),Is(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.repositoryUrl.set(s))}),ml(),BI(),ml(),Is(6,"ds-form-field",7)(7,"input",8),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.mainBranch.set(s))}),ml(),BI(),ml(),Is(8,"ds-form-field",9)(9,"select",10),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.serviceAuthSettingId.set(s))}),Is(10,"option",11),HC(11,"Select an auth setting\u2026"),ml(),Jw(12,le,2,3,"option",12,oe),ml(),BI(),Yw(14,me,2,0,"p",13),ml()(),Is(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.autoWorktree.set(s))}),ml(),BI(),HC(19," Offer a worktree to every new top-level case "),ml(),Is(20,"p",18),HC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),ml()(),Is(22,"ds-form-field",19)(23,"input",20),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.setupCommand.set(s))}),ml(),BI(),Is(24,"p",13),HC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),ml()()(),Is(26,"ds-form-actions")(27,"button",21),Eg("click",function(){mf(e);let s=dC();return yf(s.save())}),HC(28),ml(),Yw(29,pe,2,1,"button",22),ml();}if(i&2){let e=dC();Qw(e.errorMessage()?0:-1),QE(),Qw(e.associationLoaded()?-1:1),QE(),Qw(e.isAssociated()&&e.checkoutStatus()?2:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(2),pg("ngModel",e.repositoryUrl()),HI(),QE(2),pg("ngModel",e.mainBranch()),HI(),QE(2),pg("ngModel",e.serviceAuthSettingId()),HI(),QE(3),eC(e.eligibleAuthSettings()),QE(2),Qw(e.eligibleAuthSettings().length===0?14:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(3),pg("ngModel",e.autoWorktree()),HI(),QE(5),pg("ngModel",e.setupCommand()),HI(),QE(4),pg("disabled",!e.canSave()),QE(),Il(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),QE(),Qw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=zi(true);isSaving=zi(false);confirmingRemove=zi(false);associationLoaded=zi(false);errorMessage=zi(null);association=zi(null);authSettings=zi([]);repositoryUrl=zi("");mainBranch=zi("main");serviceAuthSettingId=zi("");autoWorktree=zi(false);setupCommand=zi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ny({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,ae,2,0,"p",1)(3,ue,30,14),ml(),Is(4,"ds-confirm-dialog",2),Eg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),ml()),e&2&&(QE(2),Qw(c.isLoading()?2:3),QE(2),pg("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
|
|
1
|
+
import {I}from'./chunk-D-F4_F5P.js';import {g,W,aX as L,K as we,z as zi,j as mT,aY as Ue,ac as Ny,U,a2 as ga,aa as _r,N as Nw,I as Is,a as hg,Y as Yw,m as ml,R as Eg,Q as QE,b as Qw,P as pg,H as HC,s as sC,S as BI,J as Jw,p as dC,T as HI,k as eC,o as Il,as as jg,q as mf,r as yf,L as Lg}from'./main-IUUK3O6C.js';import {a6 as gd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,c as fo,a8 as _a,ac as Bi,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-DNpsnpVA.js';import'./chunk-BSz21_Vu.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Is(0,"p",1),HC(1,"Loading\u2026"),ml());}function se(i,t){if(i&1&&(Is(0,"ds-notice"),HC(1),ml()),i&2){let e=dC(2);QE(),Lg(e.errorMessage());}}function re(i,t){if(i&1){let e=sC();Is(0,"div")(1,"button",23),Eg("click",function(){mf(e);let s=dC(2);return yf(s.retryLoad())}),HC(2,"Retry loading"),ml()();}}function ce(i,t){if(i&1&&(hg(0,"br"),HC(1)),i&2){let e=dC(3);QE(),Il("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Is(0,"ds-notice",3),HC(1),Yw(2,ce,2,1),ml()),i&2){let e=dC(2);pg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),QE(),Il(" Repository: ",e.checkoutStatus()," "),QE(),Qw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Is(0,"option",12),HC(1),ml()),i&2){let e=t.$implicit,c=dC(2);pg("value",e.id),QE(),jg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Is(0,"p",13),HC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),ml());}function pe(i,t){if(i&1){let e=sC();Is(0,"button",24),Eg("click",function(){mf(e);let s=dC(2);return yf(s.remove())}),HC(1," Remove association "),ml();}if(i&2){let e=dC(2);pg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=sC();Yw(0,se,2,1,"ds-notice"),Yw(1,re,3,0,"div"),Yw(2,de,3,3,"ds-notice",3),Is(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.repositoryUrl.set(s))}),ml(),BI(),ml(),Is(6,"ds-form-field",7)(7,"input",8),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.mainBranch.set(s))}),ml(),BI(),ml(),Is(8,"ds-form-field",9)(9,"select",10),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.serviceAuthSettingId.set(s))}),Is(10,"option",11),HC(11,"Select an auth setting\u2026"),ml(),Jw(12,le,2,3,"option",12,oe),ml(),BI(),Yw(14,me,2,0,"p",13),ml()(),Is(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.autoWorktree.set(s))}),ml(),BI(),HC(19," Offer a worktree to every new top-level case "),ml(),Is(20,"p",18),HC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),ml()(),Is(22,"ds-form-field",19)(23,"input",20),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.setupCommand.set(s))}),ml(),BI(),Is(24,"p",13),HC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),ml()()(),Is(26,"ds-form-actions")(27,"button",21),Eg("click",function(){mf(e);let s=dC();return yf(s.save())}),HC(28),ml(),Yw(29,pe,2,1,"button",22),ml();}if(i&2){let e=dC();Qw(e.errorMessage()?0:-1),QE(),Qw(e.associationLoaded()?-1:1),QE(),Qw(e.isAssociated()&&e.checkoutStatus()?2:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(2),pg("ngModel",e.repositoryUrl()),HI(),QE(2),pg("ngModel",e.mainBranch()),HI(),QE(2),pg("ngModel",e.serviceAuthSettingId()),HI(),QE(3),eC(e.eligibleAuthSettings()),QE(2),Qw(e.eligibleAuthSettings().length===0?14:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(3),pg("ngModel",e.autoWorktree()),HI(),QE(5),pg("ngModel",e.setupCommand()),HI(),QE(4),pg("disabled",!e.canSave()),QE(),Il(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),QE(),Qw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=zi(true);isSaving=zi(false);confirmingRemove=zi(false);associationLoaded=zi(false);errorMessage=zi(null);association=zi(null);authSettings=zi([]);repositoryUrl=zi("");mainBranch=zi("main");serviceAuthSettingId=zi("");autoWorktree=zi(false);setupCommand=zi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ny({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,ae,2,0,"p",1)(3,ue,30,14),ml(),Is(4,"ds-confirm-dialog",2),Eg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),ml()),e&2&&(QE(2),Qw(c.isLoading()?2:3),QE(2),pg("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
|
|
2
2
|
export{ne as NamespaceGitComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DLffGFin.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as c}from'./chunk-DNpsnpVA.js';import {g,W,F,K as we,z as zi,j as mT,U,ac as Ny,a2 as ga,aa as _r,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,b as Qw,p as dC,P as pg,s as sC,a as hg,av as cT,L as Lg,o as Il,aw as lT,J as Jw,k as eC,ao as Xw,q as mf,r as yf,ax as iE}from'./main-IUUK3O6C.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Is(0,"a",2),HC(1,"Edit skill \u2192"),ml()),e&2){let n=dC();pg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Is(0,"ds-tag",3),HC(1,"Platform level"),ml());}function te(e,t){e&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function ne(e,t){e&1&&(Is(0,"ds-notice"),HC(1,"Failed to load skill."),ml());}function ie(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Created by"),ml(),Is(2,"dd"),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.createdBy);}}function oe(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Last updated"),ml(),Is(2,"dd"),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Yw(0,ie,4,1),Yw(1,oe,4,1)),e&2){let n=dC();Qw(n.createdBy?0:-1),QE(),Qw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Is(0,"p",4),HC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),ml());}function se(e,t){e&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function re(e,t){e&1&&(Is(0,"ds-notice"),HC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),ml());}function de(e,t){e&1&&(Is(0,"p",4),HC(1,"No agent references this skill."),ml());}function ce(e,t){e&1&&(Is(0,"ds-tag",15),HC(1,"platform agent"),ml());}function me(e,t){e&1&&(Is(0,"ds-tag",15),HC(1,"via *"),ml());}function pe(e,t){if(e&1&&(Is(0,"li",13)(1,"span",14),HC(2),ml(),Yw(3,ce,2,0,"ds-tag",15),Yw(4,me,2,0,"ds-tag",15),ml()),e&2){let n=t.$implicit;QE(2),Lg(n.name),QE(),Qw(n.platform?3:-1),QE(),Qw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Is(0,"ul",12),Jw(1,pe,5,3,"li",13,Y),ml(),Is(3,"p",4),HC(4," An agent listed "),Is(5,"code"),HC(6,"via *"),ml(),HC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),ml()),e&2){let n=dC(2);QE(),eC(n.consumers());}}function _e(e,t){e&1&&(Is(0,"p",4),HC(1,"No resources bundled with this skill."),ml());}function ge(e,t){if(e&1){let n=sC();Is(0,"li")(1,"ds-disclosure",16),Eg("toggled",function(){let r=mf(n).$implicit,g=dC(3);return yf(g.toggleResource(r))}),Is(2,"pre",17),HC(3),ml()()();}if(e&2){let n=t.$implicit,o=dC(3);QE(),pg("heading",n)("open",o.isResourceExpanded(n)),QE(2),Lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Is(0,"ul",12),Jw(1,ge,4,3,"li",null,Xw),ml()),e&2){let n=dC(2);QE(),eC(n.resourcePaths());}}function fe(e,t){if(e&1){let n=sC();Is(0,"ds-card",5)(1,"dl",6)(2,"dt"),HC(3,"Name"),ml(),Is(4,"dd",7),HC(5),ml(),Is(6,"dt"),HC(7,"Description"),ml(),Is(8,"dd"),HC(9),ml(),Is(10,"dt"),HC(11,"Scope"),ml(),Is(12,"dd"),HC(13),ml(),Is(14,"dt"),HC(15,"Storage"),ml(),Is(16,"dd")(17,"ds-tag",8),HC(18),ml()(),Yw(19,ae,2,2),ml()(),Is(20,"ds-card",9),Yw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),ml(),Is(26,"ds-card")(27,"ds-disclosure",10),Eg("toggled",function(){mf(n);let r=dC();return yf(r.toggleBody())}),hg(28,"div",11),cT(29,"agentosMarkdown"),ml()(),Is(30,"ds-card",9),Yw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),ml();}if(e&2){let n=t,o=dC();QE(5),Lg(n.name),QE(4),Lg(n.description),QE(4),Lg(n.namespaceId?"Namespace":"Platform"),QE(4),pg("variant",o.isFilesystemBacked()?"outline":"neutral"),QE(),Il(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),QE(),Qw(o.isFilesystemBacked()?-1:19),QE(),pg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),QE(),Qw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),QE(6),pg("open",!o.bodyCollapsed()),QE(),pg("innerHTML",lT(29,12,n.body),iE),QE(2),pg("heading","Resources ("+o.resourcePaths().length+")"),QE(),Qw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);skill=zi(null);bodyCollapsed=zi(false);expandedResources=zi(new Set);resourcePaths=mT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=mT(()=>this.skill()?.readOnly===true);consumers=zi([]);consumersUnavailable=zi(false);consumersLoading=zi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Nw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.back()}),HC(3,"\u2190 Skills"),ml(),Yw(4,Z,2,1,"a",2),Yw(5,ee,2,0,"ds-tag",3),ml(),Yw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),ml()),n&2){let r;QE(4),Qw(o.skill()&&!o.isFilesystemBacked()?4:-1),QE(),Qw(o.isPlatformMode?5:-1),QE(),Qw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,c],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {y}from'./chunk-
|
|
1
|
+
import {y}from'./chunk-DNpsnpVA.js';import {g,aH as ie,aI as T,aa as _r,a1 as ma,ad as ne,a2 as ga,aC as Jy,a6 as A}from'./main-IUUK3O6C.js';var v=class i{userState=g(y);membership=g(ie);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return _r(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(ma(a=>a?a.isAdmin?_r(true):this.membership.getMembersNamespaceMembership(e).pipe(ne(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),ga(()=>_r(false))):_r(false)),Jy({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-anaDHfEv.js';import {g,W,F,K as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Ne,j as mT,z as zi,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,a as hg,S as BI,J as Jw,ao as Xw,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,as as jg,q as mf,r as yf}from'./main-OLEL3JTU.js';function he(r,t){r&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=dC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),HC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),QE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),HC(2,"Select provider"),ml(),Jw(3,ye,2,3,"option",44,qw().trackByProvider,true),ml(),BI()),r&2){let e=dC(2);pg("formControl",e.aiProviderIdControl),HI(),QE(3),eC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),HC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),QE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),HC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),HC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),HC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=dC();return yf(u.submit())}),Is(1,"ds-form-field",5),Yw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),BI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),BI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),BI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),BI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),BI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),BI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),HC(22,"Provider default"),ml(),Jw(23,xe,2,2,"option",25,Xw),ml(),BI(),Yw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Yw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),BI(),Is(31,"span",30),HC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),HC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),BI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),BI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),BI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),BI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),HC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=dC();return yf(u.cancel())}),HC(50,"Cancel"),ml()()();}if(r&2){let e=dC();pg("formGroup",e.form),QE(2),Qw(e.isEditMode()?2:3),QE(3),pg("formControl",e.apiModelNameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.aliasControl),HI(),QE(2),pg("formControl",e.priorityControl),HI(),QE(3),pg("formControl",e.temperatureControl),HI(),QE(2),pg("formControl",e.contextWindowControl),HI(),QE(2),pg("formControl",e.maxCompletionTokensControl),HI(),QE(2),pg("formControl",e.reasoningEffortControl),HI(),QE(),pg("ngValue",null),QE(2),eC(e.reasoningEffortOptions),QE(2),Qw(e.reasoningEffortUnsupported()?25:26),QE(2),Qw(e.temperatureMayConflictWithEffort()?27:-1),QE(3),pg("formControl",e.supportsAdvancedExecutionControl),HI(),QE(5),pg("formGroup",e.pricingGroup),QE(3),HI(),QE(2),HI(),QE(3),HI(),QE(2),HI(),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=mT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=mT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=mT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),HC(3," \u2190 AI models "),ml()(),Yw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(QE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),QE(3),Qw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
1
|
+
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-DNpsnpVA.js';import {g,W,F,K as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Ne,j as mT,z as zi,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,a as hg,S as BI,J as Jw,ao as Xw,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,as as jg,q as mf,r as yf}from'./main-IUUK3O6C.js';function he(r,t){r&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=dC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),HC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),QE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),HC(2,"Select provider"),ml(),Jw(3,ye,2,3,"option",44,qw().trackByProvider,true),ml(),BI()),r&2){let e=dC(2);pg("formControl",e.aiProviderIdControl),HI(),QE(3),eC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),HC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),QE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),HC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),HC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),HC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=dC();return yf(u.submit())}),Is(1,"ds-form-field",5),Yw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),BI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),BI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),BI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),BI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),BI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),BI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),HC(22,"Provider default"),ml(),Jw(23,xe,2,2,"option",25,Xw),ml(),BI(),Yw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Yw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),BI(),Is(31,"span",30),HC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),HC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),BI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),BI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),BI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),BI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),HC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=dC();return yf(u.cancel())}),HC(50,"Cancel"),ml()()();}if(r&2){let e=dC();pg("formGroup",e.form),QE(2),Qw(e.isEditMode()?2:3),QE(3),pg("formControl",e.apiModelNameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.aliasControl),HI(),QE(2),pg("formControl",e.priorityControl),HI(),QE(3),pg("formControl",e.temperatureControl),HI(),QE(2),pg("formControl",e.contextWindowControl),HI(),QE(2),pg("formControl",e.maxCompletionTokensControl),HI(),QE(2),pg("formControl",e.reasoningEffortControl),HI(),QE(),pg("ngValue",null),QE(2),eC(e.reasoningEffortOptions),QE(2),Qw(e.reasoningEffortUnsupported()?25:26),QE(2),Qw(e.temperatureMayConflictWithEffort()?27:-1),QE(3),pg("formControl",e.supportsAdvancedExecutionControl),HI(),QE(5),pg("formGroup",e.pricingGroup),QE(3),HI(),QE(2),HI(),QE(3),HI(),QE(2),HI(),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=mT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=mT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=mT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),HC(3," \u2190 AI models "),ml()(),Yw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(QE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),QE(3),Qw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-DpaqV0I8.js';import {I,n as nt,i as it}from'./chunk-Ca-YJxkj.js';import {g,W,F,K as we,z as zi,a9 as F$1,j as mT,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,J as Jw,ao as Xw,S as BI,a as hg,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,i as fg,q as mf,r as yf}from'./main-OLEL3JTU.js';import {T as Te,b as bn,p as pt,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn}from'./chunk-anaDHfEv.js';import'./chunk-C7Y0YglE.js';function Ce(i,t){i&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ye(i,t){if(i&1&&(Is(0,"label",16),hg(1,"input",17),BI(),HC(2),ml()),i&2){let e=t.$implicit,n=dC(3);QE(),pg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),HI(),QE(),Il(" ",e.label," ");}}function ge(i,t){if(i&1&&(Is(0,"ds-fieldset",5),Jw(1,ye,3,4,"label",16,qw().trackByScope,true),ml()),i&2){let e=dC(2);pg("disabled",e.isEditMode()),QE(),eC(e.scopeOptions);}}function fe(i,t){if(i&1&&(Is(0,"option",8),HC(1),ml()),i&2){let e=t.$implicit,n=dC(2);pg("value",e),QE(),Lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Is(0,"ds-form-field",18),hg(1,"input",19),BI(),ml()),i&2){let e=dC().$implicit;pg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),QE(),pg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),fg("aria-describedby",e.hint?"as-hint-"+e.key:null),HI();}}function Ae(i,t){if(i&1&&Yw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=dC(3);Qw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Is(0,"ds-fieldset",13),Jw(1,Ae,1,1,null,null,qw().trackByField,true),ml()),i&2){let e=dC(2);pg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),QE(),eC(e.credentialFields());}}function be(i,t){if(i&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let o=dC();return yf(o.submit())}),Yw(1,ge,3,1,"ds-fieldset",5),Is(2,"ds-form-field",6)(3,"select",7),Jw(4,fe,2,2,"option",8,Xw),ml(),BI(),ml(),Is(6,"ds-form-field",9),hg(7,"input",10),BI(),ml(),Is(8,"ds-form-field",11),hg(9,"input",12),BI(),ml(),Yw(10,ve,3,1,"ds-fieldset",13),Is(11,"ds-form-actions")(12,"button",14),HC(13),ml(),Is(14,"button",15),Eg("click",function(){mf(e);let o=dC();return yf(o.cancel())}),HC(15,"Cancel"),ml()()();}if(i&2){let e=dC();pg("formGroup",e.form),QE(),Qw(e.isPlatformMode?-1:1),QE(2),pg("formControl",e.authTypeControl),HI(),QE(),eC(e.authTypeOptions),QE(3),pg("formControl",e.nameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(),Qw(e.credentialFields().length>0?10:-1),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",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(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?zi(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:[bn.required,bn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[bn.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=mT(()=>_e[this.selectedAuthType()]);isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Ff(()=>{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=Nw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),HC(3," \u2190 Auth settings "),ml()(),Yw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),ml()),e&2&&(QE(),pg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),QE(3),Qw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,cn,Kt,fd,Mo,Do,Ut,Qt,Ca,fo,go,Nn,Rn],encapsulation:2})};
|
|
1
|
+
import {I,n as nt,i as it}from'./chunk-D-F4_F5P.js';import {v}from'./chunk-Dkderx1H.js';import {g,W,F,K as we,z as zi,a9 as F$1,j as mT,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,J as Jw,ao as Xw,S as BI,a as hg,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,i as fg,q as mf,r as yf}from'./main-IUUK3O6C.js';import {T as Te,b as bn,p as pt,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn}from'./chunk-DNpsnpVA.js';import'./chunk-BSz21_Vu.js';function Ce(i,t){i&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ye(i,t){if(i&1&&(Is(0,"label",16),hg(1,"input",17),BI(),HC(2),ml()),i&2){let e=t.$implicit,n=dC(3);QE(),pg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),HI(),QE(),Il(" ",e.label," ");}}function ge(i,t){if(i&1&&(Is(0,"ds-fieldset",5),Jw(1,ye,3,4,"label",16,qw().trackByScope,true),ml()),i&2){let e=dC(2);pg("disabled",e.isEditMode()),QE(),eC(e.scopeOptions);}}function fe(i,t){if(i&1&&(Is(0,"option",8),HC(1),ml()),i&2){let e=t.$implicit,n=dC(2);pg("value",e),QE(),Lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Is(0,"ds-form-field",18),hg(1,"input",19),BI(),ml()),i&2){let e=dC().$implicit;pg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),QE(),pg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),fg("aria-describedby",e.hint?"as-hint-"+e.key:null),HI();}}function Ae(i,t){if(i&1&&Yw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=dC(3);Qw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Is(0,"ds-fieldset",13),Jw(1,Ae,1,1,null,null,qw().trackByField,true),ml()),i&2){let e=dC(2);pg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),QE(),eC(e.credentialFields());}}function be(i,t){if(i&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let o=dC();return yf(o.submit())}),Yw(1,ge,3,1,"ds-fieldset",5),Is(2,"ds-form-field",6)(3,"select",7),Jw(4,fe,2,2,"option",8,Xw),ml(),BI(),ml(),Is(6,"ds-form-field",9),hg(7,"input",10),BI(),ml(),Is(8,"ds-form-field",11),hg(9,"input",12),BI(),ml(),Yw(10,ve,3,1,"ds-fieldset",13),Is(11,"ds-form-actions")(12,"button",14),HC(13),ml(),Is(14,"button",15),Eg("click",function(){mf(e);let o=dC();return yf(o.cancel())}),HC(15,"Cancel"),ml()()();}if(i&2){let e=dC();pg("formGroup",e.form),QE(),Qw(e.isPlatformMode?-1:1),QE(2),pg("formControl",e.authTypeControl),HI(),QE(),eC(e.authTypeOptions),QE(3),pg("formControl",e.nameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(),Qw(e.credentialFields().length>0?10:-1),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",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(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?zi(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:[bn.required,bn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[bn.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=mT(()=>_e[this.selectedAuthType()]);isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Ff(()=>{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=Nw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),HC(3," \u2190 Auth settings "),ml()(),Yw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),ml()),e&2&&(QE(),pg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),QE(3),Qw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,cn,Kt,fd,Mo,Do,Ut,Qt,Ca,fo,go,Nn,Rn],encapsulation:2})};
|
|
2
2
|
export{me as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-I4zoVvDE.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-DNpsnpVA.js';import {g,F,K as we,z as zi,U as U$1,ai as Fe,al as We,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,s as sC,q as mf,r as yf,i as fg}from'./main-IUUK3O6C.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let e=dC();QE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),HC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),HC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function O(n,t){if(n&1){let e=sC();Is(0,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.toggle(s))}),HC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.edit(s))}),HC(3,"Edit"),ml();}if(n&2){let e=dC().$implicit;QE(),Lg(e.enabled?"Disable":"Enable"),QE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=sC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=dC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=dC().$implicit,i=dC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),HC(3),ml(),Yw(4,H,2,1,"span",14),ml(),Is(5,"td",15),HC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),HC(9),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,O,4,2),Yw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=dC(2);QE(3),Lg(e.name),QE(),Qw(e.description?4:-1),QE(2),Lg(i.scheduleLabel(e)),QE(2),pg("variant",e.enabled?"accent":"outline"),QE(),Lg(e.enabled?"Enabled":"Disabled"),QE(3),Qw(i.deletion.confirmingId()!==e.id?12:-1),QE(),Qw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Schedule"),ml(),Is(8,"th",10),HC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=dC();QE(14),eC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Fe.WEEK?"week":"month",s=e.unit===Fe.WEEK&&e.days?.length?` (${e.days.map(c=>We[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New scheduled prompt"),ml()(),Yw(4,U,2,1,"p",3),Yw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-ARX7xO57.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-DNpsnpVA.js';import {v}from'./chunk-Dkderx1H.js';import {g,W as W$1,F,K as we,z as zi,U as U$1,ad as ne,a1 as ma,aa as _r,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,s as sC,i as fg,q as mf,r as yf}from'./main-IUUK3O6C.js';import'./chunk-BSz21_Vu.js';var H=(i,e)=>e.key;function U(i,e){if(i&1&&(Is(0,"p",3),HC(1),ml()),i&2){let t=dC();QE(),Lg(t.deletion.error());}}function z(i,e){i&1&&(Is(0,"p",4),HC(1,"Loading AI providers\u2026"),ml());}function J(i,e){i&1&&(Is(0,"p",5),HC(1,"No AI providers available."),ml());}function Q(i,e){i&1&&(Is(0,"p",4),HC(1,"No AI providers match the current filter."),ml());}function W(i,e){i&1&&(Is(0,"ds-tag",17),HC(1,"Read-only"),ml());}function X(i,e){if(i&1){let t=sC();Is(0,"button",22),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.duplicate(d))}),HC(1," Duplicate "),ml();}if(i&2){let t=dC().$implicit;fg("aria-label","Duplicate "+t.config.name);}}function Y(i,e){if(i&1){let t=sC();Is(0,"button",22),Eg("click",function(){mf(t);let d=dC(2).$implicit,c=dC(2);return yf(c.edit(d))}),HC(1," Edit "),ml();}if(i&2){let t=dC(2).$implicit;fg("aria-label","Edit "+t.config.name);}}function Z(i,e){if(i&1){let t=sC();Yw(0,Y,2,1,"button",20),Is(1,"agentos-row-delete-action",23),Eg("deleteRequested",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.deletion.request(d.key))})("deleteConfirmed",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=dC(3);return yf(d.deletion.cancel())}),ml();}if(i&2){let t=dC().$implicit,r=dC(2);Qw(r.deletion.confirmingId()!==t.key?0:-1),QE(),pg("rowKey",t.key)("rowLabel",t.config.name)("state",r.deletion);}}function ee(i,e){i&1&&(Is(0,"button",21),HC(1,"Inherited"),ml());}function te(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15)(7,"ds-tag",16),HC(8),ml(),Yw(9,W,2,0,"ds-tag",17),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,X,2,1,"button",20),Yw(13,Z,2,4)(14,ee,2,0,"button",21),ml()()()),i&2){let t=e.$implicit,r=dC(2);QE(2),Lg(t.config.name),QE(2),Lg(t.config.apiType),QE(3),pg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),QE(),Lg(t.scopeLabel),QE(),Qw(t.canMutate?-1:9),QE(3),Qw(r.deletion.confirmingId()!==t.key?12:-1),QE(),Qw(t.canMutate?13:14);}}function ie(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"API type"),ml(),Is(8,"th",10),HC(9,"Scope"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,te,15,7,"tr",9,H),ml()()()),i&2){let t=dC();QE(14),eC(t.rowFilter.filteredRows());}}var G=class i{route=g(W$1);router=g(F);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=zi(false);isLoading=zi(true);rows=zi([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.apiType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne(e=>e.get("namespaceId")??""),ma(e=>e?this.namespaceRole.isAdminOfNamespace$(e):_r(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,r,d){return e.map((c,K)=>({key:`${t}:${c.id??K}`,config:c,scope:t,scopeLabel:r,canMutate:d}))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-ai-providers-all-scopes"]],decls:9,vars:3,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return r.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),HC(3,"New AI provider"),ml()(),Yw(4,U,2,1,"p",3),Yw(5,z,2,0,"p",4)(6,J,2,0,"p",5)(7,Q,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(QE(),pg("query",r.rowFilter.query()),QE(3),Qw(r.deletion.error()?4:-1),QE(),Qw(r.isLoading()?5:r.rows().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{G as AiProvidersAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,aJ as fe,a6 as A}from'./main-
|
|
1
|
+
import {g,aJ as fe,a6 as A}from'./main-IUUK3O6C.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {aZ as A,a_ as z$1}from'./main-
|
|
1
|
+
import {aZ as A,a_ as z$1}from'./main-IUUK3O6C.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==`
|