@whoz-oss/coday-client 0.0.0-workstream-forge.228 → 0.0.0-workstream-forge.230

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.
Files changed (53) hide show
  1. package/browser/{chunk-DKxnQYEw.js → chunk-3iWM1pUJ.js} +1 -1
  2. package/browser/{chunk-KxPMQW9g.js → chunk-B84B1DTB.js} +1 -1
  3. package/browser/{chunk-DVh_U_Pz.js → chunk-B8NR3gly.js} +1 -1
  4. package/browser/{chunk-CAOHsMU2.js → chunk-BA4i878Z.js} +1 -1
  5. package/browser/{chunk-DCCVtxUY.js → chunk-BAKv4OOf.js} +1 -1
  6. package/browser/{chunk-CgJ89AEq.js → chunk-BMhcJQjx.js} +1 -1
  7. package/browser/chunk-BOcSAL90.js +672 -0
  8. package/browser/{chunk-DZOFO-hq.js → chunk-BSWIz_Km.js} +1 -1
  9. package/browser/{chunk-DwTR8XO9.js → chunk-BX2XpHMR.js} +1 -1
  10. package/browser/{chunk-C2MCLvYa.js → chunk-BXYK9ddk.js} +1 -1
  11. package/browser/{chunk-CGDxWxaW.js → chunk-BYqwJbiA.js} +1 -1
  12. package/browser/{chunk-YshJHpGX.js → chunk-Bd8S8WUb.js} +1 -1
  13. package/browser/{chunk-CPRh25Ns.js → chunk-Bgu8hMmi.js} +1 -1
  14. package/browser/{chunk-Do3yjTGr.js → chunk-Bi-bGiSK.js} +1 -1
  15. package/browser/{chunk-7YWH-FdV.js → chunk-Bp8gQw3Y.js} +1 -1
  16. package/browser/{chunk-BgJ8ySs3.js → chunk-Bz-woDEt.js} +1 -1
  17. package/browser/{chunk-CTc3J6-o.js → chunk-C06RuD-b.js} +1 -1
  18. package/browser/{chunk-pWR46qVc.js → chunk-C4NG5Qhr.js} +1 -1
  19. package/browser/{chunk-BbULbTE-.js → chunk-CM8V0RXH.js} +1 -1
  20. package/browser/{chunk-B-t8V9u4.js → chunk-COdXRjZV.js} +1 -1
  21. package/browser/{chunk-BJoOTamk.js → chunk-CRqKTWwq.js} +1 -1
  22. package/browser/{chunk-BU8nA2oi.js → chunk-Cey_y2CV.js} +1 -1
  23. package/browser/{chunk-CdwiSnSZ.js → chunk-CftIqK3_.js} +1 -1
  24. package/browser/chunk-CiIonjNH.js +1 -0
  25. package/browser/{chunk-BNVtpBuz.js → chunk-ClOnvvKc.js} +1 -1
  26. package/browser/{chunk-DDVFqcYY.js → chunk-CmwPBjqS.js} +1 -1
  27. package/browser/chunk-CodMcnv-.js +1 -0
  28. package/browser/{chunk-B_CfL5ct.js → chunk-D1Ae_kle.js} +1 -1
  29. package/browser/{chunk-CQO1OiJR.js → chunk-DG5PeMsJ.js} +1 -1
  30. package/browser/{chunk-CSFdqw8r.js → chunk-DHUd7frd.js} +1 -1
  31. package/browser/{chunk-RQLqPysh.js → chunk-DLObebZ1.js} +1 -1
  32. package/browser/{chunk-6p69HsOa.js → chunk-DNLzFXoQ.js} +1 -1
  33. package/browser/{chunk-TeOKZRPI.js → chunk-DQwKP_yT.js} +1 -1
  34. package/browser/{chunk-CVaTzEB2.js → chunk-DWCZa3Pe.js} +1 -1
  35. package/browser/{chunk-qeffs5uB.js → chunk-Da8TCbbj.js} +1 -1
  36. package/browser/{chunk-Bjr7FKYe.js → chunk-DcwUNNhm.js} +1 -1
  37. package/browser/{chunk-ucWYVIhR.js → chunk-DkG7-_is.js} +1 -1
  38. package/browser/{chunk-wnG909KK.js → chunk-DlLKuR6k.js} +1 -1
  39. package/browser/{chunk-DewdYvKa.js → chunk-DtxVuetC.js} +1 -1
  40. package/browser/{chunk-Q-_uA4d5.js → chunk-Dzzg0QN7.js} +1 -1
  41. package/browser/{chunk-BpaAtA6H.js → chunk-Jq3zT61j.js} +1 -1
  42. package/browser/{chunk-C1xoalWH.js → chunk-KJMGa0UO.js} +1 -1
  43. package/browser/{chunk-CYPfAgi6.js → chunk-g63Z93Jt.js} +1 -1
  44. package/browser/{chunk-D7BuhvqM.js → chunk-qdtRFvyR.js} +1 -1
  45. package/browser/chunk-vxDhq3Xm.js +1 -0
  46. package/browser/{chunk-BkqVneOQ.js → chunk-yJewQfCQ.js} +1 -1
  47. package/browser/index.html +1 -1
  48. package/browser/{main-ZPG3XUQU.js → main-YOWURGI5.js} +3 -3
  49. package/package.json +1 -1
  50. package/browser/chunk-BEy6GrAQ.js +0 -1
  51. package/browser/chunk-Bs2lM6dc.js +0 -670
  52. package/browser/chunk-CHgX-NHl.js +0 -1
  53. package/browser/chunk-TuIJresS.js +0 -1
@@ -1 +1 @@
1
- import {c}from'./chunk-DVh_U_Pz.js';import {p as pt,T as Te$1,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-Bs2lM6dc.js';import {g,W,F,I as Ie$1,ag as U,ah as ke$1,ai as Ne$1,U as Ui,aj as Fe$1,a9 as F$1,ak as md,X as XC,ac as Ty,G as U$1,a2 as da,aa as Tr,M as x,K as w,y as yw,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,v as vl,j as jw,Z as Zw,l as lg,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,O as Og,r as df,s as ff,t as oh}from'./main-ZPG3XUQU.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function _e(n,t){if(n&1&&(Ds(0,"ds-form-field",9),lg(1,"input",38),pl()),n&2){let e=Jw(2);BE(),ug("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Ds(0,"a",39),NC(1,"Add an agent config"),pl(),NC(2," first. ")),n&2){let e=Jw(3);ug("href","/agentos/"+e.namespaceId+"/agent-configs/new",oh);}}function xe(n,t){if(n&1&&(Ds(0,"ds-form-field",10)(1,"p",2),NC(2," No agent configs available in this scope yet. "),Lw(3,Se,3,1),pl()()),n&2){let e=Jw(2);BE(3),jw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Ds(0,"option",17),NC(1),pl()),n&2){let e=t.$implicit;ug("value",e.id),BE(),Og(e.name);}}function De(n,t){if(n&1&&(Ds(0,"ds-form-field",11)(1,"select",40)(2,"option",41),NC(3,"Select an agent config\u2026"),pl(),Hw(4,Ee,2,2,"option",17,ve),pl(),_I(),pl()),n&2){let e=Jw(2);ug("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),BE(),ug("formControl",e.agentConfigIdControl),NI(),BE(3),Uw(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Ds(0,"option",17),NC(1),pl()),n&2){let e=t.$implicit;ug("value",e.value),BE(),Og(e.label);}}function Ne(n,t){if(n&1){let e=Zw();Ds(0,"label",31)(1,"input",43),mg("change",function(){let f=df(e).$implicit,h=Jw(3);return ff(h.toggleDay(f.value))}),pl(),NC(2),pl();}if(n&2){let e=t.$implicit,l=Jw(3);BE(),ug("checked",l.isDaySelected(e.value)),BE(),vl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Ds(0,"ds-form-field",18)(1,"div",42),Hw(2,Ne,3,2,"label",31,V),pl()()),n&2){let e=Jw(2);BE(2),Uw(e.dayOptions);}}function Me(n,t){if(n&1&&(Ds(0,"option",17),NC(1),pl()),n&2){let e=t.$implicit;ug("value",e.value),BE(),Og(e.label);}}function Pe(n,t){if(n&1&&(Ds(0,"ds-form-field",28),lg(1,"input",44),_I(),pl()),n&2){let e=Jw(2);ug("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),BE(),ug("formControl",e.endDateControl),NI();}}function we(n,t){if(n&1&&(Ds(0,"ds-form-field",29),lg(1,"input",45),_I(),pl()),n&2){let e=Jw(2);ug("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),BE(),ug("formControl",e.occurrenceCountControl),NI();}}function Fe(n,t){if(n&1&&(Ds(0,"ds-notice"),NC(1),pl()),n&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let f=Jw();return ff(f.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),_I(),pl(),Ds(3,"ds-form-field",7),lg(4,"input",8),_I(),pl(),Lw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Ds(8,"ds-form-field",12),lg(9,"textarea",13),_I(),pl(),Ds(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Hw(13,Te,2,2,"option",17,V),pl(),_I(),pl(),Lw(15,Ie,4,0,"ds-form-field",18),Ds(16,"ds-form-field",19)(17,"div",20),lg(18,"input",21),_I(),Ds(19,"span",22),NC(20,"UTC"),pl()()()(),Ds(21,"ds-fieldset",23)(22,"ds-form-field",24),lg(23,"input",25),_I(),pl(),Ds(24,"ds-form-field",26)(25,"select",27),Hw(26,Me,2,2,"option",17,V),pl(),_I(),pl(),Lw(28,Pe,2,2,"ds-form-field",28),Lw(29,we,2,2,"ds-form-field",29),pl(),Ds(30,"div",30)(31,"label",31),lg(32,"input",32),_I(),NC(33," Enabled "),pl(),Ds(34,"p",33),NC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),pl()(),Ds(36,"ds-form-field",34),lg(37,"textarea",35),_I(),pl(),Lw(38,Fe,2,1,"ds-notice"),Ds(39,"ds-form-actions")(40,"button",36),NC(41),pl(),Ds(42,"button",37),mg("click",function(){df(e);let f=Jw();return ff(f.cancel())}),NC(43,"Cancel"),pl()()();}if(n&2){let e=Jw();ug("formGroup",e.form),BE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),BE(),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(),jw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),BE(3),ug("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),BE(),ug("formControl",e.promptContentControl),NI(),BE(3),ug("formControl",e.unitControl),NI(),BE(),Uw(e.schedulerUnits),BE(2),jw(e.showDayFilter()?15:-1),BE(),ug("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),BE(2),ug("formControl",e.timeUtcControl),NI(),BE(4),ug("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),BE(),ug("formControl",e.startDateControl),NI(),BE(2),ug("formControl",e.endTypeControl),NI(),BE(),Uw(e.endTypes),BE(2),jw(e.showEndDate()?28:-1),BE(),jw(e.showOccurrenceCount()?29:-1),BE(3),ug("formControl",e.enabledControl),NI(),BE(4),ug("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),BE(),ug("formControl",e.externalMetadataJsonControl),NI(),BE(),jw(e.errorMessage()?38:-1),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(Ie$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:[fn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[fn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[fn.required]}),unit:new Te$1(Ne$1.WEEK,{nonNullable:true,validators:[fn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[fn.required,fn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[fn.required]}),endType:new Te$1(ke$1.NEVER,{nonNullable:true,validators:[fn.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=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);errorMessage=Ui(null);SchedulerUnit=Ne$1;SchedulerEndType=ke$1;schedulerUnits=[{value:Ne$1.WEEK,label:"Week(s)"},{value:Ne$1.MONTH,label:"Month(s)"}];endTypes=[{value:ke$1.NEVER,label:"Never"},{value:ke$1.ON_DATE,label:"On date"},{value:ke$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Fe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(md(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(md(this.endTypeControl.value)));showDayFilter=XC(()=>this.unitSignal()===Ne$1.WEEK);showEndDate=XC(()=>this.endTypeSignal()===ke$1.ON_DATE);showOccurrenceCount=XC(()=>this.endTypeSignal()===ke$1.OCCURRENCES);agentConfigs=Ui([]);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),Ty({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(da(()=>Tr([])))}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===ke$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ke$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=yw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return l.cancel()}),NC(3),pl()(),Lw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),pl()),e&2&&(BE(),ug("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),BE(2),vl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),BE(),jw(l.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,Vn,An,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ke$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ke$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-B8NR3gly.js';import {p as pt,T as Te$1,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-BOcSAL90.js';import {g,W,F,I as Ie$1,ag as U,ah as ke$1,ai as Ne$1,U as Ui,aj as Fe$1,a9 as F$1,ak as md,X as XC,ac as Ty,G as U$1,a2 as da,aa as Tr,M as x,K as w,y as yw,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,v as vl,j as jw,Z as Zw,l as lg,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,O as Og,r as df,s as ff,t as oh}from'./main-YOWURGI5.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function _e(n,t){if(n&1&&(Ds(0,"ds-form-field",9),lg(1,"input",38),pl()),n&2){let e=Jw(2);BE(),ug("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Ds(0,"a",39),NC(1,"Add an agent config"),pl(),NC(2," first. ")),n&2){let e=Jw(3);ug("href","/agentos/"+e.namespaceId+"/agent-configs/new",oh);}}function xe(n,t){if(n&1&&(Ds(0,"ds-form-field",10)(1,"p",2),NC(2," No agent configs available in this scope yet. "),Lw(3,Se,3,1),pl()()),n&2){let e=Jw(2);BE(3),jw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Ds(0,"option",17),NC(1),pl()),n&2){let e=t.$implicit;ug("value",e.id),BE(),Og(e.name);}}function De(n,t){if(n&1&&(Ds(0,"ds-form-field",11)(1,"select",40)(2,"option",41),NC(3,"Select an agent config\u2026"),pl(),Hw(4,Ee,2,2,"option",17,ve),pl(),_I(),pl()),n&2){let e=Jw(2);ug("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),BE(),ug("formControl",e.agentConfigIdControl),NI(),BE(3),Uw(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Ds(0,"option",17),NC(1),pl()),n&2){let e=t.$implicit;ug("value",e.value),BE(),Og(e.label);}}function Ne(n,t){if(n&1){let e=Zw();Ds(0,"label",31)(1,"input",43),mg("change",function(){let f=df(e).$implicit,h=Jw(3);return ff(h.toggleDay(f.value))}),pl(),NC(2),pl();}if(n&2){let e=t.$implicit,l=Jw(3);BE(),ug("checked",l.isDaySelected(e.value)),BE(),vl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Ds(0,"ds-form-field",18)(1,"div",42),Hw(2,Ne,3,2,"label",31,V),pl()()),n&2){let e=Jw(2);BE(2),Uw(e.dayOptions);}}function Me(n,t){if(n&1&&(Ds(0,"option",17),NC(1),pl()),n&2){let e=t.$implicit;ug("value",e.value),BE(),Og(e.label);}}function Pe(n,t){if(n&1&&(Ds(0,"ds-form-field",28),lg(1,"input",44),_I(),pl()),n&2){let e=Jw(2);ug("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),BE(),ug("formControl",e.endDateControl),NI();}}function we(n,t){if(n&1&&(Ds(0,"ds-form-field",29),lg(1,"input",45),_I(),pl()),n&2){let e=Jw(2);ug("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),BE(),ug("formControl",e.occurrenceCountControl),NI();}}function Fe(n,t){if(n&1&&(Ds(0,"ds-notice"),NC(1),pl()),n&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let f=Jw();return ff(f.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),_I(),pl(),Ds(3,"ds-form-field",7),lg(4,"input",8),_I(),pl(),Lw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Ds(8,"ds-form-field",12),lg(9,"textarea",13),_I(),pl(),Ds(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Hw(13,Te,2,2,"option",17,V),pl(),_I(),pl(),Lw(15,Ie,4,0,"ds-form-field",18),Ds(16,"ds-form-field",19)(17,"div",20),lg(18,"input",21),_I(),Ds(19,"span",22),NC(20,"UTC"),pl()()()(),Ds(21,"ds-fieldset",23)(22,"ds-form-field",24),lg(23,"input",25),_I(),pl(),Ds(24,"ds-form-field",26)(25,"select",27),Hw(26,Me,2,2,"option",17,V),pl(),_I(),pl(),Lw(28,Pe,2,2,"ds-form-field",28),Lw(29,we,2,2,"ds-form-field",29),pl(),Ds(30,"div",30)(31,"label",31),lg(32,"input",32),_I(),NC(33," Enabled "),pl(),Ds(34,"p",33),NC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),pl()(),Ds(36,"ds-form-field",34),lg(37,"textarea",35),_I(),pl(),Lw(38,Fe,2,1,"ds-notice"),Ds(39,"ds-form-actions")(40,"button",36),NC(41),pl(),Ds(42,"button",37),mg("click",function(){df(e);let f=Jw();return ff(f.cancel())}),NC(43,"Cancel"),pl()()();}if(n&2){let e=Jw();ug("formGroup",e.form),BE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),BE(),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(),jw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),BE(3),ug("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),BE(),ug("formControl",e.promptContentControl),NI(),BE(3),ug("formControl",e.unitControl),NI(),BE(),Uw(e.schedulerUnits),BE(2),jw(e.showDayFilter()?15:-1),BE(),ug("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),BE(2),ug("formControl",e.timeUtcControl),NI(),BE(4),ug("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),BE(),ug("formControl",e.startDateControl),NI(),BE(2),ug("formControl",e.endTypeControl),NI(),BE(),Uw(e.endTypes),BE(2),jw(e.showEndDate()?28:-1),BE(),jw(e.showOccurrenceCount()?29:-1),BE(3),ug("formControl",e.enabledControl),NI(),BE(4),ug("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),BE(),ug("formControl",e.externalMetadataJsonControl),NI(),BE(),jw(e.errorMessage()?38:-1),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(Ie$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:[fn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[fn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[fn.required]}),unit:new Te$1(Ne$1.WEEK,{nonNullable:true,validators:[fn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[fn.required,fn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[fn.required]}),endType:new Te$1(ke$1.NEVER,{nonNullable:true,validators:[fn.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=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);errorMessage=Ui(null);SchedulerUnit=Ne$1;SchedulerEndType=ke$1;schedulerUnits=[{value:Ne$1.WEEK,label:"Week(s)"},{value:Ne$1.MONTH,label:"Month(s)"}];endTypes=[{value:ke$1.NEVER,label:"Never"},{value:ke$1.ON_DATE,label:"On date"},{value:ke$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Fe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(md(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(md(this.endTypeControl.value)));showDayFilter=XC(()=>this.unitSignal()===Ne$1.WEEK);showEndDate=XC(()=>this.endTypeSignal()===ke$1.ON_DATE);showOccurrenceCount=XC(()=>this.endTypeSignal()===ke$1.OCCURRENCES);agentConfigs=Ui([]);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),Ty({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(da(()=>Tr([])))}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===ke$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ke$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=yw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return l.cancel()}),NC(3),pl()(),Lw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),pl()),e&2&&(BE(),ug("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),BE(2),vl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),BE(),jw(l.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,Vn,An,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ke$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ke$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 +1 @@
1
- import {I as I$1}from'./chunk-7YWH-FdV.js';import {g,F,I as Ie,$ as Cr,U as Ui,a1 as fa,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,Z as Zw,k as cg,r as df,s as ff}from'./main-ZPG3XUQU.js';import {z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-Bs2lM6dc.js';import'./chunk-TuIJresS.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Ds(0,"p",3),NC(1),pl()),e&2){let n=Jw();BE(),Og(n.deletion.error());}}function K(e,t){e&1&&(Ds(0,"p",4),NC(1,"Loading auth settings\u2026"),pl());}function H(e,t){e&1&&(Ds(0,"p",5),NC(1,"No platform auth settings defined yet."),pl());}function U(e,t){e&1&&(Ds(0,"p",4),NC(1,"No auth settings match the current filter."),pl());}function z(e,t){if(e&1){let n=Zw();Ds(0,"button",18),mg("click",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.onEdit(d))}),NC(1," Edit "),pl();}if(e&2){let n=Jw().$implicit;cg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Zw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.onDelete(d))})("deleteCancelled",function(){df(n);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(e&2){let n=Jw().$implicit,a=Jw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14)(6,"div",15),Lw(7,z,2,1,"button",16),Lw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),e&2){let n=t.$implicit,a=Jw(2);BE(2),Og(n.name),BE(2),vl(" ",n.authType," "),BE(3),jw(a.deletion.confirmingId()!==n.id?7:-1),BE(),jw(n.id?8:-1);}}function O(e,t){if(e&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Authentication type"),pl(),Ds(8,"th",10)(9,"span",11),NC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Hw(12,J,9,4,"tr",9,B),pl()()()),e&2){let n=Jw();BE(12),Uw(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(Ie);state=g(I$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();settings=Ui([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=yw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New auth setting"),pl()(),Lw(4,j,2,1,"p",3),Lw(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&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
1
+ import {I as I$1}from'./chunk-Bp8gQw3Y.js';import {g,F,I as Ie,$ as Cr,U as Ui,a1 as fa,G as U$1,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,Z as Zw,k as cg,r as df,s as ff}from'./main-YOWURGI5.js';import {z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-BOcSAL90.js';import'./chunk-CodMcnv-.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Ds(0,"p",3),NC(1),pl()),e&2){let n=Jw();BE(),Og(n.deletion.error());}}function K(e,t){e&1&&(Ds(0,"p",4),NC(1,"Loading auth settings\u2026"),pl());}function H(e,t){e&1&&(Ds(0,"p",5),NC(1,"No platform auth settings defined yet."),pl());}function U(e,t){e&1&&(Ds(0,"p",4),NC(1,"No auth settings match the current filter."),pl());}function z(e,t){if(e&1){let n=Zw();Ds(0,"button",18),mg("click",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.onEdit(d))}),NC(1," Edit "),pl();}if(e&2){let n=Jw().$implicit;cg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Zw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Jw().$implicit,m=Jw(2);return ff(m.onDelete(d))})("deleteCancelled",function(){df(n);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(e&2){let n=Jw().$implicit,a=Jw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14)(6,"div",15),Lw(7,z,2,1,"button",16),Lw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),e&2){let n=t.$implicit,a=Jw(2);BE(2),Og(n.name),BE(2),vl(" ",n.authType," "),BE(3),jw(a.deletion.confirmingId()!==n.id?7:-1),BE(),jw(n.id?8:-1);}}function O(e,t){if(e&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Authentication type"),pl(),Ds(8,"th",10)(9,"span",11),NC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Hw(12,J,9,4,"tr",9,B),pl()()()),e&2){let n=Jw();BE(12),Uw(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(Ie);state=g(I$1);refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();settings=Ui([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=yw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New auth setting"),pl()(),Lw(4,j,2,1,"p",3),Lw(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&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-DewdYvKa.js';import {p as pt,T as Te,a as fn,U as Ut,n as nd,L as Lt,m as mo,c as po,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,C as mn,i as at,j as an,l as ko}from'./chunk-Bs2lM6dc.js';import {g,W,F,I as Ie,U as Ui,G as U,M as x,K as w,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,Z as Zw,l as lg,_ as _I,H as Hw,am as Bw,R as NI,m as Uw,v as vl,r as df,s as ff,O as Og}from'./main-ZPG3XUQU.js';function ie(i,t){if(i&1&&(Ds(0,"a",2),NC(1,"View skill \u2192"),pl()),i&2){let e=Jw();ug("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function ne(i,t){i&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function re(i,t){if(i&1){let e=Zw();Ds(0,"div",15)(1,"div",19),lg(2,"input",20),_I(),Ds(3,"button",21),mg("click",function(){let l=df(e).$implicit,te=Jw(2);return ff(te.removeResource(l))}),NC(4," \xD7 "),pl()(),lg(5,"textarea",22),_I(),pl();}if(i&2){let e=t.$implicit;BE(2),ug("formControl",e.path),NI(),BE(3),ug("formControl",e.content),NI();}}function ae(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function se(i,t){if(i&1){let e=Zw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let l=Jw();return ff(l.submit())}),Ds(1,"ds-form-field",7),lg(2,"input",8),_I(),pl(),Ds(3,"ds-form-field",9),lg(4,"textarea",10),_I(),pl(),Ds(5,"ds-form-field",11),lg(6,"textarea",12),_I(),pl(),Ds(7,"ds-form-field",13)(8,"div",14),Hw(9,re,6,2,"div",15,Bw),Ds(11,"div")(12,"button",16),mg("click",function(){df(e);let l=Jw();return ff(l.addResource())}),NC(13,"+ Add resource"),pl()()()(),Lw(14,ae,2,1,"ds-notice"),Ds(15,"ds-form-actions")(16,"button",17),NC(17),pl(),Ds(18,"button",18),mg("click",function(){df(e);let l=Jw();return ff(l.cancel())}),NC(19,"Cancel"),pl()()();}if(i&2){let e=Jw();ug("formGroup",e.form),BE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),BE(),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.bodyControl),NI(),BE(3),Uw(e.resourceRows()),BE(5),jw(e.errorMessage()?14:-1),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Ui(false);isLoading=Ui(false);isSubmitting=Ui(false);errorMessage=Ui(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(100),fn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(500),fn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})});resourceRows=Ui([]);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=yw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),NC(3,"\u2190 Skills"),pl(),Lw(4,ie,2,1,"a",2),Lw(5,oe,2,0,"ds-tag",3),pl(),Lw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),pl()),e&2&&(BE(),ug("title",o.isEditMode()?"Edit skill":"New skill"),BE(3),jw(o.isEditMode()?4:-1),BE(),jw(o.isPlatformMode?5:-1),BE(),jw(o.isLoading()?6:7));},dependencies:[Ut,nd,Lt,mo,po,Vn,An,$t,pn,hn,cn,dn,mn,at,an,ko],encapsulation:2})};export{ee as SkillFormComponent};
1
+ import {o}from'./chunk-DtxVuetC.js';import {p as pt,T as Te,a as fn,U as Ut,n as nd,L as Lt,m as mo,c as po,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,C as mn,i as at,j as an,l as ko}from'./chunk-BOcSAL90.js';import {g,W,F,I as Ie,U as Ui,G as U,M as x,K as w,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,Z as Zw,l as lg,_ as _I,H as Hw,am as Bw,R as NI,m as Uw,v as vl,r as df,s as ff,O as Og}from'./main-YOWURGI5.js';function ie(i,t){if(i&1&&(Ds(0,"a",2),NC(1,"View skill \u2192"),pl()),i&2){let e=Jw();ug("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function ne(i,t){i&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function re(i,t){if(i&1){let e=Zw();Ds(0,"div",15)(1,"div",19),lg(2,"input",20),_I(),Ds(3,"button",21),mg("click",function(){let l=df(e).$implicit,te=Jw(2);return ff(te.removeResource(l))}),NC(4," \xD7 "),pl()(),lg(5,"textarea",22),_I(),pl();}if(i&2){let e=t.$implicit;BE(2),ug("formControl",e.path),NI(),BE(3),ug("formControl",e.content),NI();}}function ae(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function se(i,t){if(i&1){let e=Zw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let l=Jw();return ff(l.submit())}),Ds(1,"ds-form-field",7),lg(2,"input",8),_I(),pl(),Ds(3,"ds-form-field",9),lg(4,"textarea",10),_I(),pl(),Ds(5,"ds-form-field",11),lg(6,"textarea",12),_I(),pl(),Ds(7,"ds-form-field",13)(8,"div",14),Hw(9,re,6,2,"div",15,Bw),Ds(11,"div")(12,"button",16),mg("click",function(){df(e);let l=Jw();return ff(l.addResource())}),NC(13,"+ Add resource"),pl()()()(),Lw(14,ae,2,1,"ds-notice"),Ds(15,"ds-form-actions")(16,"button",17),NC(17),pl(),Ds(18,"button",18),mg("click",function(){df(e);let l=Jw();return ff(l.cancel())}),NC(19,"Cancel"),pl()()();}if(i&2){let e=Jw();ug("formGroup",e.form),BE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),BE(),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.bodyControl),NI(),BE(3),Uw(e.resourceRows()),BE(5),jw(e.errorMessage()?14:-1),BE(2),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Ui(false);isLoading=Ui(false);isSubmitting=Ui(false);errorMessage=Ui(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(100),fn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(500),fn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})});resourceRows=Ui([]);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=yw({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&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),NC(3,"\u2190 Skills"),pl(),Lw(4,ie,2,1,"a",2),Lw(5,oe,2,0,"ds-tag",3),pl(),Lw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),pl()),e&2&&(BE(),ug("title",o.isEditMode()?"Edit skill":"New skill"),BE(3),jw(o.isEditMode()?4:-1),BE(),jw(o.isPlatformMode?5:-1),BE(),jw(o.isLoading()?6:7));},dependencies:[Ut,nd,Lt,mo,po,Vn,An,$t,pn,hn,cn,dn,mn,at,an,ko],encapsulation:2})};export{ee as SkillFormComponent};
@@ -1 +1 @@
1
- import {y,p as pt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,A as An,v as va,d as pn,h as hn,e as cn,g as dn,o as on,i as at,j as an,q as sn,l as ko}from'./chunk-Bs2lM6dc.js';import {g,I as Ie,W,E as J,U as Ui,G as U,y as yw,D as Ds,l as lg,Q as mg,L as Lw,p as pl,_ as _I,N as NC,a as BE,P as ug,j as jw,R as NI,v as vl,a4 as je,a5 as yd,a6 as x,J as Jw,Z as Zw,O as Og,a7 as kn,r as df,s as ff,H as Hw,m as Uw}from'./main-ZPG3XUQU.js';var I=class e{api=g(je);isLoading=Ui(false);result=Ui(null);errorMessage=Ui(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(yd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof kn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Ds(0,"p",14),NC(1,"Loading namespaces\u2026"),pl());}function pe(e,t){if(e&1&&(Ds(0,"option",17),NC(1),pl()),e&2){let n=t.$implicit;ug("value",n.id),BE(),Og(n.name);}}function ce(e,t){if(e&1&&(Ds(0,"select",15)(1,"option",16),NC(2,"Select a namespace"),pl(),Hw(3,pe,2,2,"option",17,de),pl(),_I()),e&2){let n=Jw(2);NI(),BE(3),Uw(n.namespaces());}}function ue(e,t){if(e&1&&Lw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=Jw();jw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&lg(0,"input",3),e&2){let n=Jw();ug("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Zw();Ds(0,"button",18),mg("click",function(){df(n);let l=Jw();return ff(l.reset())}),NC(1,"Clear result"),pl();}}function ve(e,t){e&1&&(Ds(0,"ds-card",12)(1,"pre",19),NC(2),pl()()),e&2&&(BE(2),Og(t));}function ye(e,t){e&1&&(Ds(0,"span",21),NC(1,"Metadata"),pl(),Ds(2,"pre",19),NC(3),pl()),e&2&&(BE(3),Og(t));}function Ce(e,t){if(e&1&&(Ds(0,"dt"),NC(1,"Type"),pl(),Ds(2,"dd",23),NC(3),pl()),e&2){let n=Jw(2);BE(3),Og(n.errorType);}}function _e(e,t){if(e&1&&(Ds(0,"dt"),NC(1,"Message"),pl(),Ds(2,"dd"),NC(3),pl()),e&2){let n=Jw(2);BE(3),Og(n.errorMessage);}}function be(e,t){if(e&1&&(Ds(0,"span",21),NC(1,"Tool error details"),pl(),Ds(2,"dl",22),Lw(3,Ce,4,1),Lw(4,_e,4,1),pl()),e&2){let n=Jw();BE(3),jw(n.errorType?3:-1),BE(),jw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Ds(0,"ds-card",13)(1,"div")(2,"ds-tag",20),NC(3),pl()(),Ds(4,"span",21),NC(5,"Output"),pl(),Ds(6,"pre",19),NC(7),pl(),Lw(8,ye,4,1),Ds(9,"span",21),NC(10,"Structured output"),pl(),Ds(11,"pre",19),NC(12),pl(),Lw(13,be,5,2),pl()),e&2){let n,o=t,l=Jw();ug("heading","Result \u2014 "+o.toolName),BE(2),ug("variant",o.success?"accent":"outline"),BE(),Og(o.success?"Success":"Tool error"),BE(4),Og(o.output),BE(),jw((n=l.formatMetadata(o.metadata))?8:-1,n),BE(4),Og(l.formatStructuredOutput(o.structuredOutput)??"null"),BE(),jw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(Ie);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Ui([]);namespacesLoading=Ui(true);namespaceName=Ui(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[fn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[fn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=yw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Ds(2,"form",1),mg("ngSubmit",function(){return o.submit()}),Ds(3,"ds-form-field",2),Lw(4,ue,2,1)(5,fe,1,1,"input",3),pl(),Ds(6,"ds-form-field",4),lg(7,"input",5),_I(),pl(),Ds(8,"ds-form-field",6),lg(9,"input",7),_I(),pl(),Ds(10,"ds-form-field",8),lg(11,"textarea",9),_I(),pl(),Ds(12,"ds-form-actions")(13,"button",10),NC(14),pl(),Lw(15,ge,2,0,"button",11),pl()(),Lw(16,ve,3,1,"ds-card",12),Lw(17,he,14,7,"ds-card",13),pl()),n&2){let l,v;BE(),ug("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),BE(),ug("formGroup",o.form),BE(2),jw(o.isPlatformMode?4:5),BE(3),NI(),BE(2),NI(),BE(2),NI(),BE(2),ug("disabled",o.form.invalid||o.state.isLoading()),BE(),vl(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),BE(),jw(o.state.result()||o.state.errorMessage()?15:-1),BE(),jw((l=o.state.errorMessage())?16:-1,l),BE(),jw((v=o.state.result())?17:-1,v);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,dn,on,at,an,sn,ko],encapsulation:2})};export{re as ToolInvokeComponent};
1
+ import {y,p as pt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,A as An,v as va,d as pn,h as hn,e as cn,g as dn,o as on,i as at,j as an,q as sn,l as ko}from'./chunk-BOcSAL90.js';import {g,I as Ie,W,E as J,U as Ui,G as U,y as yw,D as Ds,l as lg,Q as mg,L as Lw,p as pl,_ as _I,N as NC,a as BE,P as ug,j as jw,R as NI,v as vl,a4 as je,a5 as yd,a6 as x,J as Jw,Z as Zw,O as Og,a7 as kn,r as df,s as ff,H as Hw,m as Uw}from'./main-YOWURGI5.js';var I=class e{api=g(je);isLoading=Ui(false);result=Ui(null);errorMessage=Ui(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(yd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof kn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(Ds(0,"p",14),NC(1,"Loading namespaces\u2026"),pl());}function pe(e,t){if(e&1&&(Ds(0,"option",17),NC(1),pl()),e&2){let n=t.$implicit;ug("value",n.id),BE(),Og(n.name);}}function ce(e,t){if(e&1&&(Ds(0,"select",15)(1,"option",16),NC(2,"Select a namespace"),pl(),Hw(3,pe,2,2,"option",17,de),pl(),_I()),e&2){let n=Jw(2);NI(),BE(3),Uw(n.namespaces());}}function ue(e,t){if(e&1&&Lw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=Jw();jw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&lg(0,"input",3),e&2){let n=Jw();ug("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Zw();Ds(0,"button",18),mg("click",function(){df(n);let l=Jw();return ff(l.reset())}),NC(1,"Clear result"),pl();}}function ve(e,t){e&1&&(Ds(0,"ds-card",12)(1,"pre",19),NC(2),pl()()),e&2&&(BE(2),Og(t));}function ye(e,t){e&1&&(Ds(0,"span",21),NC(1,"Metadata"),pl(),Ds(2,"pre",19),NC(3),pl()),e&2&&(BE(3),Og(t));}function Ce(e,t){if(e&1&&(Ds(0,"dt"),NC(1,"Type"),pl(),Ds(2,"dd",23),NC(3),pl()),e&2){let n=Jw(2);BE(3),Og(n.errorType);}}function _e(e,t){if(e&1&&(Ds(0,"dt"),NC(1,"Message"),pl(),Ds(2,"dd"),NC(3),pl()),e&2){let n=Jw(2);BE(3),Og(n.errorMessage);}}function be(e,t){if(e&1&&(Ds(0,"span",21),NC(1,"Tool error details"),pl(),Ds(2,"dl",22),Lw(3,Ce,4,1),Lw(4,_e,4,1),pl()),e&2){let n=Jw();BE(3),jw(n.errorType?3:-1),BE(),jw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Ds(0,"ds-card",13)(1,"div")(2,"ds-tag",20),NC(3),pl()(),Ds(4,"span",21),NC(5,"Output"),pl(),Ds(6,"pre",19),NC(7),pl(),Lw(8,ye,4,1),Ds(9,"span",21),NC(10,"Structured output"),pl(),Ds(11,"pre",19),NC(12),pl(),Lw(13,be,5,2),pl()),e&2){let n,o=t,l=Jw();ug("heading","Result \u2014 "+o.toolName),BE(2),ug("variant",o.success?"accent":"outline"),BE(),Og(o.success?"Success":"Tool error"),BE(4),Og(o.output),BE(),jw((n=l.formatMetadata(o.metadata))?8:-1,n),BE(4),Og(l.formatStructuredOutput(o.structuredOutput)??"null"),BE(),jw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(Ie);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Ui([]);namespacesLoading=Ui(true);namespaceName=Ui(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[fn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[fn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=yw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Ds(2,"form",1),mg("ngSubmit",function(){return o.submit()}),Ds(3,"ds-form-field",2),Lw(4,ue,2,1)(5,fe,1,1,"input",3),pl(),Ds(6,"ds-form-field",4),lg(7,"input",5),_I(),pl(),Ds(8,"ds-form-field",6),lg(9,"input",7),_I(),pl(),Ds(10,"ds-form-field",8),lg(11,"textarea",9),_I(),pl(),Ds(12,"ds-form-actions")(13,"button",10),NC(14),pl(),Lw(15,ge,2,0,"button",11),pl()(),Lw(16,ve,3,1,"ds-card",12),Lw(17,he,14,7,"ds-card",13),pl()),n&2){let l,v;BE(),ug("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),BE(),ug("formGroup",o.form),BE(2),jw(o.isPlatformMode?4:5),BE(3),NI(),BE(2),NI(),BE(2),NI(),BE(2),ug("disabled",o.form.invalid||o.state.isLoading()),BE(),vl(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),BE(),jw(o.state.result()||o.state.errorMessage()?15:-1),BE(),jw((l=o.state.errorMessage())?16:-1,l),BE(),jw((v=o.state.result())?17:-1,v);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,dn,on,at,an,sn,ko],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -0,0 +1 @@
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DtxVuetC.js';import {O}from'./chunk-DNLzFXoQ.js';import {g,W,F as F$1,I as Ie,ag as U,ay as N,U as Ui,az as K,a8 as _,X as XC,a9 as F$2,aA as qe$1,G as U$1,a2 as da,aa as Tr,ac as Ty,ad as ne,M as x,K as w,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,Z as Zw,l as lg,_ as _I,R as NI,k as cg,v as vl,H as Hw,m as Uw,O as Og,r as df,s as ff,as as kg}from'./main-YOWURGI5.js';import {N as A,p as pt$1,T as Te,a as fn,Q as E,U as Ut,n as nd,b as bo,x as xo,L as Lt$1,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at$1,j as an,t as rn,l as ko}from'./chunk-BOcSAL90.js';import'./chunk-CodMcnv-.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Ds(0,"a",2),NC(1,"View resolved definition \u2192"),pl()),n&2){let e=Jw();ug("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function Qe(n,t){n&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function Ze(n,t){if(n&1&&(lg(0,"input",17),_I()),n&2){let e=Jw(2);ug("formControl",e.modelNameControl),NI();}}function et(n,t){if(n&1&&(Ds(0,"option",41),NC(1),pl()),n&2){let e=t;ug("ngValue",e.value),BE(),Og(e.label);}}function tt(n,t){if(n&1&&(Ds(0,"option",41),NC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),BE(),Og(e.label);}}function nt(n,t){if(n&1&&(Ds(0,"optgroup",42),Hw(1,tt,2,2,"option",41,je),pl()),n&2){let e=Jw(3);BE(),Uw(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Ds(0,"option",41),NC(1),pl()),n&2){let e=t.$implicit;ug("ngValue",e.value),BE(),Og(e.label);}}function ot(n,t){if(n&1&&(Ds(0,"optgroup",43),Hw(1,it,2,2,"option",41,je),pl()),n&2){let e=Jw(3);BE(),Uw(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Ds(0,"select",18)(1,"option",40),NC(2,"Select a model"),pl(),Lw(3,et,2,2,"option",41),Lw(4,nt,3,0,"optgroup",42),Lw(5,ot,3,0,"optgroup",43),pl(),_I()),n&2){let e,i=Jw(2);ug("formControl",i.modelNameControl),NI(),BE(),ug("ngValue",null),BE(2),jw((e=i.modelOptions().current)?3:-1,e),BE(),jw(i.modelOptions().aliases.length>0?4:-1),BE(),jw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Ds(0,"span",44),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.config.integrationType);}}function rt(n,t){if(n&1&&(lg(0,"input",45),_I()),n&2){let e=Jw().$implicit;ug("formControl",e.toolsControl),cg("aria-label","Tools of "+e.config.name),NI();}}function st(n,t){if(n&1){let e=Zw();Ds(0,"div",10)(1,"label",11)(2,"input",23),mg("change",function(){let s=df(e).$implicit,c=Jw(3);return ff(c.toggleIntegration(s))}),pl(),Ds(3,"span",24),NC(4),pl(),Lw(5,lt,2,1,"span",44),pl(),Lw(6,rt,1,2,"input",45),pl();}if(n&2){let e=t.$implicit;BE(2),ug("checked",e.enabled()),BE(2),Og(e.config.name),BE(),jw(e.config.integrationType?5:-1),BE(),jw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Ds(0,"p",13),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=Zw();Ds(0,"div",10)(1,"label",24),NC(2),Ds(3,"span",44),NC(4,"built-in"),pl()(),Ds(5,"select",47),mg("change",function(s){let c=df(e).$implicit,C=Jw(4);return ff(C.setBuiltInState(c,s.target.value))}),Ds(6,"option",48),NC(7),pl(),Ds(8,"option",49),NC(9,"Enabled"),pl(),Ds(10,"option",50),NC(11,"Disabled"),pl()(),Lw(12,dt,2,1,"p",13),Ds(13,"p",13),NC(14),pl()();}if(n&2){let e=t.$implicit,i=Jw(4);BE(),cg("for","built-in-"+e.type),BE(),vl(" ",e.displayName," "),BE(3),ug("id","built-in-"+e.type)("value",e.state()),BE(2),Og(i.builtInDefaultLabel(e)),BE(5),jw(e.state()==="on"&&e.restrictedTools?12:-1),BE(2),Og(e.description);}}function mt(n,t){if(n&1&&(Ds(0,"span",46),NC(1,"Built-in integrations"),pl(),Hw(2,ct,15,7,"div",10,qe)),n&2){let e=Jw(3);BE(2),Uw(e.builtInRows());}}function ut(n,t){n&1&&(Ds(0,"ds-notice",26),NC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),pl());}function gt(n,t){if(n&1&&(Ds(0,"ds-fieldset",21),Hw(1,st,7,4,"div",10,Ye),Lw(3,mt,4,0),Lw(4,ut,2,0,"ds-notice",26),pl()),n&2){let e=Jw(2);BE(),Uw(e.integrationRows()),BE(2),jw(e.builtInRows().length>0?3:-1),BE(),jw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&NC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Ds(0,"ds-notice",26),NC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),NC(3,"*"),pl(),NC(4,". "),pl());}function Ct(n,t){n&1&&(Ds(0,"ds-notice"),NC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function _t(n,t){n&1&&(Ds(0,"p",4),NC(1,"No skill available in this scope yet."),pl());}function bt(n,t){n&1&&(Ds(0,"span",44),NC(1,"platform"),pl());}function ht(n,t){if(n&1&&(Ds(0,"span",44),NC(1),pl()),n&2){let e=Jw(4);BE(),vl(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Ds(0,"p",13),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.description);}}function vt(n,t){if(n&1){let e=Zw();Ds(0,"div",10)(1,"label",11)(2,"input",51),mg("change",function(){let s=df(e).$implicit,c=Jw(3);return ff(c.toggleSkill(s))}),pl(),Ds(3,"span",24),NC(4),pl(),Lw(5,bt,2,0,"span",44),Lw(6,ht,2,1,"span",44),pl(),Lw(7,yt,2,1,"p",13),pl();}if(n&2){let e=t.$implicit,i=Jw(3);BE(2),ug("checked",e.selected())("disabled",i.allSkillsSelected()),BE(2),Og(e.name),BE(),jw(e.platform?5:-1),BE(),jw(e.unresolved?6:-1),BE(),jw(e.description?7:-1);}}function xt(n,t){if(n&1&&Hw(0,vt,8,6,"div",10,We),n&2){let e=Jw(2);Uw(e.skillRows());}}function St(n,t){if(n&1&&(Ds(0,"ds-form-field",30),lg(1,"textarea",52),_I(),Ds(2,"p",4),NC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Ds(4,"code"),NC(5,"AgentLoopPayload"),pl(),NC(6,". Leave empty if you always provide the payload at launch. "),pl()()),n&2){let e=Jw(2);ug("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),BE(),ug("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),NI();}}function At(n,t){n&1&&NC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&NC(0),n&2){let e=Jw(3);kg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Ds(0,"ds-notice",26),NC(1," Saving with this on replaces the selection below with "),Ds(2,"code",25),NC(3,"*"),pl(),NC(4,". "),Lw(5,wt,1,2),pl()),n&2){let e=Jw(2);BE(5),jw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Ds(0,"ds-notice"),NC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),pl());}function kt(n,t){n&1&&(Ds(0,"p",4),NC(1,"No other agent is available in this scope yet."),pl());}function It(n,t){n&1&&(Ds(0,"span",44),NC(1,"pattern"),pl());}function Rt(n,t){n&1&&(Ds(0,"span",44),NC(1,"via pattern"),pl());}function Mt(n,t){if(n&1&&(Ds(0,"span",44),NC(1),pl()),n&2){let e=Jw(4);BE(),vl(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=Zw();Ds(0,"button",55),mg("click",function(){df(e);let s=Jw().$implicit,c=Jw(3);return ff(c.removeSubAgent(s))}),NC(1," \xD7 "),pl();}if(n&2){let e=Jw().$implicit;cg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=Zw();Ds(0,"div",32)(1,"label",53)(2,"input",51),mg("change",function(){let s=df(e).$implicit,c=Jw(3);return ff(c.toggleSubAgent(s))}),pl(),Ds(3,"span",24),NC(4),pl(),Lw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),pl(),Lw(8,Ft,2,1,"button",54),pl();}if(n&2){let e=t.$implicit,i=Jw(3);BE(2),ug("checked",e.selected())("disabled",i.allSubAgentsSelected()),BE(2),Og(e.name),BE(),jw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),BE(3),jw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Hw(0,Nt,9,5,"div",32,We),n&2){let e=Jw(2);Uw(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=Zw();Ds(0,"div")(1,"button",56),mg("click",function(){df(e);let s=Jw(2);return ff(s.useDefaultDelegationTimeout())}),NC(2," Use server default "),pl()();}}function Vt(n,t){n&1&&(Ds(0,"ds-notice"),NC(1),pl()),n&2&&(BE(),Og(t));}function Pt(n,t){if(n&1){let e=Zw();Ds(0,"button",57),mg("click",function(){df(e);let s=Jw(2);return ff(s.exportYaml())}),NC(1),pl();}if(n&2){let e=Jw(2);ug("disabled",e.isExporting()),BE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=Zw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let s=Jw();return ff(s.submit())}),Ds(1,"ds-fieldset",7)(2,"ds-form-field",8),lg(3,"input",9),_I(),pl(),Ds(4,"div",10)(5,"label",11),lg(6,"input",12),_I(),NC(7," Enabled "),pl(),Ds(8,"p",13),NC(9,"Disabled agents are excluded from namespace resolution."),pl()(),Ds(10,"ds-form-field",14),lg(11,"input",15),_I(),pl(),Ds(12,"ds-form-field",16),Lw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),pl(),Ds(15,"ds-form-field",19),lg(16,"textarea",20),_I(),pl()(),Lw(17,gt,5,2,"ds-fieldset",21),Ds(18,"ds-fieldset",22)(19,"p",4),NC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Ds(21,"code"),NC(22,"readSkill"),pl(),NC(23," and "),Ds(24,"code"),NC(25,"readSkillResource"),pl(),NC(26," tools; selecting none grants neither. "),Lw(27,pt,1,0),pl(),Ds(28,"label",11)(29,"input",23),mg("change",function(){df(e);let s=Jw();return ff(s.toggleAllSkills())}),pl(),Ds(30,"span",24),NC(31,"Every skill in the catalogue ("),Ds(32,"code",25),NC(33,"*"),pl(),NC(34,")"),pl()(),Ds(35,"p",13),NC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),pl(),Lw(37,ft,5,0,"ds-notice",26),Lw(38,Ct,2,0,"ds-notice"),Lw(39,_t,2,0,"p",4)(40,xt,2,0),pl(),Ds(41,"ds-form-field",27)(42,"select",28)(43,"option",29),NC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),Ds(45,"option",29),NC(46,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),Ds(47,"option",29),NC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),_I(),pl(),Lw(49,St,7,3,"ds-form-field",30),Ds(50,"ds-fieldset",31)(51,"p",4),NC(52," The agents this one may delegate to. Selecting at least one grants it the "),Ds(53,"code"),NC(54,"DELEGATE__delegate"),pl(),NC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Lw(56,At,1,0),pl(),Ds(57,"label",11)(58,"input",23),mg("change",function(){df(e);let s=Jw();return ff(s.toggleAllSubAgents())}),pl(),Ds(59,"span",24),NC(60,"Every agent it can reach ("),Ds(61,"code",25),NC(62,"*"),pl(),NC(63,")"),pl()(),Ds(64,"p",13),NC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),pl(),Lw(66,Et,6,1,"ds-notice",26),Lw(67,Tt,2,0,"ds-notice"),Lw(68,kt,2,0,"p",4)(69,Dt,2,0),Ds(70,"p",4),NC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Ds(72,"code"),NC(73,"*Fixer"),pl(),NC(74," to cover BugFixer and StoryFixer. "),pl(),Ds(75,"div",32)(76,"input",33),mg("keydown.enter",function(){df(e);let s=Jw();return ff(s.addSubAgent())}),pl(),_I(),Ds(77,"button",34),mg("click",function(){df(e);let s=Jw();return ff(s.addSubAgent())}),NC(78," + "),pl()(),Ds(79,"ds-form-field",35),lg(80,"input",36),_I(),Lw(81,Lt,3,0,"div"),pl()(),Lw(82,Vt,2,1,"ds-notice"),Ds(83,"ds-form-actions")(84,"button",37),NC(85),pl(),Lw(86,Pt,2,2,"button",38),Ds(87,"button",39),mg("click",function(){df(e);let s=Jw();return ff(s.cancel())}),NC(88,"Cancel"),pl()()();}if(n&2){let e,i=Jw();ug("formGroup",i.form),BE(3),ug("formControl",i.nameControl),NI(),BE(3),ug("formControl",i.enabledControl),NI(),BE(5),ug("formControl",i.descriptionControl),NI(),BE(2),jw(i.modelAsFreeText()?13:14),BE(3),ug("formControl",i.instructionsControl),NI(),BE(),jw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),BE(10),jw(i.isPlatformMode?27:-1),BE(2),ug("checked",i.allSkillsSelected()),BE(8),jw(i.namedSkillSelectionDropped()?37:-1),BE(),jw(i.skillCatalogueUnavailable()?38:-1),BE(),jw(i.skillRows().length===0?39:40),BE(3),ug("formControl",i.executionModeControl),NI(),BE(),ug("value",i.ExecutionMode.SIMPLE),BE(2),ug("value",i.ExecutionMode.ADVANCED),BE(2),ug("value",i.ExecutionMode.LOOP),BE(2),jw(i.isLoopMode()?49:-1),BE(7),jw(i.isPlatformMode?56:-1),BE(2),ug("checked",i.allSubAgentsSelected()),BE(8),jw(i.namedSubAgentSelectionDropped()?66:-1),BE(),jw(i.subAgentCandidatesUnavailable()?67:-1),BE(),jw(i.subAgentRows().length===0?68:69),BE(8),ug("formControl",i.newSubAgentControl),NI(),BE(),ug("disabled",!i.newSubAgentControl.value.trim()),BE(2),ug("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),BE(),ug("formControl",i.delegationTimeoutControl),cg("aria-invalid",i.delegationTimeoutControl.invalid),NI(),BE(),jw(i.delegationTimeoutControl.value!==null?81:-1),BE(),jw((e=i.submitError())?82:-1,e),BE(2),ug("disabled",i.form.invalid||i.isSubmitting()),BE(),vl(" ",i.isEditMode()?"Save changes":"Create"," "),BE(),jw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(Ie);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=Ui(null);exportService=g(K);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[fn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[fn.min(1),fn.max(2147483647),fn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=XC(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=XC(()=>this.executionModeValue()==="LOOP");subAgentRows=Ui([]);allSubAgentsSelected=Ui(false);subAgentCandidatesUnavailable=Ui(false);namedSubAgentSelectionDropped=XC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=XC(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=XC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);submitError=Ui(null);ExecutionMode=qe$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Ui([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=XC(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=Ui({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=Ui(false);modelAsFreeText=XC(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=Ui([]);skillRows=Ui([]);allSkillsSelected=Ui(false);skillCatalogueUnavailable=Ui(false);namedSkillSelectionDropped=XC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),da(()=>Tr(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ty({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Tr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ty({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Tr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(da(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Tr([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:Ui(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:Ui(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):Tr([]);return Ty({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return da(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),Tr([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:Ui(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:Ui(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),da(t=>(console.error("[agent-config-form] failed to load integration types",t),Tr([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:Ui(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:Ui(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:Ui(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",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"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return i.cancel()}),NC(3," \u2190 Agent configs "),pl(),Lw(4,ze,2,1,"a",2),Lw(5,Xe,2,0,"ds-tag",3),pl(),Lw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),pl()),e&2&&(BE(),ug("title",i.isEditMode()?"Edit agent config":"New agent config"),BE(3),jw(i.isEditMode()?4:-1),BE(),jw(i.isPlatformMode?5:-1),BE(),jw(i.isLoading()?6:7));},dependencies:[Ut,nd,bo,xo,Lt$1,kn,vn,Gt,mo,po,$r,qr,Vn,An,$t,pn,hn,cn,ln,dn,mn,at$1,an,rn,ko],encapsulation:2})};export{Ke as AgentConfigFormComponent};
@@ -1 +1 @@
1
- import {f,y,p as pt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-Bs2lM6dc.js';import {g,W,F,E as J,I as Ie,X as XC,U as Ui,q as Af,G as U,K as w,M as x,y as yw,D as Ds,l as lg,L as Lw,p as pl,P as ug,a as BE,j as jw,N as NC,Z as Zw,Q as mg,_ as _I,H as Hw,J as Jw,R as NI,k as cg,m as Uw,v as vl,O as Og,r as df,s as ff}from'./main-ZPG3XUQU.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function he(i,t){if(i&1&&(Ds(0,"option",23),NC(1),pl()),i&2){let e=t.$implicit;ug("value",e.value),BE(),Og(e.label);}}function pe(i,t){if(i&1){let e=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Jw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),_I(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),_I(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),_I(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),_I(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),_I(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),_I(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),_I(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let se=Jw();return ff(se.onMaxToolRoundsInput(p))}),pl(),_I(),pl(),Ds(17,"ds-form-field",21)(18,"select",22),Hw(19,he,2,2,"option",23,ce),pl(),_I(),pl(),Ds(21,"ds-form-actions")(22,"button",24),NC(23),pl(),Ds(24,"button",25),mg("click",function(){df(e);let p=Jw();return ff(p.cancel())}),NC(25,"Cancel"),pl()()();}if(i&2){let e=Jw();ug("formGroup",e.form),BE(2),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.externalIdControl),NI(),BE(2),ug("formControl",e.defaultAgentNameControl),NI(),BE(2),ug("formControl",e.configPathControl),NI(),BE(),ug("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),BE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),NI(),BE(),ug("hint",e.runCostThresholdHint()),BE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),NI(),BE(),ug("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),BE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),NI(),BE(2),ug("formControl",e.adminCaseListingControl),NI(),BE(),Uw(e.adminCaseListingOptions),BE(3),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=XC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=XC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=XC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=XC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(fe),fn.max(ge),fn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Lw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),BE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),BE(),jw(u.isLoading()?2:3));},dependencies:[Ut,nd,bo,xo,Lt,kn,Gt,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
1
+ import {f,y,p as pt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-BOcSAL90.js';import {g,W,F,E as J,I as Ie,X as XC,U as Ui,q as Af,G as U,K as w,M as x,y as yw,D as Ds,l as lg,L as Lw,p as pl,P as ug,a as BE,j as jw,N as NC,Z as Zw,Q as mg,_ as _I,H as Hw,J as Jw,R as NI,k as cg,m as Uw,v as vl,O as Og,r as df,s as ff}from'./main-YOWURGI5.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function he(i,t){if(i&1&&(Ds(0,"option",23),NC(1),pl()),i&2){let e=t.$implicit;ug("value",e.value),BE(),Og(e.label);}}function pe(i,t){if(i&1){let e=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Jw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),_I(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),_I(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),_I(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),_I(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),_I(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),_I(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),_I(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let se=Jw();return ff(se.onMaxToolRoundsInput(p))}),pl(),_I(),pl(),Ds(17,"ds-form-field",21)(18,"select",22),Hw(19,he,2,2,"option",23,ce),pl(),_I(),pl(),Ds(21,"ds-form-actions")(22,"button",24),NC(23),pl(),Ds(24,"button",25),mg("click",function(){df(e);let p=Jw();return ff(p.cancel())}),NC(25,"Cancel"),pl()()();}if(i&2){let e=Jw();ug("formGroup",e.form),BE(2),ug("formControl",e.nameControl),NI(),BE(2),ug("formControl",e.descriptionControl),NI(),BE(2),ug("formControl",e.externalIdControl),NI(),BE(2),ug("formControl",e.defaultAgentNameControl),NI(),BE(2),ug("formControl",e.configPathControl),NI(),BE(),ug("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),BE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),NI(),BE(),ug("hint",e.runCostThresholdHint()),BE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),NI(),BE(),ug("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),BE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),NI(),BE(2),ug("formControl",e.adminCaseListingControl),NI(),BE(),Uw(e.adminCaseListingOptions),BE(3),ug("disabled",e.form.invalid||e.isSubmitting()),BE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=XC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=XC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=XC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=XC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(fe),fn.max(ge),fn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Lw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),BE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),BE(),jw(u.isLoading()?2:3));},dependencies:[Ut,nd,bo,xo,Lt,kn,Gt,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
@@ -1 +1 @@
1
- import {i}from'./chunk-TuIJresS.js';import {y}from'./chunk-Bs2lM6dc.js';import {g as g$1,ap as F,$ as Cr,at as wy,a1 as fa,a2 as da,aa as Tr,ad as ne,aD as $y,a5 as yd,K as w,a6 as x}from'./main-ZPG3XUQU.js';var g="none",N="me",O=class p{nsController=g$1(F);userState=g$1(y);refresh$=new Cr(void 0);namespaceId$=new Cr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([e])=>{let r=this.loadPlatformProviders().pipe(da(()=>Tr([])));return e?wy([r,this.loadNamespaceProviders(e).pipe(da(()=>Tr([]))),this.loadUserProviders(e).pipe(da(()=>Tr([]))),this.loadUserProviders("global").pipe(da(()=>Tr([])))]).pipe(ne(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):wy([r,this.loadNamespaceProviders("").pipe(da(()=>Tr([]))),this.loadUserProviders("global").pipe(da(()=>Tr([])))]).pipe(ne(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),$y({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):Tr([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(yd(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(yd(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(yd(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(yd(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
1
+ import {i}from'./chunk-CodMcnv-.js';import {y}from'./chunk-BOcSAL90.js';import {g as g$1,ap as F,$ as Cr,at as wy,a1 as fa,a2 as da,aa as Tr,ad as ne,aD as $y,a5 as yd,K as w,a6 as x}from'./main-YOWURGI5.js';var g="none",N="me",O=class p{nsController=g$1(F);userState=g$1(y);refresh$=new Cr(void 0);namespaceId$=new Cr(null);vm$=wy([this.namespaceId$,this.refresh$]).pipe(fa(([e])=>{let r=this.loadPlatformProviders().pipe(da(()=>Tr([])));return e?wy([r,this.loadNamespaceProviders(e).pipe(da(()=>Tr([]))),this.loadUserProviders(e).pipe(da(()=>Tr([]))),this.loadUserProviders("global").pipe(da(()=>Tr([])))]).pipe(ne(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):wy([r,this.loadNamespaceProviders("").pipe(da(()=>Tr([]))),this.loadUserProviders("global").pipe(da(()=>Tr([])))]).pipe(ne(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),$y({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):Tr([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(yd(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(yd(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(yd(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(yd(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
@@ -0,0 +1 @@
1
+ import {a1 as fa,a2 as da,aa as Tr,aD as $y}from'./main-YOWURGI5.js';function i(t,o,p){return t.pipe(fa(()=>o().pipe(da(()=>Tr(p)))),$y({bufferSize:1,refCount:true}))}export{i};
@@ -1,2 +1,2 @@
1
- import {I}from'./chunk-7YWH-FdV.js';import {g,W,aW as L,I as Ie,U as Ui,X as XC,aX as Be,ac as Ty,G as U,a2 as da,aa as Tr,y as yw,D as Ds,l as lg,L as Lw,p as pl,Q as mg,a as BE,j as jw,P as ug,N as NC,Z as Zw,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,v as vl,as as kg,r as df,s as ff,O as Og}from'./main-ZPG3XUQU.js';import {a4 as id,b as bo,x as xo,L as Lt,u as vn,G as Gt,m as mo,a6 as da$1,aa as Ni,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-Bs2lM6dc.js';import'./chunk-TuIJresS.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Ds(0,"p",1),NC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function re(i,t){if(i&1){let e=Zw();Ds(0,"div")(1,"button",23),mg("click",function(){df(e);let s=Jw(2);return ff(s.retryLoad())}),NC(2,"Retry loading"),pl()();}}function ce(i,t){if(i&1&&(lg(0,"br"),NC(1)),i&2){let e=Jw(3);BE(),vl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Ds(0,"ds-notice",3),NC(1),Lw(2,ce,2,1),pl()),i&2){let e=Jw(2);ug("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),BE(),vl(" Repository: ",e.checkoutStatus()," "),BE(),jw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Ds(0,"option",12),NC(1),pl()),i&2){let e=t.$implicit,c=Jw(2);ug("value",e.id),BE(),kg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Ds(0,"p",13),NC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function pe(i,t){if(i&1){let e=Zw();Ds(0,"button",24),mg("click",function(){df(e);let s=Jw(2);return ff(s.remove())}),NC(1," Remove association "),pl();}if(i&2){let e=Jw(2);ug("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Zw();Lw(0,se,2,1,"ds-notice"),Lw(1,re,3,0,"div"),Lw(2,de,3,3,"ds-notice",3),Ds(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.repositoryUrl.set(s))}),pl(),_I(),pl(),Ds(6,"ds-form-field",7)(7,"input",8),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.mainBranch.set(s))}),pl(),_I(),pl(),Ds(8,"ds-form-field",9)(9,"select",10),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.serviceAuthSettingId.set(s))}),Ds(10,"option",11),NC(11,"Select an auth setting\u2026"),pl(),Hw(12,le,2,3,"option",12,oe),pl(),_I(),Lw(14,me,2,0,"p",13),pl()(),Ds(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.autoWorktree.set(s))}),pl(),_I(),NC(19," Offer a worktree to every new top-level case "),pl(),Ds(20,"p",18),NC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),pl()(),Ds(22,"ds-form-field",19)(23,"input",20),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.setupCommand.set(s))}),pl(),_I(),Ds(24,"p",13),NC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),pl()()(),Ds(26,"ds-form-actions")(27,"button",21),mg("click",function(){df(e);let s=Jw();return ff(s.save())}),NC(28),pl(),Lw(29,pe,2,1,"button",22),pl();}if(i&2){let e=Jw();jw(e.errorMessage()?0:-1),BE(),jw(e.associationLoaded()?-1:1),BE(),jw(e.isAssociated()&&e.checkoutStatus()?2:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(2),ug("ngModel",e.repositoryUrl()),NI(),BE(2),ug("ngModel",e.mainBranch()),NI(),BE(2),ug("ngModel",e.serviceAuthSettingId()),NI(),BE(3),Uw(e.eligibleAuthSettings()),BE(2),jw(e.eligibleAuthSettings().length===0?14:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(3),ug("ngModel",e.autoWorktree()),NI(),BE(5),ug("ngModel",e.setupCommand()),NI(),BE(4),ug("disabled",!e.canSave()),BE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),BE(),jw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(Ie);isLoading=Ui(true);isSaving=Ui(false);confirmingRemove=Ui(false);associationLoaded=Ui(false);errorMessage=Ui(null);association=Ui(null);authSettings=Ui([]);repositoryUrl=Ui("");mainBranch=Ui("main");serviceAuthSettingId=Ui("");autoWorktree=Ui(false);setupCommand=Ui("");namespaceId="";isAssociated=XC(()=>this.association()?.associated===true);eligibleAuthSettings=XC(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=XC(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=XC(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Be;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ty({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),da(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),da(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Lw(2,ae,2,0,"p",1)(3,ue,30,14),pl(),Ds(4,"ds-confirm-dialog",2),mg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),pl()),e&2&&(BE(2),jw(c.isLoading()?2:3),BE(2),ug("open",c.confirmingRemove()));},dependencies:[id,bo,xo,Lt,vn,Gt,mo,da$1,Ni,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};
1
+ import {I}from'./chunk-Bp8gQw3Y.js';import {g,W,aW as L,I as Ie,U as Ui,X as XC,aX as Be,ac as Ty,G as U,a2 as da,aa as Tr,y as yw,D as Ds,l as lg,L as Lw,p as pl,Q as mg,a as BE,j as jw,P as ug,N as NC,Z as Zw,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,v as vl,as as kg,r as df,s as ff,O as Og}from'./main-YOWURGI5.js';import {a6 as id,b as bo,x as xo,L as Lt,u as vn,G as Gt,m as mo,a8 as da$1,ac as Ni,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-BOcSAL90.js';import'./chunk-CodMcnv-.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Ds(0,"p",1),NC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function re(i,t){if(i&1){let e=Zw();Ds(0,"div")(1,"button",23),mg("click",function(){df(e);let s=Jw(2);return ff(s.retryLoad())}),NC(2,"Retry loading"),pl()();}}function ce(i,t){if(i&1&&(lg(0,"br"),NC(1)),i&2){let e=Jw(3);BE(),vl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Ds(0,"ds-notice",3),NC(1),Lw(2,ce,2,1),pl()),i&2){let e=Jw(2);ug("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),BE(),vl(" Repository: ",e.checkoutStatus()," "),BE(),jw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Ds(0,"option",12),NC(1),pl()),i&2){let e=t.$implicit,c=Jw(2);ug("value",e.id),BE(),kg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Ds(0,"p",13),NC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function pe(i,t){if(i&1){let e=Zw();Ds(0,"button",24),mg("click",function(){df(e);let s=Jw(2);return ff(s.remove())}),NC(1," Remove association "),pl();}if(i&2){let e=Jw(2);ug("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Zw();Lw(0,se,2,1,"ds-notice"),Lw(1,re,3,0,"div"),Lw(2,de,3,3,"ds-notice",3),Ds(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.repositoryUrl.set(s))}),pl(),_I(),pl(),Ds(6,"ds-form-field",7)(7,"input",8),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.mainBranch.set(s))}),pl(),_I(),pl(),Ds(8,"ds-form-field",9)(9,"select",10),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.serviceAuthSettingId.set(s))}),Ds(10,"option",11),NC(11,"Select an auth setting\u2026"),pl(),Hw(12,le,2,3,"option",12,oe),pl(),_I(),Lw(14,me,2,0,"p",13),pl()(),Ds(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.autoWorktree.set(s))}),pl(),_I(),NC(19," Offer a worktree to every new top-level case "),pl(),Ds(20,"p",18),NC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),pl()(),Ds(22,"ds-form-field",19)(23,"input",20),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.setupCommand.set(s))}),pl(),_I(),Ds(24,"p",13),NC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),pl()()(),Ds(26,"ds-form-actions")(27,"button",21),mg("click",function(){df(e);let s=Jw();return ff(s.save())}),NC(28),pl(),Lw(29,pe,2,1,"button",22),pl();}if(i&2){let e=Jw();jw(e.errorMessage()?0:-1),BE(),jw(e.associationLoaded()?-1:1),BE(),jw(e.isAssociated()&&e.checkoutStatus()?2:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(2),ug("ngModel",e.repositoryUrl()),NI(),BE(2),ug("ngModel",e.mainBranch()),NI(),BE(2),ug("ngModel",e.serviceAuthSettingId()),NI(),BE(3),Uw(e.eligibleAuthSettings()),BE(2),jw(e.eligibleAuthSettings().length===0?14:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(3),ug("ngModel",e.autoWorktree()),NI(),BE(5),ug("ngModel",e.setupCommand()),NI(),BE(4),ug("disabled",!e.canSave()),BE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),BE(),jw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(Ie);isLoading=Ui(true);isSaving=Ui(false);confirmingRemove=Ui(false);associationLoaded=Ui(false);errorMessage=Ui(null);association=Ui(null);authSettings=Ui([]);repositoryUrl=Ui("");mainBranch=Ui("main");serviceAuthSettingId=Ui("");autoWorktree=Ui(false);setupCommand=Ui("");namespaceId="";isAssociated=XC(()=>this.association()?.associated===true);eligibleAuthSettings=XC(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=XC(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=XC(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Be;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ty({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),da(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),da(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Lw(2,ae,2,0,"p",1)(3,ue,30,14),pl(),Ds(4,"ds-confirm-dialog",2),mg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),pl()),e&2&&(BE(2),jw(c.isLoading()?2:3),BE(2),ug("open",c.confirmingRemove()));},dependencies:[id,bo,xo,Lt,vn,Gt,mo,da$1,Ni,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};
2
2
  export{ne as NamespaceGitComponent};
@@ -1 +1 @@
1
- import {S}from'./chunk-Bs2lM6dc.js';import {y as yw,T as br,D as Ds,N as NC,p as pl,l as lg,P as ug}from'./main-ZPG3XUQU.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=yw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Ds(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),NC(3,"Platform"),pl(),Ds(4,"span",2),NC(5,"/"),pl(),Ds(6,"span"),NC(7,"Administration"),pl()(),lg(8,"router-outlet"),pl()),e&2&&ug("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
1
+ import {S}from'./chunk-BOcSAL90.js';import {y as yw,T as br,D as Ds,N as NC,p as pl,l as lg,P as ug}from'./main-YOWURGI5.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=yw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Ds(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),NC(3,"Platform"),pl(),Ds(4,"span",2),NC(5,"/"),pl(),Ds(6,"span"),NC(7,"Administration"),pl()(),lg(8,"router-outlet"),pl()),e&2&&ug("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
@@ -1 +1 @@
1
- import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-Bs2lM6dc.js';import {g,W as W$1,F,I as Ie,ag as U$1,$ as Cr,U as Ui,a1 as fa,ac as Ty,a2 as da,aa as Tr,G as U$2,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,Z as Zw,r as df,s as ff,k as cg}from'./main-ZPG3XUQU.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let t=Jw();BE(),Og(t.deletion.error());}}function z(n,e){n&1&&(Ds(0,"p",4),NC(1,"Loading agent configs\u2026"),pl());}function G(n,e){n&1&&(Ds(0,"p",5),NC(1,"No agent configs available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),NC(1,"No agent configs match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",18),NC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=Zw();Ds(0,"button",22),mg("click",function(){df(t);let s=Jw(2).$implicit,d=Jw(2);return ff(d.launch(s))}),NC(1," Launch "),pl();}if(n&2){let t=Jw(2).$implicit;cg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Zw();Ds(0,"button",22),mg("click",function(){df(t);let s=Jw(2).$implicit,d=Jw(2);return ff(d.edit(s))}),NC(1," Edit "),pl();}if(n&2){let t=Jw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Zw();Ds(0,"button",22),mg("click",function(){df(t);let s=Jw().$implicit,d=Jw(2);return ff(d.inspect(s))}),NC(1," Inspect "),pl(),Lw(2,X,2,1,"button",23),Lw(3,Y,2,1,"button",23);}if(n&2){let t=Jw().$implicit,i=Jw(2);cg("aria-label","Inspect "+t.config.name),BE(2),jw(i.canLaunch(t)?2:-1),BE(),jw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Zw();Ds(0,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(t);let s=Jw().$implicit,d=Jw(2);return ff(d.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Jw().$implicit,d=Jw(2);return ff(d.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Jw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Jw().$implicit,i=Jw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15)(8,"div",16)(9,"ds-tag",17),NC(10),pl(),Lw(11,W,2,0,"ds-tag",18),pl()(),Ds(12,"td",19)(13,"div",20),Lw(14,Z,4,3),Lw(15,ee,1,3,"agentos-row-delete-action",21),pl()()()),n&2){let t=e.$implicit,i=Jw(2);BE(2),Og(t.config.name),BE(2),vl(" ",t.config.description||"\u2014"," "),BE(2),Og(i.mode(t)),BE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),BE(),Og(t.scope==="platform"?"Platform":"Namespace"),BE(),jw(t.scope==="platform"?11:-1),BE(3),jw(i.deletion.confirmingId()!==t.key?14:-1),BE(),jw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Description"),pl(),Ds(8,"th",10),NC(9,"Execution mode"),pl(),Ds(10,"th",10),NC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),NC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Hw(16,te,16,8,"tr",9,J),pl()()()),n&2){let t=Jw();BE(16),Uw(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();rows=Ui([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(da(()=>Tr([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return i.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),NC(3,"New agent config"),pl()(),Lw(4,U,2,1,"p",3),Lw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(BE(),ug("query",i.rowFilter.query()),BE(3),jw(i.deletion.error()?4:-1),BE(),jw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
1
+ import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-BOcSAL90.js';import {g,W as W$1,F,I as Ie,ag as U$1,$ as Cr,U as Ui,a1 as fa,ac as Ty,a2 as da,aa as Tr,G as U$2,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,Z as Zw,r as df,s as ff,k as cg}from'./main-YOWURGI5.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let t=Jw();BE(),Og(t.deletion.error());}}function z(n,e){n&1&&(Ds(0,"p",4),NC(1,"Loading agent configs\u2026"),pl());}function G(n,e){n&1&&(Ds(0,"p",5),NC(1,"No agent configs available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),NC(1,"No agent configs match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",18),NC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=Zw();Ds(0,"button",22),mg("click",function(){df(t);let s=Jw(2).$implicit,d=Jw(2);return ff(d.launch(s))}),NC(1," Launch "),pl();}if(n&2){let t=Jw(2).$implicit;cg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Zw();Ds(0,"button",22),mg("click",function(){df(t);let s=Jw(2).$implicit,d=Jw(2);return ff(d.edit(s))}),NC(1," Edit "),pl();}if(n&2){let t=Jw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Zw();Ds(0,"button",22),mg("click",function(){df(t);let s=Jw().$implicit,d=Jw(2);return ff(d.inspect(s))}),NC(1," Inspect "),pl(),Lw(2,X,2,1,"button",23),Lw(3,Y,2,1,"button",23);}if(n&2){let t=Jw().$implicit,i=Jw(2);cg("aria-label","Inspect "+t.config.name),BE(2),jw(i.canLaunch(t)?2:-1),BE(),jw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Zw();Ds(0,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(t);let s=Jw().$implicit,d=Jw(2);return ff(d.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Jw().$implicit,d=Jw(2);return ff(d.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Jw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Jw().$implicit,i=Jw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),NC(2),pl(),Ds(3,"td",13),NC(4),pl(),Ds(5,"td",14),NC(6),pl(),Ds(7,"td",15)(8,"div",16)(9,"ds-tag",17),NC(10),pl(),Lw(11,W,2,0,"ds-tag",18),pl()(),Ds(12,"td",19)(13,"div",20),Lw(14,Z,4,3),Lw(15,ee,1,3,"agentos-row-delete-action",21),pl()()()),n&2){let t=e.$implicit,i=Jw(2);BE(2),Og(t.config.name),BE(2),vl(" ",t.config.description||"\u2014"," "),BE(2),Og(i.mode(t)),BE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),BE(),Og(t.scope==="platform"?"Platform":"Namespace"),BE(),jw(t.scope==="platform"?11:-1),BE(3),jw(i.deletion.confirmingId()!==t.key?14:-1),BE(),jw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Description"),pl(),Ds(8,"th",10),NC(9,"Execution mode"),pl(),Ds(10,"th",10),NC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),NC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Hw(16,te,16,8,"tr",9,J),pl()()()),n&2){let t=Jw();BE(16),Uw(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();rows=Ui([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(da(()=>Tr([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return i.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),NC(3,"New agent config"),pl()(),Lw(4,U,2,1,"p",3),Lw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(BE(),ug("query",i.rowFilter.query()),BE(3),jw(i.deletion.error()?4:-1),BE(),jw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};