@whoz-oss/coday-client 0.0.0-workstream-forge.265 → 0.0.0-workstream-messaging.9
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-B2OdW-y7.js +1 -0
- package/browser/chunk-B4aagjFN.js +1 -0
- package/browser/chunk-BDBFLLoa.js +2 -0
- package/browser/chunk-BS4UgHRO.js +1 -0
- package/browser/chunk-BZ4F5_xt.js +1 -0
- package/browser/chunk-BZ8SegKy.js +1 -0
- package/browser/chunk-BatABxZT.js +1 -0
- package/browser/chunk-Bb1dx-Ci.js +1 -0
- package/browser/chunk-Bh7y7EIZ.js +1 -0
- package/browser/chunk-BjTEffSr.js +1 -0
- package/browser/{chunk-MzRAkbwR.js → chunk-BnIh2Agv.js} +1 -1
- package/browser/chunk-BsPrQGCO.js +1 -0
- package/browser/chunk-BtzGwr18.js +1 -0
- package/browser/chunk-Bv223hQn.js +1 -0
- package/browser/chunk-BxNPtuPg.js +1 -0
- package/browser/{chunk-BzTXrMsf.js → chunk-C4mkvgOW.js} +1 -1
- package/browser/{chunk-IMqSwtoo.js → chunk-C6aXXb6M.js} +1 -1
- package/browser/chunk-C86Xogns.js +1 -0
- package/browser/chunk-CEHHoMbA.js +2 -0
- package/browser/chunk-CHRZly0o.js +1 -0
- package/browser/chunk-CKcknwaO.js +1 -0
- package/browser/chunk-CZkST2Zn.js +1 -0
- package/browser/{chunk-DA_ON43Y.js → chunk-CdzB1hlk.js} +1 -1
- package/browser/chunk-CkbrWR16.js +1 -0
- package/browser/chunk-Cng5sc1A.js +1 -0
- package/browser/chunk-CpLFr6wl.js +1 -0
- package/browser/chunk-CwbSc94v.js +1 -0
- package/browser/chunk-DCYS0PGC.js +1 -0
- package/browser/chunk-DGU69dIe.js +1 -0
- package/browser/chunk-D_dIjWIZ.js +1 -0
- package/browser/chunk-DcX96pJb.js +1 -0
- package/browser/chunk-Ddc_ENU1.js +1 -0
- package/browser/chunk-DmkvfivC.js +1 -0
- package/browser/{chunk-D15w64SG.js → chunk-DnJZx-N1.js} +1 -1
- package/browser/{chunk-DxjesQXu.js → chunk-Do3ec7CW.js} +1 -1
- package/browser/{chunk-C3fz6Nhs.js → chunk-DoVW4Qid.js} +1 -1
- package/browser/chunk-DvtbHzPu.js +671 -0
- package/browser/chunk-DymDoxBo.js +1 -0
- package/browser/chunk-DzQphzTy.js +1 -0
- package/browser/chunk-KYe8W5ss.js +1 -0
- package/browser/chunk-MdjBSjZT.js +1 -0
- package/browser/chunk-RltTZwlz.js +1 -0
- package/browser/{chunk-CXhczMHJ.js → chunk-_ojJ8Ms-.js} +1 -1
- package/browser/chunk-bst4n40I.js +1 -0
- package/browser/chunk-iZXu2H1x.js +1 -0
- package/browser/chunk-lCKocljz.js +1 -0
- package/browser/chunk-t-Kfnaoc.js +1 -0
- package/browser/chunk-tEeX_Ukz.js +1 -0
- package/browser/chunk-yULRQNfZ.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-OQ262YIZ.js +1254 -0
- package/package.json +1 -1
- package/browser/chunk-5l4dJKzj.js +0 -1
- package/browser/chunk-6G_HDlLt.js +0 -1
- package/browser/chunk-8ZA-dXSc.js +0 -2
- package/browser/chunk-B1-Po7IP.js +0 -1
- package/browser/chunk-B1ETqMnn.js +0 -1
- package/browser/chunk-B6ucC9JA.js +0 -1
- package/browser/chunk-B8yw58sL.js +0 -1
- package/browser/chunk-B9m_Pv-N.js +0 -1
- package/browser/chunk-BAFDJC7n.js +0 -1
- package/browser/chunk-BCtLUKA1.js +0 -1
- package/browser/chunk-BEGiDML0.js +0 -1
- package/browser/chunk-BItNUZzz.js +0 -1
- package/browser/chunk-BMgJXfSE.js +0 -1
- package/browser/chunk-BUdZ5OqC.js +0 -1
- package/browser/chunk-BVY2wOIp.js +0 -1
- package/browser/chunk-BeAWBIRs.js +0 -671
- package/browser/chunk-BeGVJrPy.js +0 -1
- package/browser/chunk-BfJl60vA.js +0 -1
- package/browser/chunk-BkRwWFjx.js +0 -2
- package/browser/chunk-BoLw7dqx.js +0 -1
- package/browser/chunk-C1mIsJc9.js +0 -1
- package/browser/chunk-CfLZEoOb.js +0 -1
- package/browser/chunk-ChYykPZM.js +0 -1
- package/browser/chunk-CkDaEVkZ.js +0 -1
- package/browser/chunk-CmjEguYB.js +0 -1
- package/browser/chunk-Cq9rgtVx.js +0 -1
- package/browser/chunk-CvFTKrrN.js +0 -1
- package/browser/chunk-D8O-XquS.js +0 -1
- package/browser/chunk-D9cyFDnZ.js +0 -1
- package/browser/chunk-DAC1_8mf.js +0 -1
- package/browser/chunk-DSe6H4u5.js +0 -1
- package/browser/chunk-DYGNedc1.js +0 -1
- package/browser/chunk-Db_G9wnV.js +0 -1
- package/browser/chunk-Tz-PZzVS.js +0 -1
- package/browser/chunk-Vn-xaj9q.js +0 -1
- package/browser/chunk-fbDk9ppW.js +0 -1
- package/browser/chunk-jfM6q-6w.js +0 -1
- package/browser/chunk-t3EN_XZw.js +0 -1
- package/browser/main-P6EOYPYG.js +0 -1253
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {x as m,p as pt,W as Wt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,N as Nn,R as Rn,E as Ea,z as yo,B as bo,v as vn,d as yn,e as fn,n as pn,h as hn,_ as _n,i as at,u as un}from'./chunk-DvtbHzPu.js';import {g,W,F,v as we,ak as U,M as Mi,x as U$1,a6 as Zs,ae as Dr,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,Y as Yu,w as ww,R as Rw,H as Hh,N as lI,T as Tw,aq as Cw,L as Lw,Q as fI,l as lg,_ as _w,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function fe(o,t){if(o&1&&(os(0,"ds-form-field",20),Hh(1,"input",22),zu()),o&2){let e=Lw(3);IE(),Vh("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(os(0,"option",24),pC(1),zu()),o&2){let e=t.$implicit;Vh("ngValue",e.id),IE(),lg(e.name);}}function Ce(o,t){if(o&1&&(os(0,"ds-form-field",21)(1,"select",23)(2,"option",24),pC(3,"\u2014 None \u2014"),zu(),Tw(4,ge,2,2,"option",24,ce),zu(),lI(),zu()),o&2){let e=Lw(3);IE(),Vh("formControl",e.agentConfigIdControl),fI(),IE(),Vh("ngValue",null),IE(2),_w(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Iw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=Lw(2);ww(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(os(0,"p",2),pC(1,"No parameters defined."),zu());}function he(o,t){if(o&1){let e=Rw();os(0,"div",11)(1,"div",25)(2,"ds-form-field",26),Hh(3,"input",27),lI(),zu(),os(4,"ds-form-field",28),Hh(5,"input",29),lI(),zu(),os(6,"ds-form-field",30),Hh(7,"input",31),lI(),zu()(),os(8,"button",32),qh("click",function(){let d=Pd(e).$index,m=Lw(2);return Ld(m.removeParameter(d))}),pC(9," \xD7 "),zu()();}if(o&2){let e=t.$implicit,r=t.$index;Vh("formGroupName",r),IE(2),Vh("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),IE(),Vh("id","param-name-"+r),fI(),IE(),Vh("controlId","param-desc-"+r),IE(),Vh("id","param-desc-"+r),fI(),IE(),Vh("controlId","param-default-"+r),IE(),Vh("id","param-default-"+r),fI();}}function _e(o,t){if(o&1){let e=Rw();os(0,"div",14)(1,"span",33),pC(2),zu(),os(3,"ds-form-field",34),Hh(4,"textarea",35),lI(),zu(),os(5,"button",36),qh("click",function(){let d=Pd(e).$index,m=Lw(2);return Ld(m.removeContentEntry(d))}),pC(6," \xD7 "),zu()();}if(o&2){let e=t.$implicit,r=t.$index,d=Lw(2);IE(2),lg(r+1),IE(),Vh("error",e.invalid&&e.touched?"Content entry must not be blank.":null),IE(),Vh("formControlName",r),Bh("aria-label","Content entry "+(r+1)),fI(),IE(),Vh("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(os(0,"ds-notice"),pC(1),zu()),o&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function be(o,t){if(o&1){let e=Rw();os(0,"button",37),qh("click",function(){Pd(e);let d=Lw(2);return Ld(d.exportYaml())}),pC(1),zu();}if(o&2){let e=Lw(2);Vh("disabled",e.isExporting()),IE(),Yu(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let d=Lw();return Ld(d.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"input",8),lI(),zu(),Iw(5,ye,2,1),os(6,"ds-fieldset",9)(7,"p",2),pC(8," Each parameter must have a name and a default value. Use "),os(9,"code"),pC(10),zu(),pC(11," in content entries to reference them. "),zu(),os(12,"div",10),Iw(13,ve,2,0,"p",2),Tw(14,he,10,8,"div",11,Cw),os(16,"div")(17,"button",12),qh("click",function(){Pd(e);let d=Lw();return Ld(d.addParameter())}),pC(18,"+ Add parameter"),zu()()()(),os(19,"ds-fieldset",13)(20,"p",2),pC(21," Each content entry is a command. Use "),os(22,"code"),pC(23,"@AgentName"),zu(),pC(24," to target an agent, "),os(25,"code"),pC(26,"/promptName param1 param2"),zu(),pC(27," to call another prompt, and "),os(28,"code"),pC(29),zu(),pC(30," for parameter placeholders. "),zu(),os(31,"div",10),Tw(32,_e,7,5,"div",14,Cw),os(34,"div")(35,"button",12),qh("click",function(){Pd(e);let d=Lw();return Ld(d.addContentEntry())}),pC(36,"+ Add content entry"),zu()()()(),Iw(37,xe,2,1,"ds-notice"),os(38,"ds-form-field",15),Hh(39,"textarea",16),lI(),zu(),os(40,"ds-form-actions")(41,"button",17),pC(42),zu(),Iw(43,be,2,2,"button",18),os(44,"button",19),qh("click",function(){Pd(e);let d=Lw();return Ld(d.cancel())}),pC(45,"Cancel"),zu()()();}if(o&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(),ww(e.availableAgentConfigs().length>0?5:-1),IE(5),lg(e.paramPlaceholderSyntax),IE(2),Vh("formArrayName","parameters"),IE(),ww(e.parametersArray.length===0?13:-1),IE(),_w(e.parametersArray.controls),IE(15),lg(e.paramPlaceholderSyntax),IE(2),Vh("formArrayName","content"),IE(),_w(e.contentArray.controls),IE(5),ww(e.errorMessage()?37:-1),IE(),Vh("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),IE(),Vh("formControl",e.externalMetadataJsonControl),fI(),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create"," "),IE(),ww(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(we);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Wt([this.createContentControl()],{validators:[bn.required]}),parameters:new Wt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);isExporting=Mi(false);errorMessage=Mi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Mi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),Zs(()=>Dr([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),Zs(()=>Dr([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[bn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=ew({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value",3,"controlId"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return r.cancel()}),pC(3),zu()(),Iw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),zu()),e&2&&(IE(),Vh("title",r.isEditMode()?"Edit prompt":"New prompt"),IE(2),Yu(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),IE(),ww(r.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Nn,Rn,Ea,yo,bo,vn,yn,fn,pn,hn,_n,at,un],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-t-Kfnaoc.js';import {O}from'./chunk-RltTZwlz.js';import {g,W as W$1,F,v as we,u as L,M as Mi,x as U$1,ah as te$1,a5 as Ys,ae as Dr,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,J as Vh,c as IE,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let t=Lw();IE(),lg(t.deletion.error());}}function X(n,e){n&1&&(os(0,"p",4),pC(1,"Loading integrations\u2026"),zu());}function Z(n,e){n&1&&(os(0,"p",5),pC(1,"No integrations available."),zu());}function ee(n,e){n&1&&(os(0,"p",4),pC(1,"No integrations match the current filter."),zu());}function te(n,e){n&1&&(os(0,"ds-tag",20),pC(1,"YAML"),zu(),os(2,"ds-tag",21),pC(3,"Read-only"),zu());}function ne(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw().$implicit,c=Lw(2);return Ld(c.view(s))}),pC(1,"View"),zu();}if(n&2){let t=Lw().$implicit;Bh("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw(3).$implicit,c=Lw(2);return Ld(c.edit(s))}),pC(1," Edit "),zu();}if(n&2){let t=Lw(3).$implicit;Bh("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw(2).$implicit,c=Lw(2);return Ld(c.duplicate(s))}),pC(1," Duplicate "),zu(),Iw(2,ie,2,1,"button",19);}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Duplicate "+t.config.name),IE(2),ww(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=Rw();os(0,"agentos-row-delete-action",25),qh("deleteRequested",function(){Pd(t);let s=Lw(2).$implicit,c=Lw(2);return Ld(c.deletion.request(s.key))})("deleteConfirmed",function(){Pd(t);let s=Lw(2).$implicit,c=Lw(2);return Ld(c.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Lw(4);return Ld(s.deletion.cancel())}),zu();}if(n&2){let t=Lw(2).$implicit,a=Lw(2);Vh("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(os(0,"button",24),pC(1,"Inherited"),zu());}function le(n,e){if(n&1&&(Iw(0,oe,3,2),Iw(1,ae,1,3,"agentos-row-delete-action",23),Iw(2,re,2,0,"button",24)),n&2){let t=Lw().$implicit,a=Lw(2);ww(a.deletion.confirmingId()!==t.key?0:-1),IE(),ww(t.canDelete?1:-1),IE(),ww(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14)(6,"div",15)(7,"ds-tag",16),pC(8),zu(),Iw(9,te,4,0),zu()(),os(10,"td",17)(11,"div",18),Iw(12,ne,2,1,"button",19)(13,le,3,3),zu()()()),n&2){let t=e.$implicit;IE(2),lg(t.config.name),IE(2),Yu(" ",t.config.integrationType," "),IE(3),Vh("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),IE(),Yu(" ",t.scopeLabel," "),IE(),ww(t.source==="FILESYSTEM"?9:-1),IE(3),ww(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Type"),zu(),os(8,"th",10),pC(9,"Scope"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,se,14,6,"tr",9,Q),zu()()()),n&2){let t=Lw();IE(14),_w(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceApi=g(L);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=Mi("this namespace");isAdmin=Mi(false);isLoading=Mi(true);rows=Mi([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(te$1(e=>e.get("namespaceId")??""),Ys(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Dr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=ew({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return a.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),pC(3,"New integration"),zu()(),Iw(4,W,2,1,"p",3),Iw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(Vh("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),IE(),Vh("query",a.rowFilter.query()),IE(3),ww(a.deletion.error()?4:-1),IE(),ww(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {I}from'./chunk-DGU69dIe.js';import {g,W,b0 as J,v as we,M as Mi,i as VC,b1 as ke,ag as Gm,x as U,a6 as Zs,ae as Dr,a as ew,o as os,H as Hh,I as Iw,z as zu,K as qh,c as IE,w as ww,J as Vh,b as pC,R as Rw,N as lI,T as Tw,L as Lw,Q as fI,_ as _w,Y as Yu,$ as dg,P as Pd,n as Ld,l as lg}from'./main-OQ262YIZ.js';import {a9 as gd,M as Mo,D as Do,U as Ut,q as Mn,Q as Qt,c as fo,ab as _a,af as Bi,v as vn,d as yn,e as fn,n as pn,h as hn,_ as _n,i as at,u as un,o as cn}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(os(0,"p",1),pC(1,"Loading\u2026"),zu());}function se(i,t){if(i&1&&(os(0,"ds-notice"),pC(1),zu()),i&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function re(i,t){if(i&1){let e=Rw();os(0,"div")(1,"button",23),qh("click",function(){Pd(e);let s=Lw(2);return Ld(s.retryLoad())}),pC(2,"Retry loading"),zu()();}}function ce(i,t){if(i&1&&(Hh(0,"br"),pC(1)),i&2){let e=Lw(3);IE(),Yu("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(os(0,"ds-notice",3),pC(1),Iw(2,ce,2,1),zu()),i&2){let e=Lw(2);Vh("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),IE(),Yu(" Repository: ",e.checkoutStatus()," "),IE(),ww(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(os(0,"option",12),pC(1),zu()),i&2){let e=t.$implicit,c=Lw(2);Vh("value",e.id),IE(),dg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(os(0,"p",13),pC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),zu());}function pe(i,t){if(i&1){let e=Rw();os(0,"button",24),qh("click",function(){Pd(e);let s=Lw(2);return Ld(s.remove())}),pC(1," Remove association "),zu();}if(i&2){let e=Lw(2);Vh("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Rw();Iw(0,se,2,1,"ds-notice"),Iw(1,re,3,0,"div"),Iw(2,de,3,3,"ds-notice",3),os(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),qh("ngModelChange",function(s){Pd(e);let u=Lw();return Ld(u.repositoryUrl.set(s))}),zu(),lI(),zu(),os(6,"ds-form-field",7)(7,"input",8),qh("ngModelChange",function(s){Pd(e);let u=Lw();return Ld(u.mainBranch.set(s))}),zu(),lI(),zu(),os(8,"ds-form-field",9)(9,"select",10),qh("ngModelChange",function(s){Pd(e);let u=Lw();return Ld(u.serviceAuthSettingId.set(s))}),os(10,"option",11),pC(11,"Select an auth setting\u2026"),zu(),Tw(12,le,2,3,"option",12,oe),zu(),lI(),Iw(14,me,2,0,"p",13),zu()(),os(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),qh("ngModelChange",function(s){Pd(e);let u=Lw();return Ld(u.autoWorktree.set(s))}),zu(),lI(),pC(19," Offer a worktree to every new top-level case "),zu(),os(20,"p",18),pC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),zu()(),os(22,"ds-form-field",19)(23,"input",20),qh("ngModelChange",function(s){Pd(e);let u=Lw();return Ld(u.setupCommand.set(s))}),zu(),lI(),os(24,"p",13),pC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),zu()()(),os(26,"ds-form-actions")(27,"button",21),qh("click",function(){Pd(e);let s=Lw();return Ld(s.save())}),pC(28),zu(),Iw(29,pe,2,1,"button",22),zu();}if(i&2){let e=Lw();ww(e.errorMessage()?0:-1),IE(),ww(e.associationLoaded()?-1:1),IE(),ww(e.isAssociated()&&e.checkoutStatus()?2:-1),IE(),Vh("disabled",!e.associationLoaded()||e.isSaving()),IE(2),Vh("ngModel",e.repositoryUrl()),fI(),IE(2),Vh("ngModel",e.mainBranch()),fI(),IE(2),Vh("ngModel",e.serviceAuthSettingId()),fI(),IE(3),_w(e.eligibleAuthSettings()),IE(2),ww(e.eligibleAuthSettings().length===0?14:-1),IE(),Vh("disabled",!e.associationLoaded()||e.isSaving()),IE(3),Vh("ngModel",e.autoWorktree()),fI(),IE(5),Vh("ngModel",e.setupCommand()),fI(),IE(4),Vh("disabled",!e.canSave()),IE(),Yu(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),IE(),ww(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(J);authSettingState=g(I);destroyRef=g(we);isLoading=Mi(true);isSaving=Mi(false);confirmingRemove=Mi(false);associationLoaded=Mi(false);errorMessage=Mi(null);association=Mi(null);authSettings=Mi([]);repositoryUrl=Mi("");mainBranch=Mi("main");serviceAuthSettingId=Mi("");autoWorktree=Mi(false);setupCommand=Mi("");namespaceId="";isAssociated=VC(()=>this.association()?.associated===true);eligibleAuthSettings=VC(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=VC(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=VC(()=>this.association()?.checkoutStatus??null);CheckoutStatus=ke;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Gm({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),Zs(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Dr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),Zs(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Dr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(os(0,"ds-page"),Hh(1,"ds-section-header",0),Iw(2,ae,2,0,"p",1)(3,ue,30,14),zu(),os(4,"ds-confirm-dialog",2),qh("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),zu()),e&2&&(IE(2),ww(c.isLoading()?2:3),IE(2),Vh("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
|
|
2
|
+
export{ne as NamespaceGitComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-BnIh2Agv.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,F,v as we,M as Mi,x as U$1,am as De,ap as _e,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-OQ262YIZ.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let e=Lw();IE(),lg(e.deletion.error());}}function B(n,t){n&1&&(os(0,"p",4),pC(1,"Loading scheduled prompts\u2026"),zu());}function j(n,t){n&1&&(os(0,"p",5),pC(1,"No platform scheduled prompts defined yet."),zu());}function W(n,t){n&1&&(os(0,"p",4),pC(1,"No scheduled prompts match the current filter."),zu());}function H(n,t){if(n&1&&(os(0,"span",14),pC(1),zu()),n&2){let e=Lw().$implicit;IE(),lg(e.description);}}function O(n,t){if(n&1){let e=Rw();os(0,"button",21),qh("click",function(){Pd(e);let s=Lw().$implicit,c=Lw(2);return Ld(c.toggle(s))}),pC(1),zu(),os(2,"button",21),qh("click",function(){Pd(e);let s=Lw().$implicit,c=Lw(2);return Ld(c.edit(s))}),pC(3,"Edit"),zu();}if(n&2){let e=Lw().$implicit;IE(),lg(e.enabled?"Disable":"Enable"),IE(),Bh("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=Rw();os(0,"agentos-row-delete-action",22),qh("deleteRequested",function(){Pd(e);let s=Lw().$implicit,c=Lw(2);return Ld(c.deletion.request(s.id))})("deleteConfirmed",function(){Pd(e);let s=Lw().$implicit,c=Lw(2);return Ld(c.confirmDelete(s))})("deleteCancelled",function(){Pd(e);let s=Lw(3);return Ld(s.deletion.cancel())}),zu();}if(n&2){let e=Lw().$implicit,i=Lw(2);Vh("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(os(0,"tr",9)(1,"td",12)(2,"span",13),pC(3),zu(),Iw(4,H,2,1,"span",14),zu(),os(5,"td",15),pC(6),zu(),os(7,"td",16)(8,"ds-tag",17),pC(9),zu()(),os(10,"td",18)(11,"div",19),Iw(12,O,4,2),Iw(13,Y,1,3,"agentos-row-delete-action",20),zu()()()),n&2){let e=t.$implicit,i=Lw(2);IE(3),lg(e.name),IE(),ww(e.description?4:-1),IE(2),lg(i.scheduleLabel(e)),IE(2),Vh("variant",e.enabled?"accent":"outline"),IE(),lg(e.enabled?"Enabled":"Disabled"),IE(3),ww(i.deletion.confirmingId()!==e.id?12:-1),IE(),ww(e.id?13:-1);}}function G(n,t){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Schedule"),zu(),os(8,"th",10),pC(9,"Status"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,z,14,7,"tr",9,M),zu()()()),n&2){let e=Lw();IE(14),_w(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=Mi([]);isLoading=Mi(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===De.WEEK?"week":"month",s=e.unit===De.WEEK&&e.days?.length?` (${e.days.map(c=>_e[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=ew({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&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return i.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),pC(3,"New scheduled prompt"),zu()(),Iw(4,U,2,1,"p",3),Iw(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&&(IE(),Vh("query",i.rowFilter.query()),IE(3),ww(i.deletion.error()?4:-1),IE(),ww(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 {O as O$1}from'./chunk-RltTZwlz.js';import {g,F,v as we,aj as G$1,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';import {r as k,O as O$2,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(os(0,"p",3),pC(1),zu()),t&2){let n=Lw();IE(),lg(n.deletion.error());}}function K(t,e){t&1&&(os(0,"p",4),pC(1,"Loading integrations\u2026"),zu());}function H(t,e){t&1&&(os(0,"p",5),pC(1,"No platform integrations defined yet."),zu());}function U(t,e){t&1&&(os(0,"p",4),pC(1,"No integrations match the current filter."),zu());}function z(t,e){if(t&1){let n=Rw();os(0,"button",18),qh("click",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.edit(d))}),pC(1,"Edit"),zu();}if(t&2){let n=Lw().$implicit;Bh("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Rw();os(0,"agentos-row-delete-action",19),qh("deleteRequested",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(d.id))})("deleteConfirmed",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(d))})("deleteCancelled",function(){Pd(n);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(t&2){let n=Lw().$implicit,r=Lw(2);Vh("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14)(6,"div",15),Iw(7,z,2,1,"button",16),Iw(8,G,1,3,"agentos-row-delete-action",17),zu()()()),t&2){let n=e.$implicit,r=Lw(2);IE(2),lg(n.name),IE(2),lg(n.integrationType),IE(3),ww(r.deletion.confirmingId()!==n.id?7:-1),IE(),ww(n.id?8:-1);}}function O(t,e){if(t&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Type"),zu(),os(8,"th",10)(9,"span",11),pC(10,"Actions"),zu()()()(),os(11,"tbody",8),Tw(12,J,9,4,"tr",9,j),zu()()()),t&2){let n=Lw();IE(12),_w(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);state=g(O$1);integrationConfigController=g(G$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();configs=Mi([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ew({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return r.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return r.openCreateForm()}),pC(3,"New integration"),zu()(),Iw(4,A,2,1,"p",3),Iw(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&&(IE(),Vh("query",r.rowFilter.query()),IE(3),ww(r.deletion.error()?4:-1),IE(),ww(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {r as k,O as O$1,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,F,v as we,ak as U$1,a3 as vr,M as Mi,a5 as Ys,x as U$2,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-OQ262YIZ.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let t=Lw();IE(),lg(t.deletion.error());}}function K(n,e){n&1&&(os(0,"p",4),pC(1,"Loading agent configs\u2026"),zu());}function H(n,e){n&1&&(os(0,"p",5),pC(1,"No platform agent configs defined yet."),zu());}function U(n,e){n&1&&(os(0,"p",4),pC(1,"No agent configs match the current filter."),zu());}function z(n,e){if(n&1){let t=Rw();os(0,"button",19),qh("click",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.inspect(d))}),pC(1," Inspect "),zu(),os(2,"button",19),qh("click",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.edit(d))}),pC(3,"Edit"),zu();}if(n&2){let t=Lw().$implicit;Bh("aria-label","Inspect "+t.name),IE(2),Bh("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=Rw();os(0,"agentos-row-delete-action",20),qh("deleteRequested",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.deletion.request(d.id))})("deleteConfirmed",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.confirmDelete(d))})("deleteCancelled",function(){Pd(t);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(n&2){let t=Lw().$implicit,a=Lw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14),pC(6),zu(),os(7,"td",15),pC(8),zu(),os(9,"td",16)(10,"div",17),Iw(11,z,4,2),Iw(12,G,1,3,"agentos-row-delete-action",18),zu()()()),n&2){let t=e.$implicit,a=Lw(2);IE(2),lg(t.name),IE(2),Yu(" ",t.description||"\u2014"," "),IE(2),lg(t.modelName||"\u2014"),IE(2),lg(a.mode(t)),IE(3),ww(a.deletion.confirmingId()!==t.id?11:-1),IE(),ww(t.id?12:-1);}}function O(n,e){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Description"),zu(),os(8,"th",10),pC(9,"Model"),zu(),os(10,"th",10),pC(11,"Execution mode"),zu(),os(12,"th",10)(13,"span",11),pC(14,"Actions"),zu()()()(),os(15,"tbody",8),Tw(16,J,13,6,"tr",9,B),zu()()()),n&2){let t=Lw();IE(16),_w(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();configs=Mi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return a.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),pC(3,"New agent config"),zu()(),Iw(4,j,2,1,"p",3),Iw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(IE(),Vh("query",a.rowFilter.query()),IE(3),ww(a.deletion.error()?4:-1),IE(),ww(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {s}from'./chunk-DvtbHzPu.js';import {g,W,D as Dm,y,a as ew,G as Gu,b as pC,d as Wu,c as IE,l as lg}from'./main-OQ262YIZ.js';var A=class r{route=g(W);http=g(Dm);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=ew({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&&(Gu(0,"p",0),pC(1),Wu()),t&2&&(IE(),lg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {r as k$1,O,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,W as W$1,F,v as we,au as k,at as F$1,a3 as vr,M as Mi,a5 as Ys,ag as Gm,a6 as Zs,ae as Dr,x as U,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-OQ262YIZ.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let t=Lw();IE(),lg(t.deletion.error());}}function W(i,e){i&1&&(os(0,"p",4),pC(1,"Loading AI models\u2026"),zu());}function X(i,e){i&1&&(os(0,"p",5),pC(1,"No AI models configured."),zu());}function Y(i,e){i&1&&(os(0,"p",4),pC(1,"No AI models match the current filter."),zu());}function Z(i,e){i&1&&(os(0,"ds-tag",18),pC(1,"Read-only"),zu());}function ee(i,e){if(i&1){let t=Rw();os(0,"button",24),qh("click",function(){Pd(t);let s=Lw(2).$implicit,m=Lw(2);return Ld(m.edit(s))}),pC(1,"Edit"),zu();}if(i&2){let t=Lw(2).$implicit,n=Lw(2);Bh("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Rw();Iw(0,ee,2,1,"button",22),os(1,"agentos-row-delete-action",23),qh("deleteRequested",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(s.key))})("deleteConfirmed",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Lw(3);return Ld(s.deletion.cancel())}),zu();}if(i&2){let t=Lw().$implicit,n=Lw(2);ww(n.deletion.confirmingId()!==t.key?0:-1),IE(),Vh("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(os(0,"button",21),pC(1,"Inherited"),zu());}function ne(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14),pC(6),zu(),os(7,"td",15)(8,"div",16)(9,"ds-tag",17),pC(10),zu(),Iw(11,Z,2,0,"ds-tag",18),zu()(),os(12,"td",19)(13,"div",20),Iw(14,te,2,4)(15,ie,2,0,"button",21),zu()()()),i&2){let t=e.$implicit,n=Lw(2);IE(2),lg(n.title(t)),IE(2),lg(t.providerName),IE(2),Yu(" ",t.model.apiModelName," "),IE(3),Vh("variant",t.scope==="platform"?"neutral":"accent"),IE(),lg(t.scope==="platform"?"Platform":"Namespace"),IE(),ww(t.scope==="platform"?11:-1),IE(3),ww(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Provider"),zu(),os(8,"th",10),pC(9,"API model name"),zu(),os(10,"th",10),pC(11,"Scope"),zu(),os(12,"th",10)(13,"span",11),pC(14,"Actions"),zu()()()(),os(15,"tbody",8),Tw(16,ne,16,7,"tr",9,G),zu()()()),i&2){let t=Lw();IE(16),_w(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new vr(void 0);isLoading=Mi(true);deletion=k$1();rows=Mi([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),Gm({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(Zs(()=>Dr([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(Ys(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return Gm({namespace:Dr(e),platform:Dr(t),providers:Dr(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(Zs(()=>Dr([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,n){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return n.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return n.openCreateForm()}),pC(3,"New AI model"),zu()(),Iw(4,Q,2,1,"p",3),Iw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(IE(),Vh("query",n.rowFilter.query()),IE(3),ww(n.deletion.error()?4:-1),IE(),ww(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-Do3ec7CW.js';import {F as s,v as vn,d as yn,l as dn,_ as _n,i as at,m as mn,A as Ao,G as Ni,H as On}from'./chunk-DvtbHzPu.js';import {g,W,F,v as we,M as Mi,i as VC,x as U,ag as Gm,a6 as Zs,ae as Dr,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,w as ww,L as Lw,J as Vh,R as Rw,H as Hh,a0 as RC,l as lg,Y as Yu,ay as kC,T as Tw,_ as _w,as as bw,P as Pd,n as Ld,az as xD}from'./main-OQ262YIZ.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(os(0,"a",2),pC(1,"Edit skill \u2192"),zu()),e&2){let n=Lw();Vh("routerLink",n.editRoute());}}function ee(e,t){e&1&&(os(0,"ds-tag",3),pC(1,"Platform level"),zu());}function te(e,t){e&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function ne(e,t){e&1&&(os(0,"ds-notice"),pC(1,"Failed to load skill."),zu());}function ie(e,t){if(e&1&&(os(0,"dt"),pC(1,"Created by"),zu(),os(2,"dd"),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.createdBy);}}function oe(e,t){if(e&1&&(os(0,"dt"),pC(1,"Last updated"),zu(),os(2,"dd"),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Iw(0,ie,4,1),Iw(1,oe,4,1)),e&2){let n=Lw();ww(n.createdBy?0:-1),IE(),ww(n.updatedOn?1:-1);}}function le(e,t){e&1&&(os(0,"p",4),pC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),zu());}function se(e,t){e&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function re(e,t){e&1&&(os(0,"ds-notice"),pC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),zu());}function de(e,t){e&1&&(os(0,"p",4),pC(1,"No agent references this skill."),zu());}function ce(e,t){e&1&&(os(0,"ds-tag",15),pC(1,"platform agent"),zu());}function me(e,t){e&1&&(os(0,"ds-tag",15),pC(1,"via *"),zu());}function pe(e,t){if(e&1&&(os(0,"li",13)(1,"span",14),pC(2),zu(),Iw(3,ce,2,0,"ds-tag",15),Iw(4,me,2,0,"ds-tag",15),zu()),e&2){let n=t.$implicit;IE(2),lg(n.name),IE(),ww(n.platform?3:-1),IE(),ww(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(os(0,"ul",12),Tw(1,pe,5,3,"li",13,Y),zu(),os(3,"p",4),pC(4," An agent listed "),os(5,"code"),pC(6,"via *"),zu(),pC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),zu()),e&2){let n=Lw(2);IE(),_w(n.consumers());}}function _e(e,t){e&1&&(os(0,"p",4),pC(1,"No resources bundled with this skill."),zu());}function ge(e,t){if(e&1){let n=Rw();os(0,"li")(1,"ds-disclosure",16),qh("toggled",function(){let r=Pd(n).$implicit,g=Lw(3);return Ld(g.toggleResource(r))}),os(2,"pre",17),pC(3),zu()()();}if(e&2){let n=t.$implicit,o=Lw(3);IE(),Vh("heading",n)("open",o.isResourceExpanded(n)),IE(2),lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(os(0,"ul",12),Tw(1,ge,4,3,"li",null,bw),zu()),e&2){let n=Lw(2);IE(),_w(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Rw();os(0,"ds-card",5)(1,"dl",6)(2,"dt"),pC(3,"Name"),zu(),os(4,"dd",7),pC(5),zu(),os(6,"dt"),pC(7,"Description"),zu(),os(8,"dd"),pC(9),zu(),os(10,"dt"),pC(11,"Scope"),zu(),os(12,"dd"),pC(13),zu(),os(14,"dt"),pC(15,"Storage"),zu(),os(16,"dd")(17,"ds-tag",8),pC(18),zu()(),Iw(19,ae,2,2),zu()(),os(20,"ds-card",9),Iw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),zu(),os(26,"ds-card")(27,"ds-disclosure",10),qh("toggled",function(){Pd(n);let r=Lw();return Ld(r.toggleBody())}),Hh(28,"div",11),RC(29,"agentosMarkdown"),zu()(),os(30,"ds-card",9),Iw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),zu();}if(e&2){let n=t,o=Lw();IE(5),lg(n.name),IE(4),lg(n.description),IE(4),lg(n.namespaceId?"Namespace":"Platform"),IE(4),Vh("variant",o.isFilesystemBacked()?"outline":"neutral"),IE(),Yu(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),IE(),ww(o.isFilesystemBacked()?-1:19),IE(),Vh("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),IE(),ww(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),IE(6),Vh("open",!o.bodyCollapsed()),IE(),Vh("innerHTML",kC(29,12,n.body),xD),IE(2),Vh("heading","Resources ("+o.resourcePaths().length+")"),IE(),ww(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Mi(true);hasError=Mi(false);skill=Mi(null);bodyCollapsed=Mi(false);expandedResources=Mi(new Set);resourcePaths=VC(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=VC(()=>this.skill()?.readOnly===true);consumers=Mi([]);consumersUnavailable=Mi(false);consumersLoading=Mi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Gm({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(Zs(()=>Dr([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ew({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return o.back()}),pC(3,"\u2190 Skills"),zu(),Iw(4,Z,2,1,"a",2),Iw(5,ee,2,0,"ds-tag",3),zu(),Iw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),zu()),n&2){let r;IE(4),ww(o.skill()&&!o.isFilesystemBacked()?4:-1),IE(),ww(o.isPlatformMode?5:-1),IE(),ww(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,On],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {i}from'./chunk-iZXu2H1x.js';import {y}from'./chunk-DvtbHzPu.js';import {g as g$1,at as F,a3 as vr,aw as $m,a5 as Ys,a6 as Zs,ae as Dr,ah as te,aK as my,a9 as Hl,C as w,aa as k}from'./main-OQ262YIZ.js';var g="none",N="me",O=class p{nsController=g$1(F);userState=g$1(y);refresh$=new vr(void 0);namespaceId$=new vr(null);vm$=$m([this.namespaceId$,this.refresh$]).pipe(Ys(([e])=>{let r=this.loadPlatformProviders().pipe(Zs(()=>Dr([])));return e?$m([r,this.loadNamespaceProviders(e).pipe(Zs(()=>Dr([]))),this.loadUserProviders(e).pipe(Zs(()=>Dr([]))),this.loadUserProviders("global").pipe(Zs(()=>Dr([])))]).pipe(te(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):$m([r,this.loadNamespaceProviders("").pipe(Zs(()=>Dr([]))),this.loadUserProviders("global").pipe(Zs(()=>Dr([])))]).pipe(te(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),my({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):Dr([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Hl(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Hl(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Hl(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Hl(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=k({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,
|
|
1
|
+
import {g,aQ as he,aa as k}from'./main-OQ262YIZ.js';var c=class r{api=g(he);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-Do3ec7CW.js';import {F as s,r as k,O,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,W,F,v as we,a3 as vr,M as Mi,a5 as Ys,ag as Gm,a6 as Zs,ae as Dr,ah as te$1,x as U,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,$ as dg,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-OQ262YIZ.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let t=Lw();IE(),lg(t.deletion.error());}}function ee(n,e){n&1&&(os(0,"p",4),pC(1,"Loading skills\u2026"),zu());}function te(n,e){n&1&&(os(0,"p",5),pC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),zu());}function ne(n,e){n&1&&(os(0,"p",4),pC(1,"No skills match the current filter."),zu());}function ie(n,e){if(n&1&&(os(0,"span",14),pC(1),zu()),n&2){let t=Lw().$implicit;IE(),dg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(os(0,"ds-tag",20),pC(1,"Read-only"),zu());}function oe(n,e){n&1&&(os(0,"ds-tag",21),pC(1,"SKILL.md"),zu());}function le(n,e){if(n&1){let t=Rw();os(0,"button",25),qh("click",function(){Pd(t);let d=Lw(2).$implicit,c=Lw(2);return Ld(c.edit(d))}),pC(1,"Edit"),zu();}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=Rw();os(0,"button",25),qh("click",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.inspect(d))}),pC(1," View "),zu(),Iw(2,le,2,1,"button",26);}if(n&2){let t=Lw().$implicit,a=Lw(2);Bh("aria-label","View "+t.skill.name),IE(2),ww(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=Rw();os(0,"agentos-row-delete-action",27),qh("deleteRequested",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.requestDelete(d))})("deleteConfirmed",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.confirmDelete(d))})("deleteCancelled",function(){Pd(t);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(n&2){let t=Lw().$implicit,a=Lw(2);Vh("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(os(0,"tr",9)(1,"td",12)(2,"span",13),pC(3),zu(),Iw(4,ie,2,2,"span",14),zu(),os(5,"td",15),pC(6),zu(),os(7,"td",16),pC(8),zu(),os(9,"td",17)(10,"div",18)(11,"ds-tag",19),pC(12),zu(),Iw(13,ae,2,0,"ds-tag",20),Iw(14,oe,2,0,"ds-tag",21),zu()(),os(15,"td",22)(16,"div",23),Iw(17,re,3,2),Iw(18,se,1,3,"agentos-row-delete-action",24),zu()()()),n&2){let t=e.$implicit,a=Lw(2);IE(3),lg(t.skill.name),IE(),ww(t.namedByAgents>0?4:-1),IE(2),Yu(" ",t.skill.description||"\u2014"," "),IE(2),lg(a.resourceCount(t.skill)),IE(3),Vh("variant",t.scope==="platform"?"neutral":"accent"),IE(),lg(t.scope==="platform"?"Platform":"Namespace"),IE(),ww(t.scope==="platform"?13:-1),IE(),ww(t.skill.readOnly?14:-1),IE(3),ww(a.deletion.confirmingId()!==t.key?17:-1),IE(),ww(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Description"),zu(),os(8,"th",10),pC(9,"Resources"),zu(),os(10,"th",10),pC(11,"Scope"),zu(),os(12,"th",10)(13,"span",11),pC(14,"Actions"),zu()()()(),os(15,"tbody",8),Tw(16,ce,19,10,"tr",9,Y),zu()()()),n&2){let t=Lw();IE(16),_w(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();rows=Mi([]);rowFilter=O(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),Gm({platform:this.skillState.listPlatform().pipe(Zs(()=>Dr([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Gm({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(Zs(()=>Dr([])))}).pipe(te$1(({namespace:e,platform:t})=>[...e,...t]),Zs(()=>Dr([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return a.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),pC(3,"New skill"),zu()(),Iw(4,Z,2,1,"p",3),Iw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(IE(),Vh("query",a.rowFilter.query()),IE(3),ww(a.deletion.error()?4:-1),IE(),ww(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-BjTEffSr.js';import {v}from'./chunk-t-Kfnaoc.js';import {g,W as W$1,F,v as we,M as Mi,x as U$1,ah as te$1,a5 as Ys,ae as Dr,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var H=(i,e)=>e.key;function U(i,e){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let t=Lw();IE(),lg(t.deletion.error());}}function z(i,e){i&1&&(os(0,"p",4),pC(1,"Loading AI providers\u2026"),zu());}function J(i,e){i&1&&(os(0,"p",5),pC(1,"No AI providers available."),zu());}function Q(i,e){i&1&&(os(0,"p",4),pC(1,"No AI providers match the current filter."),zu());}function W(i,e){i&1&&(os(0,"ds-tag",17),pC(1,"Read-only"),zu());}function X(i,e){if(i&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.duplicate(d))}),pC(1," Duplicate "),zu();}if(i&2){let t=Lw().$implicit;Bh("aria-label","Duplicate "+t.config.name);}}function Y(i,e){if(i&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let d=Lw(2).$implicit,c=Lw(2);return Ld(c.edit(d))}),pC(1," Edit "),zu();}if(i&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.config.name);}}function Z(i,e){if(i&1){let t=Rw();Iw(0,Y,2,1,"button",20),os(1,"agentos-row-delete-action",23),qh("deleteRequested",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.deletion.request(d.key))})("deleteConfirmed",function(){Pd(t);let d=Lw().$implicit,c=Lw(2);return Ld(c.confirmDelete(d))})("deleteCancelled",function(){Pd(t);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(i&2){let t=Lw().$implicit,r=Lw(2);ww(r.deletion.confirmingId()!==t.key?0:-1),IE(),Vh("rowKey",t.key)("rowLabel",t.config.name)("state",r.deletion);}}function ee(i,e){i&1&&(os(0,"button",21),pC(1,"Inherited"),zu());}function te(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14)(6,"div",15)(7,"ds-tag",16),pC(8),zu(),Iw(9,W,2,0,"ds-tag",17),zu()(),os(10,"td",18)(11,"div",19),Iw(12,X,2,1,"button",20),Iw(13,Z,2,4)(14,ee,2,0,"button",21),zu()()()),i&2){let t=e.$implicit,r=Lw(2);IE(2),lg(t.config.name),IE(2),lg(t.config.apiType),IE(3),Vh("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),IE(),lg(t.scopeLabel),IE(),ww(t.canMutate?-1:9),IE(3),ww(r.deletion.confirmingId()!==t.key?12:-1),IE(),ww(t.canMutate?13:14);}}function ie(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"API type"),zu(),os(8,"th",10),pC(9,"Scope"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,te,15,7,"tr",9,H),zu()()()),i&2){let t=Lw();IE(14),_w(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=Mi(false);isLoading=Mi(true);rows=Mi([]);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(te$1(e=>e.get("namespaceId")??""),Ys(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Dr(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=ew({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&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return r.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return r.openCreateForm()}),pC(3,"New AI provider"),zu()(),Iw(4,U,2,1,"p",3),Iw(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&&(IE(),Vh("query",r.rowFilter.query()),IE(3),ww(r.deletion.error()?4:-1),IE(),ww(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {g as g$1,aH as ie,aa as k}from'./main-OQ262YIZ.js';var g=class r{botController=g$1(ie);agentBots(t,e){return this.botController.listAgentMessagingBots(t,e)}attach(t,e,s,i,l){return this.botController.attachMessagingBot(t,e,{platform:s,token:i,appToken:l})}manifest(t,e,s){return this.botController.getMessagingBotAppManifest(t,e,s)}requestCreation(t,e,s){return this.botController.requestMessagingBotCreation(t,e,{platform:s})}setEnabled(t,e){return this.botController.updateMessagingBot(t,{enabled:e})}remove(t){return this.botController.deleteMessagingBot(t)}managers(){return this.botController.listMessagingBotManagers()}setManager(t,e){return this.botController.setMessagingBotManager({platform:t,token:e})}removeManager(t){return this.botController.deleteMessagingBotManager(t)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f,a9 as gd,a as fd,U as Ut,c as fo,g as go,aa as uo,ab as _a,ac as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,ad as f$1}from'./chunk-DvtbHzPu.js';import {g,W,aT as Y,M as Mi,af as ue$1,s as sf,a as ew,aU as Jb,o as os,H as Hh,I as Iw,z as zu,c as IE,w as ww,ao as Vl,a5 as Ys,a7 as Kt,ag as Gm,a6 as Zs,b as pC,R as Rw,K as qh,aV as mg,N as lI,L as Lw,aW as gg,Q as fI,T as Tw,_ as _w,aX as SC,aY as _C,l as lg,h as Bh,a0 as RC,ay as kC,$ as dg,Y as Yu,a1 as FC,P as Pd,n as Ld,aZ as DC}from'./main-OQ262YIZ.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&&(os(0,"p",2),pC(1,"Loading usage settings\u2026"),zu());}function fe(e,a){if(e&1){let t=Rw();os(0,"ds-notice"),pC(1,"Could not load usage settings. Please try again."),zu(),os(2,"div")(3,"button",3),qh("click",function(){Pd(t);let s=Lw();return Ld(s.configuration.retry())}),pC(4,"Retry usage settings"),zu()();}}function ye(e,a){e&1&&(os(0,"p",2),pC(1,"Usage tracking is disabled."),zu());}function be(e,a){e&1&&(os(0,"ds-notice"),pC(1),zu()),e&2&&(IE(),lg(a));}function xe(e,a){e&1&&(os(0,"p",2),pC(1,"Loading usage\u2026"),zu());}function he(e,a){e&1&&(os(0,"p",12),pC(1,"No recorded usage for this period."),zu());}function Se(e,a){if(e&1&&(os(0,"p",10),pC(1),zu()),e&2){let t=Lw().$implicit;IE(),Yu("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(os(0,"tr",16)(1,"td",18),pC(2),zu(),os(3,"td",19),pC(4),RC(5,"number"),zu(),os(6,"td",20),pC(7),RC(8,"number"),RC(9,"number"),zu(),os(10,"td",21),pC(11),RC(12,"number"),RC(13,"number"),zu(),os(14,"td",22),pC(15),RC(16,"agentosCost"),Iw(17,Se,2,1,"p",10),zu()()),e&2){let t=a.$implicit;IE(2),lg(t.key),IE(2),lg(kC(5,8,t.aggregate.totalTokens)),IE(3),dg(" ",kC(8,10,t.aggregate.inputTokens)," / ",kC(9,12,t.aggregate.outputTokens)," "),IE(4),dg(" ",kC(12,14,t.aggregate.cacheReadTokens)," / ",kC(13,16,t.aggregate.cacheWriteTokens)," "),IE(4),Yu(" ",FC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),IE(2),ww(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(os(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),pC(5,"Name"),zu(),os(6,"th",17),pC(7,"Tokens"),zu(),os(8,"th",17),pC(9,"Input / output"),zu(),os(10,"th",17),pC(11,"Cache read / write"),zu(),os(12,"th",17),pC(13,"Estimated cost"),zu()()(),os(14,"tbody",15),Tw(15,we,18,21,"tr",16,_e),zu()()()),e&2){let t=Lw().$implicit;IE(),Bh("aria-label","Usage "+t.title.toLowerCase()),IE(14),_w(t.rows);}}function Ne(e,a){if(e&1&&(os(0,"h3",11),pC(1),zu(),Iw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;IE(),lg(t.title),IE(),ww(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Tw(0,Ne,4,2,null,null,ue),os(2,"p",10),pC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),zu()),e&2){let t=Lw(2);_w(SC(4,ge,_C(0,ce,t.agents()),_C(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(t);let s=Lw();return Ld(s.load())}),os(1,"ds-form-field",5)(2,"input",6),mg("ngModelChange",function(s){Pd(t);let m=Lw();return DC(m.from,s)||(m.from=s),Ld(s)}),zu(),lI(),zu(),os(3,"ds-form-field",7)(4,"input",8),mg("ngModelChange",function(s){Pd(t);let m=Lw();return DC(m.to,s)||(m.to=s),Ld(s)}),zu(),lI(),zu(),os(5,"button",9),pC(6,"Refresh"),zu()(),Iw(7,be,2,1,"ds-notice"),Iw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=Lw();IE(2),gg("ngModel",r.from),fI(),IE(2),gg("ngModel",r.to),fI(),IE(3),ww((t=r.error())?7:-1,t),IE(),ww(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=Mi([]);models=Mi([]);error=Mi(null);loading=Mi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){sf(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Vl(void 0),Ys(()=>{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),Kt):(this.loading.set(true),Gm({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(Zs(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."),Kt))))})).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=ew({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&&(os(0,"ds-page",0),Hh(1,"ds-section-header",1),Iw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),zu()),t&2&&(IE(2),ww(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,Jb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-fbDk9ppW.js';import {I,n as nt,i as it}from'./chunk-Db_G9wnV.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-P6EOYPYG.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-BeAWBIRs.js';import'./chunk-Cq9rgtVx.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})};
|
|
1
|
+
import {v}from'./chunk-t-Kfnaoc.js';import {I,n as nt,i as it}from'./chunk-DGU69dIe.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-OQ262YIZ.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-DvtbHzPu.js';import'./chunk-iZXu2H1x.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})};
|
|
2
2
|
export{me as AuthSettingFormComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {b2 as A,b3 as z$1}from'./main-OQ262YIZ.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
|
|
2
2
|
`});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
|
|
3
3
|
`?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
|
|
4
4
|
`&&(E.last=l.length==0||l[0].tag==`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {I as I$1}from'./chunk-DGU69dIe.js';import {g,F,v as we,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(os(0,"p",3),pC(1),zu()),e&2){let n=Lw();IE(),lg(n.deletion.error());}}function K(e,t){e&1&&(os(0,"p",4),pC(1,"Loading auth settings\u2026"),zu());}function H(e,t){e&1&&(os(0,"p",5),pC(1,"No platform auth settings defined yet."),zu());}function U(e,t){e&1&&(os(0,"p",4),pC(1,"No auth settings match the current filter."),zu());}function z(e,t){if(e&1){let n=Rw();os(0,"button",18),qh("click",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.onEdit(d))}),pC(1," Edit "),zu();}if(e&2){let n=Lw().$implicit;Bh("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Rw();os(0,"agentos-row-delete-action",19),qh("deleteRequested",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(d.id))})("deleteConfirmed",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.onDelete(d))})("deleteCancelled",function(){Pd(n);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(e&2){let n=Lw().$implicit,a=Lw(2);Vh("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14)(6,"div",15),Iw(7,z,2,1,"button",16),Iw(8,G,1,3,"agentos-row-delete-action",17),zu()()()),e&2){let n=t.$implicit,a=Lw(2);IE(2),lg(n.name),IE(2),Yu(" ",n.authType," "),IE(3),ww(a.deletion.confirmingId()!==n.id?7:-1),IE(),ww(n.id?8:-1);}}function O(e,t){if(e&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Authentication type"),zu(),os(8,"th",10)(9,"span",11),pC(10,"Actions"),zu()()()(),os(11,"tbody",8),Tw(12,J,9,4,"tr",9,B),zu()()()),e&2){let n=Lw();IE(12),_w(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();settings=Mi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ew({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return a.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),pC(3,"New auth setting"),zu()(),Iw(4,j,2,1,"p",3),Iw(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&&(IE(),Vh("query",a.rowFilter.query()),IE(3),ww(a.deletion.error()?4:-1),IE(),ww(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {g,V,A as A$1,p as pe$1,W as W$1,e as ee$1,B,a as ew,o as os,H as Hh,I as Iw,b as pC,z as zu,c as IE,w as ww,r as rg,G as Gu,Z as Zh,d as Wu,U as Uh,f as Gh,h as Bh,M as Mi,i as VC,T as Tw,_ as _w,j as f,l as lg,k as TC,F,s as sf,m as go,Y as Yu,L as Lw,R as Rw,P as Pd,n as Ld,O as Op,q as nC,t as ng}from'./main-OQ262YIZ.js';function ne(t,n){if(t&1&&(Gu(0,"p",7),pC(1),Wu()),t&2){let e=Lw();IE(),lg(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=ew({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&&(Gu(0,"form",0),Zh("submit",function(c){return o.submit(c)}),Gu(1,"h2",1),pC(2,"What is your email?"),Wu(),Gu(3,"p",2),pC(4," It identifies you in Coday and makes you the administrator of this installation. Nothing is sent anywhere: it stays on this machine. "),Wu(),Gu(5,"label",3)(6,"span",4),pC(7,"Email"),Wu(),Gu(8,"input",5),Zh("input",function(c){return o.onInput(c)}),Wu(),Gu(9,"span",6),pC(10,"We are already downloading AgentOS in the background while you answer."),Wu()(),Iw(11,ne,2,1,"p",7),Gu(12,"div",8),Uh(13,"span"),Gu(14,"button",9),pC(15," Continue "),Wu()()()),e&2&&(IE(8),Gh("value",o.state.email()),Bh("aria-invalid",o.state.email()&&!o.state.emailValid()?"true":null),IE(3),ww(o.state.error()?11:-1),IE(3),Gh("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&&(Gu(0,"span",21),pC(1,"link"),Wu());}function ae(t,n){if(t&1){let e=Rw();Gu(0,"li")(1,"button",18),Zh("click",function(){let d=Pd(e).$implicit,c=Lw();return Ld(c.navigate(d.path))}),Gu(2,"span",19),pC(3,"\u{1F4C1}"),Wu(),Gu(4,"span",20),pC(5),Wu(),Iw(6,ie,2,0,"span",21),Wu()();}if(t&2){let e=n.$implicit;IE(5),lg(e.name),IE(),ww(e.symlink?6:-1);}}function le(t,n){t&1&&(Gu(0,"li",22),pC(1,"No sub-folders here."),Wu());}function de(t,n){if(t&1&&Iw(0,le,2,0,"li",22),t&2){let e=Lw();ww(e.loading()?-1:0);}}function se(t,n){if(t&1){let e=Rw();Gu(0,"form",23),Zh("submit",function(d){Pd(e);let c=Lw();return Ld(c.create(d))}),Gu(1,"input",24),Zh("input",function(d){Pd(e);let c=Lw();return Ld(c.onName(d))}),Wu(),Gu(2,"button",25),pC(3,"Create"),Wu(),Gu(4,"button",16),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.creating.set(false))}),pC(5,"Cancel"),Wu()();}if(t&2){let e=Lw();IE(),Gh("value",e.newName()),IE(),Gh("disabled",!e.newName().trim());}}function ce(t,n){if(t&1&&(Gu(0,"span"),pC(1),Wu()),t&2){let e=Lw(2);IE(),Yu("(",e.listing()?.hiddenCount,")");}}function pe(t,n){if(t&1){let e=Rw();Gu(0,"button",26),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.startCreate())}),pC(1," + New folder "),Wu(),Gu(2,"label",27)(3,"input",28),Zh("change",function(){Pd(e);let d=Lw();return Ld(d.toggleHidden())}),Wu(),pC(4," Show hidden "),Iw(5,ce,2,1,"span"),Wu();}if(t&2){let e=Lw();IE(3),Gh("checked",e.showHidden()),IE(2),ww(e.listing()?.hiddenCount?5:-1);}}function me(t,n){if(t&1&&(Gu(0,"p",14),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.browseError());}}function _e(t,n){if(t&1&&(Gu(0,"p",14),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.state.error());}}var $=class t{state=g(V);listing=Mi(null);loading=Mi(false);browseError=Mi(null);showHidden=Mi(false);creating=Mi(false);newName=Mi("");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=ew({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&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Where should Coday keep your files?"),Wu(),Gu(3,"p",2),pC(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. "),Wu(),Gu(5,"div",3)(6,"span",4),pC(7,"Selected folder"),Wu(),Gu(8,"code",5),pC(9),Wu()(),Gu(10,"div",6)(11,"div",7)(12,"button",8),Zh("click",function(){return o.navigate(o.listing()?.parent??void 0)}),pC(13," \u2191 "),Wu(),Gu(14,"button",9),Zh("click",function(){return o.navigate(o.listing()?.home)}),pC(15," \u2302 "),Wu(),Gu(16,"code",10),pC(17),Wu()(),Gu(18,"ul",11),Tw(19,ae,7,2,"li",null,re,false,de,1,1),Wu(),Gu(22,"div",12),Iw(23,se,6,2,"form",13)(24,pe,6,2),Wu()(),Iw(25,me,2,1,"p",14),Iw(26,_e,2,1,"p",14),Gu(27,"div",15)(28,"button",16),Zh("click",function(){return o.state.back()}),pC(29,"Back"),Wu(),Gu(30,"button",17),Zh("click",function(){return o.submit()}),pC(31," Set everything up "),Wu()()()),e&2&&(IE(9),lg(o.state.folder()),IE(3),Gh("disabled",!o.listing()?.parent),IE(4),Gh("title",o.listing()?.path??""),IE(),lg(o.listing()?.path),IE(),Bh("aria-busy",o.loading()),IE(),_w(o.listing()?.entries??TC(10,oe)),IE(4),ww(o.creating()?23:24),IE(2),ww(o.browseError()?25:-1),IE(),ww(o.state.error()?26:-1),IE(4),Gh("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=Rw();Gu(0,"div",1)(1,"div",2),pC(2,"\u2713"),Wu(),Gu(3,"h2",3),pC(4,"You are all set"),Wu(),Gu(5,"p",4),pC(6,"Your workspace is ready and the Coday agent is waiting for you."),Wu(),Gu(7,"button",5),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.start())}),pC(8," Start with Coday "),Wu()();}}function xe(t,n){t&1&&(Gu(0,"h2",11),pC(1,"Starting Coday"),Wu(),Gu(2,"p",4),pC(3,"Just a moment, you will land in the app by yourself."),Wu());}function be(t,n){t&1&&(Gu(0,"h2",3),pC(1,"Setting things up"),Wu(),Gu(2,"p",4),pC(3,"This only happens once. You can keep this page open."),Wu());}function fe(t,n){t&1&&Uh(0,"span",14);}function ye(t,n){if(t&1&&pC(0),t&2){let e=Lw().$implicit,o=Lw(2);Yu(" ",o.icon(e.state)," ");}}function ve(t,n){if(t&1&&(Gu(0,"span",18),Uh(1,"span",19),Wu(),Gu(2,"span",17),pC(3),Wu()),t&2){let e=Lw().$implicit;Bh("aria-valuenow",e.percent??0),IE(),ng("width",e.percent??0,"%"),IE(2),Yu("",e.percent??0,"%");}}function Ce(t,n){if(t&1&&(Gu(0,"span",17),pC(1),Wu()),t&2){let e=Lw().$implicit;IE(),lg(e.message);}}function he(t,n){if(t&1&&(Gu(0,"li",12)(1,"span",13),Iw(2,fe,1,0,"span",14)(3,ye,1,1),Wu(),Gu(4,"span",15)(5,"span",16),pC(6),Wu(),Iw(7,ve,4,4)(8,Ce,2,1,"span",17),Wu()()),t&2){let e=n.$implicit;nC("item item--"+e.state),Bh("data-testid","step-"+e.key)("data-state",e.state),IE(2),ww(e.state==="running"?2:3),IE(4),lg(e.label),IE(),ww(e.key==="download"&&e.state==="running"?7:e.message?8:-1);}}function Ee(t,n){if(t&1&&(Gu(0,"div",8)(1,"strong"),pC(2,"Java 25 is required."),Wu(),Gu(3,"span"),pC(4),Wu(),Gu(5,"span"),pC(6,"Install it, then come back: this page continues by itself."),Wu()()),t&2){let e=Lw(2);IE(4),lg(e.javaHint());}}function Pe(t,n){if(t&1){let e=Rw();Gu(0,"div",9)(1,"strong"),pC(2,"Something went wrong."),Wu(),Gu(3,"span"),pC(4),Wu(),Gu(5,"span"),pC(6,"Fix your answers and run the setup again, or retry as is."),Wu(),Gu(7,"div",20)(8,"button",21),Zh("click",function(){Pd(e);let d=Lw(2);return Ld(d.state.editAfterFailure("providers"))}),pC(9," Change the API keys "),Wu(),Gu(10,"button",22),Zh("click",function(){Pd(e);let d=Lw(2);return Ld(d.state.editAfterFailure("folder"))}),pC(11," Change the folder "),Wu(),Gu(12,"button",23),Zh("click",function(){Pd(e);let d=Lw(2);return Ld(d.retry())}),pC(13," Try again "),Wu()()();}if(t&2){let e=Lw(2);IE(4),lg(e.applyError()),IE(4),Gh("disabled",e.state.busy()),IE(2),Gh("disabled",e.state.busy()),IE(2),Gh("disabled",e.state.busy());}}function we(t,n){if(t&1&&(Gu(0,"p",10),pC(1),Wu()),t&2){let e=Lw(2);IE(),lg(e.state.statusError());}}function Me(t,n){if(t&1&&(Iw(0,xe,4,0)(1,be,4,0),Gu(2,"ul",6),Tw(3,he,9,7,"li",7,ge),Wu(),Iw(5,Ee,7,1,"div",8),Iw(6,Pe,14,4,"div",9),Iw(7,we,2,1,"p",10)),t&2){let e=Lw();ww(e.loading()?0:1),IE(3),_w(e.items()),IE(2),ww(e.state.javaBlocked()?5:-1),IE(),ww(!e.loading()&&e.state.failed()?6:-1),IE(),ww(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=VC(()=>this.state.status()?.steps.java.hint??"");applyError=VC(()=>this.state.status()?.apply.error??null);loading=VC(()=>this.state.mode()==="loading");items=VC(()=>this.loading()?this.state.loadingChecklist():this.state.checklist());leaving=false;constructor(){sf(()=>{!this.loading()||!this.state.loadingReady()||this.state.preview()||go(()=>{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=ew({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&&(Gu(0,"section",0),Iw(1,ue,9,0,"div",1)(2,Me,8,4),Wu()),e&2&&(IE(),ww(!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=Rw();Gu(0,"span",17)(1,"button",18),Zh("click",function(){Pd(e);let d=Lw(2).$implicit,c=Lw();return Ld(c.state.moveProvider(d.draft.id,-1))}),pC(2," \u2191 "),Wu(),Gu(3,"button",19),Zh("click",function(){Pd(e);let d=Lw(2).$implicit,c=Lw();return Ld(c.state.moveProvider(d.draft.id,1))}),pC(4," \u2193 "),Wu()();}if(t&2){let e=Lw(2).$implicit,o=Lw();IE(),Gh("disabled",e.rank===1),IE(2),Gh("disabled",e.rank===o.enabledCount());}}function Te(t,n){if(t&1&&(Gu(0,"span",16),pC(1),Wu(),Iw(2,ke,5,2,"span",17)),t&2){let e=Lw().$implicit,o=Lw();Bh("aria-label","Rank "+e.rank),IE(),Yu("#",e.rank),IE(),ww(o.enabledCount()>1?2:-1);}}function Ie(t,n){if(t&1){let e=Rw();Gu(0,"label",15)(1,"span",20),pC(2,"API key"),Wu(),Gu(3,"input",21),Zh("input",function(d){Pd(e);let c=Lw().$implicit,h=Lw();return Ld(h.onKey(c.draft.id,d))})("keydown",function(d){Pd(e);let c=Lw().$implicit,h=Lw();return Ld(h.onCardKeydown(c.draft.id,d))}),Wu(),Gu(4,"span",22),pC(5," Stored on this machine only. "),Gu(6,"a",23),pC(7,"Get a key"),Wu()()();}if(t&2){let e=Lw().$implicit,o=Lw();IE(3),Gh("value",e.draft.apiKey),Bh("data-testid","provider-key-"+e.draft.id)("aria-invalid",o.keyTooShort(e.draft.id)?"true":null),IE(3),Gh("href",e.info.keyUrl,Op);}}function De(t,n){if(t&1){let e=Rw();Gu(0,"li",9),Zh("dragstart",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onDragStart(c.draft.id,d))})("dragover",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onDragOver(c.draft.id,d))})("drop",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onDrop(c.draft.id,d))})("dragend",function(){Pd(e);let d=Lw();return Ld(d.onDragEnd())}),Gu(1,"div",10)(2,"label",11)(3,"input",12),Zh("change",function(){let d=Pd(e).$implicit,c=Lw();return Ld(c.state.toggleProvider(d.draft.id))})("keydown",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onCardKeydown(c.draft.id,d))}),Wu(),Gu(4,"span",13),pC(5),Wu()(),Iw(6,Te,3,3),Wu(),Gu(7,"p",14),pC(8),Wu(),Iw(9,Ie,8,4,"label",15),Wu();}if(t&2){let e=n.$implicit,o=Lw();rg("card--on",e.draft.enabled)("card--dragging",o.dragging()===e.draft.id)("card--over",o.dragOver()===e.draft.id&&o.dragging()!==e.draft.id),Bh("draggable",e.draft.enabled&&o.enabledCount()>1?"true":null)("data-testid","provider-"+e.draft.id),IE(3),Gh("checked",e.draft.enabled),Bh("data-testid","provider-toggle-"+e.draft.id),IE(2),lg(e.info.label),IE(),ww(e.rank!==null?6:-1),IE(2),lg(e.info.description),IE(),ww(e.draft.enabled?9:-1);}}function Fe(t,n){if(t&1&&(Gu(0,"p",5),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.state.error());}}function Ve(t,n){if(t&1){let e=Rw();Gu(0,"button",24),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.state.back())}),pC(1,"Back"),Wu();}}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=Mi(null);dragOver=Mi(null);info=VC(()=>this.state.status()?.providers??ee);cards=VC(()=>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=VC(()=>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=ew({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&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Which models do you want to use?"),Wu(),Gu(3,"p",2),pC(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. "),Wu(),Gu(5,"ul",3),Tw(6,De,10,14,"li",4,Oe),Wu(),Iw(8,Fe,2,1,"p",5),Gu(9,"div",6),Iw(10,Ve,2,0,"button",7),Gu(11,"button",8),Zh("click",function(){return o.state.submitProviders()}),pC(12," Continue "),Wu()()()),e&2&&(IE(6),_w(o.cards()),IE(2),ww(o.state.error()?8:-1),IE(2),ww(o.state.emailLocked()?-1:10),IE(),Gh("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=Rw();Gu(0,"label",3)(1,"span",7),pC(2,"Email"),Wu(),Gu(3,"input",8),Zh("input",function(d){Pd(e);let c=Lw();return Ld(c.onEmail(d))}),Wu(),Gu(4,"span",9),pC(5,"Saved in your personal settings."),Wu()();}if(t&2){let e=Lw();IE(3),Gh("value",e.state.profileEmail()),Bh("aria-invalid",e.state.profileEmail()&&!e.state.profileEmailValid()?"true":null);}}function Le(t,n){if(t&1){let e=Rw();Gu(0,"li")(1,"label",3)(2,"span",7),pC(3),Wu(),Gu(4,"input",11),Zh("input",function(d){let c=Pd(e).$implicit,h=Lw(2);return Ld(h.onKey(c.name,d))}),Wu(),Gu(5,"span",9),pC(6,"Saved in your personal settings, used for you only."),Wu()()();}if(t&2){let e=n.$implicit,o=Lw(2);IE(3),lg(e.name),IE(),Gh("value",e.apiKey),Bh("data-testid","user-key-"+e.name)("aria-invalid",o.keyTooShort(e.apiKey)?"true":null);}}function Ke(t,n){if(t&1&&(Gu(0,"p",2),pC(1,"Paste a key for at least one of these providers, the others are optional."),Wu(),Gu(2,"ul",10),Tw(3,Le,7,4,"li",null,ze),Wu()),t&2){let e=Lw();IE(3),_w(e.state.userKeys());}}function $e(t,n){if(t&1&&(Gu(0,"p",4),pC(1),Wu()),t&2){let e=Lw();IE(),lg(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=ew({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&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Complete your profile"),Wu(),Gu(3,"p",2),pC(4," Your platform provides the AI providers, and Coday needs your email and at least one personal API key to start. "),Wu(),Iw(5,Ne,6,2,"label",3),Iw(6,Ke,5,0),Iw(7,$e,2,1,"p",4),Gu(8,"div",5),Uh(9,"span"),Gu(10,"button",6),Zh("click",function(){return o.state.submitProfile()}),pC(11," Save and continue "),Wu()()()),e&2&&(IE(5),ww(o.state.needsEmail()?5:-1),IE(),ww(o.state.needsUserKeys()?6:-1),IE(),ww(o.state.error()?7:-1),IE(3),Gh("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&&(os(0,"p",3),pC(1),zu()),t&2&&(IE(),Yu(" Preview: ",n,". Nothing is saved and this page stays here. "));}function Ue(t,n){t&1&&(os(0,"h1",6),pC(1,"Coday"),zu());}function He(t,n){t&1&&(os(0,"h1",6),pC(1,"Welcome to Coday"),zu(),os(2,"p",10),pC(3,"A few questions, then you are working with your first agent."),zu());}function Re(t,n){if(t&1&&(os(0,"li",12)(1,"span",13),pC(2),zu(),os(3,"span",14),pC(4),zu()()),t&2){let e=n.$implicit,o=n.$index,d=Lw(2);rg("stepper__item--active",d.state.step()===e.id)("stepper__item--done",o<d.state.stepIndex()),Bh("aria-current",d.state.step()===e.id?"step":null),IE(2),lg(o<d.state.stepIndex()?"\u2713":o+1),IE(2),lg(e.label);}}function Ye(t,n){if(t&1&&(os(0,"ol",7),Tw(1,Re,5,7,"li",11,We),zu()),t&2){let e=Lw();IE(),_w(e.steps);}}function qe(t,n){if(t&1&&(os(0,"p",8),pC(1),zu()),t&2){let e=Lw();IE(),lg(e.state.statusError());}}function Be(t,n){t&1&&Hh(0,"app-email-step");}function Ge(t,n){t&1&&Hh(0,"app-providers-step");}function Je(t,n){t&1&&Hh(0,"app-folder-step");}function Ze(t,n){t&1&&Hh(0,"app-user-keys-step");}function Qe(t,n){t&1&&Hh(0,"app-progress-step");}function Xe(t,n){if(t&1&&Iw(0,Ze,1,0,"app-user-keys-step")(1,Qe,1,0,"app-progress-step"),t&2){let e=Lw();ww(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(pe$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-DvtbHzPu.js').then(function(n){return n.ag});this.injector.get(n);}catch(n){}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({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&&(os(0,"main",0),Hh(1,"div",1),os(2,"section",2),Iw(3,Ae,2,1,"p",3),os(4,"header",4)(5,"div",5),pC(6,"C"),zu(),os(7,"div"),Iw(8,Ue,2,0,"h1",6)(9,He,4,0),zu()(),Iw(10,Ye,3,0,"ol",7),Iw(11,qe,2,1,"p",8),os(12,"div",9),Iw(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),zu()()()),e&2){let d,c;IE(3),ww((d=o.state.preview())?3:-1,d),IE(5),ww(o.state.mode()==="loading"?8:9),IE(2),ww(o.state.mode()==="wizard"?10:-1),IE(),ww(o.state.statusError()&&!o.state.status()?11:-1),IE(),rg("welcome__step--loading",o.state.mode()==="loading"),IE(),ww((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};
|