@whoz-oss/coday-client 0.0.0-workstream-forge.298 → 0.0.0-workstream-forge.299
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-Djrqlsja.js → chunk-0xo7y4S1.js} +1 -1
- package/browser/{chunk-BibOnln8.js → chunk-B6gsrnkr.js} +1 -1
- package/browser/{chunk-ClvOUHzO.js → chunk-B8ShoQZU.js} +1 -1
- package/browser/{chunk-QA5UvRgp.js → chunk-BAPa85aK.js} +1 -1
- package/browser/{chunk-BaXKtzjd.js → chunk-BAjpVi_E.js} +1 -1
- package/browser/{chunk-Bvdz5sFR.js → chunk-BEDwkVZi.js} +1 -1
- package/browser/{chunk-hSQhyXAK.js → chunk-BJt9W1KJ.js} +1 -1
- package/browser/{chunk-Dh9AMc9f.js → chunk-BQZxl77C.js} +1 -1
- package/browser/{chunk-GlRgl5dB.js → chunk-BYBwATcv.js} +1 -1
- package/browser/{chunk-DVwHMZjr.js → chunk-BjlPQNOw.js} +1 -1
- package/browser/chunk-BlhyPwlI.js +1 -0
- package/browser/{chunk-B5JsB4XI.js → chunk-Btjxfsn3.js} +1 -1
- package/browser/{chunk-9wvyLHuk.js → chunk-Bu-j1i1F.js} +1 -1
- package/browser/{chunk-BIkPktdf.js → chunk-C6D03eC9.js} +1 -1
- package/browser/{chunk-CdBOn66B.js → chunk-C7KIJivU.js} +1 -1
- package/browser/{chunk-BY4pYYCq.js → chunk-C90nyg8k.js} +3 -3
- package/browser/{chunk-BZmi7l-J.js → chunk-C9QdIeaf.js} +1 -1
- package/browser/{chunk-8XyNS78o.js → chunk-CFmjVNMp.js} +1 -1
- package/browser/{chunk-h1DwHzOw.js → chunk-CNsf98BP.js} +1 -1
- package/browser/{chunk-nfwj1uBg.js → chunk-CYuC3k-F.js} +1 -1
- package/browser/{chunk-BMhgEzMc.js → chunk-CdkH2NKZ.js} +1 -1
- package/browser/{chunk-DjrS7piD.js → chunk-CiWU3c_P.js} +1 -1
- package/browser/chunk-Cuut2fuQ.js +1 -0
- package/browser/{chunk-B42ywiOW.js → chunk-Cv0bmOfa.js} +1 -1
- package/browser/{chunk-EV6Gb91d.js → chunk-D6VG9tfL.js} +1 -1
- package/browser/{chunk-BtTk4lBd.js → chunk-DCWDH_a0.js} +1 -1
- package/browser/{chunk-Dp8Qtax9.js → chunk-DD2v7fvf.js} +1 -1
- package/browser/{chunk-BweVOo8c.js → chunk-DDm3cabl.js} +1 -1
- package/browser/{chunk-Dwi6o0t0.js → chunk-DKBlG8bB.js} +1 -1
- package/browser/{chunk-CZLbKUEE.js → chunk-DOWY5FGX.js} +1 -1
- package/browser/{chunk-9l3CfInB.js → chunk-DPfzD59Q.js} +1 -1
- package/browser/{chunk-CBQlusyZ.js → chunk-DdMkHIw_.js} +1 -1
- package/browser/{chunk-BP7l1804.js → chunk-DdTCwg3n.js} +1 -1
- package/browser/{chunk-BJGcsBm7.js → chunk-DgKHoGIv.js} +1 -1
- package/browser/{chunk-By5ToOHd.js → chunk-Dhs29Flf.js} +1 -1
- package/browser/chunk-DizwKPR4.js +1 -0
- package/browser/{chunk-Cqm5BJv_.js → chunk-DjLF6ZtY.js} +1 -1
- package/browser/{chunk-DvDLDjpo.js → chunk-Dly3kfft.js} +1 -1
- package/browser/{chunk-BHTuNMop.js → chunk-DoX2Jqcx.js} +1 -1
- package/browser/{chunk-CJ4vPhs4.js → chunk-DrowH10V.js} +1 -1
- package/browser/{chunk-DSwZ2lJp.js → chunk-DxbOkoDc.js} +1 -1
- package/browser/{chunk-DlUTCVia.js → chunk-Nldlx5RO.js} +1 -1
- package/browser/{chunk-zOYWk0nL.js → chunk-bT43nx1T.js} +1 -1
- package/browser/{chunk-DUQtHd5Q.js → chunk-d4x3KbTe.js} +1 -1
- package/browser/{chunk-BM0VZISu.js → chunk-fHUER4U6.js} +1 -1
- package/browser/{chunk-DfkhqlKG.js → chunk-kn6mevUy.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-WIKPRSWZ.js → main-EE6GZH3K.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BNT94xkt.js +0 -1
- package/browser/chunk-Bu0mFMKp.js +0 -1
- package/browser/chunk-DIe7xrW1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-CJ4vPhs4.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-BY4pYYCq.js';import {g,W,F,H as we$1,ag as U,ah as De$1,ai as ke$1,z as zi,aj as We,a9 as F$1,ak as Dd,k as yT,ac as Ny,M as U$1,a2 as ga,aa as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,r as fC,X as UI,t as tC,L as Lg,u as mf,w as yf,C as ch}from'./main-WIKPRSWZ.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function _e(n,t){if(n&1&&(Is(0,"ds-form-field",9),hg(1,"input",38),ml()),n&2){let e=fC(2);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Is(0,"a",39),UC(1,"Add an agent config"),ml(),UC(2," first. ")),n&2){let e=fC(3);pg("href","/agentos/"+e.namespaceId+"/agent-configs/new",ch);}}function xe(n,t){if(n&1&&(Is(0,"ds-form-field",10)(1,"p",2),UC(2," No agent configs available in this scope yet. "),Qw(3,Se,3,1),ml()()),n&2){let e=fC(2);KE(3),Kw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.id),KE(),Lg(e.name);}}function De(n,t){if(n&1&&(Is(0,"ds-form-field",11)(1,"select",40)(2,"option",41),UC(3,"Select an agent config\u2026"),ml(),eC(4,Ee,2,2,"option",17,ve),ml(),VI(),ml()),n&2){let e=fC(2);pg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(3),tC(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Ne(n,t){if(n&1){let e=aC();Is(0,"label",31)(1,"input",43),Eg("change",function(){let f=mf(e).$implicit,h=fC(3);return yf(h.toggleDay(f.value))}),ml(),UC(2),ml();}if(n&2){let e=t.$implicit,l=fC(3);KE(),pg("checked",l.isDaySelected(e.value)),KE(),Il(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Is(0,"ds-form-field",18)(1,"div",42),eC(2,Ne,3,2,"label",31,V),ml()()),n&2){let e=fC(2);KE(2),tC(e.dayOptions);}}function Me(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Pe(n,t){if(n&1&&(Is(0,"ds-form-field",28),hg(1,"input",44),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),KE(),pg("formControl",e.endDateControl),UI();}}function we(n,t){if(n&1&&(Is(0,"ds-form-field",29),hg(1,"input",45),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),KE(),pg("formControl",e.occurrenceCountControl),UI();}}function Fe(n,t){if(n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let f=fC();return yf(f.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Is(8,"ds-form-field",12),hg(9,"textarea",13),VI(),ml(),Is(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),eC(13,Te,2,2,"option",17,V),ml(),VI(),ml(),Qw(15,Ie,4,0,"ds-form-field",18),Is(16,"ds-form-field",19)(17,"div",20),hg(18,"input",21),VI(),Is(19,"span",22),UC(20,"UTC"),ml()()()(),Is(21,"ds-fieldset",23)(22,"ds-form-field",24),hg(23,"input",25),VI(),ml(),Is(24,"ds-form-field",26)(25,"select",27),eC(26,Me,2,2,"option",17,V),ml(),VI(),ml(),Qw(28,Pe,2,2,"ds-form-field",28),Qw(29,we,2,2,"ds-form-field",29),ml(),Is(30,"div",30)(31,"label",31),hg(32,"input",32),VI(),UC(33," Enabled "),ml(),Is(34,"p",33),UC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),ml()(),Is(36,"ds-form-field",34),hg(37,"textarea",35),VI(),ml(),Qw(38,Fe,2,1,"ds-notice"),Is(39,"ds-form-actions")(40,"button",36),UC(41),ml(),Is(42,"button",37),Eg("click",function(){mf(e);let f=fC();return yf(f.cancel())}),UC(43,"Cancel"),ml()()();}if(n&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),KE(3),pg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),KE(),pg("formControl",e.promptContentControl),UI(),KE(3),pg("formControl",e.unitControl),UI(),KE(),tC(e.schedulerUnits),KE(2),Kw(e.showDayFilter()?15:-1),KE(),pg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),KE(2),pg("formControl",e.timeUtcControl),UI(),KE(4),pg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),KE(),pg("formControl",e.startDateControl),UI(),KE(2),pg("formControl",e.endTypeControl),UI(),KE(),tC(e.endTypes),KE(2),Kw(e.showEndDate()?28:-1),KE(),Kw(e.showOccurrenceCount()?29:-1),KE(3),pg("formControl",e.enabledControl),UI(),KE(4),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(),Kw(e.errorMessage()?38:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(ke$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(De$1.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);errorMessage=zi(null);SchedulerUnit=ke$1;SchedulerEndType=De$1;schedulerUnits=[{value:ke$1.WEEK,label:"Week(s)"},{value:ke$1.MONTH,label:"Month(s)"}];endTypes=[{value:De$1.NEVER,label:"Never"},{value:De$1.ON_DATE,label:"On date"},{value:De$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(We).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Dd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Dd(this.endTypeControl.value)));showDayFilter=yT(()=>this.unitSignal()===ke$1.WEEK);showEndDate=yT(()=>this.endTypeSignal()===De$1.ON_DATE);showOccurrenceCount=yT(()=>this.endTypeSignal()===De$1.OCCURRENCES);agentConfigs=zi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),Ny({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ga(()=>_r([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===De$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===De$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return l.cancel()}),UC(3),ml()(),Qw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),ml()),e&2&&(KE(),pg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),KE(2),Il(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),KE(),Kw(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===De$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===De$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
|
|
1
|
+
import {c}from'./chunk-DrowH10V.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-C90nyg8k.js';import {g,W,F,H as we$1,ag as U,ah as De$1,ai as ke$1,z as zi,aj as We,a9 as F$1,ak as Dd,k as yT,ac as Ny,M as U$1,a2 as ga,aa as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,r as fC,X as UI,t as tC,L as Lg,u as mf,w as yf,C as ch}from'./main-EE6GZH3K.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function _e(n,t){if(n&1&&(Is(0,"ds-form-field",9),hg(1,"input",38),ml()),n&2){let e=fC(2);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Is(0,"a",39),UC(1,"Add an agent config"),ml(),UC(2," first. ")),n&2){let e=fC(3);pg("href","/agentos/"+e.namespaceId+"/agent-configs/new",ch);}}function xe(n,t){if(n&1&&(Is(0,"ds-form-field",10)(1,"p",2),UC(2," No agent configs available in this scope yet. "),Qw(3,Se,3,1),ml()()),n&2){let e=fC(2);KE(3),Kw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.id),KE(),Lg(e.name);}}function De(n,t){if(n&1&&(Is(0,"ds-form-field",11)(1,"select",40)(2,"option",41),UC(3,"Select an agent config\u2026"),ml(),eC(4,Ee,2,2,"option",17,ve),ml(),VI(),ml()),n&2){let e=fC(2);pg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(3),tC(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Ne(n,t){if(n&1){let e=aC();Is(0,"label",31)(1,"input",43),Eg("change",function(){let f=mf(e).$implicit,h=fC(3);return yf(h.toggleDay(f.value))}),ml(),UC(2),ml();}if(n&2){let e=t.$implicit,l=fC(3);KE(),pg("checked",l.isDaySelected(e.value)),KE(),Il(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Is(0,"ds-form-field",18)(1,"div",42),eC(2,Ne,3,2,"label",31,V),ml()()),n&2){let e=fC(2);KE(2),tC(e.dayOptions);}}function Me(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Pe(n,t){if(n&1&&(Is(0,"ds-form-field",28),hg(1,"input",44),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),KE(),pg("formControl",e.endDateControl),UI();}}function we(n,t){if(n&1&&(Is(0,"ds-form-field",29),hg(1,"input",45),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),KE(),pg("formControl",e.occurrenceCountControl),UI();}}function Fe(n,t){if(n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let f=fC();return yf(f.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Is(8,"ds-form-field",12),hg(9,"textarea",13),VI(),ml(),Is(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),eC(13,Te,2,2,"option",17,V),ml(),VI(),ml(),Qw(15,Ie,4,0,"ds-form-field",18),Is(16,"ds-form-field",19)(17,"div",20),hg(18,"input",21),VI(),Is(19,"span",22),UC(20,"UTC"),ml()()()(),Is(21,"ds-fieldset",23)(22,"ds-form-field",24),hg(23,"input",25),VI(),ml(),Is(24,"ds-form-field",26)(25,"select",27),eC(26,Me,2,2,"option",17,V),ml(),VI(),ml(),Qw(28,Pe,2,2,"ds-form-field",28),Qw(29,we,2,2,"ds-form-field",29),ml(),Is(30,"div",30)(31,"label",31),hg(32,"input",32),VI(),UC(33," Enabled "),ml(),Is(34,"p",33),UC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),ml()(),Is(36,"ds-form-field",34),hg(37,"textarea",35),VI(),ml(),Qw(38,Fe,2,1,"ds-notice"),Is(39,"ds-form-actions")(40,"button",36),UC(41),ml(),Is(42,"button",37),Eg("click",function(){mf(e);let f=fC();return yf(f.cancel())}),UC(43,"Cancel"),ml()()();}if(n&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),KE(3),pg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),KE(),pg("formControl",e.promptContentControl),UI(),KE(3),pg("formControl",e.unitControl),UI(),KE(),tC(e.schedulerUnits),KE(2),Kw(e.showDayFilter()?15:-1),KE(),pg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),KE(2),pg("formControl",e.timeUtcControl),UI(),KE(4),pg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),KE(),pg("formControl",e.startDateControl),UI(),KE(2),pg("formControl",e.endTypeControl),UI(),KE(),tC(e.endTypes),KE(2),Kw(e.showEndDate()?28:-1),KE(),Kw(e.showOccurrenceCount()?29:-1),KE(3),pg("formControl",e.enabledControl),UI(),KE(4),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(),Kw(e.errorMessage()?38:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(ke$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(De$1.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);errorMessage=zi(null);SchedulerUnit=ke$1;SchedulerEndType=De$1;schedulerUnits=[{value:ke$1.WEEK,label:"Week(s)"},{value:ke$1.MONTH,label:"Month(s)"}];endTypes=[{value:De$1.NEVER,label:"Never"},{value:De$1.ON_DATE,label:"On date"},{value:De$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(We).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Dd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Dd(this.endTypeControl.value)));showDayFilter=yT(()=>this.unitSignal()===ke$1.WEEK);showEndDate=yT(()=>this.endTypeSignal()===De$1.ON_DATE);showOccurrenceCount=yT(()=>this.endTypeSignal()===De$1.OCCURRENCES);agentConfigs=zi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),Ny({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ga(()=>_r([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===De$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===De$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return l.cancel()}),UC(3),ml()(),Qw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),ml()),e&2&&(KE(),pg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),KE(2),Il(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),KE(),Kw(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===De$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===De$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {w 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,x as yo,z as bo,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un}from'./chunk-C90nyg8k.js';import {g,W,F,H as we,ag as U,z as zi,M as U$1,a2 as ga,aa as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,am as Xw,r as fC,X as UI,L as Lg,t as tC,j as fg,u as mf,w as yf}from'./main-EE6GZH3K.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function fe(o,t){if(o&1&&(Is(0,"ds-form-field",20),hg(1,"input",22),ml()),o&2){let e=fC(3);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Is(0,"option",24),UC(1),ml()),o&2){let e=t.$implicit;pg("ngValue",e.id),KE(),Lg(e.name);}}function Ce(o,t){if(o&1&&(Is(0,"ds-form-field",21)(1,"select",23)(2,"option",24),UC(3,"\u2014 None \u2014"),ml(),eC(4,ge,2,2,"option",24,ce),ml(),VI(),ml()),o&2){let e=fC(3);KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Qw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=fC(2);Kw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Is(0,"p",2),UC(1,"No parameters defined."),ml());}function he(o,t){if(o&1){let e=aC();Is(0,"div",11)(1,"div",25)(2,"ds-form-field",26),hg(3,"input",27),VI(),ml(),Is(4,"ds-form-field",28),hg(5,"input",29),VI(),ml(),Is(6,"ds-form-field",30),hg(7,"input",31),VI(),ml()(),Is(8,"button",32),Eg("click",function(){let d=mf(e).$index,m=fC(2);return yf(m.removeParameter(d))}),UC(9," \xD7 "),ml()();}if(o&2){let e=t.$implicit,r=t.$index;pg("formGroupName",r),KE(2),pg("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),KE(),pg("id","param-name-"+r),UI(),KE(),pg("controlId","param-desc-"+r),KE(),pg("id","param-desc-"+r),UI(),KE(),pg("controlId","param-default-"+r)("error",e.controls.defaultValue.invalid&&e.controls.defaultValue.touched?"Default value is required.":null),KE(),pg("id","param-default-"+r),UI();}}function _e(o,t){if(o&1){let e=aC();Is(0,"div",14)(1,"span",33),UC(2),ml(),Is(3,"ds-form-field",34),hg(4,"textarea",35),VI(),ml(),Is(5,"button",36),Eg("click",function(){let d=mf(e).$index,m=fC(2);return yf(m.removeContentEntry(d))}),UC(6," \xD7 "),ml()();}if(o&2){let e=t.$implicit,r=t.$index,d=fC(2);KE(2),Lg(r+1),KE(),pg("error",e.invalid&&e.touched?"Content entry must not be blank.":null),KE(),pg("formControlName",r),fg("aria-label","Content entry "+(r+1)),UI(),KE(),pg("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Is(0,"ds-notice"),UC(1),ml()),o&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function be(o,t){if(o&1){let e=aC();Is(0,"button",37),Eg("click",function(){mf(e);let d=fC(2);return yf(d.exportYaml())}),UC(1),ml();}if(o&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let d=fC();return yf(d.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,ye,2,1),Is(6,"ds-fieldset",9)(7,"p",2),UC(8," Each parameter must have a name and a default value. Use "),Is(9,"code"),UC(10),ml(),UC(11," in content entries to reference them. "),ml(),Is(12,"div",10),Qw(13,ve,2,0,"p",2),eC(14,he,10,9,"div",11,Xw),Is(16,"div")(17,"button",12),Eg("click",function(){mf(e);let d=fC();return yf(d.addParameter())}),UC(18,"+ Add parameter"),ml()()()(),Is(19,"ds-fieldset",13)(20,"p",2),UC(21," Each content entry is a command. Use "),Is(22,"code"),UC(23,"@AgentName"),ml(),UC(24," to target an agent, "),Is(25,"code"),UC(26,"/promptName param1 param2"),ml(),UC(27," to call another prompt, and "),Is(28,"code"),UC(29),ml(),UC(30," for parameter placeholders. "),ml(),Is(31,"div",10),eC(32,_e,7,5,"div",14,Xw),Is(34,"div")(35,"button",12),Eg("click",function(){mf(e);let d=fC();return yf(d.addContentEntry())}),UC(36,"+ Add content entry"),ml()()()(),Qw(37,xe,2,1,"ds-notice"),Is(38,"ds-form-field",15),hg(39,"textarea",16),VI(),ml(),Is(40,"ds-form-actions")(41,"button",17),UC(42),ml(),Qw(43,be,2,2,"button",18),Is(44,"button",19),Eg("click",function(){mf(e);let d=fC();return yf(d.cancel())}),UC(45,"Cancel"),ml()()();}if(o&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.availableAgentConfigs().length>0?5:-1),KE(5),Lg(e.paramPlaceholderSyntax),KE(2),pg("formArrayName","parameters"),KE(),Kw(e.parametersArray.length===0?13:-1),KE(),tC(e.parametersArray.controls),KE(15),Lg(e.paramPlaceholderSyntax),KE(2),pg("formArrayName","content"),KE(),tC(e.contentArray.controls),KE(5),Kw(e.errorMessage()?37:-1),KE(),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," "),KE(),Kw(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=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);errorMessage=zi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=zi([]);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),ga(()=>_r([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),ga(()=>_r([]))).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=xw({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","required","",3,"controlId","error"],["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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return r.cancel()}),UC(3),ml()(),Qw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),ml()),e&2&&(KE(),pg("title",r.isEditMode()?"Edit prompt":"New prompt"),KE(2),Il(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),KE(),Kw(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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {b0 as A,b1 as z$1}from'./main-EE6GZH3K.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
|
|
2
2
|
`});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
|
|
3
3
|
`?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
|
|
4
4
|
`&&(E.last=l.length==0||l[0].tag==`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-B6gsrnkr.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-C90nyg8k.js';import {g,W,F,H as we,z as zi,M as U,P as x,O as w,x as xw,au as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,s as aC,a as hg,T as VI,l as eC,am as Xw,X as UI,t as tC,q as Il,u as mf,w as yf,L as Lg}from'./main-EE6GZH3K.js';function ie(i,t){if(i&1&&(Is(0,"a",2),UC(1,"View skill \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function ne(i,t){i&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(i,t){if(i&1){let e=aC();Is(0,"div",15)(1,"div",19),hg(2,"input",20),VI(),Is(3,"button",21),Eg("click",function(){let l=mf(e).$implicit,te=fC(2);return yf(te.removeResource(l))}),UC(4," \xD7 "),ml()(),hg(5,"textarea",22),VI(),ml();}if(i&2){let e=t.$implicit;KE(2),pg("formControl",e.path),UI(),KE(3),pg("formControl",e.content),UI();}}function ae(i,t){if(i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function se(i,t){if(i&1){let e=aC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let l=fC();return yf(l.submit())}),Is(1,"ds-form-field",7),hg(2,"input",8),VI(),ml(),Is(3,"ds-form-field",9),hg(4,"textarea",10),VI(),ml(),Is(5,"ds-form-field",11),hg(6,"textarea",12),VI(),ml(),Is(7,"ds-form-field",13)(8,"div",14),eC(9,re,6,2,"div",15,Xw),Is(11,"div")(12,"button",16),Eg("click",function(){mf(e);let l=fC();return yf(l.addResource())}),UC(13,"+ Add resource"),ml()()()(),Qw(14,ae,2,1,"ds-notice"),Is(15,"ds-form-actions")(16,"button",17),UC(17),ml(),Is(18,"button",18),Eg("click",function(){mf(e);let l=fC();return yf(l.cancel())}),UC(19,"Cancel"),ml()()();}if(i&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.bodyControl),UI(),KE(3),tC(e.resourceRows()),KE(5),Kw(e.errorMessage()?14:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=zi(false);isLoading=zi(false);isSubmitting=zi(false);errorMessage=zi(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=zi([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.cancel()}),UC(3,"\u2190 Skills"),ml(),Qw(4,ie,2,1,"a",2),Qw(5,oe,2,0,"ds-tag",3),ml(),Qw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),ml()),e&2&&(KE(),pg("title",o.isEditMode()?"Edit skill":"New skill"),KE(3),Kw(o.isEditMode()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-DrowH10V.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-C90nyg8k.js';import {g,F,H as we,z as zi,M as U$1,ai as ke,al as Ge,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-EE6GZH3K.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),UC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.description);}}function O(n,t){if(n&1){let e=aC();Is(0,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.toggle(s))}),UC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.edit(s))}),UC(3,"Edit"),ml();}if(n&2){let e=fC().$implicit;KE(),Lg(e.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=aC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=fC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,H,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19),Qw(12,O,4,2),Qw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.name),KE(),Kw(e.description?4:-1),KE(2),Lg(i.scheduleLabel(e)),KE(2),pg("variant",e.enabled?"accent":"outline"),KE(),Lg(e.enabled?"Enabled":"Disabled"),KE(3),Kw(i.deletion.confirmingId()!==e.id?12:-1),KE(),Kw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=fC();KE(14),tC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===ke.WEEK?"week":"month",s=e.unit===ke.WEEK&&e.days?.length?` (${e.days.map(c=>Ge[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=xw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,U,2,1,"p",3),Qw(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&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,
|
|
1
|
+
import {g,aM as fe,a6 as A}from'./main-EE6GZH3K.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-BAPa85aK.js';import {g,W,H as we,z as zi,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,r as fC,L as Lg}from'./main-EE6GZH3K.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-C90nyg8k.js';import'./chunk-Cuut2fuQ.js';function O(r,e){r&1&&(Is(0,"p",1),UC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),UC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),UC(2,"YAML"),ml(),Is(3,"ds-tag",10),UC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Qw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),UC(4,"Name"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"Type"),ml(),Is(9,"dd",5),UC(10),ml(),Is(11,"dt"),UC(12,"Description"),ml(),Is(13,"dd"),UC(14),ml(),Is(15,"dt"),UC(16,"Scope"),ml(),Is(17,"dd"),UC(18),ml(),Is(19,"dt"),UC(20,"Source"),ml(),Is(21,"dd"),UC(22),ml(),Is(23,"dt"),UC(24,"Auto grant"),ml(),Is(25,"dd"),UC(26),ml(),Is(27,"dt"),UC(28,"Auth setting"),ml(),Is(29,"dd"),UC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),UC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),UC(35),ml()()),r&2){let o=e,a=fC();KE(),Kw(a.source()==="FILESYSTEM"?1:-1),KE(5),Lg(o.name),KE(4),Lg(o.integrationType),KE(4),Lg(o.description||"\u2014"),KE(4),Lg(a.scopeOf(o)),KE(4),Lg(a.source()),KE(4),Lg(o.autoGrant?"Enabled":"Disabled"),KE(4),Lg(o.authSettingName||"None"),KE(5),Lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Qw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;KE(2),Kw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P}from'./chunk-
|
|
1
|
+
import {O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P}from'./chunk-C90nyg8k.js';import {g,H as we,Z as W,$ as Sr,z as zi,k as yT,a0 as Ue,a1 as ma,a2 as ga,a3 as rn,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,l as eC,r as fC,t as tC,q as Il,L as Lg}from'./main-EE6GZH3K.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Is(0,"p",10),UC(1,"Loading the configuration failed. Try refreshing."),ml());}function V(e,t){e&1&&(Is(0,"p",11),UC(1,"Loading configuration\u2026"),ml());}function j(e,t){e&1&&(Is(0,"p",12),UC(1,"The service reported no settings."),ml());}function O(e,t){e&1&&(Is(0,"p",11),UC(1,"No settings match the current filters."),ml());}function Y(e,t){e&1&&(Is(0,"ds-tag",22),UC(1,"on"),ml());}function z(e,t){e&1&&(Is(0,"ds-tag",20),UC(1,"off"),ml());}function H(e,t){if(e&1&&(Is(0,"ds-tag",20),UC(1),ml()),e&2){let i=fC().$implicit;KE(),Lg(i.display.text);}}function G(e,t){if(e&1&&(Is(0,"ds-tag",23),UC(1),ml()),e&2){let i=fC().$implicit;KE(),Lg(i.display.text);}}function J(e,t){if(e&1&&(Is(0,"span",24),UC(1),ml()),e&2){let i=fC().$implicit;KE(),Lg(i.display.text);}}function K(e,t){if(e&1&&(Is(0,"tr",16)(1,"td",18),UC(2),ml(),Is(3,"td",19)(4,"ds-tag",20),UC(5),ml()(),Is(6,"td",21),Qw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),ml(),Is(12,"td",25),UC(13),ml()()),e&2){let i,a=t.$implicit,m=fC(2);KE(2),Il(" ",a.entry.key," "),KE(3),Il(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),KE(2),Kw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),KE(6),Il(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),UC(5,"Setting"),ml(),Is(6,"th",17),UC(7,"Source"),ml(),Is(8,"th",17),UC(9,"Value"),ml(),Is(10,"th",17),UC(11,"Description"),ml()()(),Is(12,"tbody",15),eC(13,K,14,4,"tr",16,U),ml()()()),e&2){let i=fC();KE(13),tC(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new Sr(void 0);isLoading=zi(true);loadError=zi(false);rows=zi([]);source=zi("ALL");status=zi("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=yT(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Ue;constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(ga(()=>(this.loadError.set(true),this.isLoading.set(false),rn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["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","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.reload()}),UC(3,"Refresh"),ml()(),Is(4,"div",3)(5,"select",4),Eg("change",function(c){return a.source.set(c.target.value)}),Is(6,"option",5),UC(7,"All sources"),ml(),Is(8,"option",6),UC(9,"Environment variables"),ml(),Is(10,"option",6),UC(11,"Spring properties"),ml()(),Is(12,"select",7),Eg("change",function(c){return a.status.set(c.target.value)}),Is(13,"option",5),UC(14,"Set and unset"),ml(),Is(15,"option",8),UC(16,"Set only"),ml(),Is(17,"option",9),UC(18,"Unset only"),ml()()(),Qw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(KE(),pg("query",a.rowFilter.query()),KE(4),pg("value",a.source()),KE(3),pg("value",a.Source.ENVIRONMENT),KE(2),pg("value",a.Source.PROPERTY),KE(2),pg("value",a.status()),KE(7),Kw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,yn,Vo,Ao,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-C90nyg8k.js';import {I as I$1}from'./chunk-DPfzD59Q.js';import {g,F,H as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-EE6GZH3K.js';import'./chunk-Cuut2fuQ.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Is(0,"p",3),UC(1),ml()),e&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading auth settings\u2026"),ml());}function H(e,t){e&1&&(Is(0,"p",5),UC(1,"No platform auth settings defined yet."),ml());}function U(e,t){e&1&&(Is(0,"p",4),UC(1,"No auth settings match the current filter."),ml());}function z(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onEdit(d))}),UC(1," Edit "),ml();}if(e&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(e&2){let n=fC().$implicit,a=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),e&2){let n=t.$implicit,a=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.authType," "),KE(3),Kw(a.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(e,t){if(e&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Authentication type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,B),ml()()()),e&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();settings=zi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return a.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New auth setting"),ml()(),Qw(4,j,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-B6gsrnkr.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as c}from'./chunk-C90nyg8k.js';import {g,W,F,H as we,z as zi,k as yT,M as U,ac as Ny,a2 as ga,aa as _r,x as xw,au as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,b as Kw,r as fC,R as pg,s as aC,a as hg,av as uT,L as Lg,q as Il,aw as dT,l as eC,t as tC,ao as Jw,u as mf,w as yf,ax as iE}from'./main-EE6GZH3K.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Is(0,"a",2),UC(1,"Edit skill \u2192"),ml()),e&2){let n=fC();pg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function te(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function ne(e,t){e&1&&(Is(0,"ds-notice"),UC(1,"Failed to load skill."),ml());}function ie(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Created by"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.createdBy);}}function oe(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Last updated"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Qw(0,ie,4,1),Qw(1,oe,4,1)),e&2){let n=fC();Kw(n.createdBy?0:-1),KE(),Kw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Is(0,"p",4),UC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),ml());}function se(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(e,t){e&1&&(Is(0,"ds-notice"),UC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),ml());}function de(e,t){e&1&&(Is(0,"p",4),UC(1,"No agent references this skill."),ml());}function ce(e,t){e&1&&(Is(0,"ds-tag",15),UC(1,"platform agent"),ml());}function me(e,t){e&1&&(Is(0,"ds-tag",15),UC(1,"via *"),ml());}function pe(e,t){if(e&1&&(Is(0,"li",13)(1,"span",14),UC(2),ml(),Qw(3,ce,2,0,"ds-tag",15),Qw(4,me,2,0,"ds-tag",15),ml()),e&2){let n=t.$implicit;KE(2),Lg(n.name),KE(),Kw(n.platform?3:-1),KE(),Kw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Is(0,"ul",12),eC(1,pe,5,3,"li",13,Y),ml(),Is(3,"p",4),UC(4," An agent listed "),Is(5,"code"),UC(6,"via *"),ml(),UC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),ml()),e&2){let n=fC(2);KE(),tC(n.consumers());}}function _e(e,t){e&1&&(Is(0,"p",4),UC(1,"No resources bundled with this skill."),ml());}function ge(e,t){if(e&1){let n=aC();Is(0,"li")(1,"ds-disclosure",16),Eg("toggled",function(){let r=mf(n).$implicit,g=fC(3);return yf(g.toggleResource(r))}),Is(2,"pre",17),UC(3),ml()()();}if(e&2){let n=t.$implicit,o=fC(3);KE(),pg("heading",n)("open",o.isResourceExpanded(n)),KE(2),Lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Is(0,"ul",12),eC(1,ge,4,3,"li",null,Jw),ml()),e&2){let n=fC(2);KE(),tC(n.resourcePaths());}}function fe(e,t){if(e&1){let n=aC();Is(0,"ds-card",5)(1,"dl",6)(2,"dt"),UC(3,"Name"),ml(),Is(4,"dd",7),UC(5),ml(),Is(6,"dt"),UC(7,"Description"),ml(),Is(8,"dd"),UC(9),ml(),Is(10,"dt"),UC(11,"Scope"),ml(),Is(12,"dd"),UC(13),ml(),Is(14,"dt"),UC(15,"Storage"),ml(),Is(16,"dd")(17,"ds-tag",8),UC(18),ml()(),Qw(19,ae,2,2),ml()(),Is(20,"ds-card",9),Qw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),ml(),Is(26,"ds-card")(27,"ds-disclosure",10),Eg("toggled",function(){mf(n);let r=fC();return yf(r.toggleBody())}),hg(28,"div",11),uT(29,"agentosMarkdown"),ml()(),Is(30,"ds-card",9),Qw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),ml();}if(e&2){let n=t,o=fC();KE(5),Lg(n.name),KE(4),Lg(n.description),KE(4),Lg(n.namespaceId?"Namespace":"Platform"),KE(4),pg("variant",o.isFilesystemBacked()?"outline":"neutral"),KE(),Il(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),KE(),Kw(o.isFilesystemBacked()?-1:19),KE(),pg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),KE(),Kw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),KE(6),pg("open",!o.bodyCollapsed()),KE(),pg("innerHTML",dT(29,12,n.body),iE),KE(2),pg("heading","Resources ("+o.resourcePaths().length+")"),KE(),Kw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);skill=zi(null);bodyCollapsed=zi(false);expandedResources=zi(new Set);resourcePaths=yT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=yT(()=>this.skill()?.readOnly===true);consumers=zi([]);consumersUnavailable=zi(false);consumersLoading=zi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.back()}),UC(3,"\u2190 Skills"),ml(),Qw(4,Z,2,1,"a",2),Qw(5,ee,2,0,"ds-tag",3),ml(),Qw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),ml()),n&2){let r;KE(4),Kw(o.skill()&&!o.isFilesystemBacked()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,c],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {q as k,O as O$2,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {q as k,O as O$2,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-C90nyg8k.js';import {O as O$1}from'./chunk-BAPa85aK.js';import {g,F,H as we,af as G$1,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,j as fg,u as mf,w as yf}from'./main-EE6GZH3K.js';import'./chunk-Cuut2fuQ.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading integrations\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform integrations defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No integrations match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Lg(n.integrationType),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);state=g(O$1);integrationConfigController=g(G$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return r.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New integration"),ml()(),Qw(4,A,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-BY4pYYCq.js';import {g,W,F,H as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Fe,k as yT,z as zi,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,a as hg,T as VI,l as eC,ao as Jw,r as fC,X as UI,t as tC,q as Il,ae as Zw,L as Lg,as as jg,u as mf,w as yf}from'./main-WIKPRSWZ.js';function he(r,t){r&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=fC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),UC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),KE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),UC(2,"Select provider"),ml(),eC(3,ye,2,3,"option",44,Zw().trackByProvider,true),ml(),VI()),r&2){let e=fC(2);pg("formControl",e.aiProviderIdControl),UI(),KE(3),tC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),UC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),KE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),UC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),UC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),UC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=fC();return yf(u.submit())}),Is(1,"ds-form-field",5),Qw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),VI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),VI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),VI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),VI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),VI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),VI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),UC(22,"Provider default"),ml(),eC(23,xe,2,2,"option",25,Jw),ml(),VI(),Qw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Qw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),VI(),Is(31,"span",30),UC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),UC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),VI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),VI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),VI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),VI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),UC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=fC();return yf(u.cancel())}),UC(50,"Cancel"),ml()()();}if(r&2){let e=fC();pg("formGroup",e.form),KE(2),Kw(e.isEditMode()?2:3),KE(3),pg("formControl",e.apiModelNameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.aliasControl),UI(),KE(2),pg("formControl",e.priorityControl),UI(),KE(3),pg("formControl",e.temperatureControl),UI(),KE(2),pg("formControl",e.contextWindowControl),UI(),KE(2),pg("formControl",e.maxCompletionTokensControl),UI(),KE(2),pg("formControl",e.reasoningEffortControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.reasoningEffortOptions),KE(2),Kw(e.reasoningEffortUnsupported()?25:26),KE(2),Kw(e.temperatureMayConflictWithEffort()?27:-1),KE(3),pg("formControl",e.supportsAdvancedExecutionControl),UI(),KE(5),pg("formGroup",e.pricingGroup),KE(3),UI(),KE(2),UI(),KE(3),UI(),KE(2),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Fe);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=yT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=yT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=yT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),UC(3," \u2190 AI models "),ml()(),Qw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(KE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),KE(3),Kw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
1
|
+
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-C90nyg8k.js';import {g,W,F,H as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Fe,k as yT,z as zi,p as Ff,M as U,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,s as aC,a as hg,T as VI,l as eC,ao as Jw,r as fC,X as UI,t as tC,q as Il,ae as Zw,L as Lg,as as jg,u as mf,w as yf}from'./main-EE6GZH3K.js';function he(r,t){r&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=fC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),UC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),KE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),UC(2,"Select provider"),ml(),eC(3,ye,2,3,"option",44,Zw().trackByProvider,true),ml(),VI()),r&2){let e=fC(2);pg("formControl",e.aiProviderIdControl),UI(),KE(3),tC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),UC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),KE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),UC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),UC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),UC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=fC();return yf(u.submit())}),Is(1,"ds-form-field",5),Qw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),VI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),VI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),VI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),VI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),VI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),VI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),VI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),UC(22,"Provider default"),ml(),eC(23,xe,2,2,"option",25,Jw),ml(),VI(),Qw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Qw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),VI(),Is(31,"span",30),UC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),UC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),VI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),VI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),VI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),VI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),UC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=fC();return yf(u.cancel())}),UC(50,"Cancel"),ml()()();}if(r&2){let e=fC();pg("formGroup",e.form),KE(2),Kw(e.isEditMode()?2:3),KE(3),pg("formControl",e.apiModelNameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.aliasControl),UI(),KE(2),pg("formControl",e.priorityControl),UI(),KE(3),pg("formControl",e.temperatureControl),UI(),KE(2),pg("formControl",e.contextWindowControl),UI(),KE(2),pg("formControl",e.maxCompletionTokensControl),UI(),KE(2),pg("formControl",e.reasoningEffortControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.reasoningEffortOptions),KE(2),Kw(e.reasoningEffortUnsupported()?25:26),KE(2),Kw(e.temperatureMayConflictWithEffort()?27:-1),KE(3),pg("formControl",e.supportsAdvancedExecutionControl),UI(),KE(5),pg("formGroup",e.pricingGroup),KE(3),UI(),KE(2),UI(),KE(3),UI(),KE(2),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Fe);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=yT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=yT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=yT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),UC(3," \u2190 AI models "),ml()(),Qw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(KE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),KE(3),Kw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|