@whoz-oss/coday-client 0.0.0-workstream-messaging.11 → 0.0.0-workstream-forge.278
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/chunk-16x50-2o.js +1 -0
- package/browser/chunk-4sEBawqk.js +1 -0
- package/browser/{chunk-BE9_RSN2.js → chunk-6fDAAwY8.js} +1 -1
- package/browser/chunk-7pogBin0.js +1 -0
- package/browser/chunk-9P3XaWWg.js +1 -0
- package/browser/chunk-B4OgWFKq.js +1 -0
- package/browser/chunk-B4f2_ca9.js +2 -0
- package/browser/chunk-BA-i5BKD.js +1 -0
- package/browser/chunk-BBFrt_ui.js +1 -0
- package/browser/chunk-BBhwwK7X.js +1 -0
- package/browser/chunk-BCtndyUL.js +1 -0
- package/browser/chunk-BE6h6pT_.js +1 -0
- package/browser/chunk-BQ5imqmR.js +1 -0
- package/browser/chunk-BSmzFmke.js +1 -0
- package/browser/chunk-BT3Kc2zZ.js +1 -0
- package/browser/chunk-BUz52zHO.js +1 -0
- package/browser/{chunk-DX5hDq00.js → chunk-BXOJ2TCq.js} +1 -1
- package/browser/chunk-BgGkMHQh.js +1 -0
- package/browser/{chunk-Cdc4bldZ.js → chunk-Bi5i4Kkf.js} +1 -1
- package/browser/{chunk-B0uIZBmR.js → chunk-BlijPSJE.js} +1 -1
- package/browser/chunk-Bzw6eX2O.js +2 -0
- package/browser/chunk-C-SfjwGQ.js +1 -0
- package/browser/chunk-C4-DYb1G.js +1 -0
- package/browser/chunk-CB3QL_VJ.js +1 -0
- package/browser/chunk-CODcIR_k.js +1 -0
- package/browser/{chunk-DT39vMjm.js → chunk-CXNhEZjs.js} +1 -1
- package/browser/{chunk-3Gitpl_W.js → chunk-CY2foyNy.js} +1 -1
- package/browser/chunk-Cy47rqqD.js +1 -0
- package/browser/chunk-D3SHcns-.js +1 -0
- package/browser/chunk-DA0pzWja.js +1 -0
- package/browser/chunk-DGXWmn-4.js +1 -0
- package/browser/chunk-DHcXUI30.js +1 -0
- package/browser/{chunk-SMCp3GcF.js → chunk-DSTLb91j.js} +1 -1
- package/browser/chunk-DSY07m68.js +671 -0
- package/browser/chunk-DVqVR--u.js +1 -0
- package/browser/chunk-DWwEMYi2.js +1 -0
- package/browser/chunk-DXhejKLu.js +1 -0
- package/browser/{chunk-CM0r-RA8.js → chunk-DZ4B-YtP.js} +1 -1
- package/browser/chunk-DrmwwKVW.js +1 -0
- package/browser/chunk-Dz60Uxy_.js +1 -0
- package/browser/chunk-InQGdgxF.js +1 -0
- package/browser/chunk-Zao0hsES.js +1 -0
- package/browser/chunk-bP8lCYXZ.js +1 -0
- package/browser/chunk-lXS49hV2.js +1 -0
- package/browser/chunk-s-WZZxtO.js +1 -0
- package/browser/chunk-uWIGwngv.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-4HEE4DSD.js +1253 -0
- package/package.json +1 -1
- package/browser/chunk-3HWaG27c.js +0 -1
- package/browser/chunk-74ukJ4Xi.js +0 -1
- package/browser/chunk-B03vbh4f.js +0 -1
- package/browser/chunk-B3TB_PnM.js +0 -1
- package/browser/chunk-BYbk8T3K.js +0 -1
- package/browser/chunk-BlF0vroR.js +0 -1
- package/browser/chunk-Bn8HYTTM.js +0 -1
- package/browser/chunk-Bsqc_xnw.js +0 -1
- package/browser/chunk-Bvgg4-BU.js +0 -2
- package/browser/chunk-BxIVdFlW.js +0 -1
- package/browser/chunk-BzGzNc-T.js +0 -1
- package/browser/chunk-C1t3O1k4.js +0 -1
- package/browser/chunk-C40WwJqu.js +0 -1
- package/browser/chunk-C4i-jeuv.js +0 -1
- package/browser/chunk-CAAhkREQ.js +0 -1
- package/browser/chunk-CCKO622E.js +0 -1
- package/browser/chunk-CIHlLjrB.js +0 -1
- package/browser/chunk-CM6VQi9F.js +0 -1
- package/browser/chunk-CfX6vIYj.js +0 -1
- package/browser/chunk-Ch-yIotV.js +0 -1
- package/browser/chunk-CiRJa9KR.js +0 -1
- package/browser/chunk-Cmd42Ubi.js +0 -1
- package/browser/chunk-CrFtQd0x.js +0 -1
- package/browser/chunk-CxQaRSXz.js +0 -1
- package/browser/chunk-CzFv-twG.js +0 -1
- package/browser/chunk-D2mdz_SD.js +0 -1
- package/browser/chunk-D5QHsISQ.js +0 -1
- package/browser/chunk-DB_wGI-O.js +0 -1
- package/browser/chunk-DIF7cPtA.js +0 -1
- package/browser/chunk-DXtHX7ac.js +0 -1
- package/browser/chunk-DbK9IJQd.js +0 -1
- package/browser/chunk-Dg0rwtUo.js +0 -1
- package/browser/chunk-DqI0c9B5.js +0 -2
- package/browser/chunk-DwEcQtO1.js +0 -670
- package/browser/chunk-FY_ZYR73.js +0 -1
- package/browser/chunk-QpTN-Nr6.js +0 -1
- package/browser/chunk-axNMhn9i.js +0 -1
- package/browser/chunk-hp_96Xe0.js +0 -1
- package/browser/chunk-nLTwJihI.js +0 -1
- package/browser/chunk-vhSiFYge.js +0 -1
- package/browser/chunk-w7fu2Om4.js +0 -1
- package/browser/main-JXQYBZRK.js +0 -1254
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {g,V,A as A$1,h as he$1,W as W$1,e as ee$1,B,D as Dw,E as Es,f as fg,a as Bw,b as AC,c as hl,d as VE,i as Vw,M as Mg,j as gl,k as Dg,m as ml,p as pg,l as mg,n as lg,$ as $i,o as oT,q as $w,z as zw,r as f,F as Fg,s as $C,t as F,O as Of,C as Co,u as Dl,v as tC,Q as Qw,w as pf,x as hf,y as sh,G as EC,_ as _g}from'./main-4HEE4DSD.js';function ne(t,n){if(t&1&&(gl(0,"p",7),AC(1),ml()),t&2){let e=tC();VE(),Fg(e.state.error());}}var K=class t{state=g(V);onInput(n){this.state.email.set(n.target.value);}submit(n){n.preventDefault(),this.state.submitEmail();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Dw({type:t,selectors:[["app-email-step"]],decls:16,vars:4,consts:[["novalidate","",1,"step",3,"submit"],[1,"step__title"],[1,"step__lead"],[1,"field"],[1,"field__label"],["type","email","name","email","autocomplete","email","placeholder","you@company.com","data-testid","email-input",1,"field__input",3,"input","value"],[1,"field__hint"],["role","alert",1,"step__error"],[1,"step__actions"],["type","submit","data-testid","email-next",1,"btn","btn--primary",3,"disabled"]],template:function(e,o){e&1&&(gl(0,"form",0),Dg("submit",function(c){return o.submit(c)}),gl(1,"h2",1),AC(2,"What is your email?"),ml(),gl(3,"p",2),AC(4," It identifies you in Coday and makes you the administrator of this installation. Nothing is sent anywhere: it stays on this machine. "),ml(),gl(5,"label",3)(6,"span",4),AC(7,"Email"),ml(),gl(8,"input",5),Dg("input",function(c){return o.onInput(c)}),ml(),gl(9,"span",6),AC(10,"We are already downloading AgentOS in the background while you answer."),ml()(),Bw(11,ne,2,1,"p",7),gl(12,"div",8),pg(13,"span"),gl(14,"button",9),AC(15," Continue "),ml()()()),e&2&&(VE(8),mg("value",o.state.email()),lg("aria-invalid",o.state.email()&&!o.state.emailValid()?"true":null),VE(3),Vw(o.state.error()?11:-1),VE(3),mg("disabled",!o.state.emailValid()||o.state.busy()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}"]})};var oe=()=>[],re=(t,n)=>n.path;function ie(t,n){t&1&&(gl(0,"span",21),AC(1,"link"),ml());}function ae(t,n){if(t&1){let e=Qw();gl(0,"li")(1,"button",18),Dg("click",function(){let d=pf(e).$implicit,c=tC();return hf(c.navigate(d.path))}),gl(2,"span",19),AC(3,"\u{1F4C1}"),ml(),gl(4,"span",20),AC(5),ml(),Bw(6,ie,2,0,"span",21),ml()();}if(t&2){let e=n.$implicit;VE(5),Fg(e.name),VE(),Vw(e.symlink?6:-1);}}function le(t,n){t&1&&(gl(0,"li",22),AC(1,"No sub-folders here."),ml());}function de(t,n){if(t&1&&Bw(0,le,2,0,"li",22),t&2){let e=tC();Vw(e.loading()?-1:0);}}function se(t,n){if(t&1){let e=Qw();gl(0,"form",23),Dg("submit",function(d){pf(e);let c=tC();return hf(c.create(d))}),gl(1,"input",24),Dg("input",function(d){pf(e);let c=tC();return hf(c.onName(d))}),ml(),gl(2,"button",25),AC(3,"Create"),ml(),gl(4,"button",16),Dg("click",function(){pf(e);let d=tC();return hf(d.creating.set(false))}),AC(5,"Cancel"),ml()();}if(t&2){let e=tC();VE(),mg("value",e.newName()),VE(),mg("disabled",!e.newName().trim());}}function ce(t,n){if(t&1&&(gl(0,"span"),AC(1),ml()),t&2){let e=tC(2);VE(),Dl("(",e.listing()?.hiddenCount,")");}}function pe(t,n){if(t&1){let e=Qw();gl(0,"button",26),Dg("click",function(){pf(e);let d=tC();return hf(d.startCreate())}),AC(1," + New folder "),ml(),gl(2,"label",27)(3,"input",28),Dg("change",function(){pf(e);let d=tC();return hf(d.toggleHidden())}),ml(),AC(4," Show hidden "),Bw(5,ce,2,1,"span"),ml();}if(t&2){let e=tC();VE(3),mg("checked",e.showHidden()),VE(2),Vw(e.listing()?.hiddenCount?5:-1);}}function me(t,n){if(t&1&&(gl(0,"p",14),AC(1),ml()),t&2){let e=tC();VE(),Fg(e.browseError());}}function _e(t,n){if(t&1&&(gl(0,"p",14),AC(1),ml()),t&2){let e=tC();VE(),Fg(e.state.error());}}var $=class t{state=g(V);listing=$i(null);loading=$i(false);browseError=$i(null);showHidden=$i(false);creating=$i(false);newName=$i("");ngOnInit(){this.open(this.parentOfSelection());}parentOfSelection(){let n=this.state.folder(),e=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));return e>0?n.slice(0,e):void 0}navigate(n){return this.open(n,true)}open(n,e=false){return B(this,null,function*(){this.loading.set(true),this.browseError.set(null);try{let o=yield this.state.browse(n,this.showHidden());this.listing.set(o),e&&this.state.selectFolder(o.path);}catch(o){if(e){this.browseError.set(f(o,"Cannot open this folder."));return}if(n)return this.open(void 0);this.browseError.set(f(o,"Cannot list this folder."));}finally{this.loading.set(false);}})}toggleHidden(){this.showHidden.update(n=>!n),this.open(this.listing()?.path);}startCreate(){this.creating.set(true),this.newName.set("");}onName(n){this.newName.set(n.target.value);}create(n){return B(this,null,function*(){n.preventDefault();let e=this.listing()?.path,o=this.newName().trim();if(!(!e||!o))try{let d=yield this.state.mkdir(e,o);this.creating.set(!1),this.state.selectFolder(d.path),yield this.open(d.path,!0);}catch(d){this.browseError.set(f(d,"Could not create this folder."));}})}submit(){this.state.submitFolderAndApply();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Dw({type:t,selectors:[["app-folder-step"]],decls:32,vars:11,consts:[[1,"step"],[1,"step__title"],[1,"step__lead"],["data-testid","selected-folder",1,"selected"],[1,"selected__label"],[1,"selected__path"],[1,"browser"],[1,"browser__bar"],["type","button","aria-label","Parent folder",1,"browser__icon",3,"click","disabled"],["type","button","aria-label","Home folder",1,"browser__icon",3,"click"],[1,"browser__path",3,"title"],["role","list",1,"browser__list"],[1,"browser__footer"],[1,"browser__new"],["role","alert",1,"step__error"],[1,"step__actions"],["type","button",1,"btn","btn--ghost",3,"click"],["type","button","data-testid","folder-next",1,"btn","btn--primary",3,"click","disabled"],["type","button",1,"entry",3,"click"],["aria-hidden","true"],[1,"entry__name"],[1,"entry__tag"],[1,"browser__empty"],[1,"browser__new",3,"submit"],["type","text","placeholder","New folder name","aria-label","New folder name","data-testid","new-folder-name",1,"field__input",3,"input","value"],["type","submit",1,"btn",3,"disabled"],["type","button","data-testid","new-folder",1,"btn","btn--ghost",3,"click"],[1,"browser__hidden"],["type","checkbox",3,"change","checked"]],template:function(e,o){e&1&&(gl(0,"section",0)(1,"h2",1),AC(2,"Where should Coday keep your files?"),ml(),gl(3,"p",2),AC(4," The agent reads and writes the files of your personal workspace in this folder. The default is fine for most people; it is created if it does not exist. To choose another one, open it below. "),ml(),gl(5,"div",3)(6,"span",4),AC(7,"Selected folder"),ml(),gl(8,"code",5),AC(9),ml()(),gl(10,"div",6)(11,"div",7)(12,"button",8),Dg("click",function(){return o.navigate(o.listing()?.parent??void 0)}),AC(13," \u2191 "),ml(),gl(14,"button",9),Dg("click",function(){return o.navigate(o.listing()?.home)}),AC(15," \u2302 "),ml(),gl(16,"code",10),AC(17),ml()(),gl(18,"ul",11),$w(19,ae,7,2,"li",null,re,false,de,1,1),ml(),gl(22,"div",12),Bw(23,se,6,2,"form",13)(24,pe,6,2),ml()(),Bw(25,me,2,1,"p",14),Bw(26,_e,2,1,"p",14),gl(27,"div",15)(28,"button",16),Dg("click",function(){return o.state.back()}),AC(29,"Back"),ml(),gl(30,"button",17),Dg("click",function(){return o.submit()}),AC(31," Set everything up "),ml()()()),e&2&&(VE(9),Fg(o.state.folder()),VE(3),mg("disabled",!o.listing()?.parent),VE(4),mg("title",o.listing()?.path??""),VE(),Fg(o.listing()?.path),VE(),lg("aria-busy",o.loading()),VE(),zw(o.listing()?.entries??$C(10,oe)),VE(4),Vw(o.creating()?23:24),VE(2),Vw(o.browseError()?25:-1),VE(),Vw(o.state.error()?26:-1),VE(4),mg("disabled",!o.state.folderValid()||o.state.busy()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".selected[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--color-primary) 8%,transparent)}.selected__label[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-secondary)}.selected__path[_ngcontent-%COMP%]{font-size:14px;word-break:break-all}.browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid var(--color-border);border-radius:14px;overflow:hidden}.browser__bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px;background:var(--color-surface-muted);border-bottom:1px solid var(--color-border)}.browser__icon[_ngcontent-%COMP%]{flex:none;width:32px;height:32px;font:inherit;color:var(--color-text);background:var(--color-bg-hover);border:none;border-radius:8px;cursor:pointer}.browser__icon[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:default}.browser__path[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.browser__list[_ngcontent-%COMP%]{margin:0;padding:4px;max-height:220px;overflow-y:auto;list-style:none}.browser__empty[_ngcontent-%COMP%]{padding:18px;text-align:center;font-size:13px;color:var(--color-text-tertiary)}.browser__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-top:1px solid var(--color-border)}.browser__new[_ngcontent-%COMP%]{display:flex;flex:1;gap:8px}.browser__new[_ngcontent-%COMP%] .field__input[_ngcontent-%COMP%]{padding:8px 12px}.browser__hidden[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--color-text-secondary)}.entry[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;font:inherit;color:var(--color-text);text-align:left;background:transparent;border:none;border-radius:8px;cursor:pointer}.entry[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.entry[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary)}.entry__name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entry__tag[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-tertiary)}"]})};var ge=(t,n)=>n.key;function ue(t,n){if(t&1){let e=Qw();gl(0,"div",1)(1,"div",2),AC(2,"\u2713"),ml(),gl(3,"h2",3),AC(4,"You are all set"),ml(),gl(5,"p",4),AC(6,"Your workspace is ready and the Coday agent is waiting for you."),ml(),gl(7,"button",5),Dg("click",function(){pf(e);let d=tC();return hf(d.start())}),AC(8," Start with Coday "),ml()();}}function xe(t,n){t&1&&(gl(0,"h2",11),AC(1,"Starting Coday"),ml(),gl(2,"p",4),AC(3,"Just a moment, you will land in the app by yourself."),ml());}function be(t,n){t&1&&(gl(0,"h2",3),AC(1,"Setting things up"),ml(),gl(2,"p",4),AC(3,"This only happens once. You can keep this page open."),ml());}function fe(t,n){t&1&&pg(0,"span",14);}function ye(t,n){if(t&1&&AC(0),t&2){let e=tC().$implicit,o=tC(2);Dl(" ",o.icon(e.state)," ");}}function ve(t,n){if(t&1&&(gl(0,"span",18),pg(1,"span",19),ml(),gl(2,"span",17),AC(3),ml()),t&2){let e=tC().$implicit;lg("aria-valuenow",e.percent??0),VE(),_g("width",e.percent??0,"%"),VE(2),Dl("",e.percent??0,"%");}}function Ce(t,n){if(t&1&&(gl(0,"span",17),AC(1),ml()),t&2){let e=tC().$implicit;VE(),Fg(e.message);}}function he(t,n){if(t&1&&(gl(0,"li",12)(1,"span",13),Bw(2,fe,1,0,"span",14)(3,ye,1,1),ml(),gl(4,"span",15)(5,"span",16),AC(6),ml(),Bw(7,ve,4,4)(8,Ce,2,1,"span",17),ml()()),t&2){let e=n.$implicit;EC("item item--"+e.state),lg("data-testid","step-"+e.key)("data-state",e.state),VE(2),Vw(e.state==="running"?2:3),VE(4),Fg(e.label),VE(),Vw(e.key==="download"&&e.state==="running"?7:e.message?8:-1);}}function Ee(t,n){if(t&1&&(gl(0,"div",8)(1,"strong"),AC(2,"Java 25 is required."),ml(),gl(3,"span"),AC(4),ml(),gl(5,"span"),AC(6,"Install it, then come back: this page continues by itself."),ml()()),t&2){let e=tC(2);VE(4),Fg(e.javaHint());}}function Pe(t,n){if(t&1){let e=Qw();gl(0,"div",9)(1,"strong"),AC(2,"Something went wrong."),ml(),gl(3,"span"),AC(4),ml(),gl(5,"span"),AC(6,"Fix your answers and run the setup again, or retry as is."),ml(),gl(7,"div",20)(8,"button",21),Dg("click",function(){pf(e);let d=tC(2);return hf(d.state.editAfterFailure("providers"))}),AC(9," Change the API keys "),ml(),gl(10,"button",22),Dg("click",function(){pf(e);let d=tC(2);return hf(d.state.editAfterFailure("folder"))}),AC(11," Change the folder "),ml(),gl(12,"button",23),Dg("click",function(){pf(e);let d=tC(2);return hf(d.retry())}),AC(13," Try again "),ml()()();}if(t&2){let e=tC(2);VE(4),Fg(e.applyError()),VE(4),mg("disabled",e.state.busy()),VE(2),mg("disabled",e.state.busy()),VE(2),mg("disabled",e.state.busy());}}function we(t,n){if(t&1&&(gl(0,"p",10),AC(1),ml()),t&2){let e=tC(2);VE(),Fg(e.state.statusError());}}function Me(t,n){if(t&1&&(Bw(0,xe,4,0)(1,be,4,0),gl(2,"ul",6),$w(3,he,9,7,"li",7,ge),ml(),Bw(5,Ee,7,1,"div",8),Bw(6,Pe,14,4,"div",9),Bw(7,we,2,1,"p",10)),t&2){let e=tC();Vw(e.loading()?0:1),VE(3),zw(e.items()),VE(2),Vw(e.state.javaBlocked()?5:-1),VE(),Vw(!e.loading()&&e.state.failed()?6:-1),VE(),Vw(e.state.statusError()?7:-1);}}var Se={pending:"\u25CB",running:"",done:"\u2713",error:"!",blocked:"!"},j=class t{state=g(V);router=g(F);icon=n=>Se[n];javaHint=oT(()=>this.state.status()?.steps.java.hint??"");applyError=oT(()=>this.state.status()?.apply.error??null);loading=oT(()=>this.state.mode()==="loading");items=oT(()=>this.loading()?this.state.loadingChecklist():this.state.checklist());leaving=false;constructor(){Of(()=>{!this.loading()||!this.state.loadingReady()||this.state.preview()||Co(()=>{this.leaveToPersonalNamespace();});});}start(){let n=this.state.landingCommands();n&&this.leave(n);}leaveToPersonalNamespace(){return B(this,null,function*(){this.leaving||(this.leaving=true,this.state.stopPolling(),this.leave(yield this.state.loadingTarget()));})}leave(n){this.state.stopPolling(),this.router.navigate([n.path],{queryParams:n.queryParams});}retry(){this.state.retry();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Dw({type:t,selectors:[["app-progress-step"]],decls:3,vars:1,consts:[[1,"step"],["data-testid","ready",1,"ready"],["aria-hidden","true",1,"ready__badge"],[1,"step__title"],[1,"step__lead"],["type","button","data-testid","start-with-coday",1,"btn","btn--primary","btn--big",3,"click"],["role","list","data-testid","checklist",1,"checklist"],[1,"item",3,"class"],["role","alert","data-testid","java-hint",1,"callout"],["role","alert","data-testid","apply-error",1,"callout","callout--error"],["role","status",1,"step__error"],["data-testid","loading-title",1,"step__title"],[1,"item"],["aria-hidden","true",1,"item__icon"],[1,"spinner"],[1,"item__body"],[1,"item__label"],[1,"item__note"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"bar"],[1,"bar__fill"],[1,"callout__actions"],["type","button","data-testid","edit-providers",1,"btn",3,"click","disabled"],["type","button","data-testid","edit-folder",1,"btn",3,"click","disabled"],["type","button","data-testid","retry",1,"btn","btn--ghost",3,"click","disabled"]],template:function(e,o){e&1&&(gl(0,"section",0),Bw(1,ue,9,0,"div",1)(2,Me,8,4),ml()),e&2&&(VE(),Vw(!o.loading()&&o.state.ready()?1:2));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".checklist[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;padding:10px 12px;border-radius:12px;color:var(--color-text-tertiary);transition:color .2s,background .2s}.item--running[_ngcontent-%COMP%]{color:var(--color-text);background:color-mix(in srgb,var(--color-primary) 8%,transparent)}.item--done[_ngcontent-%COMP%]{color:var(--color-text)}.item--error[_ngcontent-%COMP%], .item--blocked[_ngcontent-%COMP%]{color:var(--color-text);background:color-mix(in srgb,var(--color-warning) 12%,transparent)}.item--error[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-error) 12%,transparent)}.item__icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:none;width:22px;height:22px;font-size:13px;font-weight:700;border-radius:50%;border:1.5px solid currentColor}.item--done[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-success);border-color:var(--color-success)}.item--error[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-error);border-color:var(--color-error)}.item--blocked[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-warning);border-color:var(--color-warning)}.item--running[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{border-color:transparent}.item__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}.item__label[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:22px;font-size:14px;font-weight:540;line-height:1.3}.item__note[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-secondary);word-break:break-word}.spinner[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;border:2px solid color-mix(in srgb,var(--color-primary) 25%,transparent);border-top-color:var(--color-primary);animation:_ngcontent-%COMP%_spin .8s linear infinite}.bar[_ngcontent-%COMP%]{display:block;height:6px;border-radius:999px;overflow:hidden;background:var(--color-border)}.bar__fill[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--color-primary),var(--color-accent));transition:width .4s ease}.callout[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 16px;border-radius:12px;font-size:13px;line-height:1.5;background:color-mix(in srgb,var(--color-warning) 14%,transparent)}.callout[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .callout[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{word-break:break-word}.callout--error[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-error) 12%,transparent)}.callout__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.ready[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:16px;padding:24px 0;text-align:center;animation:_ngcontent-%COMP%_pop .42s cubic-bezier(.2,.9,.3,1.2) both}.ready__badge[_ngcontent-%COMP%]{display:grid;place-items:center;width:64px;height:64px;font-size:32px;color:var(--color-text-inverse);border-radius:50%;background:var(--color-success);box-shadow:0 8px 24px color-mix(in srgb,var(--color-success) 40%,transparent)}@media(prefers-reduced-motion:reduce){.spinner[_ngcontent-%COMP%]{animation-duration:2.4s}.ready[_ngcontent-%COMP%]{animation:none}.bar__fill[_ngcontent-%COMP%]{transition:none}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_pop{0%{opacity:0;transform:scale(.92)}}"]})};var Oe=(t,n)=>n.draft.id;function ke(t,n){if(t&1){let e=Qw();gl(0,"span",17)(1,"button",18),Dg("click",function(){pf(e);let d=tC(2).$implicit,c=tC();return hf(c.state.moveProvider(d.draft.id,-1))}),AC(2," \u2191 "),ml(),gl(3,"button",19),Dg("click",function(){pf(e);let d=tC(2).$implicit,c=tC();return hf(c.state.moveProvider(d.draft.id,1))}),AC(4," \u2193 "),ml()();}if(t&2){let e=tC(2).$implicit,o=tC();VE(),mg("disabled",e.rank===1),VE(2),mg("disabled",e.rank===o.enabledCount());}}function Te(t,n){if(t&1&&(gl(0,"span",16),AC(1),ml(),Bw(2,ke,5,2,"span",17)),t&2){let e=tC().$implicit,o=tC();lg("aria-label","Rank "+e.rank),VE(),Dl("#",e.rank),VE(),Vw(o.enabledCount()>1?2:-1);}}function Ie(t,n){if(t&1){let e=Qw();gl(0,"label",15)(1,"span",20),AC(2,"API key"),ml(),gl(3,"input",21),Dg("input",function(d){pf(e);let c=tC().$implicit,h=tC();return hf(h.onKey(c.draft.id,d))})("keydown",function(d){pf(e);let c=tC().$implicit,h=tC();return hf(h.onCardKeydown(c.draft.id,d))}),ml(),gl(4,"span",22),AC(5," Stored on this machine only. "),gl(6,"a",23),AC(7,"Get a key"),ml()()();}if(t&2){let e=tC().$implicit,o=tC();VE(3),mg("value",e.draft.apiKey),lg("data-testid","provider-key-"+e.draft.id)("aria-invalid",o.keyTooShort(e.draft.id)?"true":null),VE(3),mg("href",e.info.keyUrl,sh);}}function De(t,n){if(t&1){let e=Qw();gl(0,"li",9),Dg("dragstart",function(d){let c=pf(e).$implicit,h=tC();return hf(h.onDragStart(c.draft.id,d))})("dragover",function(d){let c=pf(e).$implicit,h=tC();return hf(h.onDragOver(c.draft.id,d))})("drop",function(d){let c=pf(e).$implicit,h=tC();return hf(h.onDrop(c.draft.id,d))})("dragend",function(){pf(e);let d=tC();return hf(d.onDragEnd())}),gl(1,"div",10)(2,"label",11)(3,"input",12),Dg("change",function(){let d=pf(e).$implicit,c=tC();return hf(c.state.toggleProvider(d.draft.id))})("keydown",function(d){let c=pf(e).$implicit,h=tC();return hf(h.onCardKeydown(c.draft.id,d))}),ml(),gl(4,"span",13),AC(5),ml()(),Bw(6,Te,3,3),ml(),gl(7,"p",14),AC(8),ml(),Bw(9,Ie,8,4,"label",15),ml();}if(t&2){let e=n.$implicit,o=tC();Mg("card--on",e.draft.enabled)("card--dragging",o.dragging()===e.draft.id)("card--over",o.dragOver()===e.draft.id&&o.dragging()!==e.draft.id),lg("draggable",e.draft.enabled&&o.enabledCount()>1?"true":null)("data-testid","provider-"+e.draft.id),VE(3),mg("checked",e.draft.enabled),lg("data-testid","provider-toggle-"+e.draft.id),VE(2),Fg(e.info.label),VE(),Vw(e.rank!==null?6:-1),VE(2),Fg(e.info.description),VE(),Vw(e.draft.enabled?9:-1);}}function Fe(t,n){if(t&1&&(gl(0,"p",5),AC(1),ml()),t&2){let e=tC();VE(),Fg(e.state.error());}}function Ve(t,n){if(t&1){let e=Qw();gl(0,"button",24),Dg("click",function(){pf(e);let d=tC();return hf(d.state.back())}),AC(1,"Back"),ml();}}var ee=[{id:"anthropic",label:"Anthropic",description:"Claude models, directly from Anthropic.",keyUrl:"https://console.anthropic.com/settings/keys"},{id:"openai",label:"OpenAI",description:"GPT models, directly from OpenAI.",keyUrl:"https://platform.openai.com/api-keys"},{id:"requesty",label:"Requesty",description:"Requires Requesty policies named claude-fable, claude-opus, claude-sonnet and claude-haiku configured in your account.",keyUrl:"https://app.requesty.ai/api-keys"}],W=class t{state=g(V);dragging=$i(null);dragOver=$i(null);info=oT(()=>this.state.status()?.providers??ee);cards=oT(()=>this.state.providers().map(n=>({draft:n,info:this.info().find(e=>e.id===n.id)??ee.find(e=>e.id===n.id),rank:this.state.rankOf(n.id)})));enabledCount=oT(()=>this.state.enabledProviders().length);onKey(n,e){this.state.setApiKey(n,e.target.value);}keyTooShort(n){let e=this.state.providers().find(o=>o.id===n);return !!e&&e.enabled&&e.apiKey.length>0&&e.apiKey.trim().length<8}onDragStart(n,e){this.dragging.set(n),e.dataTransfer?.setData("text/plain",n),e.dataTransfer&&(e.dataTransfer.effectAllowed="move");}onDragOver(n,e){!this.dragging()||this.state.rankOf(n)===null||(e.preventDefault(),this.dragOver.set(n));}onDrop(n,e){e.preventDefault();let o=this.dragging();o&&this.state.moveProviderTo(o,n),this.onDragEnd();}onDragEnd(){this.dragging.set(null),this.dragOver.set(null);}onCardKeydown(n,e){e.altKey&&(e.key==="ArrowUp"?(e.preventDefault(),this.state.moveProvider(n,-1)):e.key==="ArrowDown"&&(e.preventDefault(),this.state.moveProvider(n,1)));}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Dw({type:t,selectors:[["app-providers-step"]],decls:13,vars:3,consts:[[1,"step"],[1,"step__title"],[1,"step__lead"],["role","list",1,"cards"],[1,"card",3,"card--on","card--dragging","card--over"],["role","alert",1,"step__error"],[1,"step__actions"],["type","button",1,"btn","btn--ghost"],["type","button","data-testid","providers-next",1,"btn","btn--primary",3,"click","disabled"],[1,"card",3,"dragstart","dragover","drop","dragend"],[1,"card__head"],[1,"card__toggle"],["type","checkbox",3,"change","keydown","checked"],[1,"card__name"],[1,"card__desc"],[1,"field"],[1,"card__rank"],[1,"card__move"],["type","button","aria-label","Prefer this provider more",1,"card__arrow",3,"click","disabled"],["type","button","aria-label","Prefer this provider less",1,"card__arrow",3,"click","disabled"],[1,"field__label"],["type","password","autocomplete","off","spellcheck","false","placeholder","Paste your key",1,"field__input",3,"input","keydown","value"],[1,"field__hint"],["target","_blank","rel","noopener noreferrer",3,"href"],["type","button",1,"btn","btn--ghost",3,"click"]],template:function(e,o){e&1&&(gl(0,"section",0)(1,"h2",1),AC(2,"Which models do you want to use?"),ml(),gl(3,"p",2),AC(4," Pick at least one provider and paste its API key. With several, drag the cards (or use the arrows) to say which one you prefer for shared model aliases. The default alias for utility calls is currently provided only by Requesty, regardless of this order. "),ml(),gl(5,"ul",3),$w(6,De,10,14,"li",4,Oe),ml(),Bw(8,Fe,2,1,"p",5),gl(9,"div",6),Bw(10,Ve,2,0,"button",7),gl(11,"button",8),Dg("click",function(){return o.state.submitProviders()}),AC(12," Continue "),ml()()()),e&2&&(VE(6),zw(o.cards()),VE(2),Vw(o.state.error()?8:-1),VE(2),Vw(o.state.emailLocked()?-1:10),VE(),mg("disabled",!o.state.providersValid()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin:0;padding:0;list-style:none}.card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--color-border);border-radius:14px;background:var(--color-surface-muted);transition:border-color .18s,background .18s,box-shadow .18s,transform .18s}.card--on[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--color-primary) 60%,transparent);background:color-mix(in srgb,var(--color-primary) 7%,transparent)}.card[draggable=true][_ngcontent-%COMP%]{cursor:grab}.card--dragging[_ngcontent-%COMP%]{opacity:.5;transform:scale(.99)}.card--over[_ngcontent-%COMP%]{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.card__head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.card__toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;flex:1;cursor:pointer}.card__toggle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:18px;height:18px;accent-color:var(--color-primary)}.card__name[_ngcontent-%COMP%]{font-weight:620;font-size:16px}.card__rank[_ngcontent-%COMP%]{padding:2px 10px;font-size:12px;font-weight:650;border-radius:999px;color:var(--color-text-inverse);background:var(--color-primary)}.card__move[_ngcontent-%COMP%]{display:inline-flex;gap:4px}.card__arrow[_ngcontent-%COMP%]{width:28px;height:28px;font:inherit;color:var(--color-text);background:var(--color-bg-hover);border:none;border-radius:8px;cursor:pointer}.card__arrow[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:default}.card__arrow[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary)}.card__desc[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--color-text-secondary)}a[_ngcontent-%COMP%]{color:var(--color-link)}@media(prefers-reduced-motion:reduce){.card[_ngcontent-%COMP%]{transition:none}}"]})};var ze=(t,n)=>n.name;function Ne(t,n){if(t&1){let e=Qw();gl(0,"label",3)(1,"span",7),AC(2,"Email"),ml(),gl(3,"input",8),Dg("input",function(d){pf(e);let c=tC();return hf(c.onEmail(d))}),ml(),gl(4,"span",9),AC(5,"Saved in your personal settings."),ml()();}if(t&2){let e=tC();VE(3),mg("value",e.state.profileEmail()),lg("aria-invalid",e.state.profileEmail()&&!e.state.profileEmailValid()?"true":null);}}function Le(t,n){if(t&1){let e=Qw();gl(0,"li")(1,"label",3)(2,"span",7),AC(3),ml(),gl(4,"input",11),Dg("input",function(d){let c=pf(e).$implicit,h=tC(2);return hf(h.onKey(c.name,d))}),ml(),gl(5,"span",9),AC(6,"Saved in your personal settings, used for you only."),ml()()();}if(t&2){let e=n.$implicit,o=tC(2);VE(3),Fg(e.name),VE(),mg("value",e.apiKey),lg("data-testid","user-key-"+e.name)("aria-invalid",o.keyTooShort(e.apiKey)?"true":null);}}function Ke(t,n){if(t&1&&(gl(0,"p",2),AC(1,"Paste a key for at least one of these providers, the others are optional."),ml(),gl(2,"ul",10),$w(3,Le,7,4,"li",null,ze),ml()),t&2){let e=tC();VE(3),zw(e.state.userKeys());}}function $e(t,n){if(t&1&&(gl(0,"p",4),AC(1),ml()),t&2){let e=tC();VE(),Fg(e.state.error());}}var je=8,A=class t{state=g(V);onEmail(n){this.state.setProfileEmail(n.target.value);}onKey(n,e){this.state.setUserKey(n,e.target.value);}keyTooShort(n){return n.length>0&&n.trim().length<je}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Dw({type:t,selectors:[["app-user-keys-step"]],decls:12,vars:4,consts:[[1,"step"],[1,"step__title"],[1,"step__lead"],[1,"field"],["role","alert",1,"step__error"],[1,"step__actions"],["type","button","data-testid","user-keys-save",1,"btn","btn--primary",3,"click","disabled"],[1,"field__label"],["type","email","autocomplete","email","placeholder","you@company.com","data-testid","profile-email",1,"field__input",3,"input","value"],[1,"field__hint"],["role","list","data-testid","user-keys",1,"keys"],["type","password","autocomplete","off","spellcheck","false","placeholder","Paste your key",1,"field__input",3,"input","value"]],template:function(e,o){e&1&&(gl(0,"section",0)(1,"h2",1),AC(2,"Complete your profile"),ml(),gl(3,"p",2),AC(4," Your platform provides the AI providers, and Coday needs your email and at least one personal API key to start. "),ml(),Bw(5,Ne,6,2,"label",3),Bw(6,Ke,5,0),Bw(7,$e,2,1,"p",4),gl(8,"div",5),pg(9,"span"),gl(10,"button",6),Dg("click",function(){return o.state.submitProfile()}),AC(11," Save and continue "),ml()()()),e&2&&(VE(5),Vw(o.state.needsEmail()?5:-1),VE(),Vw(o.state.needsUserKeys()?6:-1),VE(),Vw(o.state.error()?7:-1),VE(3),mg("disabled",!o.state.profileValid()||o.state.busy()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".keys[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;margin:0;padding:0;list-style:none}"]})};var We=(t,n)=>n.id;function Ae(t,n){t&1&&(Es(0,"p",3),AC(1),hl()),t&2&&(VE(),Dl(" Preview: ",n,". Nothing is saved and this page stays here. "));}function Ue(t,n){t&1&&(Es(0,"h1",6),AC(1,"Coday"),hl());}function He(t,n){t&1&&(Es(0,"h1",6),AC(1,"Welcome to Coday"),hl(),Es(2,"p",10),AC(3,"A few questions, then you are working with your first agent."),hl());}function Re(t,n){if(t&1&&(Es(0,"li",12)(1,"span",13),AC(2),hl(),Es(3,"span",14),AC(4),hl()()),t&2){let e=n.$implicit,o=n.$index,d=tC(2);Mg("stepper__item--active",d.state.step()===e.id)("stepper__item--done",o<d.state.stepIndex()),lg("aria-current",d.state.step()===e.id?"step":null),VE(2),Fg(o<d.state.stepIndex()?"\u2713":o+1),VE(2),Fg(e.label);}}function Ye(t,n){if(t&1&&(Es(0,"ol",7),$w(1,Re,5,7,"li",11,We),hl()),t&2){let e=tC();VE(),zw(e.steps);}}function qe(t,n){if(t&1&&(Es(0,"p",8),AC(1),hl()),t&2){let e=tC();VE(),Fg(e.state.statusError());}}function Be(t,n){t&1&&fg(0,"app-email-step");}function Ge(t,n){t&1&&fg(0,"app-providers-step");}function Je(t,n){t&1&&fg(0,"app-folder-step");}function Ze(t,n){t&1&&fg(0,"app-user-keys-step");}function Qe(t,n){t&1&&fg(0,"app-progress-step");}function Xe(t,n){if(t&1&&Bw(0,Ze,1,0,"app-user-keys-step")(1,Qe,1,0,"app-progress-step"),t&2){let e=tC();Vw(e.state.mode()==="loading"&&e.state.needsProfile()?0:1);}}var et={email:"You",providers:"Models",folder:"Files",progress:"Launch"},te=class t{state=g(V);steps=A$1.map(n=>({id:n,label:et[n]}));injector=g(he$1);route=g(W$1);ngOnInit(){this.applyTheme(),this.state.init(ee$1(this.route.snapshot.queryParamMap.get("preview")));}ngOnDestroy(){this.state.stopPolling();}applyTheme(){return B(this,null,function*(){try{let{THEME_PORT:n}=yield import('./chunk-DSY07m68.js').then(function(n){return n.ad});this.injector.get(n);}catch(n){}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Dw({type:t,selectors:[["app-welcome"]],decls:17,vars:7,consts:[[1,"welcome"],["aria-hidden","true",1,"welcome__aurora"],["aria-live","polite",1,"welcome__card"],["data-testid","preview-badge",1,"welcome__preview"],[1,"welcome__header"],["aria-hidden","true",1,"welcome__logo"],[1,"welcome__title"],["aria-label","Setup progress",1,"stepper"],["role","alert",1,"welcome__banner","welcome__banner--error"],[1,"welcome__step"],[1,"welcome__subtitle"],[1,"stepper__item",3,"stepper__item--active","stepper__item--done"],[1,"stepper__item"],[1,"stepper__dot"],[1,"stepper__label"]],template:function(e,o){if(e&1&&(Es(0,"main",0),fg(1,"div",1),Es(2,"section",2),Bw(3,Ae,2,1,"p",3),Es(4,"header",4)(5,"div",5),AC(6,"C"),hl(),Es(7,"div"),Bw(8,Ue,2,0,"h1",6)(9,He,4,0),hl()(),Bw(10,Ye,3,0,"ol",7),Bw(11,qe,2,1,"p",8),Es(12,"div",9),Bw(13,Be,1,0,"app-email-step")(14,Ge,1,0,"app-providers-step")(15,Je,1,0,"app-folder-step")(16,Xe,2,1),hl()()()),e&2){let d,c;VE(3),Vw((d=o.state.preview())?3:-1,d),VE(5),Vw(o.state.mode()==="loading"?8:9),VE(2),Vw(o.state.mode()==="wizard"?10:-1),VE(),Vw(o.state.statusError()&&!o.state.status()?11:-1),VE(),Mg("welcome__step--loading",o.state.mode()==="loading"),VE(),Vw((c=o.state.step())==="email"?13:c==="providers"?14:c==="folder"?15:c==="progress"?16:-1);}},dependencies:[K,W,$,j,A],styles:['[_nghost-%COMP%]{display:block;min-height:100vh;background:var(--color-bg);color:var(--color-text)}.welcome[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;min-height:100vh;padding:32px 16px;overflow:hidden}.welcome__aurora[_ngcontent-%COMP%]{position:absolute;inset:-20%;background:radial-gradient(40% 40% at 20% 25%,color-mix(in srgb,var(--color-primary) 28%,transparent),transparent 70%),radial-gradient(35% 35% at 80% 20%,color-mix(in srgb,var(--color-accent) 24%,transparent),transparent 70%),radial-gradient(45% 45% at 60% 85%,color-mix(in srgb,var(--color-info) 18%,transparent),transparent 70%);pointer-events:none}.welcome__card[_ngcontent-%COMP%]{position:relative;width:100%;max-width:640px;padding:32px;border-radius:20px;background:var(--glass-bg);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);animation:_ngcontent-%COMP%_rise .48s cubic-bezier(.2,.8,.2,1) both}.welcome__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-bottom:24px}.welcome__preview[_ngcontent-%COMP%]{margin:0 0 16px;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:560;color:var(--color-text-secondary);background:color-mix(in srgb,var(--color-warning) 14%,transparent)}.welcome__logo[_ngcontent-%COMP%]{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;font-size:24px;font-weight:700;color:var(--color-text-inverse);background:linear-gradient(135deg,var(--color-primary),var(--color-accent));box-shadow:0 6px 18px color-mix(in srgb,var(--color-primary) 40%,transparent)}.welcome__title[_ngcontent-%COMP%]{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.welcome__subtitle[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--color-text-secondary);font-size:14px}.welcome__banner[_ngcontent-%COMP%]{margin:0 0 16px;padding:10px 14px;border-radius:10px;font-size:13px}.welcome__banner--error[_ngcontent-%COMP%]{color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.welcome__step[_ngcontent-%COMP%]{min-height:280px;animation:_ngcontent-%COMP%_fade .24s ease both}.welcome__step--loading[_ngcontent-%COMP%]{min-height:0}.stepper[_ngcontent-%COMP%]{display:flex;gap:8px;margin:0 0 28px;padding:0;list-style:none}.stepper__item[_ngcontent-%COMP%]{display:flex;flex:1;align-items:center;gap:8px;font-size:12px;font-weight:500;color:var(--color-text-tertiary);transition:color .2s}.stepper__item[_ngcontent-%COMP%]:after{content:"";flex:1;height:2px;border-radius:2px;background:var(--color-border)}.stepper__item[_ngcontent-%COMP%]:last-child:after{display:none}.stepper__item--active[_ngcontent-%COMP%]{color:var(--color-text)}.stepper__item--done[_ngcontent-%COMP%]{color:var(--color-success)}.stepper__item--done[_ngcontent-%COMP%]:after{background:var(--color-success)}.stepper__dot[_ngcontent-%COMP%]{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;font-size:12px;border:1.5px solid currentColor;transition:background .2s,color .2s}.stepper__item--active[_ngcontent-%COMP%] .stepper__dot[_ngcontent-%COMP%]{background:var(--color-primary);border-color:var(--color-primary);color:var(--color-text-inverse)}.stepper__item--done[_ngcontent-%COMP%] .stepper__dot[_ngcontent-%COMP%]{background:var(--color-success);border-color:var(--color-success);color:var(--color-text-inverse)}@media(max-width:520px){.welcome__card[_ngcontent-%COMP%]{padding:22px 18px}.stepper__label[_ngcontent-%COMP%]{display:none}}@media(prefers-reduced-motion:reduce){.welcome__card[_ngcontent-%COMP%], .welcome__step[_ngcontent-%COMP%]{animation:none}}@keyframes _ngcontent-%COMP%_rise{0%{opacity:0;transform:translateY(14px)}}@keyframes _ngcontent-%COMP%_fade{0%{opacity:0}}']})};
|
|
2
|
+
export{te as WelcomeComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {s}from'./chunk-DSY07m68.js';import {g,W,J as Jm,H as y,D as Dw,j as gl,b as AC,m as ml,d as VE,F as Fg}from'./main-4HEE4DSD.js';var A=class r{route=g(W);http=g(Jm);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(s,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(s,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Dw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(gl(0,"p",0),AC(1),ml()),t&2&&(VE(),Fg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-Zao0hsES.js';import {I}from'./chunk-BgGkMHQh.js';import {g,W,t as F,K as we,$ as $i,U,ad as ne$1,a1 as ga,aa as br,aM as ui,a2 as ha,ac as by,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,G as EC,n as lg,u as Dl,q as $w,z as zw,Q as Qw,w as pf,x as hf}from'./main-4HEE4DSD.js';import {q as k,O,a5 as w,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-DSY07m68.js';import'./chunk-7pogBin0.js';var Q=(i,t)=>t.key;function X(i,t){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let e=tC();VE(),Fg(e.deletion.error());}}function Z(i,t){if(i&1&&(Es(0,"p"),AC(1),hl()),i&2){let e=t;EC(e.kind==="error"?"settings-table__error":"settings-table__status"),lg("role",e.kind==="error"?"alert":"status"),VE(),Dl(" ",e.text," ");}}function ee(i,t){i&1&&(Es(0,"p",5),AC(1,"Loading auth settings\u2026"),hl());}function te(i,t){i&1&&(Es(0,"p",6),AC(1,"No auth settings available."),hl());}function ne(i,t){i&1&&(Es(0,"p",5),AC(1,"No auth settings match the current filter."),hl());}function ie(i,t){i&1&&(Es(0,"ds-tag",18),AC(1,"Read-only"),hl());}function oe(i,t){i&1&&(Es(0,"ds-tag",20),AC(1,"Connected"),hl());}function ae(i,t){i&1&&(Es(0,"ds-tag",18),AC(1,"Not connected"),hl());}function se(i,t){i&1&&(Es(0,"span",21),AC(1,"\u2014"),hl());}function re(i,t){if(i&1){let e=Qw();Es(0,"span",26),AC(1,"Waiting for authorization\u2026"),hl(),Es(2,"button",27),vg("click",function(){pf(e);let r=tC(4);return hf(r.cancelConnect())}),AC(3," Cancel "),hl();}if(i&2){let e=tC(2).$implicit;VE(2),lg("aria-label","Stop waiting for the authorization of "+e.config.name);}}function le(i,t){if(i&1){let e=Qw();Es(0,"span",28),AC(1,"Disconnect?"),hl(),Es(2,"button",29),vg("click",function(){pf(e);let r=tC(2).$implicit,d=tC(2);return hf(d.confirmReset(r))}),AC(3),hl(),Es(4,"button",29),vg("click",function(){pf(e);let r=tC(4);return hf(r.cancelReset())}),AC(5," Cancel "),hl();}if(i&2){let e=tC(2).$implicit,n=tC(2);VE(2),dg("disabled",n.resettingKey()===e.key),lg("aria-label","Confirm disconnecting "+e.config.name),VE(),Dl(" ",n.resettingKey()===e.key?"Disconnecting\u2026":"Confirm"," "),VE(),dg("disabled",n.resettingKey()===e.key),lg("aria-label","Cancel disconnecting "+e.config.name);}}function ce(i,t){if(i&1){let e=Qw();Es(0,"button",29),vg("click",function(){pf(e);let r=tC(3).$implicit,d=tC(2);return hf(d.requestReset(r))}),AC(1," Disconnect "),hl();}if(i&2){let e=tC(3).$implicit,n=tC(2);dg("disabled",n.connectingKey()!==null),lg("aria-label","Disconnect "+e.config.name);}}function de(i,t){if(i&1){let e=Qw();Es(0,"button",29),vg("click",function(){pf(e);let r=tC(2).$implicit,d=tC(2);return hf(d.connect(r))}),AC(1),hl(),Bw(2,ce,2,2,"button",30);}if(i&2){let e=tC(2).$implicit,n=tC(2);dg("disabled",n.connectingKey()!==null||n.resettingKey()!==null),lg("aria-label",(n.connectionOf(e)==="connected"?"Reconnect ":"Connect ")+e.config.name),VE(),Dl(" ",n.connectionOf(e)==="connected"?"Reconnect":"Connect"," "),VE(),Vw(n.connectionOf(e)==="connected"?2:-1);}}function pe(i,t){if(i&1&&Bw(0,re,4,1)(1,le,6,5)(2,de,3,4),i&2){let e=tC().$implicit,n=tC(2);Vw(n.connectingKey()===e.key?0:n.resetConfirmingKey()===e.key?1:n.deletion.confirmingId()!==e.key?2:-1);}}function ue(i,t){if(i&1){let e=Qw();Es(0,"button",27),vg("click",function(){pf(e);let r=tC().$implicit,d=tC(2);return hf(d.duplicate(r))}),AC(1," Duplicate "),hl();}if(i&2){let e=tC().$implicit;lg("aria-label","Duplicate "+e.config.name);}}function _e(i,t){if(i&1){let e=Qw();Es(0,"button",27),vg("click",function(){pf(e);let r=tC(2).$implicit,d=tC(2);return hf(d.edit(r))}),AC(1," Edit "),hl();}if(i&2){let e=tC(2).$implicit;lg("aria-label","Edit "+e.config.name);}}function me(i,t){if(i&1){let e=Qw();Bw(0,_e,2,1,"button",24),Es(1,"agentos-row-delete-action",31),vg("deleteRequested",function(){pf(e);let r=tC().$implicit,d=tC(2);return hf(d.deletion.request(r.key))})("deleteConfirmed",function(){pf(e);let r=tC().$implicit,d=tC(2);return hf(d.confirmDelete(r))})("deleteCancelled",function(){pf(e);let r=tC(3);return hf(r.deletion.cancel())}),hl();}if(i&2){let e=tC().$implicit,n=tC(2);Vw(n.deletion.confirmingId()!==e.key?0:-1),VE(),dg("rowKey",e.key)("rowLabel",e.config.name)("state",n.deletion);}}function ge(i,t){i&1&&(Es(0,"button",25),AC(1,"Inherited"),hl());}function he(i,t){if(i&1&&(Es(0,"tr",10)(1,"td",13),AC(2),hl(),Es(3,"td",14),AC(4),hl(),Es(5,"td",15)(6,"div",16)(7,"ds-tag",17),AC(8),hl(),Bw(9,ie,2,0,"ds-tag",18),hl()(),Es(10,"td",19),Bw(11,oe,2,0,"ds-tag",20)(12,ae,2,0,"ds-tag",18)(13,se,2,0,"span",21),hl(),Es(14,"td",22)(15,"div",23),Bw(16,pe,3,1),Bw(17,ue,2,1,"button",24),Bw(18,me,2,4)(19,ge,2,0,"button",25),hl()()()),i&2){let e=t.$implicit,n=tC(2);VE(2),Fg(e.config.name),VE(2),Dl(" ",e.config.authType," "),VE(3),dg("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),VE(),Fg(e.scopeLabel),VE(),Vw(e.canMutate?-1:9),VE(2),Vw(n.isOAuth(e)&&n.connectionOf(e)==="connected"?11:n.isOAuth(e)&&n.connectionOf(e)==="disconnected"?12:13),VE(5),Vw(n.isOAuth(e)?16:-1),VE(),Vw(n.deletion.confirmingId()!==e.key&&n.resetConfirmingKey()!==e.key&&n.connectingKey()!==e.key?17:-1),VE(),Vw(e.canMutate?18:19);}}function Ce(i,t){if(i&1&&(Es(0,"div",7)(1,"table",8)(2,"thead",9)(3,"tr",10)(4,"th",11),AC(5,"Name"),hl(),Es(6,"th",11),AC(7,"Authentication type"),hl(),Es(8,"th",11),AC(9,"Scope"),hl(),Es(10,"th",11),AC(11,"Connection"),hl(),Es(12,"th",11)(13,"span",12),AC(14,"Actions"),hl()()()(),Es(15,"tbody",9),$w(16,he,20,9,"tr",10,Q),hl()()()),i&2){let e=tC();VE(16),zw(e.rowFilter.filteredRows());}}var fe=new Set(["OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"]),J=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=$i(false);isLoading=$i(true);rows=$i([]);deletion=k();connections=$i({});connectingKey=$i(null);resetConfirmingKey=$i(null);resettingKey=$i(null);actionMessage=$i(null);connectAttempt=null;connectPopup=null;connectionsLoad=null;rowFilter=O(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(ne$1(t=>t.get("namespaceId")??""),ga(t=>t?this.namespaceRole.isAdminOfNamespace$(t):br(false)),U(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false),this.loadConnections();},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}confirmDelete(t){!t.canMutate||!t.config.id||this.deletion.execute(t.key,{request$:this.state.delete(t.config.id,t.scope).pipe(U(this.destroyRef)),errorMessage:`Deleting "${t.config.name}" failed. Try again.`});}isOAuth(t){return fe.has(t.config.authType)}connectionOf(t){return this.connections()[t.key]??"unknown"}connect(t){let e=t.config.id;if(!e||this.connectingKey()||this.resettingKey())return;let n=w();if(!n){this.actionMessage.set({kind:"error",text:"The browser blocked the authorization window. Allow pop-ups for this site and try again."});return}this.actionMessage.set(null),this.resetConfirmingKey.set(null),this.connectPopup=n,this.connectingKey.set(t.key),this.connectAttempt=this.state.connect(e,this.namespaceParam(),r=>n.location.href=r,()=>n.closed).pipe(ui(()=>{this.connectingKey.set(null),this.connectAttempt=null,this.connectPopup=null;}),U(this.destroyRef)).subscribe({next:r=>this.onConnectOutcome(t,r,n),error:()=>{n.close(),this.actionMessage.set({kind:"error",text:`Connecting "${t.config.name}" failed. Check that its OAuth settings are complete, then try again.`});}});}cancelConnect(){this.connectAttempt?.unsubscribe(),this.connectPopup?.close();}requestReset(t){this.resettingKey()||this.connectingKey()||(this.actionMessage.set(null),this.resetConfirmingKey.set(t.key));}cancelReset(){this.resettingKey()||this.resetConfirmingKey.set(null);}confirmReset(t){let e=t.config.id;!e||this.resettingKey()||this.resetConfirmingKey()!==t.key||(this.resettingKey.set(t.key),this.state.resetCredential(e,this.namespaceParam()).pipe(U(this.destroyRef)).subscribe({next:()=>{this.resettingKey.set(null),this.resetConfirmingKey.set(null),this.loadConnections();},error:()=>{this.resettingKey.set(null),this.actionMessage.set({kind:"error",text:`Disconnecting "${t.config.name}" failed. Try again.`});}}));}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}onConnectOutcome(t,e,n){n.close(),this.loadConnections(),e==="abandoned"?this.actionMessage.set({kind:"info",text:`The authorization window was closed before "${t.config.name}" got connected.`}):e==="timeout"&&this.actionMessage.set({kind:"info",text:`No authorization was received for "${t.config.name}" in time. Try again.`});}namespaceParam(){return this.namespaceId||void 0}loadConnections(){this.connectionsLoad?.unsubscribe();let t=this.rows().filter(e=>this.isOAuth(e)&&e.config.id).map(e=>this.state.getConnection(e.config.id,this.namespaceParam()).pipe(ne$1(n=>[e.key,n.connected?"connected":"disconnected"]),ha(()=>br([e.key,"unknown"]))));if(t.length===0){this.connections.set({});return}this.connectionsLoad=by(t).pipe(U(this.destroyRef)).subscribe(e=>this.connections.set(Object.fromEntries(e)));}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,n,r){return t.map((d,Y)=>({key:`${e}:${d.id??Y}`,config:d,scope:e,scopeLabel:n,canMutate:r}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:10,vars:4,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],[3,"class"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Connection"],["variant","accent"],[1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["role","status",1,"settings-table__confirm-label"],["type","button",3,"click"],[1,"settings-table__confirm-label"],["type","button",3,"click","disabled"],["type","button",3,"disabled"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,n){if(e&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(d){return n.rowFilter.query.set(d)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),AC(3,"New auth setting"),hl()(),Bw(4,X,2,1,"p",3),Bw(5,Z,2,4,"p",4),Bw(6,ee,2,0,"p",5)(7,te,2,0,"p",6)(8,ne,2,0,"p",5)(9,Ce,18,0,"div",7)),e&2){let r;VE(),dg("query",n.rowFilter.query()),VE(3),Vw(n.deletion.error()?4:-1),VE(),Vw((r=n.actionMessage())?5:-1,r),VE(),Vw(n.isLoading()?6:n.rows().length===0?7:n.rowFilter.filteredRows().length===0?8:9);}},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{J as AuthSettingsAllScopesComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-Bi5i4Kkf.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-DSY07m68.js';import {g,t as F,K as we,$ as $i,U as U$1,ai as ke,al as We,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,Q as Qw,w as pf,x as hf,n as lg}from'./main-4HEE4DSD.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Es(0,"p",3),AC(1),hl()),n&2){let e=tC();VE(),Fg(e.deletion.error());}}function B(n,t){n&1&&(Es(0,"p",4),AC(1,"Loading scheduled prompts\u2026"),hl());}function j(n,t){n&1&&(Es(0,"p",5),AC(1,"No platform scheduled prompts defined yet."),hl());}function W(n,t){n&1&&(Es(0,"p",4),AC(1,"No scheduled prompts match the current filter."),hl());}function H(n,t){if(n&1&&(Es(0,"span",14),AC(1),hl()),n&2){let e=tC().$implicit;VE(),Fg(e.description);}}function O(n,t){if(n&1){let e=Qw();Es(0,"button",21),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.toggle(s))}),AC(1),hl(),Es(2,"button",21),vg("click",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.edit(s))}),AC(3,"Edit"),hl();}if(n&2){let e=tC().$implicit;VE(),Fg(e.enabled?"Disable":"Enable"),VE(),lg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=Qw();Es(0,"agentos-row-delete-action",22),vg("deleteRequested",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.deletion.request(s.id))})("deleteConfirmed",function(){pf(e);let s=tC().$implicit,c=tC(2);return hf(c.confirmDelete(s))})("deleteCancelled",function(){pf(e);let s=tC(3);return hf(s.deletion.cancel())}),hl();}if(n&2){let e=tC().$implicit,i=tC(2);dg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Es(0,"tr",9)(1,"td",12)(2,"span",13),AC(3),hl(),Bw(4,H,2,1,"span",14),hl(),Es(5,"td",15),AC(6),hl(),Es(7,"td",16)(8,"ds-tag",17),AC(9),hl()(),Es(10,"td",18)(11,"div",19),Bw(12,O,4,2),Bw(13,Y,1,3,"agentos-row-delete-action",20),hl()()()),n&2){let e=t.$implicit,i=tC(2);VE(3),Fg(e.name),VE(),Vw(e.description?4:-1),VE(2),Fg(i.scheduleLabel(e)),VE(2),dg("variant",e.enabled?"accent":"outline"),VE(),Fg(e.enabled?"Enabled":"Disabled"),VE(3),Vw(i.deletion.confirmingId()!==e.id?12:-1),VE(),Vw(e.id?13:-1);}}function G(n,t){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Schedule"),hl(),Es(8,"th",10),AC(9,"Status"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,z,14,7,"tr",9,M),hl()()()),n&2){let e=tC();VE(14),zw(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=$i([]);isLoading=$i(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===ke.WEEK?"week":"month",s=e.unit===ke.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=Dw({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&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return i.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),AC(3,"New scheduled prompt"),hl()(),Bw(4,U,2,1,"p",3),Bw(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&&(VE(),dg("query",i.rowFilter.query()),VE(3),Vw(i.deletion.error()?4:-1),VE(),Vw(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-4sEBawqk.js';import {v}from'./chunk-Zao0hsES.js';import {g,W as W$1,t as F,K as we,$ as $i,U as U$1,ad as ne,a1 as ga,aa as br,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,Q as Qw,n as lg,w as pf,x as hf}from'./main-4HEE4DSD.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-DSY07m68.js';import'./chunk-7pogBin0.js';var H=(i,e)=>e.key;function U(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function z(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading AI providers\u2026"),hl());}function J(i,e){i&1&&(Es(0,"p",5),AC(1,"No AI providers available."),hl());}function Q(i,e){i&1&&(Es(0,"p",4),AC(1,"No AI providers match the current filter."),hl());}function W(i,e){i&1&&(Es(0,"ds-tag",17),AC(1,"Read-only"),hl());}function X(i,e){if(i&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.duplicate(d))}),AC(1," Duplicate "),hl();}if(i&2){let t=tC().$implicit;lg("aria-label","Duplicate "+t.config.name);}}function Y(i,e){if(i&1){let t=Qw();Es(0,"button",22),vg("click",function(){pf(t);let d=tC(2).$implicit,c=tC(2);return hf(c.edit(d))}),AC(1," Edit "),hl();}if(i&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.config.name);}}function Z(i,e){if(i&1){let t=Qw();Bw(0,Y,2,1,"button",20),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.deletion.request(d.key))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,c=tC(2);return hf(c.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,r=tC(2);Vw(r.deletion.confirmingId()!==t.key?0:-1),VE(),dg("rowKey",t.key)("rowLabel",t.config.name)("state",r.deletion);}}function ee(i,e){i&1&&(Es(0,"button",21),AC(1,"Inherited"),hl());}function te(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),AC(8),hl(),Bw(9,W,2,0,"ds-tag",17),hl()(),Es(10,"td",18)(11,"div",19),Bw(12,X,2,1,"button",20),Bw(13,Z,2,4)(14,ee,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,r=tC(2);VE(2),Fg(t.config.name),VE(2),Fg(t.config.apiType),VE(3),dg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),VE(),Fg(t.scopeLabel),VE(),Vw(t.canMutate?-1:9),VE(3),Vw(r.deletion.confirmingId()!==t.key?12:-1),VE(),Vw(t.canMutate?13:14);}}function ie(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"API type"),hl(),Es(8,"th",10),AC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,te,15,7,"tr",9,H),hl()()()),i&2){let t=tC();VE(14),zw(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=$i(false);isLoading=$i(true);rows=$i([]);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")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(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=Dw({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&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return r.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return r.openCreateForm()}),AC(3,"New AI provider"),hl()(),Bw(4,U,2,1,"p",3),Bw(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&&(VE(),dg("query",r.rowFilter.query()),VE(3),Vw(r.deletion.error()?4:-1),VE(),Vw(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,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-DbK9IJQd.js';import {I,n as nt,i as it}from'./chunk-Bsqc_xnw.js';import {g,W,F,v as we,M as Mi,ad as F$1,i as VC,s as sf,x as U,E as x,C as w,a as ew,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,R as Rw,T as Tw,as as bw,N as lI,H as Hh,L as Lw,Q as fI,_ as _w,Y as Yu,ai as Dw,l as lg,h as Bh,P as Pd,n as Ld}from'./main-JXQYBZRK.js';import {T as Te,b as bn,p as pt,v as vn,d as yn,e as fn,n as pn,h as hn,i as at,u as un,o 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-DwEcQtO1.js';import'./chunk-Dg0rwtUo.js';function Ce(i,t){i&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function ye(i,t){if(i&1&&(os(0,"label",16),Hh(1,"input",17),lI(),pC(2),zu()),i&2){let e=t.$implicit,n=Lw(3);IE(),Vh("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),fI(),IE(),Yu(" ",e.label," ");}}function ge(i,t){if(i&1&&(os(0,"ds-fieldset",5),Tw(1,ye,3,4,"label",16,Dw().trackByScope,true),zu()),i&2){let e=Lw(2);Vh("disabled",e.isEditMode()),IE(),_w(e.scopeOptions);}}function fe(i,t){if(i&1&&(os(0,"option",8),pC(1),zu()),i&2){let e=t.$implicit,n=Lw(2);Vh("value",e),IE(),lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(os(0,"ds-form-field",18),Hh(1,"input",19),lI(),zu()),i&2){let e=Lw().$implicit;Vh("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),IE(),Vh("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Bh("aria-describedby",e.hint?"as-hint-"+e.key:null),fI();}}function Ae(i,t){if(i&1&&Iw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=Lw(3);ww((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(os(0,"ds-fieldset",13),Tw(1,Ae,1,1,null,null,Dw().trackByField,true),zu()),i&2){let e=Lw(2);Vh("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),IE(),_w(e.credentialFields());}}function be(i,t){if(i&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let o=Lw();return Ld(o.submit())}),Iw(1,ge,3,1,"ds-fieldset",5),os(2,"ds-form-field",6)(3,"select",7),Tw(4,fe,2,2,"option",8,bw),zu(),lI(),zu(),os(6,"ds-form-field",9),Hh(7,"input",10),lI(),zu(),os(8,"ds-form-field",11),Hh(9,"input",12),lI(),zu(),Iw(10,ve,3,1,"ds-fieldset",13),os(11,"ds-form-actions")(12,"button",14),pC(13),zu(),os(14,"button",15),qh("click",function(){Pd(e);let o=Lw();return Ld(o.cancel())}),pC(15,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(),ww(e.isPlatformMode?-1:1),IE(2),Vh("formControl",e.authTypeControl),fI(),IE(),_w(e.authTypeOptions),IE(3),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(),ww(e.credentialFields().length>0?10:-1),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",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?Mi(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=VC(()=>_e[this.selectedAuthType()]);isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||sf(()=>{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=ew({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&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return n.cancel()}),pC(3," \u2190 Auth settings "),zu()(),Iw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),zu()),e&2&&(IE(),Vh("title",n.isEditMode()?"Edit auth setting":"New auth setting"),IE(3),ww(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 {v}from'./chunk-Zao0hsES.js';import {I,n as nt,i as it}from'./chunk-BgGkMHQh.js';import {g,W,t as F,K as we,$ as $i,a9 as F$1,o as oT,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,q as $w,ao as Uw,S as NI,f as fg,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,n as lg,w as pf,x as hf}from'./main-4HEE4DSD.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-DSY07m68.js';import'./chunk-7pogBin0.js';function Ce(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ye(i,t){if(i&1&&(Es(0,"label",16),fg(1,"input",17),NI(),AC(2),hl()),i&2){let e=t.$implicit,n=tC(3);VE(),dg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),AI(),VE(),Dl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Es(0,"ds-fieldset",5),$w(1,ye,3,4,"label",16,Lw().trackByScope,true),hl()),i&2){let e=tC(2);dg("disabled",e.isEditMode()),VE(),zw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Es(0,"option",8),AC(1),hl()),i&2){let e=t.$implicit,n=tC(2);dg("value",e),VE(),Fg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Es(0,"ds-form-field",18),fg(1,"input",19),NI(),hl()),i&2){let e=tC().$implicit;dg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),VE(),dg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),lg("aria-describedby",e.hint?"as-hint-"+e.key:null),AI();}}function Ae(i,t){if(i&1&&Bw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=tC(3);Vw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Es(0,"ds-fieldset",13),$w(1,Ae,1,1,null,null,Lw().trackByField,true),hl()),i&2){let e=tC(2);dg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),VE(),zw(e.credentialFields());}}function be(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let o=tC();return hf(o.submit())}),Bw(1,ge,3,1,"ds-fieldset",5),Es(2,"ds-form-field",6)(3,"select",7),$w(4,fe,2,2,"option",8,Uw),hl(),NI(),hl(),Es(6,"ds-form-field",9),fg(7,"input",10),NI(),hl(),Es(8,"ds-form-field",11),fg(9,"input",12),NI(),hl(),Bw(10,ve,3,1,"ds-fieldset",13),Es(11,"ds-form-actions")(12,"button",14),AC(13),hl(),Es(14,"button",15),vg("click",function(){pf(e);let o=tC();return hf(o.cancel())}),AC(15,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(),Vw(e.isPlatformMode?-1:1),VE(2),dg("formControl",e.authTypeControl),AI(),VE(),zw(e.authTypeOptions),VE(3),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(),Vw(e.credentialFields().length>0?10:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",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?$i(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=oT(()=>_e[this.selectedAuthType()]);isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Of(()=>{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=Dw({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&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return n.cancel()}),AC(3," \u2190 Auth settings "),hl()(),Bw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),hl()),e&2&&(VE(),dg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),VE(3),Vw(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 {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-BlijPSJE.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-DSY07m68.js';import {g,W,t as F,K as we,$ as $i,U,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,q as $w,am as Hw,T as AI,z as zw,u as Dl,w as pf,x as hf,F as Fg}from'./main-4HEE4DSD.js';function ie(i,t){if(i&1&&(Es(0,"a",2),AC(1,"View skill \u2192"),hl()),i&2){let e=tC();dg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function ne(i,t){i&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function re(i,t){if(i&1){let e=Qw();Es(0,"div",15)(1,"div",19),fg(2,"input",20),NI(),Es(3,"button",21),vg("click",function(){let l=pf(e).$implicit,te=tC(2);return hf(te.removeResource(l))}),AC(4," \xD7 "),hl()(),fg(5,"textarea",22),NI(),hl();}if(i&2){let e=t.$implicit;VE(2),dg("formControl",e.path),AI(),VE(3),dg("formControl",e.content),AI();}}function ae(i,t){if(i&1&&(Es(0,"ds-notice"),AC(1),hl()),i&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function se(i,t){if(i&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let l=tC();return hf(l.submit())}),Es(1,"ds-form-field",7),fg(2,"input",8),NI(),hl(),Es(3,"ds-form-field",9),fg(4,"textarea",10),NI(),hl(),Es(5,"ds-form-field",11),fg(6,"textarea",12),NI(),hl(),Es(7,"ds-form-field",13)(8,"div",14),$w(9,re,6,2,"div",15,Hw),Es(11,"div")(12,"button",16),vg("click",function(){pf(e);let l=tC();return hf(l.addResource())}),AC(13,"+ Add resource"),hl()()()(),Bw(14,ae,2,1,"ds-notice"),Es(15,"ds-form-actions")(16,"button",17),AC(17),hl(),Es(18,"button",18),vg("click",function(){pf(e);let l=tC();return hf(l.cancel())}),AC(19,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),VE(),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.bodyControl),AI(),VE(3),zw(e.resourceRows()),VE(5),Vw(e.errorMessage()?14:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=$i(false);isLoading=$i(false);isSubmitting=$i(false);errorMessage=$i(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=$i([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.cancel()}),AC(3,"\u2190 Skills"),hl(),Bw(4,ie,2,1,"a",2),Bw(5,oe,2,0,"ds-tag",3),hl(),Bw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),hl()),e&2&&(VE(),dg("title",o.isEditMode()?"Edit skill":"New skill"),VE(3),Vw(o.isEditMode()?4:-1),VE(),Vw(o.isPlatformMode?5:-1),VE(),Vw(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {o}from'./chunk-BlijPSJE.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-DSY07m68.js';import {g,t as F,K as we,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,w as pf,x as hf,n as lg}from'./main-4HEE4DSD.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Es(0,"p",3),AC(1),hl()),i&2){let t=tC();VE(),Fg(t.deletion.error());}}function A(i,e){i&1&&(Es(0,"p",4),AC(1,"Loading skills\u2026"),hl());}function H(i,e){i&1&&(Es(0,"p",5),AC(1,"No platform skills defined yet."),hl());}function U(i,e){i&1&&(Es(0,"p",4),AC(1,"No skills match the current filter."),hl());}function z(i,e){i&1&&(Es(0,"ds-tag",15),AC(1,"SKILL.md"),hl());}function G(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC(2).$implicit,m=tC(2);return hf(m.edit(d))}),AC(1,"Edit"),hl();}if(i&2){let t=tC(2).$implicit;lg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Qw();Es(0,"button",21),vg("click",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.inspect(d))}),AC(1,"View"),hl(),Bw(2,G,2,1,"button",22);}if(i&2){let t=tC().$implicit;lg("aria-label","View "+t.name),VE(2),Vw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Qw();Es(0,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=tC().$implicit,m=tC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=tC(3);return hf(d.deletion.cancel())}),hl();}if(i&2){let t=tC().$implicit,l=tC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),AC(4),hl(),Bw(5,z,2,0,"ds-tag",15),hl()(),Es(6,"td",16),AC(7),hl(),Es(8,"td",17),AC(9),hl(),Es(10,"td",18)(11,"div",19),Bw(12,J,3,2),Bw(13,Q,1,3,"agentos-row-delete-action",20),hl()()()),i&2){let t=e.$implicit,l=tC(2);VE(4),Fg(t.name),VE(),Vw(t.readOnly?5:-1),VE(2),Dl(" ",t.description||"\u2014"," "),VE(2),Fg(l.resourceCount(t)),VE(3),Vw(l.deletion.confirmingId()!==t.id?12:-1),VE(),Vw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10),AC(9,"Resources"),hl(),Es(10,"th",10)(11,"span",11),AC(12,"Actions"),hl()()()(),Es(13,"tbody",8),$w(14,W,14,6,"tr",9,K),hl()()()),i&2){let t=tC();VE(14),zw(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();skills=$i([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(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=Dw({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&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return l.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return l.openCreateForm()}),AC(3,"New skill"),hl()(),Bw(4,O,2,1,"p",3),Bw(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&&(VE(),dg("query",l.rowFilter.query()),VE(3),Vw(l.deletion.error()?4:-1),VE(),Vw(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-B4OgWFKq.js';import {g,W,K as we,$ as $i,U,D as Dw,E as Es,f as fg,a as Bw,c as hl,d as VE,i as Vw,b as AC,v as tC,F as Fg}from'./main-4HEE4DSD.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-DSY07m68.js';import'./chunk-7pogBin0.js';function O(r,e){r&1&&(Es(0,"p",1),AC(1,"Loading integration\u2026"),hl());}function T(r,e){r&1&&(Es(0,"ds-notice"),AC(1,"Failed to load this integration configuration."),hl());}function L(r,e){r&1&&(Es(0,"div",3)(1,"ds-tag",9),AC(2,"YAML"),hl(),Es(3,"ds-tag",10),AC(4,"Read-only"),hl()());}function k(r,e){if(r&1&&(Es(0,"ds-card",2),Bw(1,L,5,0,"div",3),Es(2,"dl",4)(3,"dt"),AC(4,"Name"),hl(),Es(5,"dd"),AC(6),hl(),Es(7,"dt"),AC(8,"Type"),hl(),Es(9,"dd",5),AC(10),hl(),Es(11,"dt"),AC(12,"Description"),hl(),Es(13,"dd"),AC(14),hl(),Es(15,"dt"),AC(16,"Scope"),hl(),Es(17,"dd"),AC(18),hl(),Es(19,"dt"),AC(20,"Source"),hl(),Es(21,"dd"),AC(22),hl(),Es(23,"dt"),AC(24,"Auto grant"),hl(),Es(25,"dd"),AC(26),hl(),Es(27,"dt"),AC(28,"Auth setting"),hl(),Es(29,"dd"),AC(30),hl()()(),Es(31,"ds-card",6)(32,"p",7),AC(33,"Sensitive values are always redacted."),hl(),Es(34,"pre",8),AC(35),hl()()),r&2){let o=e,a=tC();VE(),Vw(a.source()==="FILESYSTEM"?1:-1),VE(5),Fg(o.name),VE(4),Fg(o.integrationType),VE(4),Fg(o.description||"\u2014"),VE(4),Fg(a.scopeOf(o)),VE(4),Fg(a.source()),VE(4),Fg(o.autoGrant?"Enabled":"Disabled"),VE(4),Fg(o.authSettingName||"None"),VE(5),Fg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=$i(true);hasError=$i(false);config=$i(null);source=$i("NEO4J");parameters=$i("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=Dw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Es(0,"ds-page"),fg(1,"ds-section-header",0),Bw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),hl()),o&2){let m;VE(2),Vw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
|
|
@@ -0,0 +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-DSY07m68.js';import {g,W,t as F,K as we,aq as k,ap as F$1,a9 as F$2,a2 as ha,aa as br,ar as Ne,o as oT,$ as $i,O as Of,U,N as x,L as w,D as Dw,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,Q as Qw,f as fg,S as NI,q as $w,ao as Uw,v as tC,T as AI,z as zw,u as Dl,ae as Lw,F as Fg,as as Pg,w as pf,x as hf}from'./main-4HEE4DSD.js';function he(r,t){r&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function ve(r,t){if(r&1&&fg(0,"input",6),r&2){let e=tC(2);dg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Es(0,"option",44),AC(1),hl()),r&2){let e=t.$implicit;dg("value",e.id),VE(),Pg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Es(0,"select",7)(1,"option",43),AC(2,"Select provider"),hl(),$w(3,ye,2,3,"option",44,Lw().trackByProvider,true),hl(),NI()),r&2){let e=tC(2);dg("formControl",e.aiProviderIdControl),AI(),VE(3),zw(e.providers());}}function xe(r,t){if(r&1&&(Es(0,"option",25),AC(1),hl()),r&2){let e=t.$implicit;dg("ngValue",e),VE(),Fg(e.toLowerCase());}}function _e(r,t){r&1&&(Es(0,"p",2),AC(1,"Not supported yet for Anthropic and Gemini providers."),hl());}function Me(r,t){r&1&&(Es(0,"p",2),AC(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. "),hl());}function Ee(r,t){r&1&&(Es(0,"p",26),AC(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. "),hl());}function Ae(r,t){if(r&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let u=tC();return hf(u.submit())}),Es(1,"ds-form-field",5),Bw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),hl(),Es(4,"ds-form-field",8),fg(5,"input",9),NI(),hl(),Es(6,"ds-form-field",10),fg(7,"input",11),NI(),hl(),Es(8,"ds-form-field",12),fg(9,"input",13),NI(),hl(),Es(10,"ds-form-field",14),fg(11,"input",15),NI(),hl(),Es(12,"div",16)(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19),fg(16,"input",20),NI(),hl()(),Es(17,"ds-form-field",21),fg(18,"input",22),NI(),hl(),Es(19,"ds-form-field",23)(20,"select",24)(21,"option",25),AC(22,"Provider default"),hl(),$w(23,xe,2,2,"option",25,Uw),hl(),NI(),Bw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Bw(27,Ee,2,0,"p",26),hl(),Es(28,"div",27)(29,"label",28),fg(30,"input",29),NI(),Es(31,"span",30),AC(32,"Supports advanced execution"),hl()(),Es(33,"p",31),AC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),hl()(),Es(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),fg(38,"input",34),NI(),hl(),Es(39,"ds-form-field",35),fg(40,"input",36),NI(),hl()(),Es(41,"div",16)(42,"ds-form-field",37),fg(43,"input",38),NI(),hl(),Es(44,"ds-form-field",39),fg(45,"input",40),NI(),hl()()(),Es(46,"ds-form-actions")(47,"button",41),AC(48),hl(),Es(49,"button",42),vg("click",function(){pf(e);let u=tC();return hf(u.cancel())}),AC(50,"Cancel"),hl()()();}if(r&2){let e=tC();dg("formGroup",e.form),VE(2),Vw(e.isEditMode()?2:3),VE(3),dg("formControl",e.apiModelNameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.aliasControl),AI(),VE(2),dg("formControl",e.priorityControl),AI(),VE(3),dg("formControl",e.temperatureControl),AI(),VE(2),dg("formControl",e.contextWindowControl),AI(),VE(2),dg("formControl",e.maxCompletionTokensControl),AI(),VE(2),dg("formControl",e.reasoningEffortControl),AI(),VE(),dg("ngValue",null),VE(2),zw(e.reasoningEffortOptions),VE(2),Vw(e.reasoningEffortUnsupported()?25:26),VE(2),Vw(e.temperatureMayConflictWithEffort()?27:-1),VE(3),dg("formControl",e.supportsAdvancedExecutionControl),AI(),VE(5),dg("formGroup",e.pricingGroup),VE(3),AI(),VE(2),AI(),VE(3),AI(),VE(2),AI(),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ha(()=>br([]))),{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=oT(()=>{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=oT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);selectedProviderLabel=oT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Of(()=>{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=Dw({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&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return c.cancel()}),AC(3," \u2190 AI models "),hl()(),Bw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),hl()),e&2&&(VE(),dg("title",c.isEditMode()?"Edit AI model":"New AI model"),VE(3),Vw(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-DSY07m68.js';import {g,t as F,K as we,Z as Tr,$ as $i,a1 as ga,U as U$1,D as Dw,E as Es,R as vg,c as hl,b as AC,a as Bw,d as VE,P as dg,i as Vw,v as tC,F as Fg,q as $w,z as zw,u as Dl,Q as Qw,n as lg,w as pf,x as hf}from'./main-4HEE4DSD.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Es(0,"p",3),AC(1),hl()),t&2){let n=tC();VE(),Fg(n.deletion.error());}}function K(t,e){t&1&&(Es(0,"p",4),AC(1,"Loading prompts\u2026"),hl());}function H(t,e){t&1&&(Es(0,"p",5),AC(1,"No platform prompts defined yet."),hl());}function U(t,e){t&1&&(Es(0,"p",4),AC(1,"No prompts match the current filter."),hl());}function z(t,e){if(t&1){let n=Qw();Es(0,"button",18),vg("click",function(){pf(n);let m=tC().$implicit,p=tC(2);return hf(p.edit(m))}),AC(1,"Edit"),hl();}if(t&2){let n=tC().$implicit;lg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Qw();Es(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){pf(n);let m=tC().$implicit,p=tC(2);return hf(p.deletion.request(m.id))})("deleteConfirmed",function(){pf(n);let m=tC().$implicit,p=tC(2);return hf(p.confirmDelete(m))})("deleteCancelled",function(){pf(n);let m=tC(3);return hf(m.deletion.cancel())}),hl();}if(t&2){let n=tC().$implicit,r=tC(2);dg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Es(0,"tr",9)(1,"td",12),AC(2),hl(),Es(3,"td",13),AC(4),hl(),Es(5,"td",14)(6,"div",15),Bw(7,z,2,1,"button",16),Bw(8,G,1,3,"agentos-row-delete-action",17),hl()()()),t&2){let n=e.$implicit,r=tC(2);VE(2),Fg(n.name),VE(2),Dl(" ",n.description||"\u2014"," "),VE(3),Vw(r.deletion.confirmingId()!==n.id?7:-1),VE(),Vw(n.id?8:-1);}}function O(t,e){if(t&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),AC(5,"Name"),hl(),Es(6,"th",10),AC(7,"Description"),hl(),Es(8,"th",10)(9,"span",11),AC(10,"Actions"),hl()()()(),Es(11,"tbody",8),$w(12,J,9,4,"tr",9,j),hl()()()),t&2){let n=tC();VE(12),zw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();prompts=$i([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Dw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(p){return r.rowFilter.query.set(p)}),hl(),Es(2,"button",2),vg("click",function(){return r.openCreateForm()}),AC(3,"New prompt"),hl()(),Bw(4,A,2,1,"p",3),Bw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(VE(),dg("query",r.rowFilter.query()),VE(3),Vw(r.deletion.error()?4:-1),VE(),Vw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-DSY07m68.js';import {g,W,aN as Y,$ as $i,ab as le,O as Of,D as Dw,aO as Eb,E as Es,f as fg,a as Bw,c as hl,d as VE,i as Vw,ak as yd,a1 as ga,a3 as rn,ac as by,a2 as ha,b as AC,Q as Qw,R as vg,aP as Hg,S as NI,v as tC,aQ as Vg,T as AI,q as $w,z as zw,aR as GC,aS as zC,F as Fg,n as lg,av as QC,aw as XC,as as Pg,u as Dl,aT as JC,w as pf,x as hf,aU as LC}from'./main-4HEE4DSD.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Es(0,"p",2),AC(1,"Loading usage settings\u2026"),hl());}function fe(e,a){if(e&1){let t=Qw();Es(0,"ds-notice"),AC(1,"Could not load usage settings. Please try again."),hl(),Es(2,"div")(3,"button",3),vg("click",function(){pf(t);let s=tC();return hf(s.configuration.retry())}),AC(4,"Retry usage settings"),hl()();}}function ye(e,a){e&1&&(Es(0,"p",2),AC(1,"Usage tracking is disabled."),hl());}function be(e,a){e&1&&(Es(0,"ds-notice"),AC(1),hl()),e&2&&(VE(),Fg(a));}function xe(e,a){e&1&&(Es(0,"p",2),AC(1,"Loading usage\u2026"),hl());}function he(e,a){e&1&&(Es(0,"p",12),AC(1,"No recorded usage for this period."),hl());}function Se(e,a){if(e&1&&(Es(0,"p",10),AC(1),hl()),e&2){let t=tC().$implicit;VE(),Dl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Es(0,"tr",16)(1,"td",18),AC(2),hl(),Es(3,"td",19),AC(4),QC(5,"number"),hl(),Es(6,"td",20),AC(7),QC(8,"number"),QC(9,"number"),hl(),Es(10,"td",21),AC(11),QC(12,"number"),QC(13,"number"),hl(),Es(14,"td",22),AC(15),QC(16,"agentosCost"),Bw(17,Se,2,1,"p",10),hl()()),e&2){let t=a.$implicit;VE(2),Fg(t.key),VE(2),Fg(XC(5,8,t.aggregate.totalTokens)),VE(3),Pg(" ",XC(8,10,t.aggregate.inputTokens)," / ",XC(9,12,t.aggregate.outputTokens)," "),VE(4),Pg(" ",XC(12,14,t.aggregate.cacheReadTokens)," / ",XC(13,16,t.aggregate.cacheWriteTokens)," "),VE(4),Dl(" ",JC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),VE(2),Vw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Es(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),AC(5,"Name"),hl(),Es(6,"th",17),AC(7,"Tokens"),hl(),Es(8,"th",17),AC(9,"Input / output"),hl(),Es(10,"th",17),AC(11,"Cache read / write"),hl(),Es(12,"th",17),AC(13,"Estimated cost"),hl()()(),Es(14,"tbody",15),$w(15,we,18,21,"tr",16,_e),hl()()()),e&2){let t=tC().$implicit;VE(),lg("aria-label","Usage "+t.title.toLowerCase()),VE(14),zw(t.rows);}}function Ne(e,a){if(e&1&&(Es(0,"h3",11),AC(1),hl(),Bw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;VE(),Fg(t.title),VE(),Vw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&($w(0,Ne,4,2,null,null,ue),Es(2,"p",10),AC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),hl()),e&2){let t=tC(2);zw(GC(4,ge,zC(0,ce,t.agents()),zC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(t);let s=tC();return hf(s.load())}),Es(1,"ds-form-field",5)(2,"input",6),Hg("ngModelChange",function(s){pf(t);let m=tC();return LC(m.from,s)||(m.from=s),hf(s)}),hl(),NI(),hl(),Es(3,"ds-form-field",7)(4,"input",8),Hg("ngModelChange",function(s){pf(t);let m=tC();return LC(m.to,s)||(m.to=s),hf(s)}),hl(),NI(),hl(),Es(5,"button",9),AC(6,"Refresh"),hl()(),Bw(7,be,2,1,"ds-notice"),Bw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=tC();VE(2),Vg("ngModel",r.from),AI(),VE(2),Vg("ngModel",r.to),AI(),VE(3),Vw((t=r.error())?7:-1,t),VE(),Vw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Y);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=$i([]);models=$i([]);error=$i(null);loading=$i(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Of(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(yd(void 0),ga(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),rn):(this.loading.set(true),by({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ha(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),rn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Dw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),hl()),t&2&&(VE(2),Vw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Eb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,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,P as Pn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,i as at,u as un}from'./chunk-DwEcQtO1.js';import {g,W,F,u as L,v as we,i as VC,M as Mi,s as sf,x as U,C as w,E as x,a as ew,o as os,H as Hh,I as Iw,z as zu,J as Vh,c as IE,w as ww,b as pC,R as Rw,K as qh,N as lI,T as Tw,L as Lw,Q as fI,h as Bh,_ as _w,Y as Yu,l as lg,P as Pd,n as Ld}from'./main-JXQYBZRK.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function he(i,t){if(i&1&&(os(0,"option",23),pC(1),zu()),i&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function pe(i,t){if(i&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let p=Lw();return Ld(p.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"textarea",8),lI(),zu(),os(5,"ds-form-field",9),Hh(6,"input",10),lI(),zu(),os(7,"ds-form-field",11),Hh(8,"input",12),lI(),zu(),os(9,"ds-form-field",13),Hh(10,"input",14),lI(),zu(),os(11,"ds-form-field",15),Hh(12,"input",16),lI(),zu(),os(13,"ds-form-field",17),Hh(14,"input",18),lI(),zu(),os(15,"ds-form-field",19)(16,"input",20),qh("input",function(p){Pd(e);let se=Lw();return Ld(se.onMaxToolRoundsInput(p))}),zu(),lI(),zu(),os(17,"ds-form-field",21)(18,"select",22),Tw(19,he,2,2,"option",23,ce),zu(),lI(),zu(),os(21,"ds-form-actions")(22,"button",24),pC(23),zu(),os(24,"button",25),qh("click",function(){Pd(e);let p=Lw();return Ld(p.cancel())}),pC(25,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(2),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.externalIdControl),fI(),IE(2),Vh("formControl",e.defaultAgentNameControl),fI(),IE(2),Vh("formControl",e.configPathControl),fI(),IE(),Vh("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),IE(),Vh("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),Bh("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),fI(),IE(),Vh("hint",e.runCostThresholdHint()),IE(),Vh("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),fI(),IE(),Vh("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),IE(),Vh("formControl",e.maxToolRoundsControl),Bh("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),fI(),IE(2),Vh("formControl",e.adminCaseListingControl),fI(),IE(),_w(e.adminCaseListingOptions),IE(3),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(L);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=VC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=VC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=VC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=VC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=Mi(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);existingNamespace=null;constructor(){sf(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(os(0,"ds-page",0),Hh(1,"ds-section-header",1),Iw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),zu()),e&2&&(Vh("framed",!u.isEditMode()),IE(),Vh("title",u.isEditMode()?"Edit namespace":"New namespace"),IE(),ww(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
|
|
1
|
+
import {f,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,P as Pn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,i as at,u as un}from'./chunk-DSY07m68.js';import {g,W,t as F,I as J,K as we,o as oT,$ as $i,O as Of,U,L as w,N as x,D as Dw,E as Es,f as fg,a as Bw,c as hl,P as dg,d as VE,i as Vw,b as AC,Q as Qw,R as vg,S as NI,q as $w,v as tC,T as AI,n as lg,z as zw,u as Dl,F as Fg,w as pf,x as hf}from'./main-4HEE4DSD.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),AC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=tC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),NI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),NI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),NI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),NI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),NI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),NI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=tC();return hf(se.onMaxToolRoundsInput(p))}),hl(),NI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),$w(19,he,2,2,"option",23,ce),hl(),NI(),hl(),Es(21,"ds-form-actions")(22,"button",24),AC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=tC();return hf(p.cancel())}),AC(25,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(2),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.externalIdControl),AI(),VE(2),dg("formControl",e.defaultAgentNameControl),AI(),VE(2),dg("formControl",e.configPathControl),AI(),VE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),VE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),AI(),VE(),dg("hint",e.runCostThresholdHint()),VE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),AI(),VE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),VE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),AI(),VE(2),dg("formControl",e.adminCaseListingControl),AI(),VE(),zw(e.adminCaseListingOptions),VE(3),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=oT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=oT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=oT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=oT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),VE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),VE(),Vw(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
|