@whoz-oss/coday-client 0.0.0-workstream-forge.163 → 0.0.0-workstream-forge.165

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 (50) hide show
  1. package/browser/{chunk-Cc6IKSyC.js → chunk-0VeqXZ9d.js} +1 -1
  2. package/browser/{chunk-CbxILJkh.js → chunk-2HHZ3LC4.js} +1 -1
  3. package/browser/{chunk-BUHpp4JE.js → chunk-8AFIbDZU.js} +1 -1
  4. package/browser/{chunk-CsSaiA1P.js → chunk-APy1T-1u.js} +1 -1
  5. package/browser/{chunk-O-V09dXj.js → chunk-B5ePzsIu.js} +1 -1
  6. package/browser/{chunk-33f1Bq4d.js → chunk-BB8Lzhwo.js} +1 -1
  7. package/browser/{chunk-CkucggC3.js → chunk-BEEjS55d.js} +1 -1
  8. package/browser/chunk-BJSbfkDj.js +1 -0
  9. package/browser/{chunk-BfnsSzkw.js → chunk-BONtS7al.js} +1 -1
  10. package/browser/{chunk-ILOTMMoB.js → chunk-BQblY_Kv.js} +1 -1
  11. package/browser/{chunk-CubEcxsT.js → chunk-BSqHjzXQ.js} +1 -1
  12. package/browser/{chunk-BVM48Akd.js → chunk-BcLZGu2F.js} +1 -1
  13. package/browser/{chunk-BdAw3RVr.js → chunk-Bf8bCumD.js} +1 -1
  14. package/browser/{chunk-DHFl5v8y.js → chunk-BqrOxZdE.js} +1 -1
  15. package/browser/{chunk-BJT1pT3j.js → chunk-BxXzXgnw.js} +1 -1
  16. package/browser/{chunk-Dnq1VkLC.js → chunk-C4KCDgok.js} +1 -1
  17. package/browser/{chunk-BO1HGYJ3.js → chunk-C7QOV3yc.js} +1 -1
  18. package/browser/{chunk-D0Fm138-.js → chunk-CG1SJzmH.js} +1 -1
  19. package/browser/{chunk-DAFgF2zk.js → chunk-CGnbW-VY.js} +1 -1
  20. package/browser/{chunk-LDlaL5qr.js → chunk-COXl1FiZ.js} +1 -1
  21. package/browser/{chunk-G9dv78Yj.js → chunk-CS1tczfK.js} +1 -1
  22. package/browser/{chunk-03YpIQRe.js → chunk-CTCRh-DP.js} +1 -1
  23. package/browser/{chunk-CV3K5zNT.js → chunk-CXv7Ai08.js} +1 -1
  24. package/browser/{chunk-CUjEhdzX.js → chunk-CcuY-VZC.js} +1 -1
  25. package/browser/{chunk-C1QfCycr.js → chunk-ClI63nto.js} +1 -1
  26. package/browser/{chunk-BPDyUW9C.js → chunk-CnRe9SoM.js} +1 -1
  27. package/browser/{chunk-DFXEWELG.js → chunk-Cs89O_uQ.js} +1 -1
  28. package/browser/{chunk-DqhsOOSW.js → chunk-CxLl2FLQ.js} +1 -1
  29. package/browser/{chunk-BQtSIe5T.js → chunk-D5UFWtax.js} +1 -1
  30. package/browser/{chunk-BVdMofRH.js → chunk-DGRsoYx_.js} +1 -1
  31. package/browser/{chunk-BIqQDrzJ.js → chunk-DXSN6VYs.js} +1 -1
  32. package/browser/{chunk-KPQ2pP66.js → chunk-DdWF9OO6.js} +1 -1
  33. package/browser/{chunk-C4HOlFhc.js → chunk-Dga8qADW.js} +1 -1
  34. package/browser/{chunk-O3MeTbDv.js → chunk-DzLt2p-b.js} +1 -1
  35. package/browser/{chunk-Cml5V2VG.js → chunk-EmHExSnw.js} +1 -1
  36. package/browser/{chunk-Bu3U66-H.js → chunk-Go1_Zu5R.js} +1 -1
  37. package/browser/{chunk-QZ9v-olu.js → chunk-PCe11EaT.js} +1 -1
  38. package/browser/{chunk-CDsD_Pfd.js → chunk-THLjXVP8.js} +1 -1
  39. package/browser/{chunk-Btu4vlJn.js → chunk-UMiCRMsh.js} +3 -3
  40. package/browser/chunk-cKHTB9X6.js +1 -0
  41. package/browser/{chunk-DhVxqqFl.js → chunk-cz67d1ar.js} +1 -1
  42. package/browser/{chunk-CDenpy3I.js → chunk-dkiNkKfC.js} +1 -1
  43. package/browser/{chunk-C6LQzD3M.js → chunk-fAeW8v1H.js} +1 -1
  44. package/browser/{chunk-HGFAbUg7.js → chunk-gX9pSFmE.js} +1 -1
  45. package/browser/{chunk-CDzMjHDI.js → chunk-sUX4ZlTt.js} +1 -1
  46. package/browser/index.html +1 -1
  47. package/browser/{main-ITBV6BE5.js → main-BNXY3UWS.js} +1 -1
  48. package/package.json +1 -1
  49. package/browser/chunk-BXDdc4SZ.js +0 -1
  50. package/browser/chunk-CrJHMDmB.js +0 -1
@@ -1 +1 @@
1
- import {p,aI as be,Z as R}from'./main-ITBV6BE5.js';var o=class r{skillController=p(be);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
1
+ import {p,aI as be,Z as R}from'./main-BNXY3UWS.js';var o=class r{skillController=p(be);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=R({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
@@ -1 +1 @@
1
- import {f,l,$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,d as dn,L as Ln,W as Wn,q as qt,b as pn,V as Vn}from'./chunk-Btu4vlJn.js';import {p,$ as $t,g as It,F as G,H as Me,M as Mi,s as se,j as Tg,U,J as w,K as x,a as Ef,z as za,n as n_,S as Sf,f as fT,y as yb,I as Iv,h as hT,C as CT,L as dc,l as lc,N as iS,k as MT,O as tv,Q as aS,u as uc,x as xf,o as sg,q as ag}from'./main-ITBV6BE5.js';var W=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function Y(r){return W.test(r)}function J(r=()=>true){return t=>{let e=(t.value??"").trim();return !r()||e===""||Y(e)?null:{absolutePath:true}}}function ee(r,t){r&1&&(za(0,"p",3),n_(1,"Loading\u2026"),Sf());}function te(r,t){r&1&&n_(0," Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location. ");}function ne(r,t){r&1&&n_(0," Only a super-admin can change this folder. ");}function oe(r,t){r&1&&(za(0,"span",21),n_(1," Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty. "),Sf());}function ae(r,t){r&1&&(za(0,"span",28),n_(1," Enter a whole number of at least 1, or leave the field empty. "),Sf());}function re(r,t){if(r&1){let e=CT();za(0,"form",5),dc("ngSubmit",function(){sg(e);let f=MT();return ag(f.submit())}),za(1,"div",6)(2,"label",7),n_(3,"Name "),za(4,"span",8),n_(5,"*"),Sf()(),lc(6,"input",9),iS(),Sf(),za(7,"div",6)(8,"label",10),n_(9,"Description"),Sf(),lc(10,"textarea",11),iS(),Sf(),za(11,"div",6)(12,"label",12),n_(13,"External ID"),Sf(),lc(14,"input",13),iS(),Sf(),za(15,"div",6)(16,"label",14),n_(17,"Default agent"),Sf(),lc(18,"input",15),iS(),Sf(),za(19,"div",6)(20,"label",16),n_(21,"Config path"),Sf(),lc(22,"input",17),iS(),Sf(),za(23,"div",6)(24,"label",18),n_(25,"Shared files folder"),Sf(),lc(26,"input",19),iS(),za(27,"span",20),fT(28,te,1,0)(29,ne,1,0),Sf(),fT(30,oe,2,0,"span",21),Sf(),za(31,"div",6)(32,"label",22),n_(33,"Run cost threshold"),Sf(),lc(34,"input",23),iS(),za(35,"span",24),n_(36),Sf()(),za(37,"div",6)(38,"label",25),n_(39,"Maximum tool rounds"),Sf(),za(40,"input",26),dc("input",function(f){sg(e);let Q=MT();return ag(Q.onMaxToolRoundsInput(f))}),Sf(),iS(),za(41,"span",27),n_(42," Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run. "),Sf(),fT(43,ae,2,0,"span",28),Sf(),za(44,"div",29)(45,"button",30),n_(46),Sf(),za(47,"button",31),dc("click",function(){sg(e);let f=MT();return ag(f.cancel())}),n_(48,"Cancel"),Sf()()();}if(r&2){let e=MT();tv("formGroup",e.form),yb(6),tv("formControl",e.nameControl),aS(),yb(4),tv("formControl",e.descriptionControl),aS(),yb(4),tv("formControl",e.externalIdControl),aS(),yb(4),tv("formControl",e.defaultAgentNameControl),aS(),yb(4),tv("formControl",e.configPathControl),aS(),yb(4),tv("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),uc("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),aS(),yb(2),hT(e.canEditSharedExchangePath()?28:29),yb(2),hT(e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?30:-1),yb(4),tv("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),aS(),yb(2),Iv(e.runCostThresholdHint()),yb(4),tv("formControl",e.maxToolRoundsControl),uc("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),aS(),yb(3),hT(e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?43:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),xf(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ie=1,le=2147483647,K=class r{route=p($t);router=p(It);namespaceController=p(G);destroyRef=p(Me);usageConfiguration=p(f);userState=p(l);canEditSharedExchangePath=Mi(()=>this.userState.currentUser()?.isAdmin===true);runCostThresholdPlaceholder=Mi(()=>{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=Mi(()=>{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 $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt("",{nonNullable:true}),configPath:new vt("",{nonNullable:true}),sharedExchangePath:new vt("",{nonNullable:true,validators:[J(()=>this.canEditSharedExchangePath())]}),externalId:new vt("",{nonNullable:true}),defaultAgentName:new vt("",{nonNullable:true}),runCostThreshold:new vt(null),maxToolRounds:new vt(null,{validators:[ve.min(ie),ve.max(le),ve.pattern(/^\d+$/)]})});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}maxToolRoundsUnparsable=se(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=se(false);isSubmitting=se(false);isLoading=se(false);existingNamespace=null;constructor(){Tg(()=>{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.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}),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||r)};static \u0275cmp=Ef({type:r,selectors:[["agentos-namespace-form"]],decls:6,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","rows","4","placeholder","Optional description",1,"namespace-form__textarea",3,"formControl"],["for","ns-external-id",1,"namespace-form__label"],["id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-default-agent",1,"namespace-form__label"],["id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-shared-exchange-path",1,"namespace-form__label"],["id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",1,"namespace-form__input",3,"readOnly","formControl"],["id","ns-shared-exchange-path-hint",1,"namespace-form__hint"],["id","ns-shared-exchange-path-error","role","alert",1,"namespace-form__error"],["for","ns-run-cost-threshold",1,"namespace-form__label"],["id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",1,"namespace-form__input",3,"placeholder","formControl"],["id","ns-run-cost-threshold-hint",1,"namespace-form__hint"],["for","ns-max-tool-rounds",1,"namespace-form__label"],["id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",1,"namespace-form__input",3,"input","formControl"],["id","ns-max-tool-rounds-hint",1,"namespace-form__hint"],["id","ns-max-tool-rounds-error","role","alert",1,"namespace-form__error"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,h){e&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),n_(3),Sf()(),fT(4,ee,2,0,"p",3)(5,re,49,19,"form",4),Sf()),e&2&&(yb(3),Iv(h.isEditMode()?"Edit namespace":"New namespace"),yb(),hT(h.isLoading()?4:5));},dependencies:[Kn,zn,Ye,dn,Ln,Wn,qt,pn,Vn],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.namespace-form__input[_ngcontent-%COMP%], .namespace-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:var(--radius-md, 0);border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus, .namespace-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.namespace-form__input[_ngcontent-%COMP%]::placeholder, .namespace-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.namespace-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:96px;line-height:1.5}.namespace-form__hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.namespace-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #dc2626)}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:var(--radius-pill, 0);border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{K as NamespaceFormComponent};
1
+ import {f,l,$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,d as dn,L as Ln,W as Wn,q as qt,b as pn,V as Vn}from'./chunk-UMiCRMsh.js';import {p,$ as $t,g as It,F as G,H as Me,M as Mi,s as se,j as Tg,U,J as w,K as x,a as Ef,z as za,n as n_,S as Sf,f as fT,y as yb,I as Iv,h as hT,C as CT,L as dc,l as lc,N as iS,k as MT,O as tv,Q as aS,u as uc,x as xf,o as sg,q as ag}from'./main-BNXY3UWS.js';var W=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function Y(r){return W.test(r)}function J(r=()=>true){return t=>{let e=(t.value??"").trim();return !r()||e===""||Y(e)?null:{absolutePath:true}}}function ee(r,t){r&1&&(za(0,"p",3),n_(1,"Loading\u2026"),Sf());}function te(r,t){r&1&&n_(0," Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location. ");}function ne(r,t){r&1&&n_(0," Only a super-admin can change this folder. ");}function oe(r,t){r&1&&(za(0,"span",21),n_(1," Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty. "),Sf());}function ae(r,t){r&1&&(za(0,"span",28),n_(1," Enter a whole number of at least 1, or leave the field empty. "),Sf());}function re(r,t){if(r&1){let e=CT();za(0,"form",5),dc("ngSubmit",function(){sg(e);let f=MT();return ag(f.submit())}),za(1,"div",6)(2,"label",7),n_(3,"Name "),za(4,"span",8),n_(5,"*"),Sf()(),lc(6,"input",9),iS(),Sf(),za(7,"div",6)(8,"label",10),n_(9,"Description"),Sf(),lc(10,"textarea",11),iS(),Sf(),za(11,"div",6)(12,"label",12),n_(13,"External ID"),Sf(),lc(14,"input",13),iS(),Sf(),za(15,"div",6)(16,"label",14),n_(17,"Default agent"),Sf(),lc(18,"input",15),iS(),Sf(),za(19,"div",6)(20,"label",16),n_(21,"Config path"),Sf(),lc(22,"input",17),iS(),Sf(),za(23,"div",6)(24,"label",18),n_(25,"Shared files folder"),Sf(),lc(26,"input",19),iS(),za(27,"span",20),fT(28,te,1,0)(29,ne,1,0),Sf(),fT(30,oe,2,0,"span",21),Sf(),za(31,"div",6)(32,"label",22),n_(33,"Run cost threshold"),Sf(),lc(34,"input",23),iS(),za(35,"span",24),n_(36),Sf()(),za(37,"div",6)(38,"label",25),n_(39,"Maximum tool rounds"),Sf(),za(40,"input",26),dc("input",function(f){sg(e);let Q=MT();return ag(Q.onMaxToolRoundsInput(f))}),Sf(),iS(),za(41,"span",27),n_(42," Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run. "),Sf(),fT(43,ae,2,0,"span",28),Sf(),za(44,"div",29)(45,"button",30),n_(46),Sf(),za(47,"button",31),dc("click",function(){sg(e);let f=MT();return ag(f.cancel())}),n_(48,"Cancel"),Sf()()();}if(r&2){let e=MT();tv("formGroup",e.form),yb(6),tv("formControl",e.nameControl),aS(),yb(4),tv("formControl",e.descriptionControl),aS(),yb(4),tv("formControl",e.externalIdControl),aS(),yb(4),tv("formControl",e.defaultAgentNameControl),aS(),yb(4),tv("formControl",e.configPathControl),aS(),yb(4),tv("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),uc("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),aS(),yb(2),hT(e.canEditSharedExchangePath()?28:29),yb(2),hT(e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?30:-1),yb(4),tv("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),aS(),yb(2),Iv(e.runCostThresholdHint()),yb(4),tv("formControl",e.maxToolRoundsControl),uc("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),aS(),yb(3),hT(e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?43:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),xf(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ie=1,le=2147483647,K=class r{route=p($t);router=p(It);namespaceController=p(G);destroyRef=p(Me);usageConfiguration=p(f);userState=p(l);canEditSharedExchangePath=Mi(()=>this.userState.currentUser()?.isAdmin===true);runCostThresholdPlaceholder=Mi(()=>{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=Mi(()=>{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 $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt("",{nonNullable:true}),configPath:new vt("",{nonNullable:true}),sharedExchangePath:new vt("",{nonNullable:true,validators:[J(()=>this.canEditSharedExchangePath())]}),externalId:new vt("",{nonNullable:true}),defaultAgentName:new vt("",{nonNullable:true}),runCostThreshold:new vt(null),maxToolRounds:new vt(null,{validators:[ve.min(ie),ve.max(le),ve.pattern(/^\d+$/)]})});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}maxToolRoundsUnparsable=se(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=se(false);isSubmitting=se(false);isLoading=se(false);existingNamespace=null;constructor(){Tg(()=>{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.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}),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||r)};static \u0275cmp=Ef({type:r,selectors:[["agentos-namespace-form"]],decls:6,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","rows","4","placeholder","Optional description",1,"namespace-form__textarea",3,"formControl"],["for","ns-external-id",1,"namespace-form__label"],["id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-default-agent",1,"namespace-form__label"],["id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-shared-exchange-path",1,"namespace-form__label"],["id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",1,"namespace-form__input",3,"readOnly","formControl"],["id","ns-shared-exchange-path-hint",1,"namespace-form__hint"],["id","ns-shared-exchange-path-error","role","alert",1,"namespace-form__error"],["for","ns-run-cost-threshold",1,"namespace-form__label"],["id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",1,"namespace-form__input",3,"placeholder","formControl"],["id","ns-run-cost-threshold-hint",1,"namespace-form__hint"],["for","ns-max-tool-rounds",1,"namespace-form__label"],["id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",1,"namespace-form__input",3,"input","formControl"],["id","ns-max-tool-rounds-hint",1,"namespace-form__hint"],["id","ns-max-tool-rounds-error","role","alert",1,"namespace-form__error"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,h){e&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),n_(3),Sf()(),fT(4,ee,2,0,"p",3)(5,re,49,19,"form",4),Sf()),e&2&&(yb(3),Iv(h.isEditMode()?"Edit namespace":"New namespace"),yb(),hT(h.isLoading()?4:5));},dependencies:[Kn,zn,Ye,dn,Ln,Wn,qt,pn,Vn],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.namespace-form__input[_ngcontent-%COMP%], .namespace-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:var(--radius-md, 0);border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus, .namespace-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.namespace-form__input[_ngcontent-%COMP%]::placeholder, .namespace-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.namespace-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:96px;line-height:1.5}.namespace-form__hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.namespace-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #dc2626)}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:var(--radius-pill, 0);border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{K as NamespaceFormComponent};
@@ -1 +1 @@
1
- import {f,J as Yn,z as zn,Y as Ye,L as Ln,W as Wn$1,N as ft,Q as ln,R as rn,T as f$1}from'./chunk-Btu4vlJn.js';import {p,$ as $t,aJ as J,s as se$1,aK as ne$1,j as Tg,a as Ef,ad as Os,a8 as Ae,aL as pe$1,ae as pw,af as Wn,aM as UM,z as za,n as n_,S as Sf,f as fT,y as yb,h as hT,C as CT,L as dc,aN as Mv,N as iS,k as MT,aO as _v,Q as aS,I as Iv,m as mT,d as yT,aP as m_,aQ as g_,au as y_,av as D_,ar as Cv,x as xf,aR as E_,o as sg,q as ag,aS as c_}from'./main-ITBV6BE5.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&(za(0,"p",1),n_(1,"Loading usage settings\u2026"),Sf());}function le(e,o){if(e&1){let t=CT();za(0,"p",2),n_(1,"Could not load usage settings. Please try again."),Sf(),za(2,"button",3),dc("click",function(){sg(t);let s=MT();return ag(s.configuration.retry())}),n_(3,"Retry usage settings"),Sf();}}function me(e,o){e&1&&(za(0,"p",1),n_(1,"Usage tracking is disabled."),Sf());}function de(e,o){e&1&&(za(0,"p",2),n_(1),Sf()),e&2&&(yb(),Iv(o));}function ce(e,o){e&1&&(za(0,"p",1),n_(1,"Loading usage\u2026"),Sf());}function pe(e,o){e&1&&(za(0,"p"),n_(1,"No recorded usage for this period."),Sf());}function ge(e,o){if(e&1&&(za(0,"small"),n_(1),Sf()),e&2){let t=MT().$implicit;yb(),xf("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&(za(0,"tr")(1,"th",10),n_(2),Sf(),za(3,"td"),n_(4),y_(5,"number"),Sf(),za(6,"td"),n_(7),y_(8,"number"),y_(9,"number"),Sf(),za(10,"td"),n_(11),y_(12,"number"),y_(13,"number"),Sf(),za(14,"td"),n_(15),y_(16,"agentosCost"),fT(17,ge,2,1,"small"),Sf()()),e&2){let t=o.$implicit;yb(2),Iv(t.key),yb(2),Iv(D_(5,8,t.aggregate.totalTokens)),yb(3),Cv("",D_(8,10,t.aggregate.inputTokens)," / ",D_(9,12,t.aggregate.outputTokens)),yb(4),Cv(" ",D_(12,14,t.aggregate.cacheReadTokens)," / ",D_(13,16,t.aggregate.cacheWriteTokens)," "),yb(4),xf(" ",E_(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),yb(2),hT(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&(za(0,"div",8)(1,"table")(2,"thead")(3,"tr")(4,"th",9),n_(5,"Name"),Sf(),za(6,"th",9),n_(7,"Tokens"),Sf(),za(8,"th",9),n_(9,"Input / output"),Sf(),za(10,"th",9),n_(11,"Cache read / write"),Sf(),za(12,"th",9),n_(13,"Estimated cost"),Sf()()(),za(14,"tbody"),mT(15,ue,18,21,"tr",null,re),Sf()()()),e&2){let t=MT().$implicit;yb(15),yT(t.rows);}}function Ce(e,o){if(e&1&&(za(0,"h2"),n_(1),Sf(),fT(2,pe,2,0,"p")(3,_e,17,0,"div",8)),e&2){let t=o.$implicit;yb(),Iv(t.title),yb(),hT(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(mT(0,Ce,4,2,null,null,oe),za(2,"p"),n_(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),Sf()),e&2){let t=MT(2);yT(m_(4,ae,g_(0,ne,t.agents()),g_(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=CT();za(0,"p"),n_(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),Sf(),za(2,"form",4),dc("ngSubmit",function(){sg(t);let s=MT();return ag(s.load())}),za(3,"label"),n_(4,"From (UTC)"),za(5,"input",5),Mv("ngModelChange",function(s){sg(t);let d=MT();return c_(d.from,s)||(d.from=s),ag(s)}),Sf(),iS(),Sf(),za(6,"label"),n_(7,"To (UTC)"),za(8,"input",6),Mv("ngModelChange",function(s){sg(t);let d=MT();return c_(d.to,s)||(d.to=s),ag(s)}),Sf(),iS(),Sf(),za(9,"button",7),n_(10,"Refresh"),Sf()(),fT(11,de,2,1,"p",2),fT(12,ce,2,0,"p",1)(13,fe,4,7);}if(e&2){let t,r=MT();yb(5),_v("ngModel",r.from),aS(),yb(3),_v("ngModel",r.to),aS(),yb(3),hT((t=r.error())?11:-1,t),yb(),hT(r.loading()?12:r.error()?-1:13);}}var te=class e{route=p($t);api=p(J);configuration=p(f);namespaceId=this.route.snapshot.params.namespaceId;agents=se$1([]);models=se$1([]);error=se$1(null);loading=se$1(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ne$1;constructor(){Tg(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Os(void 0),Ae(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),pe$1):(this.loading.set(true),pw({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(Wn(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),pe$1))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Ef({type:e,selectors:[["agentos-namespace-usage"]],decls:7,vars:1,consts:[[1,"report"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(za(0,"section",0)(1,"h1"),n_(2,"Usage and costs"),Sf(),fT(3,se,2,0,"p",1)(4,le,4,0)(5,me,2,0,"p",1)(6,ye,14,4),Sf()),t&2&&(yb(3),hT(r.configuration.state()==="loading"?3:r.configuration.state()==="error"?4:r.configuration.state()==="disabled"?5:6));},dependencies:[Yn,zn,Ye,Ln,Wn$1,ft,ln,rn,UM,f$1],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{te as NamespaceUsageComponent};
1
+ import {f,J as Yn,z as zn,Y as Ye,L as Ln,W as Wn$1,N as ft,Q as ln,R as rn,T as f$1}from'./chunk-UMiCRMsh.js';import {p,$ as $t,aJ as J,s as se$1,aK as ne$1,j as Tg,a as Ef,ad as Os,a8 as Ae,aL as pe$1,ae as pw,af as Wn,aM as UM,z as za,n as n_,S as Sf,f as fT,y as yb,h as hT,C as CT,L as dc,aN as Mv,N as iS,k as MT,aO as _v,Q as aS,I as Iv,m as mT,d as yT,aP as m_,aQ as g_,au as y_,av as D_,ar as Cv,x as xf,aR as E_,o as sg,q as ag,aS as c_}from'./main-BNXY3UWS.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&(za(0,"p",1),n_(1,"Loading usage settings\u2026"),Sf());}function le(e,o){if(e&1){let t=CT();za(0,"p",2),n_(1,"Could not load usage settings. Please try again."),Sf(),za(2,"button",3),dc("click",function(){sg(t);let s=MT();return ag(s.configuration.retry())}),n_(3,"Retry usage settings"),Sf();}}function me(e,o){e&1&&(za(0,"p",1),n_(1,"Usage tracking is disabled."),Sf());}function de(e,o){e&1&&(za(0,"p",2),n_(1),Sf()),e&2&&(yb(),Iv(o));}function ce(e,o){e&1&&(za(0,"p",1),n_(1,"Loading usage\u2026"),Sf());}function pe(e,o){e&1&&(za(0,"p"),n_(1,"No recorded usage for this period."),Sf());}function ge(e,o){if(e&1&&(za(0,"small"),n_(1),Sf()),e&2){let t=MT().$implicit;yb(),xf("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&(za(0,"tr")(1,"th",10),n_(2),Sf(),za(3,"td"),n_(4),y_(5,"number"),Sf(),za(6,"td"),n_(7),y_(8,"number"),y_(9,"number"),Sf(),za(10,"td"),n_(11),y_(12,"number"),y_(13,"number"),Sf(),za(14,"td"),n_(15),y_(16,"agentosCost"),fT(17,ge,2,1,"small"),Sf()()),e&2){let t=o.$implicit;yb(2),Iv(t.key),yb(2),Iv(D_(5,8,t.aggregate.totalTokens)),yb(3),Cv("",D_(8,10,t.aggregate.inputTokens)," / ",D_(9,12,t.aggregate.outputTokens)),yb(4),Cv(" ",D_(12,14,t.aggregate.cacheReadTokens)," / ",D_(13,16,t.aggregate.cacheWriteTokens)," "),yb(4),xf(" ",E_(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),yb(2),hT(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&(za(0,"div",8)(1,"table")(2,"thead")(3,"tr")(4,"th",9),n_(5,"Name"),Sf(),za(6,"th",9),n_(7,"Tokens"),Sf(),za(8,"th",9),n_(9,"Input / output"),Sf(),za(10,"th",9),n_(11,"Cache read / write"),Sf(),za(12,"th",9),n_(13,"Estimated cost"),Sf()()(),za(14,"tbody"),mT(15,ue,18,21,"tr",null,re),Sf()()()),e&2){let t=MT().$implicit;yb(15),yT(t.rows);}}function Ce(e,o){if(e&1&&(za(0,"h2"),n_(1),Sf(),fT(2,pe,2,0,"p")(3,_e,17,0,"div",8)),e&2){let t=o.$implicit;yb(),Iv(t.title),yb(),hT(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(mT(0,Ce,4,2,null,null,oe),za(2,"p"),n_(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),Sf()),e&2){let t=MT(2);yT(m_(4,ae,g_(0,ne,t.agents()),g_(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=CT();za(0,"p"),n_(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),Sf(),za(2,"form",4),dc("ngSubmit",function(){sg(t);let s=MT();return ag(s.load())}),za(3,"label"),n_(4,"From (UTC)"),za(5,"input",5),Mv("ngModelChange",function(s){sg(t);let d=MT();return c_(d.from,s)||(d.from=s),ag(s)}),Sf(),iS(),Sf(),za(6,"label"),n_(7,"To (UTC)"),za(8,"input",6),Mv("ngModelChange",function(s){sg(t);let d=MT();return c_(d.to,s)||(d.to=s),ag(s)}),Sf(),iS(),Sf(),za(9,"button",7),n_(10,"Refresh"),Sf()(),fT(11,de,2,1,"p",2),fT(12,ce,2,0,"p",1)(13,fe,4,7);}if(e&2){let t,r=MT();yb(5),_v("ngModel",r.from),aS(),yb(3),_v("ngModel",r.to),aS(),yb(3),hT((t=r.error())?11:-1,t),yb(),hT(r.loading()?12:r.error()?-1:13);}}var te=class e{route=p($t);api=p(J);configuration=p(f);namespaceId=this.route.snapshot.params.namespaceId;agents=se$1([]);models=se$1([]);error=se$1(null);loading=se$1(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ne$1;constructor(){Tg(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Os(void 0),Ae(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),pe$1):(this.loading.set(true),pw({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(Wn(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),pe$1))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Ef({type:e,selectors:[["agentos-namespace-usage"]],decls:7,vars:1,consts:[[1,"report"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(za(0,"section",0)(1,"h1"),n_(2,"Usage and costs"),Sf(),fT(3,se,2,0,"p",1)(4,le,4,0)(5,me,2,0,"p",1)(6,ye,14,4),Sf()),t&2&&(yb(3),hT(r.configuration.state()==="loading"?3:r.configuration.state()==="error"?4:r.configuration.state()==="disabled"?5:6));},dependencies:[Yn,zn,Ye,Ln,Wn$1,ft,ln,rn,UM,f$1],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{te as NamespaceUsageComponent};
@@ -1 +1 @@
1
- import {w as On}from'./chunk-Btu4vlJn.js';import {p,$ as $t,g as It,H as Me,a9 as $$1,s as se,M as Mi,U as U$1,a as Ef,at as pu,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,O as tv,h as hT,k as MT,I as Iv,r as gv,x as xf,C as CT,u as uc,m as mT,d as yT,l as lc,au as y_,av as D_,o as sg,q as ag,aw as NC}from'./main-ITBV6BE5.js';var $=(n,o)=>o.id,B=(n,o)=>o.name;function j(n,o){n&1&&(za(0,"p",6),n_(1,"Loading\u2026"),Sf());}function H(n,o){n&1&&(za(0,"p",7),n_(1,"Failed to load agent definition."),Sf());}function J(n,o){if(n&1&&(za(0,"dt",12),n_(1,"User context"),Sf(),za(2,"dd",14),n_(3),Sf()),n&2){let e=MT();yb(3),Iv(e.userId);}}function U(n,o){if(n&1&&(za(0,"pre",22),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.systemPrompt);}}function G(n,o){if(n&1){let e=CT();za(0,"section",9)(1,"button",20),dc("click",function(){sg(e);let p=MT(2);return ag(p.toggleSystemPrompt())}),za(2,"h2",10),n_(3,"System Prompt"),Sf(),za(4,"span",21),n_(5," \u25BC "),Sf()(),fT(6,U,2,1,"pre",22),Sf();}if(n&2){let e=MT(2);yb(),uc("aria-expanded",!e.systemPromptCollapsed()),yb(3),gv("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),yb(2),hT(e.systemPromptCollapsed()?-1:6);}}function K(n,o){if(n&1&&(za(0,"pre",22),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.instructions);}}function q(n,o){if(n&1){let e=CT();za(0,"section",9)(1,"button",20),dc("click",function(){sg(e);let p=MT(2);return ag(p.toggleInstructions())}),za(2,"h2",10),n_(3,"Instructions"),Sf(),za(4,"span",21),n_(5," \u25BC "),Sf()(),fT(6,K,2,1,"pre",22),Sf();}if(n&2){let e=MT(2);yb(),uc("aria-expanded",!e.instructionsCollapsed()),yb(3),gv("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),yb(2),hT(e.instructionsCollapsed()?-1:6);}}function Q(n,o){n&1&&(za(0,"p",17),n_(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),Sf());}function W(n,o){n&1&&(za(0,"span",25),n_(1,"platform"),Sf());}function X(n,o){n&1&&(za(0,"span",25),n_(1,"SKILL.md"),Sf());}function Y(n,o){if(n&1&&(za(0,"li",23)(1,"span",24),n_(2),Sf(),fT(3,W,2,0,"span",25),fT(4,X,2,0,"span",25),za(5,"p",26),n_(6),Sf()()),n&2){let e=o.$implicit;yb(2),Iv(e.name),yb(),hT(e.namespaceId?-1:3),yb(),hT(e.readOnly?4:-1),yb(2),Iv(e.description);}}function Z(n,o){if(n&1&&(za(0,"ul",18),mT(1,Y,7,4,"li",23,$),Sf()),n&2){let e=MT(2);yb(),yT(e.resolvedSkills());}}function ee(n,o){n&1&&(za(0,"p",17),n_(1,"No tools available for this agent."),Sf());}function ne(n,o){if(n&1&&(lc(0,"div",31),y_(1,"agentosMarkdown")),n&2){let e=MT(2).$implicit;tv("innerHTML",D_(1,1,e.description),NC);}}function te(n,o){if(n&1&&(za(0,"div",30),fT(1,ne,2,3,"div",31),za(2,"pre",32),n_(3),Sf()()),n&2){let e=MT().$implicit,c=MT(3);yb(),hT(e.description?1:-1),yb(2),Iv(c.formatSchema(e.inputSchema));}}function ie(n,o){if(n&1){let e=CT();za(0,"li",27)(1,"button",28),dc("click",function(){let p=sg(e).$implicit,V=MT(3);return ag(V.toggleTool(p))}),za(2,"span",29),n_(3),Sf(),za(4,"span",21),n_(5," \u25BC "),Sf()(),fT(6,te,4,2,"div",30),Sf();}if(n&2){let e=o.$implicit,c=MT(3);yb(),uc("aria-expanded",c.isToolExpanded(e)),yb(2),Iv(e.name),yb(),gv("agent-config-inspect__chevron--open",c.isToolExpanded(e)),yb(2),hT(c.isToolExpanded(e)?6:-1);}}function oe(n,o){if(n&1&&(za(0,"ul",19),mT(1,ie,7,5,"li",27,B),Sf()),n&2){let e=MT();yb(),yT(e.tools);}}function ae(n,o){if(n&1&&(za(0,"div",8)(1,"section",9)(2,"h2",10),n_(3,"General"),Sf(),za(4,"dl",11)(5,"dt",12),n_(6,"Name"),Sf(),za(7,"dd",13),n_(8),Sf(),za(9,"dt",12),n_(10,"Resolved model"),Sf(),za(11,"dd",14),n_(12),Sf(),za(13,"dt",12),n_(14,"Provider"),Sf(),za(15,"dd",13),n_(16),Sf(),za(17,"dt",12),n_(18,"Execution mode"),Sf(),za(19,"dd",13)(20,"span",15),n_(21),Sf()(),fT(22,J,4,1),Sf()(),fT(23,G,7,4,"section",9),fT(24,q,7,4,"section",9),za(25,"section",9)(26,"h2",10),n_(27," Skills "),za(28,"span",16),n_(29),Sf()(),fT(30,Q,2,0,"p",17)(31,Z,3,0,"ul",18),Sf(),za(32,"section",9)(33,"h2",10),n_(34," Tools "),za(35,"span",16),n_(36),Sf()(),fT(37,ee,2,0,"p",17)(38,oe,3,0,"ul",19),Sf()()),n&2){let e=o,c=MT();yb(8),Iv(e.name),yb(4),Iv(e.resolvedModelApiName),yb(4),Iv(e.resolvedProviderName),yb(4),gv("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),yb(),xf(" ",e.executionMode," "),yb(),hT(e.userId?22:-1),yb(),hT(e.systemPrompt?23:-1),yb(),hT(e.instructions?24:-1),yb(5),xf("(",c.resolvedSkills().length,")"),yb(),hT(c.resolvedSkills().length===0?30:31),yb(6),xf("(",e.tools.length,")"),yb(),hT(e.tools.length===0?37:38);}}var R=class n{route=p($t);router=p(It);destroyRef=p(Me);agentConfigController=p($$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=se(true);hasError=se(false);definition=se(null);expandedTools=se(new Set);resolvedSkills=Mi(()=>this.definition()?.skills??[]);systemPromptCollapsed=se(true);instructionsCollapsed=se(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){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=Ef({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__skills"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__skill"],[1,"agent-config-inspect__skill-name"],[1,"agent-config-inspect__skill-badge"],[1,"agent-config-inspect__skill-desc"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return c.back()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5," Agent Configs "),Sf(),za(6,"h1",4),n_(7,"Agent definition"),Sf(),za(8,"a",5),n_(9,"Edit config \u2192"),Sf()(),fT(10,j,2,0,"p",6)(11,H,2,0,"p",7)(12,ae,39,13,"div",8),Sf()),e&2){let p;yb(8),tv("routerLink",c.editRoute()),yb(2),hT(c.isLoading()?10:c.hasError()?11:(p=c.definition())?12:-1,p);}},dependencies:[pu,On],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%], .agent-config-inspect__skills[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__skill[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem}.agent-config-inspect__skill-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.agent-config-inspect__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__skill-desc[_ngcontent-%COMP%]{flex:1 1 100%;margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
1
+ import {w as On}from'./chunk-UMiCRMsh.js';import {p,$ as $t,g as It,H as Me,a9 as $$1,s as se,M as Mi,U as U$1,a as Ef,at as pu,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,O as tv,h as hT,k as MT,I as Iv,r as gv,x as xf,C as CT,u as uc,m as mT,d as yT,l as lc,au as y_,av as D_,o as sg,q as ag,aw as NC}from'./main-BNXY3UWS.js';var $=(n,o)=>o.id,B=(n,o)=>o.name;function j(n,o){n&1&&(za(0,"p",6),n_(1,"Loading\u2026"),Sf());}function H(n,o){n&1&&(za(0,"p",7),n_(1,"Failed to load agent definition."),Sf());}function J(n,o){if(n&1&&(za(0,"dt",12),n_(1,"User context"),Sf(),za(2,"dd",14),n_(3),Sf()),n&2){let e=MT();yb(3),Iv(e.userId);}}function U(n,o){if(n&1&&(za(0,"pre",22),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.systemPrompt);}}function G(n,o){if(n&1){let e=CT();za(0,"section",9)(1,"button",20),dc("click",function(){sg(e);let p=MT(2);return ag(p.toggleSystemPrompt())}),za(2,"h2",10),n_(3,"System Prompt"),Sf(),za(4,"span",21),n_(5," \u25BC "),Sf()(),fT(6,U,2,1,"pre",22),Sf();}if(n&2){let e=MT(2);yb(),uc("aria-expanded",!e.systemPromptCollapsed()),yb(3),gv("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),yb(2),hT(e.systemPromptCollapsed()?-1:6);}}function K(n,o){if(n&1&&(za(0,"pre",22),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.instructions);}}function q(n,o){if(n&1){let e=CT();za(0,"section",9)(1,"button",20),dc("click",function(){sg(e);let p=MT(2);return ag(p.toggleInstructions())}),za(2,"h2",10),n_(3,"Instructions"),Sf(),za(4,"span",21),n_(5," \u25BC "),Sf()(),fT(6,K,2,1,"pre",22),Sf();}if(n&2){let e=MT(2);yb(),uc("aria-expanded",!e.instructionsCollapsed()),yb(3),gv("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),yb(2),hT(e.instructionsCollapsed()?-1:6);}}function Q(n,o){n&1&&(za(0,"p",17),n_(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),Sf());}function W(n,o){n&1&&(za(0,"span",25),n_(1,"platform"),Sf());}function X(n,o){n&1&&(za(0,"span",25),n_(1,"SKILL.md"),Sf());}function Y(n,o){if(n&1&&(za(0,"li",23)(1,"span",24),n_(2),Sf(),fT(3,W,2,0,"span",25),fT(4,X,2,0,"span",25),za(5,"p",26),n_(6),Sf()()),n&2){let e=o.$implicit;yb(2),Iv(e.name),yb(),hT(e.namespaceId?-1:3),yb(),hT(e.readOnly?4:-1),yb(2),Iv(e.description);}}function Z(n,o){if(n&1&&(za(0,"ul",18),mT(1,Y,7,4,"li",23,$),Sf()),n&2){let e=MT(2);yb(),yT(e.resolvedSkills());}}function ee(n,o){n&1&&(za(0,"p",17),n_(1,"No tools available for this agent."),Sf());}function ne(n,o){if(n&1&&(lc(0,"div",31),y_(1,"agentosMarkdown")),n&2){let e=MT(2).$implicit;tv("innerHTML",D_(1,1,e.description),NC);}}function te(n,o){if(n&1&&(za(0,"div",30),fT(1,ne,2,3,"div",31),za(2,"pre",32),n_(3),Sf()()),n&2){let e=MT().$implicit,c=MT(3);yb(),hT(e.description?1:-1),yb(2),Iv(c.formatSchema(e.inputSchema));}}function ie(n,o){if(n&1){let e=CT();za(0,"li",27)(1,"button",28),dc("click",function(){let p=sg(e).$implicit,V=MT(3);return ag(V.toggleTool(p))}),za(2,"span",29),n_(3),Sf(),za(4,"span",21),n_(5," \u25BC "),Sf()(),fT(6,te,4,2,"div",30),Sf();}if(n&2){let e=o.$implicit,c=MT(3);yb(),uc("aria-expanded",c.isToolExpanded(e)),yb(2),Iv(e.name),yb(),gv("agent-config-inspect__chevron--open",c.isToolExpanded(e)),yb(2),hT(c.isToolExpanded(e)?6:-1);}}function oe(n,o){if(n&1&&(za(0,"ul",19),mT(1,ie,7,5,"li",27,B),Sf()),n&2){let e=MT();yb(),yT(e.tools);}}function ae(n,o){if(n&1&&(za(0,"div",8)(1,"section",9)(2,"h2",10),n_(3,"General"),Sf(),za(4,"dl",11)(5,"dt",12),n_(6,"Name"),Sf(),za(7,"dd",13),n_(8),Sf(),za(9,"dt",12),n_(10,"Resolved model"),Sf(),za(11,"dd",14),n_(12),Sf(),za(13,"dt",12),n_(14,"Provider"),Sf(),za(15,"dd",13),n_(16),Sf(),za(17,"dt",12),n_(18,"Execution mode"),Sf(),za(19,"dd",13)(20,"span",15),n_(21),Sf()(),fT(22,J,4,1),Sf()(),fT(23,G,7,4,"section",9),fT(24,q,7,4,"section",9),za(25,"section",9)(26,"h2",10),n_(27," Skills "),za(28,"span",16),n_(29),Sf()(),fT(30,Q,2,0,"p",17)(31,Z,3,0,"ul",18),Sf(),za(32,"section",9)(33,"h2",10),n_(34," Tools "),za(35,"span",16),n_(36),Sf()(),fT(37,ee,2,0,"p",17)(38,oe,3,0,"ul",19),Sf()()),n&2){let e=o,c=MT();yb(8),Iv(e.name),yb(4),Iv(e.resolvedModelApiName),yb(4),Iv(e.resolvedProviderName),yb(4),gv("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),yb(),xf(" ",e.executionMode," "),yb(),hT(e.userId?22:-1),yb(),hT(e.systemPrompt?23:-1),yb(),hT(e.instructions?24:-1),yb(5),xf("(",c.resolvedSkills().length,")"),yb(),hT(c.resolvedSkills().length===0?30:31),yb(6),xf("(",e.tools.length,")"),yb(),hT(e.tools.length===0?37:38);}}var R=class n{route=p($t);router=p(It);destroyRef=p(Me);agentConfigController=p($$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=se(true);hasError=se(false);definition=se(null);expandedTools=se(new Set);resolvedSkills=Mi(()=>this.definition()?.skills??[]);systemPromptCollapsed=se(true);instructionsCollapsed=se(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){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=Ef({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__skills"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__skill"],[1,"agent-config-inspect__skill-name"],[1,"agent-config-inspect__skill-badge"],[1,"agent-config-inspect__skill-desc"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return c.back()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5," Agent Configs "),Sf(),za(6,"h1",4),n_(7,"Agent definition"),Sf(),za(8,"a",5),n_(9,"Edit config \u2192"),Sf()(),fT(10,j,2,0,"p",6)(11,H,2,0,"p",7)(12,ae,39,13,"div",8),Sf()),e&2){let p;yb(8),tv("routerLink",c.editRoute()),yb(2),hT(c.isLoading()?10:c.hasError()?11:(p=c.definition())?12:-1,p);}},dependencies:[pu,On],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%], .agent-config-inspect__skills[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__skill[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem}.agent-config-inspect__skill-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.agent-config-inspect__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__skill-desc[_ngcontent-%COMP%]{flex:1 1 100%;margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
@@ -1 +1 @@
1
- import {p as p$1}from'./chunk-Btu4vlJn.js';import {p,$ as $t,A as jD,D as y,a as Ef,T as Tf,n as n_,_ as _f,y as yb,I as Iv}from'./main-ITBV6BE5.js';var A=class r{route=p($t);http=p(jD);config=p(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p$1,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p$1,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Ef({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(Tf(0,"p",0),n_(1),_f()),t&2&&(yb(),Iv(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
1
+ import {p as p$1}from'./chunk-UMiCRMsh.js';import {p,$ as $t,A as jD,D as y,a as Ef,T as Tf,n as n_,_ as _f,y as yb,I as Iv}from'./main-BNXY3UWS.js';var A=class r{route=p($t);http=p(jD);config=p(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p$1,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p$1,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Ef({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(Tf(0,"p",0),n_(1),_f()),t&2&&(yb(),Iv(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
@@ -1 +1 @@
1
- import {l}from'./chunk-Btu4vlJn.js';import {p,aC as ae,aD as T,a3 as _,a8 as Ae,aE as gw,Z as R,aA as j,af as Wn}from'./main-ITBV6BE5.js';var v=class i{userState=p(l);membership=p(ae);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return _(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(Ae(a=>a?a.isAdmin?_(true):this.membership.getMembersNamespaceMembership(e).pipe(j(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),Wn(()=>_(false))):_(false)),gw({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
1
+ import {l}from'./chunk-UMiCRMsh.js';import {p,aC as ae,aD as T,a3 as _,a8 as Ae,aE as gw,Z as R,aA as j,af as Wn}from'./main-BNXY3UWS.js';var v=class i{userState=p(l);membership=p(ae);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return _(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(Ae(a=>a?a.isAdmin?_(true):this.membership.getMembersNamespaceMembership(e).pipe(j(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),Wn(()=>_(false))):_(false)),gw({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
@@ -1 +1 @@
1
- import {c}from'./chunk-LDlaL5qr.js';import {$ as $$1,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,b as pn,V as Vn}from'./chunk-Btu4vlJn.js';import {p,$ as $t,g as It,H as Me$1,a9 as $,aa as Oe$1,ab as Ee$1,s as se$1,ac as Ve$1,a2 as F,ad as Os,M as Mi,ae as pw,U,af as Wn,K as x,J as w,a as Ef,a3 as _,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,x as xf,h as hT,C as CT,l as lc,N as iS,m as mT,k as MT,O as tv,r as gv,Q as aS,d as yT,I as Iv,o as sg,q as ag,t as ey}from'./main-ITBV6BE5.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(za(0,"p",5),n_(1,"Loading\u2026"),Sf());}function ue(n,t){n&1&&(za(0,"span",12),n_(1," Name is required. "),Sf());}function fe(n,t){if(n&1&&(za(0,"p",42),n_(1),Sf(),za(2,"span",13),n_(3,"Agent Config cannot be changed after creation."),Sf()),n&2){let e=MT(2);yb(),Iv(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(za(0,"a",43),n_(1,"Add an agent config"),Sf(),n_(2," first. ")),n&2){let e=MT(3);tv("href","/agentos/"+e.namespaceId+"/agent-configs/new",ey);}}function he(n,t){if(n&1&&(za(0,"p",13),n_(1," No agent configs available in this scope yet. "),fT(2,_e,3,1),Sf()),n&2){let e=MT(2);yb(2),hT(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(za(0,"option",23),n_(1),Sf()),n&2){let e=t.$implicit;tv("value",e.id),yb(),Iv(e.name);}}function Ce(n,t){n&1&&(za(0,"span",12),n_(1,"Agent Config is required."),Sf());}function ve(n,t){if(n&1&&(za(0,"select",44)(1,"option",45),n_(2,"Select an agent config\u2026"),Sf(),mT(3,ge,2,2,"option",23,me),Sf(),iS(),fT(5,Ce,2,0,"span",12),za(6,"span",13),n_(7,"Immutable after creation."),Sf()),n&2){let e=MT(2);tv("formControl",e.agentConfigIdControl),aS(),yb(3),yT(e.availableAgentConfigs()),yb(2),hT(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(za(0,"span",12),n_(1,"Opening message is required."),Sf());}function ye(n,t){if(n&1&&(za(0,"option",23),n_(1),Sf()),n&2){let e=t.$implicit;tv("value",e.value),yb(),Iv(e.label);}}function be(n,t){if(n&1){let e=CT();za(0,"label",48)(1,"input",49),dc("change",function(){let g=sg(e).$implicit,v=MT(3);return ag(v.toggleDay(g.value))}),Sf(),za(2,"span",50),n_(3),Sf()();}if(n&2){let e=t.$implicit,d=MT(3);yb(),tv("checked",d.isDaySelected(e.value)),yb(2),Iv(e.label);}}function Se(n,t){if(n&1&&(za(0,"div",8)(1,"span",46),n_(2,"Days of week"),Sf(),za(3,"div",47),mT(4,be,4,2,"label",48,A),Sf(),za(6,"span",13),n_(7,"Leave empty to run every day of the week."),Sf()()),n&2){let e=MT(2);yb(4),yT(e.dayOptions);}}function Ee(n,t){n&1&&(za(0,"span",12),n_(1,"Valid time is required (HH:mm)."),Sf());}function Pe(n,t){n&1&&(za(0,"span",12),n_(1,"Start date is required."),Sf());}function Me(n,t){if(n&1&&(za(0,"option",23),n_(1),Sf()),n&2){let e=t.$implicit;tv("value",e.value),yb(),Iv(e.label);}}function Oe(n,t){n&1&&(za(0,"span",12),n_(1,"End date is required."),Sf());}function De(n,t){if(n&1&&(za(0,"div",8)(1,"label",51),n_(2," End date "),za(3,"span",10),n_(4,"*"),Sf()(),lc(5,"input",52),iS(),fT(6,Oe,2,0,"span",12),Sf()),n&2){let e=MT(2);yb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),tv("formControl",e.endDateControl),aS(),yb(),hT(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(za(0,"span",12),n_(1,"Must be at least 1."),Sf());}function we(n,t){if(n&1&&(za(0,"div",8)(1,"label",53),n_(2," Number of occurrences "),za(3,"span",10),n_(4,"*"),Sf()(),lc(5,"input",54),iS(),fT(6,Te,2,0,"span",12),Sf()),n&2){let e=MT(2);yb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),tv("formControl",e.occurrenceCountControl),aS(),yb(),hT(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(za(0,"span",12),n_(1,"Invalid JSON."),Sf());}function Ne(n,t){if(n&1&&(za(0,"p",38),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.errorMessage());}}function Fe(n,t){if(n&1){let e=CT();za(0,"form",7),dc("ngSubmit",function(){sg(e);let g=MT();return ag(g.submit())}),za(1,"div",8)(2,"label",9),n_(3," Name "),za(4,"span",10),n_(5,"*"),Sf()(),lc(6,"input",11),iS(),fT(7,ue,2,0,"span",12),za(8,"span",13),n_(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),Sf()(),za(10,"div",8)(11,"label",14),n_(12,"Description"),Sf(),lc(13,"input",15),iS(),Sf(),za(14,"div",8)(15,"label",16),n_(16," Agent Config "),za(17,"span",10),n_(18,"*"),Sf()(),fT(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),Sf(),za(22,"div",8)(23,"label",17),n_(24," Opening message "),za(25,"span",10),n_(26,"*"),Sf()(),lc(27,"textarea",18),iS(),fT(28,xe,2,0,"span",12),za(29,"span",13),n_(30," The message sent to the agent when the scheduled prompt fires. "),Sf()(),za(31,"fieldset",19)(32,"legend",20),n_(33,"Recurrence"),Sf(),za(34,"div",8)(35,"label",21),n_(36," Unit "),za(37,"span",10),n_(38,"*"),Sf()(),za(39,"select",22),mT(40,ye,2,2,"option",23,A),Sf(),iS(),Sf(),fT(42,Se,8,0,"div",8),za(43,"div",8)(44,"label",24),n_(45," Time (UTC) "),za(46,"span",10),n_(47,"*"),Sf()(),za(48,"div",25),lc(49,"input",26),iS(),za(50,"span",27),n_(51,"UTC"),Sf()(),fT(52,Ee,2,0,"span",12),Sf()(),za(53,"fieldset",19)(54,"legend",20),n_(55,"Planning"),Sf(),za(56,"div",8)(57,"label",28),n_(58," Start date "),za(59,"span",10),n_(60,"*"),Sf()(),lc(61,"input",29),iS(),fT(62,Pe,2,0,"span",12),Sf(),za(63,"div",8)(64,"label",30),n_(65," Ends "),za(66,"span",10),n_(67,"*"),Sf()(),za(68,"select",31),mT(69,Me,2,2,"option",23,A),Sf(),iS(),Sf(),fT(71,De,7,4,"div",8),fT(72,we,7,4,"div",8),Sf(),za(73,"div",8)(74,"label",32),lc(75,"input",33),iS(),za(76,"span",34),n_(77,"Enabled"),Sf()(),za(78,"p",35),n_(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),Sf()(),za(80,"div",8)(81,"label",36),n_(82,"External Metadata"),Sf(),lc(83,"textarea",37),iS(),fT(84,ke,2,0,"span",12),za(85,"span",13),n_(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),Sf()(),fT(87,Ne,2,1,"p",38),za(88,"div",39)(89,"button",40),n_(90),Sf(),za(91,"button",41),dc("click",function(){sg(e);let g=MT();return ag(g.cancel())}),n_(92,"Cancel"),Sf()()();}if(n&2){let e=MT();tv("formGroup",e.form),yb(6),gv("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),tv("formControl",e.nameControl),aS(),yb(),hT(e.nameControl.invalid&&e.nameControl.touched?7:-1),yb(6),tv("formControl",e.descriptionControl),aS(),yb(6),hT(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),yb(8),gv("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),tv("formControl",e.promptContentControl),aS(),yb(),hT(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),yb(11),tv("formControl",e.unitControl),aS(),yb(),yT(e.schedulerUnits),yb(2),hT(e.showDayFilter()?42:-1),yb(7),tv("formControl",e.timeUtcControl),aS(),yb(3),hT(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),yb(9),gv("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),tv("formControl",e.startDateControl),aS(),yb(),hT(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),yb(6),tv("formControl",e.endTypeControl),aS(),yb(),yT(e.endTypes),yb(2),hT(e.showEndDate()?71:-1),yb(),hT(e.showOccurrenceCount()?72:-1),yb(3),tv("formControl",e.enabledControl),aS(),yb(8),tv("formControl",e.externalMetadataJsonControl),aS(),yb(),hT(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),yb(3),hT(e.errorMessage()?87:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),xf(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=p($t);router=p(It);destroyRef=p(Me$1);state=p(c);agentConfigController=p($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve$1.required]}),description:new vt(null),agentConfigId:new vt("",{nonNullable:true,validators:[ve$1.required]}),promptContent:new vt("",{nonNullable:true,validators:[ve$1.required]}),unit:new vt(Ee$1.WEEK,{nonNullable:true,validators:[ve$1.required]}),days:new vt([],{nonNullable:true}),timeUtc:new vt("09:00",{nonNullable:true,validators:[ve$1.required,ve$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new vt("",{nonNullable:true,validators:[ve$1.required]}),endType:new vt(Oe$1.NEVER,{nonNullable:true,validators:[ve$1.required]}),endDate:new vt(null),occurrenceCount:new vt(null),enabled:new vt(true,{nonNullable:true}),externalMetadataJson:new vt("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,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=se$1(false);isSubmitting=se$1(false);isLoading=se$1(false);errorMessage=se$1(null);SchedulerUnit=Ee$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ee$1.WEEK,label:"Week(s)"},{value:Ee$1.MONTH,label:"Month(s)"}];endTypes=[{value:Oe$1.NEVER,label:"Never"},{value:Oe$1.ON_DATE,label:"On date"},{value:Oe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Os(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Os(this.endTypeControl.value)));showDayFilter=Mi(()=>this.unitSignal()===Ee$1.WEEK);showEndDate=Mi(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=Mi(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=se$1([]);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),pw({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(Wn(()=>_([])))}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,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}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,d=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===Oe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Oe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.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=Ef({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return d.cancel()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5),Sf(),za(6,"h1",4),n_(7),Sf()(),fT(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),Sf()),e&2&&(yb(5),xf(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),yb(2),xf(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),yb(),hT(d.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn$1,qt,pn,Vn],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Oe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Oe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(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"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
1
+ import {c}from'./chunk-COXl1FiZ.js';import {$ as $$1,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,d as dn,F as Ft,c as bt,L as Ln,W as Wn$1,q as qt,b as pn,V as Vn}from'./chunk-UMiCRMsh.js';import {p,$ as $t,g as It,H as Me$1,a9 as $,aa as Oe$1,ab as Ee$1,s as se$1,ac as Ve$1,a2 as F,ad as Os,M as Mi,ae as pw,U,af as Wn,K as x,J as w,a as Ef,a3 as _,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,x as xf,h as hT,C as CT,l as lc,N as iS,m as mT,k as MT,O as tv,r as gv,Q as aS,d as yT,I as Iv,o as sg,q as ag,t as ey}from'./main-BNXY3UWS.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(za(0,"p",5),n_(1,"Loading\u2026"),Sf());}function ue(n,t){n&1&&(za(0,"span",12),n_(1," Name is required. "),Sf());}function fe(n,t){if(n&1&&(za(0,"p",42),n_(1),Sf(),za(2,"span",13),n_(3,"Agent Config cannot be changed after creation."),Sf()),n&2){let e=MT(2);yb(),Iv(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(za(0,"a",43),n_(1,"Add an agent config"),Sf(),n_(2," first. ")),n&2){let e=MT(3);tv("href","/agentos/"+e.namespaceId+"/agent-configs/new",ey);}}function he(n,t){if(n&1&&(za(0,"p",13),n_(1," No agent configs available in this scope yet. "),fT(2,_e,3,1),Sf()),n&2){let e=MT(2);yb(2),hT(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(za(0,"option",23),n_(1),Sf()),n&2){let e=t.$implicit;tv("value",e.id),yb(),Iv(e.name);}}function Ce(n,t){n&1&&(za(0,"span",12),n_(1,"Agent Config is required."),Sf());}function ve(n,t){if(n&1&&(za(0,"select",44)(1,"option",45),n_(2,"Select an agent config\u2026"),Sf(),mT(3,ge,2,2,"option",23,me),Sf(),iS(),fT(5,Ce,2,0,"span",12),za(6,"span",13),n_(7,"Immutable after creation."),Sf()),n&2){let e=MT(2);tv("formControl",e.agentConfigIdControl),aS(),yb(3),yT(e.availableAgentConfigs()),yb(2),hT(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(za(0,"span",12),n_(1,"Opening message is required."),Sf());}function ye(n,t){if(n&1&&(za(0,"option",23),n_(1),Sf()),n&2){let e=t.$implicit;tv("value",e.value),yb(),Iv(e.label);}}function be(n,t){if(n&1){let e=CT();za(0,"label",48)(1,"input",49),dc("change",function(){let g=sg(e).$implicit,v=MT(3);return ag(v.toggleDay(g.value))}),Sf(),za(2,"span",50),n_(3),Sf()();}if(n&2){let e=t.$implicit,d=MT(3);yb(),tv("checked",d.isDaySelected(e.value)),yb(2),Iv(e.label);}}function Se(n,t){if(n&1&&(za(0,"div",8)(1,"span",46),n_(2,"Days of week"),Sf(),za(3,"div",47),mT(4,be,4,2,"label",48,A),Sf(),za(6,"span",13),n_(7,"Leave empty to run every day of the week."),Sf()()),n&2){let e=MT(2);yb(4),yT(e.dayOptions);}}function Ee(n,t){n&1&&(za(0,"span",12),n_(1,"Valid time is required (HH:mm)."),Sf());}function Pe(n,t){n&1&&(za(0,"span",12),n_(1,"Start date is required."),Sf());}function Me(n,t){if(n&1&&(za(0,"option",23),n_(1),Sf()),n&2){let e=t.$implicit;tv("value",e.value),yb(),Iv(e.label);}}function Oe(n,t){n&1&&(za(0,"span",12),n_(1,"End date is required."),Sf());}function De(n,t){if(n&1&&(za(0,"div",8)(1,"label",51),n_(2," End date "),za(3,"span",10),n_(4,"*"),Sf()(),lc(5,"input",52),iS(),fT(6,Oe,2,0,"span",12),Sf()),n&2){let e=MT(2);yb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),tv("formControl",e.endDateControl),aS(),yb(),hT(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(za(0,"span",12),n_(1,"Must be at least 1."),Sf());}function we(n,t){if(n&1&&(za(0,"div",8)(1,"label",53),n_(2," Number of occurrences "),za(3,"span",10),n_(4,"*"),Sf()(),lc(5,"input",54),iS(),fT(6,Te,2,0,"span",12),Sf()),n&2){let e=MT(2);yb(5),gv("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),tv("formControl",e.occurrenceCountControl),aS(),yb(),hT(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(za(0,"span",12),n_(1,"Invalid JSON."),Sf());}function Ne(n,t){if(n&1&&(za(0,"p",38),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.errorMessage());}}function Fe(n,t){if(n&1){let e=CT();za(0,"form",7),dc("ngSubmit",function(){sg(e);let g=MT();return ag(g.submit())}),za(1,"div",8)(2,"label",9),n_(3," Name "),za(4,"span",10),n_(5,"*"),Sf()(),lc(6,"input",11),iS(),fT(7,ue,2,0,"span",12),za(8,"span",13),n_(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),Sf()(),za(10,"div",8)(11,"label",14),n_(12,"Description"),Sf(),lc(13,"input",15),iS(),Sf(),za(14,"div",8)(15,"label",16),n_(16," Agent Config "),za(17,"span",10),n_(18,"*"),Sf()(),fT(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),Sf(),za(22,"div",8)(23,"label",17),n_(24," Opening message "),za(25,"span",10),n_(26,"*"),Sf()(),lc(27,"textarea",18),iS(),fT(28,xe,2,0,"span",12),za(29,"span",13),n_(30," The message sent to the agent when the scheduled prompt fires. "),Sf()(),za(31,"fieldset",19)(32,"legend",20),n_(33,"Recurrence"),Sf(),za(34,"div",8)(35,"label",21),n_(36," Unit "),za(37,"span",10),n_(38,"*"),Sf()(),za(39,"select",22),mT(40,ye,2,2,"option",23,A),Sf(),iS(),Sf(),fT(42,Se,8,0,"div",8),za(43,"div",8)(44,"label",24),n_(45," Time (UTC) "),za(46,"span",10),n_(47,"*"),Sf()(),za(48,"div",25),lc(49,"input",26),iS(),za(50,"span",27),n_(51,"UTC"),Sf()(),fT(52,Ee,2,0,"span",12),Sf()(),za(53,"fieldset",19)(54,"legend",20),n_(55,"Planning"),Sf(),za(56,"div",8)(57,"label",28),n_(58," Start date "),za(59,"span",10),n_(60,"*"),Sf()(),lc(61,"input",29),iS(),fT(62,Pe,2,0,"span",12),Sf(),za(63,"div",8)(64,"label",30),n_(65," Ends "),za(66,"span",10),n_(67,"*"),Sf()(),za(68,"select",31),mT(69,Me,2,2,"option",23,A),Sf(),iS(),Sf(),fT(71,De,7,4,"div",8),fT(72,we,7,4,"div",8),Sf(),za(73,"div",8)(74,"label",32),lc(75,"input",33),iS(),za(76,"span",34),n_(77,"Enabled"),Sf()(),za(78,"p",35),n_(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),Sf()(),za(80,"div",8)(81,"label",36),n_(82,"External Metadata"),Sf(),lc(83,"textarea",37),iS(),fT(84,ke,2,0,"span",12),za(85,"span",13),n_(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),Sf()(),fT(87,Ne,2,1,"p",38),za(88,"div",39)(89,"button",40),n_(90),Sf(),za(91,"button",41),dc("click",function(){sg(e);let g=MT();return ag(g.cancel())}),n_(92,"Cancel"),Sf()()();}if(n&2){let e=MT();tv("formGroup",e.form),yb(6),gv("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),tv("formControl",e.nameControl),aS(),yb(),hT(e.nameControl.invalid&&e.nameControl.touched?7:-1),yb(6),tv("formControl",e.descriptionControl),aS(),yb(6),hT(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),yb(8),gv("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),tv("formControl",e.promptContentControl),aS(),yb(),hT(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),yb(11),tv("formControl",e.unitControl),aS(),yb(),yT(e.schedulerUnits),yb(2),hT(e.showDayFilter()?42:-1),yb(7),tv("formControl",e.timeUtcControl),aS(),yb(3),hT(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),yb(9),gv("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),tv("formControl",e.startDateControl),aS(),yb(),hT(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),yb(6),tv("formControl",e.endTypeControl),aS(),yb(),yT(e.endTypes),yb(2),hT(e.showEndDate()?71:-1),yb(),hT(e.showOccurrenceCount()?72:-1),yb(3),tv("formControl",e.enabledControl),aS(),yb(8),tv("formControl",e.externalMetadataJsonControl),aS(),yb(),hT(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),yb(3),hT(e.errorMessage()?87:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),xf(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=p($t);router=p(It);destroyRef=p(Me$1);state=p(c);agentConfigController=p($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$1({name:new vt("",{nonNullable:true,validators:[ve$1.required]}),description:new vt(null),agentConfigId:new vt("",{nonNullable:true,validators:[ve$1.required]}),promptContent:new vt("",{nonNullable:true,validators:[ve$1.required]}),unit:new vt(Ee$1.WEEK,{nonNullable:true,validators:[ve$1.required]}),days:new vt([],{nonNullable:true}),timeUtc:new vt("09:00",{nonNullable:true,validators:[ve$1.required,ve$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new vt("",{nonNullable:true,validators:[ve$1.required]}),endType:new vt(Oe$1.NEVER,{nonNullable:true,validators:[ve$1.required]}),endDate:new vt(null),occurrenceCount:new vt(null),enabled:new vt(true,{nonNullable:true}),externalMetadataJson:new vt("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,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=se$1(false);isSubmitting=se$1(false);isLoading=se$1(false);errorMessage=se$1(null);SchedulerUnit=Ee$1;SchedulerEndType=Oe$1;schedulerUnits=[{value:Ee$1.WEEK,label:"Week(s)"},{value:Ee$1.MONTH,label:"Month(s)"}];endTypes=[{value:Oe$1.NEVER,label:"Never"},{value:Oe$1.ON_DATE,label:"On date"},{value:Oe$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Os(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Os(this.endTypeControl.value)));showDayFilter=Mi(()=>this.unitSignal()===Ee$1.WEEK);showEndDate=Mi(()=>this.endTypeSignal()===Oe$1.ON_DATE);showOccurrenceCount=Mi(()=>this.endTypeSignal()===Oe$1.OCCURRENCES);agentConfigs=se$1([]);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),pw({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(Wn(()=>_([])))}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,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}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,d=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===Oe$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Oe$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.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=Ef({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return d.cancel()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5),Sf(),za(6,"h1",4),n_(7),Sf()(),fT(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),Sf()),e&2&&(yb(5),xf(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),yb(2),xf(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),yb(),hT(d.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,dn,Ft,bt,Ln,Wn$1,qt,pn,Vn],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Oe$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Oe$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(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"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
@@ -0,0 +1 @@
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-0VeqXZ9d.js';import {O}from'./chunk-Bf8bCumD.js';import {p,$ as $t,g as It,H as Me$1,a9 as $$1,ax as U,s as se,ay as Y,a1 as W,a2 as F,M as Mi,az as we,U as U$1,af as Wn,ae as pw,a3 as _,aA as j,K as x,J as w,a as Ef,at as pu,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,I as Iv,h as hT,k as MT,O as tv,C as CT,l as lc,N as iS,Q as aS,u as uc,x as xf,m as mT,d as yT,o as sg,q as ag,ar as Cv}from'./main-BNXY3UWS.js';import {$ as $$2,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye$1,d as dn,F as Ft,c as bt$1,L as Ln,W as Wn$1,q as qt,t as Lt,b as pn,V as Vn}from'./chunk-UMiCRMsh.js';import'./chunk-cKHTB9X6.js';var T="*";function ke(o){return (o??[]).some(t=>t.trim()===T)}function Ee(o){let t=(o??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==T).map(e=>e.toLowerCase());return new Set(t)}function $(o){return o.includes(T)}function Oe(o){let t=o.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");return new RegExp(`^${t}$`,"i")}function K(o,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==T&&$(e)).some(e=>Oe(e).test(o))}var Me="AGENTOS_CONFIG",Re=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Te(o){return o.configEnabled&&(o.hasSubAgents||o.integrationTypes.some(t=>Re.has(t)))}var Fe=(o,t)=>t.config.id,De=(o,t)=>t.type,Ie=(o,t)=>t.selector;function Ne(o,t){if(o&1&&(za(0,"a",5),n_(1,"View resolved definition \u2192"),Sf()),o&2){let e=MT();tv("routerLink",e.inspectRoute());}}function Le(o,t){o&1&&(za(0,"span",6),n_(1,"Platform level"),Sf());}function Ve(o,t){o&1&&(za(0,"p",7),n_(1,"Loading\u2026"),Sf());}function Be(o,t){if(o&1&&(za(0,"span",57),n_(1),Sf()),o&2){let e=MT().$implicit;yb(),Iv(e.config.integrationType);}}function ze(o,t){if(o&1&&(lc(0,"input",58),iS()),o&2){let e=MT().$implicit;tv("formControl",e.toolsControl),aS();}}function $e(o,t){if(o&1){let e=CT();za(0,"div",52)(1,"label",54)(2,"input",55),dc("change",function(){let s=sg(e).$implicit,c=MT(3);return ag(c.toggleIntegration(s))}),Sf(),za(3,"span",56),n_(4),Sf(),fT(5,Be,2,1,"span",57),Sf(),fT(6,ze,1,1,"input",58),Sf();}if(o&2){let e=t.$implicit;yb(2),tv("checked",e.enabled()),yb(2),Iv(e.config.name),yb(),hT(e.config.integrationType?5:-1),yb(),hT(e.enabled()?6:-1);}}function Ge(o,t){if(o&1&&(za(0,"p",64),n_(1),Sf()),o&2){let e=MT().$implicit;yb(),xf(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ue(o,t){if(o&1){let e=CT();za(0,"div",52)(1,"label",54)(2,"span",56),n_(3),Sf(),za(4,"span",57),n_(5,"built-in"),Sf()(),za(6,"select",60),dc("change",function(s){let c=sg(e).$implicit,C=MT(4);return ag(C.setBuiltInState(c,s.target.value))}),za(7,"option",61),n_(8),Sf(),za(9,"option",62),n_(10,"Enabled"),Sf(),za(11,"option",63),n_(12,"Disabled"),Sf()(),fT(13,Ge,2,1,"p",64),za(14,"p",65),n_(15),Sf()();}if(o&2){let e=t.$implicit,n=MT(4);yb(),uc("for","built-in-"+e.type),yb(2),Iv(e.displayName),yb(3),tv("id","built-in-"+e.type)("value",e.state()),yb(2),Iv(n.builtInDefaultLabel(e)),yb(5),hT(e.state()==="on"&&e.restrictedTools?13:-1),yb(2),Iv(e.description);}}function je(o,t){if(o&1&&(za(0,"p",59),n_(1,"Built-in integrations"),Sf(),mT(2,Ue,16,7,"div",52,De)),o&2){let e=MT(3);yb(2),yT(e.builtInRows());}}function We(o,t){o&1&&(za(0,"p",53),n_(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. "),Sf());}function Je(o,t){if(o&1&&(za(0,"fieldset",20)(1,"legend",22),n_(2,"Integrations"),Sf(),za(3,"p",51),n_(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),Sf(),mT(5,$e,7,4,"div",52,Fe),fT(7,je,4,0),fT(8,We,2,0,"p",53),Sf()),o&2){let e=MT(2);yb(5),yT(e.integrationRows()),yb(2),hT(e.builtInRows().length>0?7:-1),yb(),hT(e.configAgentExposureWarning()?8:-1);}}function Ke(o,t){o&1&&n_(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function Ye(o,t){o&1&&(za(0,"p",29),n_(1," Saving with this on replaces the selection below with "),za(2,"code",24),n_(3,"*"),Sf(),n_(4,". "),Sf());}function He(o,t){o&1&&(za(0,"p",29),n_(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),Sf());}function qe(o,t){o&1&&(za(0,"p",30),n_(1,"No skill available in this scope yet."),Sf());}function Xe(o,t){o&1&&(za(0,"span",69),n_(1,"platform"),Sf());}function Qe(o,t){if(o&1&&(za(0,"span",70),n_(1),Sf()),o&2){let e=MT(4);yb(),xf(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function Ze(o,t){if(o&1&&(za(0,"p",71),n_(1),Sf()),o&2){let e=MT().$implicit;yb(),Iv(e.description);}}function et(o,t){if(o&1){let e=CT();za(0,"div",66)(1,"label",67)(2,"input",68),dc("change",function(){let s=sg(e).$implicit,c=MT(3);return ag(c.toggleSkill(s))}),Sf(),za(3,"span",27),n_(4),Sf(),fT(5,Xe,2,0,"span",69),fT(6,Qe,2,1,"span",70),Sf(),fT(7,Ze,2,1,"p",71),Sf();}if(o&2){let e=t.$implicit,n=MT(3);yb(2),tv("checked",e.selected())("disabled",n.allSkillsSelected()),yb(2),Iv(e.name),yb(),hT(e.platform?5:-1),yb(),hT(e.unresolved?6:-1),yb(),hT(e.description?7:-1);}}function tt(o,t){if(o&1&&mT(0,et,8,6,"div",66,Ie),o&2){let e=MT(2);yT(e.skillRows());}}function nt(o,t){o&1&&(za(0,"p",74),n_(1,"Invalid JSON \u2014 please fix the syntax."),Sf());}function ot(o,t){if(o&1&&(za(0,"div",10)(1,"label",72),n_(2,"Loop configuration (JSON)"),Sf(),lc(3,"textarea",73),iS(),fT(4,nt,2,0,"p",74),za(5,"p",28),n_(6," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),za(7,"code",24),n_(8,"AgentLoopPayload"),Sf(),n_(9,". Leave empty if you always provide the payload at launch. "),Sf()()),o&2){let e=MT(2);yb(3),tv("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),aS(),yb(),hT(e.loopConfigControl.invalid&&e.loopConfigControl.touched?4:-1);}}function it(o,t){o&1&&n_(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function at(o,t){o&1&&(za(0,"p",29),n_(1," Saving with this on replaces the selection below with "),za(2,"code",24),n_(3,"*"),Sf(),n_(4,". "),Sf());}function rt(o,t){o&1&&(za(0,"p",29),n_(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),Sf());}function lt(o,t){o&1&&(za(0,"p",30),n_(1,"No other agent is available in this scope yet."),Sf());}function st(o,t){o&1&&(za(0,"span",69),n_(1,"pattern"),Sf());}function ct(o,t){o&1&&(za(0,"span",69),n_(1,"via pattern"),Sf());}function dt(o,t){if(o&1&&(za(0,"span",70),n_(1),Sf()),o&2){let e=MT(4);yb(),xf(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function gt(o,t){if(o&1){let e=CT();za(0,"button",76),dc("click",function(){sg(e);let s=MT().$implicit,c=MT(3);return ag(c.removeSubAgent(s))}),n_(1," \u{1F5D1} "),Sf();}}function mt(o,t){if(o&1){let e=CT();za(0,"div",66)(1,"label",67)(2,"input",68),dc("change",function(){let s=sg(e).$implicit,c=MT(3);return ag(c.toggleSubAgent(s))}),Sf(),za(3,"span",27),n_(4),Sf(),fT(5,st,2,0,"span",69)(6,ct,2,0,"span",69)(7,dt,2,1,"span",70),fT(8,gt,2,0,"button",75),Sf()();}if(o&2){let e=t.$implicit,n=MT(3);yb(2),tv("checked",e.selected())("disabled",n.allSubAgentsSelected()),yb(2),Iv(e.name),yb(),hT(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),yb(3),hT(e.unresolved?8:-1);}}function ft(o,t){if(o&1&&mT(0,mt,9,5,"div",66,Ie),o&2){let e=MT(2);yT(e.subAgentRows());}}function ut(o,t){if(o&1&&n_(0),o&2){let e=MT(2);Cv(" : ",e.defaultDelegationTimeoutSeconds()," s (",e.defaultDelegationTimeoutSeconds()/60," min) ");}}function pt(o,t){o&1&&(za(0,"p",44),n_(1," Enter a valid positive whole number of seconds, or leave empty to inherit the server default. "),Sf());}function _t(o,t){if(o&1){let e=CT();za(0,"button",77),dc("click",function(){sg(e);let s=MT(2);return ag(s.useDefaultDelegationTimeout())}),n_(1," Use server default "),Sf();}}function Ct(o,t){o&1&&(za(0,"p",46),n_(1),Sf()),o&2&&(yb(),Iv(t));}function bt(o,t){if(o&1){let e=CT();za(0,"button",78),dc("click",function(){sg(e);let s=MT(2);return ag(s.exportYaml())}),n_(1),Sf();}if(o&2){let e=MT(2);tv("disabled",e.isExporting()),yb(),xf(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ht(o,t){if(o&1){let e=CT();za(0,"form",9),dc("ngSubmit",function(){sg(e);let s=MT();return ag(s.submit())}),za(1,"div",10)(2,"label",11),n_(3,"Name "),za(4,"span",12),n_(5,"*"),Sf()(),lc(6,"input",13),iS(),Sf(),za(7,"div",10)(8,"label",14),n_(9,"Description"),Sf(),lc(10,"input",15),iS(),Sf(),za(11,"div",10)(12,"label",16),n_(13,"Model name"),Sf(),lc(14,"input",17),iS(),Sf(),za(15,"div",10)(16,"label",18),n_(17,"Instructions"),Sf(),lc(18,"textarea",19),iS(),Sf(),fT(19,Je,9,2,"fieldset",20),za(20,"fieldset",21)(21,"legend",22),n_(22,"Skills"),Sf(),za(23,"p",23),n_(24," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),za(25,"code",24),n_(26,"readSkill"),Sf(),n_(27," and "),za(28,"code",24),n_(29,"readSkillResource"),Sf(),n_(30," tools; selecting none grants neither. "),fT(31,Ke,1,0),Sf(),za(32,"label",25)(33,"input",26),dc("change",function(){sg(e);let s=MT();return ag(s.toggleAllSkills())}),Sf(),za(34,"span",27),n_(35," Every skill in the catalogue ("),za(36,"code",24),n_(37,"*"),Sf(),n_(38,") "),Sf()(),za(39,"p",28),n_(40," Resolved at run time, so skills added later are granted too, without editing this agent. "),Sf(),fT(41,Ye,5,0,"p",29),fT(42,He,2,0,"p",29),fT(43,qe,2,0,"p",30)(44,tt,2,0),Sf(),za(45,"div",10)(46,"label",31),n_(47,"Execution mode"),Sf(),za(48,"select",32)(49,"option",33),n_(50,"SIMPLE \u2014 Standard agent (single LLM call)"),Sf(),za(51,"option",33),n_(52,"ADVANCED \u2014 Multi-step reasoning loop"),Sf(),za(53,"option",33),n_(54,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),Sf()(),iS(),za(55,"p",28),n_(56,' 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. '),Sf()(),fT(57,ot,10,3,"div",10),za(58,"div",10)(59,"label",34),lc(60,"input",35),iS(),za(61,"span",36),n_(62,"Enabled"),Sf()(),za(63,"p",37),n_(64,"Disabled agents are excluded from namespace resolution."),Sf()(),za(65,"fieldset",21)(66,"legend",22),n_(67,"Sub-agents"),Sf(),za(68,"p",23),n_(69," The agents this one may delegate to. Selecting at least one grants it the "),za(70,"code",24),n_(71,"DELEGATE__delegate"),Sf(),n_(72," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),fT(73,it,1,0),Sf(),za(74,"label",25)(75,"input",26),dc("change",function(){sg(e);let s=MT();return ag(s.toggleAllSubAgents())}),Sf(),za(76,"span",27),n_(77," Every agent it can reach ("),za(78,"code",24),n_(79,"*"),Sf(),n_(80,") "),Sf()(),za(81,"p",28),n_(82," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),Sf(),fT(83,at,5,0,"p",29),fT(84,rt,2,0,"p",29),fT(85,lt,2,0,"p",30)(86,ft,2,0),za(87,"p",28),n_(88," Advanced \u2014 add a glob instead of picking a name, for example "),za(89,"code",24),n_(90,"*Fixer"),Sf(),n_(91," to cover BugFixer and StoryFixer. "),Sf(),za(92,"div",38)(93,"input",39),dc("keydown.enter",function(){sg(e);let s=MT();return ag(s.addSubAgent())}),Sf(),iS(),za(94,"button",40),dc("click",function(){sg(e);let s=MT();return ag(s.addSubAgent())}),n_(95," + "),Sf()()(),za(96,"div",10)(97,"label",41),n_(98,"Delegation timeout (seconds)"),Sf(),za(99,"p",42),n_(100," 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 "),fT(101,ut,1,2),n_(102," . "),Sf(),lc(103,"input",43),iS(),fT(104,pt,2,0,"p",44),fT(105,_t,2,0,"button",45),Sf(),fT(106,Ct,2,1,"p",46),za(107,"div",47)(108,"button",48),n_(109),Sf(),fT(110,bt,2,2,"button",49),za(111,"button",50),dc("click",function(){sg(e);let s=MT();return ag(s.cancel())}),n_(112,"Cancel"),Sf()()();}if(o&2){let e,n=MT();tv("formGroup",n.form),yb(6),tv("formControl",n.nameControl),aS(),yb(4),tv("formControl",n.descriptionControl),aS(),yb(4),tv("formControl",n.modelNameControl),aS(),yb(4),tv("formControl",n.instructionsControl),aS(),yb(),hT(n.integrationRows().length>0||n.builtInRows().length>0?19:-1),yb(12),hT(n.isPlatformMode?31:-1),yb(2),tv("checked",n.allSkillsSelected()),yb(8),hT(n.namedSkillSelectionDropped()?41:-1),yb(),hT(n.skillCatalogueUnavailable()?42:-1),yb(),hT(n.skillRows().length===0?43:44),yb(5),tv("formControl",n.executionModeControl),aS(),yb(),tv("value",n.ExecutionMode.SIMPLE),yb(2),tv("value",n.ExecutionMode.ADVANCED),yb(2),tv("value",n.ExecutionMode.LOOP),yb(4),hT(n.isLoopMode()?57:-1),yb(3),tv("formControl",n.enabledControl),aS(),yb(13),hT(n.isPlatformMode?73:-1),yb(2),tv("checked",n.allSubAgentsSelected()),yb(8),hT(n.namedSubAgentSelectionDropped()?83:-1),yb(),hT(n.subAgentCandidatesUnavailable()?84:-1),yb(),hT(n.subAgentRows().length===0?85:86),yb(8),tv("formControl",n.newSubAgentControl),aS(),yb(),tv("disabled",!n.newSubAgentControl.value.trim()),yb(7),hT(n.defaultDelegationTimeoutSeconds()!==null?101:-1),yb(2),tv("formControl",n.delegationTimeoutControl),uc("aria-invalid",n.delegationTimeoutControl.invalid),aS(),yb(),hT(n.delegationTimeoutControl.invalid?104:-1),yb(),hT(n.delegationTimeoutControl.value!==null?105:-1),yb(),hT((e=n.submitError())?106:-1,e),yb(2),tv("disabled",n.form.invalid||n.isSubmitting()),yb(),xf(" ",n.isEditMode()?"Save changes":"Create"," "),yb(),hT(n.isEditMode()?110:-1);}}var Pe=class o$2{route=p($t);router=p(It);destroyRef=p(Me$1);agentConfigController=p($$1);defaultsController=p(U);defaultDelegationTimeoutSeconds=se(null);exportService=p(Y);integrationConfigState=p(O);integrationTypeController=p(W);skillState=p(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new $$2({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),modelName:new vt(null),instructions:new vt(null),executionMode:new vt("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new vt(null,{validators:[ve.min(1),ve.max(2147483647),ve.pattern(/^\d+$/)]}),enabled:new vt(false,{nonNullable:true}),loopConfig:new vt(null,{validators:[o$2.jsonValidator]})});static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(n){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();}get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=Mi(()=>this.executionModeValue()==="LOOP");subAgentRows=se([]);allSubAgentsSelected=se(false);subAgentCandidatesUnavailable=se(false);namedSubAgentSelectionDropped=Mi(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));hasAnySubAgent=Mi(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new vt("",{nonNullable:true});isEditMode=se(false);isSubmitting=se(false);isLoading=se(false);isExporting=se(false);submitError=se(null);ExecutionMode=we;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=se([]);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=Mi(()=>Te({configEnabled:this.builtInRows().some(t=>t.type===Me&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));integrationRows=se([]);skillRows=se([]);allSkillsSelected=se(false);skillCatalogueUnavailable=se(false);namedSkillSelectionDropped=Mi(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),Wn(()=>_(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),pw({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:n,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:v})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let P=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(P),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 _=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(_,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(ke(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(v,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){pw({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates()}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:n,builtInTypes:s,skillCatalogue:c,delegationCandidates:C})=>{let v=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(v,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(j(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(Wn(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_([]))))}buildSkillRows(t,e){let s=(e??[]).map(_=>_.trim()).filter(_=>_.length>0).filter(_=>_!==r),c=i(s),C=new Set(t.map(_=>_.name.toLowerCase())),v=t.map(_=>({selector:_.name,name:_.name,description:_.description,platform:_.namespaceId==null,unresolved:false,selected:se(c.has(_.name.toLowerCase()))})),P=new Set;for(let _ of s){let u=l(_).toLowerCase();C.has(u)||P.has(u)||(P.add(u),v.push({selector:_,name:_,description:"",platform:false,unresolved:true,selected:se(true)}));}return v}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);return (this.namespaceId?pw({namespace:this.agentConfigController.listByParentAgentConfig(this.namespaceId,false),platform:t}).pipe(j(({namespace:n,platform:s})=>[...s,...n])):t).pipe(j(n=>n.map(s=>s.name).filter(s=>s.length>0)),j(n=>[...new Set(n)]),Wn(n=>(console.error("[agent-config-form] failed to load the delegation candidates",n),this.subAgentCandidatesUnavailable.set(true),_([]))))}buildSubAgentRows(t,e,n){let s=t.filter(u=>u!==n),c=Ee(e),C=new Set(s.map(u=>u.toLowerCase())),v=s.map(u=>({selector:u,name:u,unresolved:false,pattern:false,grantedByPattern:K(u,e),selected:se(c.has(u.toLowerCase()))})),P=new Set,_=(e??[]).map(u=>u.trim()).filter(u=>u.length>0&&u!==T);for(let u of _){let G=u.toLowerCase();C.has(G)||P.has(G)||(P.add(G),v.push({selector:u,name:u,unresolved:true,pattern:$(u),grantedByPattern:false,selected:se(true)}));}return v}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(j(t=>t.filter(e=>!e.configSchema)),Wn(t=>(console.error("[agent-config-form] failed to load integration types",t),_([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",c=e?.[s],C=e!=null&&s in e,v=Array.isArray(c)?c.join(", "):"";return {config:n,enabled:se(C),toolsControl:new vt(v,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,c=e?.[n.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:se(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(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===T?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>[...n.map(s=>s.unresolved||s.grantedByPattern||!K(s.name,[t])?s:x(w({},s),{grantedByPattern:true})),{selector:t,name:t,unresolved:true,pattern:$(t),grantedByPattern:false,selected:se(true)}]),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(n=>n.filter(s=>s.selector.toLowerCase()!==e));}toggleSubAgent(t){t.selected.update(e=>!e);}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t);}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [T];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",c=n.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=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:n=>{this.isSubmitting.set(false),this.submitError.set(o$2.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;return typeof n=="string"&&n.trim().length>0?n:"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 n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),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||o$2)};static \u0275cmp=Ef({type:o$2,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__skills"],[1,"agent-config-form__label"],[1,"agent-config-form__skills-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__skill-all"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked"],[1,"agent-config-form__skill-name"],[1,"agent-config-form__field-hint"],["role","alert",1,"agent-config-form__skills-warning"],[1,"agent-config-form__skills-empty"],["for","agent-config-execution-mode",1,"agent-config-form__label"],["id","agent-config-execution-mode",1,"agent-config-form__select",3,"formControl"],[3,"value"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],["for","delegation-timeout",1,"agent-config-form__label"],["id","delegation-timeout-hint",1,"agent-config-form__field-hint"],["id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",1,"agent-config-form__input",3,"formControl"],["id","delegation-timeout-error","role","alert",1,"agent-config-form__field-hint"],["type","button",1,"agent-config-form__sub-agent-btn"],["role","alert",1,"agent-config-form__submit-error"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],["role","note",1,"agent-config-form__integration-warning"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__skill-row"],[1,"agent-config-form__skill-toggle"],["type","checkbox",1,"agent-config-form__skill-checkbox",3,"change","checked","disabled"],[1,"agent-config-form__skill-badge"],[1,"agent-config-form__skill-badge","agent-config-form__skill-badge--unresolved"],[1,"agent-config-form__skill-desc"],["for","agent-config-loop-config",1,"agent-config-form__label"],["id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",1,"agent-config-form__textarea","agent-config-form__textarea--mono",3,"placeholder","formControl"],["role","alert",1,"agent-config-form__field-error"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__sub-agent-btn",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return n.cancel()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5," Agent Configs "),Sf(),za(6,"h1",4),n_(7),Sf(),fT(8,Ne,2,1,"a",5),fT(9,Le,2,0,"span",6),Sf(),fT(10,Ve,2,0,"p",7)(11,ht,113,33,"form",8),Sf()),e&2&&(yb(7),Iv(n.isEditMode()?"Edit agent config":"New agent config"),yb(),hT(n.isEditMode()?8:-1),yb(),hT(n.isPlatformMode?9:-1),yb(),hT(n.isLoading()?10:11));},dependencies:[Kn,zn,Zn,Xn,Ye$1,dn,Ft,bt$1,Ln,Wn$1,qt,Lt,pn,Vn,pu],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:var(--radius-pill, 0);padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:var(--radius-md, 0);border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.8125rem}.agent-config-form__submit-error[_ngcontent-%COMP%]{margin:1rem 0 0;padding:.625rem .875rem;border:1px solid var(--color-error, var(--red, #dc2626));font-size:.85rem;color:var(--color-error, var(--red, #dc2626));line-height:1.5}.agent-config-form__field-error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:var(--radius-md, 0);border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;transition:border-color .15s ease;appearance:auto}.agent-config-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:var(--radius-md, 0);padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-warning[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8rem;color:var(--color-warning, #b25000);line-height:1.4}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__skills[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:var(--radius-md, 0);padding:1rem;margin:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-form__skills-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__skills-warning[_ngcontent-%COMP%]{margin:0;font-size:.8rem;line-height:1.4;color:var(--color-error, var(--red, #dc2626))}.agent-config-form__skills-empty[_ngcontent-%COMP%]{margin:0;font-size:.8rem;font-style:italic;color:var(--color-text-secondary)}.agent-config-form__skill-all[_ngcontent-%COMP%], .agent-config-form__skill-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.agent-config-form__skill-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.agent-config-form__skill-checkbox[_ngcontent-%COMP%]{flex:0 0 auto}.agent-config-form__skill-name[_ngcontent-%COMP%]{font-size:.875rem}.agent-config-form__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary)}.agent-config-form__skill-badge--unresolved[_ngcontent-%COMP%]{color:var(--color-error, var(--red, #dc2626))}.agent-config-form__skill-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:var(--radius-sm, 0);border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:var(--radius-pill, 0);border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{Pe as AgentConfigFormComponent};
@@ -1,2 +1,2 @@
1
- import {R}from'./chunk-HGFAbUg7.js';import {p,$ as $t,aW as _,H as Me,s as se,M as Mi,aX as Ie,ae as pw,U,af as Wn,a as Ef,a3 as _$1,z as za,n as n_,S as Sf,f as fT,y as yb,h as hT,C as CT,L as dc,N as iS,m as mT,k as MT,O as tv,Q as aS,d as yT,x as xf,I as Iv,r as gv,ar as Cv,o as sg,q as ag}from'./main-ITBV6BE5.js';import {J as Yn,Z as Zn,X as Xn,Y as Ye,F as Ft,c as bt,L as Ln,Q as ln}from'./chunk-Btu4vlJn.js';import'./chunk-CrJHMDmB.js';var q=(a,t)=>t.id;function $(a,t){a&1&&(za(0,"p",3),n_(1,"Loading\u2026"),Sf());}function J(a,t){if(a&1&&(za(0,"p",6),n_(1),Sf()),a&2){let e=MT(2);yb(),Iv(e.errorMessage());}}function Q(a,t){if(a&1){let e=CT();za(0,"button",26),dc("click",function(){sg(e);let s=MT(2);return ag(s.retryLoad())}),n_(1,"Retry loading"),Sf();}}function X(a,t){if(a&1&&(za(0,"span",28),n_(1),Sf()),a&2){let e=MT(3);yb(),Iv(e.association()?.checkoutFailureReason);}}function Z(a,t){if(a&1&&(za(0,"p",27),n_(1),fT(2,X,2,1,"span",28),Sf()),a&2){let e=MT(2);gv("namespace-git__status--failed",e.checkoutStatus()===e.CheckoutStatus.FAILED)("namespace-git__status--ready",e.checkoutStatus()===e.CheckoutStatus.READY),yb(),xf(" Repository: ",e.checkoutStatus()," "),yb(),hT(e.association()?.checkoutFailureReason?2:-1);}}function ee(a,t){if(a&1&&(za(0,"option",18),n_(1),Sf()),a&2){let e=t.$implicit,d=MT(2);tv("value",e.id),yb(),Cv("",e.name," (",d.authTypeLabel(e.authType),")");}}function te(a,t){a&1&&(za(0,"span",19),n_(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),Sf());}function ne(a,t){if(a&1){let e=CT();za(0,"button",29),dc("click",function(){sg(e);let s=MT(2);return ag(s.remove())}),n_(1," Remove association "),Sf();}if(a&2){let e=MT(2);tv("disabled",!e.associationLoaded()||e.isSaving());}}function ie(a,t){if(a&1){let e=CT();za(0,"div",4)(1,"p",5),n_(2," 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. "),Sf(),fT(3,J,2,1,"p",6),fT(4,Q,2,0,"button",7),fT(5,Z,3,6,"p",8),za(6,"fieldset",9)(7,"legend",10),n_(8,"Repository"),Sf(),za(9,"label",11)(10,"span",12),n_(11,"Repository URL"),Sf(),za(12,"input",13),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.repositoryUrl.set(s))}),Sf(),iS(),za(13,"span",14),n_(14,"HTTPS only, without credentials in the URL."),Sf()(),za(15,"label",11)(16,"span",12),n_(17,"Main branch"),Sf(),za(18,"input",15),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.mainBranch.set(s))}),Sf(),iS(),za(19,"span",14),n_(20,"New worktrees start at this branch\u2019s commit, without creating a branch."),Sf()(),za(21,"label",11)(22,"span",12),n_(23,"Service account"),Sf(),za(24,"select",16),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.serviceAuthSettingId.set(s))}),za(25,"option",17),n_(26,"Select an auth setting\u2026"),Sf(),mT(27,ee,2,3,"option",18,q),Sf(),iS(),za(29,"span",14),n_(30," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),Sf(),fT(31,te,2,0,"span",19),Sf()(),za(32,"fieldset",9)(33,"legend",10),n_(34,"Automation"),Sf(),za(35,"label",20)(36,"input",21),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.autoWorktree.set(s))}),Sf(),iS(),za(37,"span"),n_(38,"Offer a worktree to every new top-level case"),Sf()(),za(39,"span",14),n_(40," 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. "),Sf(),za(41,"label",11)(42,"span",12),n_(43,"Setup command (optional)"),Sf(),za(44,"input",22),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.setupCommand.set(s))}),Sf(),iS(),za(45,"span",19),n_(46," 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. "),Sf()()(),za(47,"div",23)(48,"button",24),dc("click",function(){sg(e);let s=MT();return ag(s.save())}),n_(49),Sf(),fT(50,ne,2,1,"button",25),Sf()();}if(a&2){let e=MT();yb(3),hT(e.errorMessage()?3:-1),yb(),hT(e.associationLoaded()?-1:4),yb(),hT(e.isAssociated()&&e.checkoutStatus()?5:-1),yb(),tv("disabled",!e.associationLoaded()||e.isSaving()),yb(6),tv("ngModel",e.repositoryUrl()),aS(),yb(6),tv("ngModel",e.mainBranch()),aS(),yb(6),tv("ngModel",e.serviceAuthSettingId()),aS(),yb(3),yT(e.eligibleAuthSettings()),yb(4),hT(e.eligibleAuthSettings().length===0?31:-1),yb(),tv("disabled",!e.associationLoaded()||e.isSaving()),yb(4),tv("ngModel",e.autoWorktree()),aS(),yb(8),tv("ngModel",e.setupCommand()),aS(),yb(4),tv("disabled",!e.canSave()),yb(),xf(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),yb(),hT(e.isAssociated()?50:-1);}}var ae=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],oe={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},j=class a{route=p($t);gitApi=p(_);authSettingState=p(R);destroyRef=p(Me);isLoading=se(true);isSaving=se(false);associationLoaded=se(false);errorMessage=se(null);association=se(null);authSettings=se([]);repositoryUrl=se("");mainBranch=se("main");serviceAuthSettingId=se("");autoWorktree=se(false);setupCommand=se("");namespaceId="";isAssociated=Mi(()=>this.association()?.associated===true);eligibleAuthSettings=Mi(()=>this.authSettings().filter(t=>ae.includes(t.authType)));authTypeLabel(t){return oe[t??""]??t??"unknown"}canSave=Mi(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=Mi(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ie;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),pw({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),Wn(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_$1(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||confirm("Remove the repository association? Existing workspaces keep their worktree.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),Wn(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_$1(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||a)};static \u0275cmp=Ef({type:a,selectors:[["agentos-namespace-git"]],decls:6,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],["type","button",1,"namespace-git__retry"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section",3,"disabled"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__checkbox"],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],["type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__retry",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(e,d){e&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),n_(3,"Git repository"),Sf()(),fT(4,$,2,0,"p",3)(5,ie,51,14,"div",4),Sf()),e&2&&(yb(4),hT(d.isLoading()?4:5));},dependencies:[Yn,Zn,Xn,Ye,Ft,bt,Ln,ln],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__checkbox[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;cursor:pointer}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__retry[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
1
+ import {R}from'./chunk-gX9pSFmE.js';import {p,$ as $t,aW as _,H as Me,s as se,M as Mi,aX as Ie,ae as pw,U,af as Wn,a as Ef,a3 as _$1,z as za,n as n_,S as Sf,f as fT,y as yb,h as hT,C as CT,L as dc,N as iS,m as mT,k as MT,O as tv,Q as aS,d as yT,x as xf,I as Iv,r as gv,ar as Cv,o as sg,q as ag}from'./main-BNXY3UWS.js';import {J as Yn,Z as Zn,X as Xn,Y as Ye,F as Ft,c as bt,L as Ln,Q as ln}from'./chunk-UMiCRMsh.js';import'./chunk-cKHTB9X6.js';var q=(a,t)=>t.id;function $(a,t){a&1&&(za(0,"p",3),n_(1,"Loading\u2026"),Sf());}function J(a,t){if(a&1&&(za(0,"p",6),n_(1),Sf()),a&2){let e=MT(2);yb(),Iv(e.errorMessage());}}function Q(a,t){if(a&1){let e=CT();za(0,"button",26),dc("click",function(){sg(e);let s=MT(2);return ag(s.retryLoad())}),n_(1,"Retry loading"),Sf();}}function X(a,t){if(a&1&&(za(0,"span",28),n_(1),Sf()),a&2){let e=MT(3);yb(),Iv(e.association()?.checkoutFailureReason);}}function Z(a,t){if(a&1&&(za(0,"p",27),n_(1),fT(2,X,2,1,"span",28),Sf()),a&2){let e=MT(2);gv("namespace-git__status--failed",e.checkoutStatus()===e.CheckoutStatus.FAILED)("namespace-git__status--ready",e.checkoutStatus()===e.CheckoutStatus.READY),yb(),xf(" Repository: ",e.checkoutStatus()," "),yb(),hT(e.association()?.checkoutFailureReason?2:-1);}}function ee(a,t){if(a&1&&(za(0,"option",18),n_(1),Sf()),a&2){let e=t.$implicit,d=MT(2);tv("value",e.id),yb(),Cv("",e.name," (",d.authTypeLabel(e.authType),")");}}function te(a,t){a&1&&(za(0,"span",19),n_(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),Sf());}function ne(a,t){if(a&1){let e=CT();za(0,"button",29),dc("click",function(){sg(e);let s=MT(2);return ag(s.remove())}),n_(1," Remove association "),Sf();}if(a&2){let e=MT(2);tv("disabled",!e.associationLoaded()||e.isSaving());}}function ie(a,t){if(a&1){let e=CT();za(0,"div",4)(1,"p",5),n_(2," 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. "),Sf(),fT(3,J,2,1,"p",6),fT(4,Q,2,0,"button",7),fT(5,Z,3,6,"p",8),za(6,"fieldset",9)(7,"legend",10),n_(8,"Repository"),Sf(),za(9,"label",11)(10,"span",12),n_(11,"Repository URL"),Sf(),za(12,"input",13),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.repositoryUrl.set(s))}),Sf(),iS(),za(13,"span",14),n_(14,"HTTPS only, without credentials in the URL."),Sf()(),za(15,"label",11)(16,"span",12),n_(17,"Main branch"),Sf(),za(18,"input",15),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.mainBranch.set(s))}),Sf(),iS(),za(19,"span",14),n_(20,"New worktrees start at this branch\u2019s commit, without creating a branch."),Sf()(),za(21,"label",11)(22,"span",12),n_(23,"Service account"),Sf(),za(24,"select",16),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.serviceAuthSettingId.set(s))}),za(25,"option",17),n_(26,"Select an auth setting\u2026"),Sf(),mT(27,ee,2,3,"option",18,q),Sf(),iS(),za(29,"span",14),n_(30," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),Sf(),fT(31,te,2,0,"span",19),Sf()(),za(32,"fieldset",9)(33,"legend",10),n_(34,"Automation"),Sf(),za(35,"label",20)(36,"input",21),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.autoWorktree.set(s))}),Sf(),iS(),za(37,"span"),n_(38,"Offer a worktree to every new top-level case"),Sf()(),za(39,"span",14),n_(40," 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. "),Sf(),za(41,"label",11)(42,"span",12),n_(43,"Setup command (optional)"),Sf(),za(44,"input",22),dc("ngModelChange",function(s){sg(e);let p=MT();return ag(p.setupCommand.set(s))}),Sf(),iS(),za(45,"span",19),n_(46," 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. "),Sf()()(),za(47,"div",23)(48,"button",24),dc("click",function(){sg(e);let s=MT();return ag(s.save())}),n_(49),Sf(),fT(50,ne,2,1,"button",25),Sf()();}if(a&2){let e=MT();yb(3),hT(e.errorMessage()?3:-1),yb(),hT(e.associationLoaded()?-1:4),yb(),hT(e.isAssociated()&&e.checkoutStatus()?5:-1),yb(),tv("disabled",!e.associationLoaded()||e.isSaving()),yb(6),tv("ngModel",e.repositoryUrl()),aS(),yb(6),tv("ngModel",e.mainBranch()),aS(),yb(6),tv("ngModel",e.serviceAuthSettingId()),aS(),yb(3),yT(e.eligibleAuthSettings()),yb(4),hT(e.eligibleAuthSettings().length===0?31:-1),yb(),tv("disabled",!e.associationLoaded()||e.isSaving()),yb(4),tv("ngModel",e.autoWorktree()),aS(),yb(8),tv("ngModel",e.setupCommand()),aS(),yb(4),tv("disabled",!e.canSave()),yb(),xf(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),yb(),hT(e.isAssociated()?50:-1);}}var ae=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],oe={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},j=class a{route=p($t);gitApi=p(_);authSettingState=p(R);destroyRef=p(Me);isLoading=se(true);isSaving=se(false);associationLoaded=se(false);errorMessage=se(null);association=se(null);authSettings=se([]);repositoryUrl=se("");mainBranch=se("main");serviceAuthSettingId=se("");autoWorktree=se(false);setupCommand=se("");namespaceId="";isAssociated=Mi(()=>this.association()?.associated===true);eligibleAuthSettings=Mi(()=>this.authSettings().filter(t=>ae.includes(t.authType)));authTypeLabel(t){return oe[t??""]??t??"unknown"}canSave=Mi(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=Mi(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ie;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),pw({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),Wn(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_$1(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||confirm("Remove the repository association? Existing workspaces keep their worktree.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),Wn(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_$1(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||a)};static \u0275cmp=Ef({type:a,selectors:[["agentos-namespace-git"]],decls:6,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],["type","button",1,"namespace-git__retry"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section",3,"disabled"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__checkbox"],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],["type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__retry",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(e,d){e&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),n_(3,"Git repository"),Sf()(),fT(4,$,2,0,"p",3)(5,ie,51,14,"div",4),Sf()),e&2&&(yb(4),hT(d.isLoading()?4:5));},dependencies:[Yn,Zn,Xn,Ye,Ft,bt,Ln,ln],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__checkbox[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;cursor:pointer}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__retry[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
2
2
  export{j as NamespaceGitComponent};