@whoz-oss/coday-client 0.0.0-workstream-forge.273 → 0.0.0-workstream-messaging.10

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 (91) hide show
  1. package/browser/chunk-0mZ3Y_ZJ.js +1 -0
  2. package/browser/chunk-1XF6Qsuy.js +1 -0
  3. package/browser/chunk-2KFuV5E5.js +671 -0
  4. package/browser/chunk-ATg3fmRI.js +1 -0
  5. package/browser/{chunk-CDUMxrcp.js → chunk-BFAp9jo2.js} +1 -1
  6. package/browser/chunk-BL1cOmqY.js +1 -0
  7. package/browser/chunk-BMbtNfWQ.js +1 -0
  8. package/browser/chunk-BqHLVmOf.js +1 -0
  9. package/browser/{chunk-BB9Gq9LM.js → chunk-BuwHCrKf.js} +1 -1
  10. package/browser/{chunk-BgL5ewFe.js → chunk-BwyYPrKV.js} +1 -1
  11. package/browser/chunk-C0i49sQV.js +1 -0
  12. package/browser/chunk-C4EP50-g.js +1 -0
  13. package/browser/chunk-C4OG4ewl.js +1 -0
  14. package/browser/chunk-C57t194y.js +1 -0
  15. package/browser/chunk-C7nsTLJX.js +1 -0
  16. package/browser/chunk-CCDRNHex.js +1 -0
  17. package/browser/chunk-CIeSnHU_.js +1 -0
  18. package/browser/chunk-CL0y_n4N.js +1 -0
  19. package/browser/chunk-CMZIhnyc.js +1 -0
  20. package/browser/chunk-CVlOQ_eN.js +1 -0
  21. package/browser/chunk-C_6VN9jF.js +1 -0
  22. package/browser/chunk-C_ual2NQ.js +2 -0
  23. package/browser/{chunk-CBVMv4ai.js → chunk-Cdql7t44.js} +1 -1
  24. package/browser/chunk-CqT7zdSp.js +1 -0
  25. package/browser/chunk-D2x7xu27.js +1 -0
  26. package/browser/chunk-D51v34BD.js +1 -0
  27. package/browser/chunk-D7Yaudd7.js +1 -0
  28. package/browser/chunk-D9gwrCSe.js +1 -0
  29. package/browser/chunk-DAoXL__Q.js +2 -0
  30. package/browser/chunk-DKPVmUTX.js +1 -0
  31. package/browser/{chunk-CZFKR68R.js → chunk-DPNOnAOU.js} +1 -1
  32. package/browser/chunk-D_jkAHyb.js +1 -0
  33. package/browser/{chunk-CBWtz2mG.js → chunk-DoiOjutD.js} +1 -1
  34. package/browser/chunk-DpA9bfvt.js +1 -0
  35. package/browser/chunk-DqrAPruo.js +1 -0
  36. package/browser/chunk-Dt3vfYW7.js +1 -0
  37. package/browser/chunk-DvR4terh.js +1 -0
  38. package/browser/{chunk-BnhHFWL5.js → chunk-R1TauUsQ.js} +1 -1
  39. package/browser/chunk-SMenvxTt.js +1 -0
  40. package/browser/chunk-dszE6BqR.js +1 -0
  41. package/browser/chunk-hCtZ2RNp.js +1 -0
  42. package/browser/chunk-ijPuDimC.js +1 -0
  43. package/browser/chunk-nnH-h9C7.js +1 -0
  44. package/browser/chunk-peLkf2eQ.js +1 -0
  45. package/browser/{chunk-Dadlh5JC.js → chunk-rKr5ufU2.js} +1 -1
  46. package/browser/chunk-tNsYxLDx.js +1 -0
  47. package/browser/chunk-wXEAK6xj.js +1 -0
  48. package/browser/chunk-wmoMXtn0.js +1 -0
  49. package/browser/chunk-x7GGjcqr.js +1 -0
  50. package/browser/index.html +1 -1
  51. package/browser/main-EPHSXFSY.js +1254 -0
  52. package/package.json +1 -1
  53. package/browser/chunk-0ZtY80DW.js +0 -1
  54. package/browser/chunk-14mxT3bD.js +0 -1
  55. package/browser/chunk-9n3XkPN1.js +0 -1
  56. package/browser/chunk-B0xq8HoB.js +0 -1
  57. package/browser/chunk-BQof2LNq.js +0 -1
  58. package/browser/chunk-BSRpGLZu.js +0 -1
  59. package/browser/chunk-BTUoHs1a.js +0 -1
  60. package/browser/chunk-BZjbpPBa.js +0 -671
  61. package/browser/chunk-BbjUb8n0.js +0 -1
  62. package/browser/chunk-BkPDwEh1.js +0 -1
  63. package/browser/chunk-BmsFJQ_v.js +0 -2
  64. package/browser/chunk-Bt4hGQrm.js +0 -1
  65. package/browser/chunk-C1EaR3-9.js +0 -1
  66. package/browser/chunk-C9MRS4KJ.js +0 -1
  67. package/browser/chunk-CAqIYs7P.js +0 -1
  68. package/browser/chunk-C_vj5e-Y.js +0 -1
  69. package/browser/chunk-CaSk42fD.js +0 -1
  70. package/browser/chunk-CeqhBlc6.js +0 -1
  71. package/browser/chunk-CfhLsKNC.js +0 -1
  72. package/browser/chunk-Cix3-0K2.js +0 -1
  73. package/browser/chunk-CjVNMPMk.js +0 -2
  74. package/browser/chunk-Cl72Xnim.js +0 -1
  75. package/browser/chunk-CuwUFZ9P.js +0 -1
  76. package/browser/chunk-CyYuvnGm.js +0 -1
  77. package/browser/chunk-D68ToWiu.js +0 -1
  78. package/browser/chunk-DDZiCKt-.js +0 -1
  79. package/browser/chunk-DKbc-fih.js +0 -1
  80. package/browser/chunk-Daidn0iH.js +0 -1
  81. package/browser/chunk-DgEngWkY.js +0 -1
  82. package/browser/chunk-Dnc62mls.js +0 -1
  83. package/browser/chunk-NON463g4.js +0 -1
  84. package/browser/chunk-PGJjZGrF.js +0 -1
  85. package/browser/chunk-VCV19Z6L.js +0 -1
  86. package/browser/chunk-dCxf5p0L.js +0 -1
  87. package/browser/chunk-hha5EuTF.js +0 -1
  88. package/browser/chunk-hmzIFgbE.js +0 -1
  89. package/browser/chunk-q02QECba.js +0 -1
  90. package/browser/chunk-sKMEQoDc.js +0 -1
  91. package/browser/main-G2NDWI4S.js +0 -1253
@@ -1 +1 @@
1
- import {f,y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,i as at,u as un}from'./chunk-BZjbpPBa.js';import {g,W,t as F,I as J,K as we,o as oT,$ as $i,O as Of,U,L as w,N as x,D as Dw,E as Es,f as fg,a as Bw,c as hl,P as dg,d as VE,i as Vw,b as AC,Q as Qw,R as vg,S as NI,q as $w,v as tC,T as AI,n as lg,z as zw,u as Dl,F as Fg,w as pf,x as hf}from'./main-G2NDWI4S.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),AC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=tC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),NI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),NI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),NI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),NI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),NI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),NI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=tC();return hf(se.onMaxToolRoundsInput(p))}),hl(),NI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),$w(19,he,2,2,"option",23,ce),hl(),NI(),hl(),Es(21,"ds-form-actions")(22,"button",24),AC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=tC();return hf(p.cancel())}),AC(25,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(2),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.externalIdControl),AI(),VE(2),dg("formControl",e.defaultAgentNameControl),AI(),VE(2),dg("formControl",e.configPathControl),AI(),VE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),VE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),AI(),VE(),dg("hint",e.runCostThresholdHint()),VE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),AI(),VE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),VE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),AI(),VE(2),dg("formControl",e.adminCaseListingControl),AI(),VE(),zw(e.adminCaseListingOptions),VE(3),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=oT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=oT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=oT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=oT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),VE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),VE(),Vw(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
1
+ import {f,y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,i as at,u as un}from'./chunk-2KFuV5E5.js';import {g,W,F,u as L,v as we,i as VC,M as Mi,s as sf,x as U,C as w,E as x,a as ew,o as os,H as Hh,I as Iw,z as zu,J as Vh,c as IE,w as ww,b as pC,R as Rw,K as qh,N as lI,T as Tw,L as Lw,Q as fI,h as Bh,_ as _w,Y as Yu,l as lg,P as Pd,n as Ld}from'./main-EPHSXFSY.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function he(i,t){if(i&1&&(os(0,"option",23),pC(1),zu()),i&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function pe(i,t){if(i&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let p=Lw();return Ld(p.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"textarea",8),lI(),zu(),os(5,"ds-form-field",9),Hh(6,"input",10),lI(),zu(),os(7,"ds-form-field",11),Hh(8,"input",12),lI(),zu(),os(9,"ds-form-field",13),Hh(10,"input",14),lI(),zu(),os(11,"ds-form-field",15),Hh(12,"input",16),lI(),zu(),os(13,"ds-form-field",17),Hh(14,"input",18),lI(),zu(),os(15,"ds-form-field",19)(16,"input",20),qh("input",function(p){Pd(e);let se=Lw();return Ld(se.onMaxToolRoundsInput(p))}),zu(),lI(),zu(),os(17,"ds-form-field",21)(18,"select",22),Tw(19,he,2,2,"option",23,ce),zu(),lI(),zu(),os(21,"ds-form-actions")(22,"button",24),pC(23),zu(),os(24,"button",25),qh("click",function(){Pd(e);let p=Lw();return Ld(p.cancel())}),pC(25,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(2),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.externalIdControl),fI(),IE(2),Vh("formControl",e.defaultAgentNameControl),fI(),IE(2),Vh("formControl",e.configPathControl),fI(),IE(),Vh("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),IE(),Vh("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),Bh("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),fI(),IE(),Vh("hint",e.runCostThresholdHint()),IE(),Vh("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),fI(),IE(),Vh("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),IE(),Vh("formControl",e.maxToolRoundsControl),Bh("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),fI(),IE(2),Vh("formControl",e.adminCaseListingControl),fI(),IE(),_w(e.adminCaseListingOptions),IE(3),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(L);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=VC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=VC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=VC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=VC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=Mi(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);existingNamespace=null;constructor(){sf(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(os(0,"ds-page",0),Hh(1,"ds-section-header",1),Iw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),zu()),e&2&&(Vh("framed",!u.isEditMode()),IE(),Vh("title",u.isEditMode()?"Edit namespace":"New namespace"),IE(),ww(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-BuwHCrKf.js';import {F as s,v as vn,d as yn,l as dn,_ as _n,i as at,m as mn,A as Ao,G as Ni,H as On}from'./chunk-2KFuV5E5.js';import {g,W,F,v as we,M as Mi,i as VC,x as U,ag as Gm,a6 as Zs,ae as Dr,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,w as ww,L as Lw,J as Vh,R as Rw,H as Hh,a0 as RC,l as lg,Y as Yu,ay as kC,T as Tw,_ as _w,as as bw,P as Pd,n as Ld,az as xD}from'./main-EPHSXFSY.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(os(0,"a",2),pC(1,"Edit skill \u2192"),zu()),e&2){let n=Lw();Vh("routerLink",n.editRoute());}}function ee(e,t){e&1&&(os(0,"ds-tag",3),pC(1,"Platform level"),zu());}function te(e,t){e&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function ne(e,t){e&1&&(os(0,"ds-notice"),pC(1,"Failed to load skill."),zu());}function ie(e,t){if(e&1&&(os(0,"dt"),pC(1,"Created by"),zu(),os(2,"dd"),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.createdBy);}}function oe(e,t){if(e&1&&(os(0,"dt"),pC(1,"Last updated"),zu(),os(2,"dd"),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Iw(0,ie,4,1),Iw(1,oe,4,1)),e&2){let n=Lw();ww(n.createdBy?0:-1),IE(),ww(n.updatedOn?1:-1);}}function le(e,t){e&1&&(os(0,"p",4),pC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),zu());}function se(e,t){e&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function re(e,t){e&1&&(os(0,"ds-notice"),pC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),zu());}function de(e,t){e&1&&(os(0,"p",4),pC(1,"No agent references this skill."),zu());}function ce(e,t){e&1&&(os(0,"ds-tag",15),pC(1,"platform agent"),zu());}function me(e,t){e&1&&(os(0,"ds-tag",15),pC(1,"via *"),zu());}function pe(e,t){if(e&1&&(os(0,"li",13)(1,"span",14),pC(2),zu(),Iw(3,ce,2,0,"ds-tag",15),Iw(4,me,2,0,"ds-tag",15),zu()),e&2){let n=t.$implicit;IE(2),lg(n.name),IE(),ww(n.platform?3:-1),IE(),ww(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(os(0,"ul",12),Tw(1,pe,5,3,"li",13,Y),zu(),os(3,"p",4),pC(4," An agent listed "),os(5,"code"),pC(6,"via *"),zu(),pC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),zu()),e&2){let n=Lw(2);IE(),_w(n.consumers());}}function _e(e,t){e&1&&(os(0,"p",4),pC(1,"No resources bundled with this skill."),zu());}function ge(e,t){if(e&1){let n=Rw();os(0,"li")(1,"ds-disclosure",16),qh("toggled",function(){let r=Pd(n).$implicit,g=Lw(3);return Ld(g.toggleResource(r))}),os(2,"pre",17),pC(3),zu()()();}if(e&2){let n=t.$implicit,o=Lw(3);IE(),Vh("heading",n)("open",o.isResourceExpanded(n)),IE(2),lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(os(0,"ul",12),Tw(1,ge,4,3,"li",null,bw),zu()),e&2){let n=Lw(2);IE(),_w(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Rw();os(0,"ds-card",5)(1,"dl",6)(2,"dt"),pC(3,"Name"),zu(),os(4,"dd",7),pC(5),zu(),os(6,"dt"),pC(7,"Description"),zu(),os(8,"dd"),pC(9),zu(),os(10,"dt"),pC(11,"Scope"),zu(),os(12,"dd"),pC(13),zu(),os(14,"dt"),pC(15,"Storage"),zu(),os(16,"dd")(17,"ds-tag",8),pC(18),zu()(),Iw(19,ae,2,2),zu()(),os(20,"ds-card",9),Iw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),zu(),os(26,"ds-card")(27,"ds-disclosure",10),qh("toggled",function(){Pd(n);let r=Lw();return Ld(r.toggleBody())}),Hh(28,"div",11),RC(29,"agentosMarkdown"),zu()(),os(30,"ds-card",9),Iw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),zu();}if(e&2){let n=t,o=Lw();IE(5),lg(n.name),IE(4),lg(n.description),IE(4),lg(n.namespaceId?"Namespace":"Platform"),IE(4),Vh("variant",o.isFilesystemBacked()?"outline":"neutral"),IE(),Yu(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),IE(),ww(o.isFilesystemBacked()?-1:19),IE(),Vh("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),IE(),ww(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),IE(6),Vh("open",!o.bodyCollapsed()),IE(),Vh("innerHTML",kC(29,12,n.body),xD),IE(2),Vh("heading","Resources ("+o.resourcePaths().length+")"),IE(),ww(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Mi(true);hasError=Mi(false);skill=Mi(null);bodyCollapsed=Mi(false);expandedResources=Mi(new Set);resourcePaths=VC(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=VC(()=>this.skill()?.readOnly===true);consumers=Mi([]);consumersUnavailable=Mi(false);consumersLoading=Mi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Gm({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(Zs(()=>Dr([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ew({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return o.back()}),pC(3,"\u2190 Skills"),zu(),Iw(4,Z,2,1,"a",2),Iw(5,ee,2,0,"ds-tag",3),zu(),Iw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),zu()),n&2){let r;IE(4),ww(o.skill()&&!o.isFilesystemBacked()?4:-1),IE(),ww(o.isPlatformMode?5:-1),IE(),ww(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,On],encapsulation:2})};export{X as SkillInspectComponent};
@@ -0,0 +1 @@
1
+ import {g as g$1}from'./chunk-C57t194y.js';import {j as e}from'./chunk-2KFuV5E5.js';import {g,v as we,M as Mi,i as VC,x as U,a as ew,X as Kb,G as Gu,b as pC,d as Wu,I as Iw,c as IE,Y as Yu,$ as dg,w as ww,R as Rw,a0 as RC,U as Uh,Z as Zh,P as Pd,L as Lw,n as Ld,l as lg,a1 as FC,f as Gh}from'./main-EPHSXFSY.js';function R(r,n){if(r&1){let e=Rw();Gu(0,"span",11),pC(1,"Remove it? The bots it created stay."),Wu(),Gu(2,"button",15),Zh("click",function(){Pd(e);let t=Lw(2);return Ld(t.remove())}),pC(3," Remove "),Wu(),Gu(4,"button",13),Zh("click",function(){Pd(e);let t=Lw(2);return Ld(t.confirmingRemove.set(false))}),pC(5,"Cancel"),Wu();}if(r&2){let e=Lw(2);IE(2),Gh("disabled",e.busy());}}function I(r,n){if(r&1){let e=Rw();Gu(0,"button",13),Zh("click",function(){Pd(e);let t=Lw(2);return Ld(t.confirmingRemove.set(true))}),pC(1,"Remove"),Wu();}}function V(r,n){if(r&1){let e=Rw();Gu(0,"div",5)(1,"span",9),pC(2),Wu(),Gu(3,"span",10),pC(4),Wu(),Gu(5,"span",11),pC(6),RC(7,"date"),Wu(),Uh(8,"span",12),Gu(9,"button",13),Zh("click",function(){Pd(e);let t=Lw();return Ld(t.replacing.set(!t.replacing()))}),pC(10,"Replace"),Wu(),Iw(11,R,6,1)(12,I,2,0,"button",14),Wu();}if(r&2){let e=n,o=Lw();IE(2),Yu("@",e.username),IE(2),lg(o.statusLabel(e.status)),IE(2),Yu("since ",FC(7,4,e.createdAt,"mediumDate")),IE(5),ww(o.confirmingRemove()?11:12);}}function z(r,n){if(r&1&&(Gu(0,"ol",6)(1,"li"),pC(2),Wu(),Gu(3,"li"),pC(4,"In BotFather's Mini App, open the bot's settings and turn Bot Management Mode on."),Wu(),Gu(5,"li"),pC(6,"Paste the bot's token below. It is stored encrypted and never shown again."),Wu()()),r&2){let e=Lw();IE(2),Yu("In ",e.platformName,', create a bot with @BotFather (/newbot), for example "AgentOS".');}}function B(r,n){if(r&1){let e=Rw();Gu(0,"form",16),Zh("submit",function(t){Pd(e);let p=Lw();return t.preventDefault(),Ld(p.save())}),Gu(1,"label",17),pC(2,"Bot manager token"),Wu(),Gu(3,"input",18),Zh("input",function(t){Pd(e);let p=Lw();return Ld(p.token.set(t.target.value))}),Wu(),Gu(4,"button",19),pC(5),Wu()();}if(r&2){let e=Lw();IE(3),Gh("value",e.token()),IE(),Gh("disabled",e.busy()||!e.token().trim()),IE(),Yu(" ",e.manager()?"Replace":"Set"," ");}}function L(r,n){r&1&&(Gu(0,"p",8),pC(1),Wu()),r&2&&(IE(),lg(n));}var D=class r{botConfig=g(g$1);destroyRef=g(we);platform="TELEGRAM";platformName=e("TELEGRAM");managers=Mi([]);manager=VC(()=>this.managers().find(n=>n.platform===this.platform)??null);replacing=Mi(false);confirmingRemove=Mi(false);token=Mi("");busy=Mi(false);error=Mi(null);ngOnInit(){this.run(this.botConfig.managers(),n=>this.managers.set(n),"Could not load the bot managers.");}statusLabel(n){return n==="RUNNING"?"Running":n.replace("_"," ").toLowerCase()}save(){let n=this.token().trim();n&&this.run(this.botConfig.setManager(this.platform,n),e=>{this.token.set(""),this.replacing.set(false),this.managers.update(o=>[...o.filter(t=>t.platform!==e.platform),e]);},`${this.platformName} refused this token, or the bot cannot manage other bots yet.`);}remove(){this.confirmingRemove.set(false),this.run(this.botConfig.removeManager(this.platform),()=>this.managers.update(n=>n.filter(e=>e.platform!==this.platform)),"Could not remove the bot manager.");}run(n,e,o){this.error.set(null),this.busy.set(true),n.pipe(U(this.destroyRef)).subscribe({next:t=>{this.busy.set(false),e(t);},error:t=>{console.error("[AdminMessaging]",o,t),this.busy.set(false),this.error.set(t?.error?.message??o);}});}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=ew({type:r,selectors:[["agentos-admin-messaging"]],decls:12,vars:6,consts:[[1,"admin-messaging"],[1,"admin-messaging__title"],[1,"admin-messaging__section"],[1,"admin-messaging__section-title"],[1,"admin-messaging__hint"],[1,"admin-messaging__row"],[1,"admin-messaging__steps"],[1,"admin-messaging__token"],["role","alert",1,"admin-messaging__error"],[1,"admin-messaging__bot"],[1,"admin-messaging__status"],[1,"admin-messaging__note"],[1,"admin-messaging__spacer"],["type","button",1,"admin-messaging__btn",3,"click"],["type","button",1,"admin-messaging__btn"],["type","button",1,"admin-messaging__btn","admin-messaging__btn--danger",3,"click","disabled"],[1,"admin-messaging__token",3,"submit"],["for","admin-messaging-token",1,"admin-messaging__label"],["id","admin-messaging-token","type","password","name","token","autocomplete","off","placeholder","123456789:AA\u2026",1,"admin-messaging__input",3,"input","value"],["type","submit",1,"admin-messaging__btn","admin-messaging__btn--primary",3,"disabled"]],template:function(e,o){if(e&1&&(Gu(0,"div",0)(1,"h1",1),pC(2,"Messaging"),Wu(),Gu(3,"section",2)(4,"h2",3),pC(5),Wu(),Gu(6,"p",4),pC(7),Wu(),Iw(8,V,13,7,"div",5)(9,z,7,1,"ol",6),Iw(10,B,6,3,"form",7),Iw(11,L,2,1,"p",8),Wu()()),e&2){let t,p;IE(5),Yu("",o.platformName," bot manager"),IE(2),dg(" The bot manager creates the ",o.platformName," bots of agents for the admins of their namespace: on an agent's page, Create a bot opens ",o.platformName,", the admin confirms, and the bot answers as the agent. Nobody copies a token. Without a bot manager, an agent can still get a bot created with @BotFather, from its token. "),IE(),ww((t=o.manager())?8:9,t),IE(2),ww(!o.manager()||o.replacing()?10:-1),IE(),ww((p=o.error())?11:-1,p);}},dependencies:[Kb],styles:[".admin-messaging[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.admin-messaging__title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:1.25rem;font-weight:600;color:var(--color-text)}.admin-messaging__hint[_ngcontent-%COMP%], .admin-messaging__note[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-text-secondary)}.admin-messaging__warning[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-warning, #b26a00)}.admin-messaging__error[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-error, #c62828)}.admin-messaging__row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.admin-messaging__spacer[_ngcontent-%COMP%]{flex:1}.admin-messaging__bot[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);font-size:.9375rem;color:var(--color-accent);text-decoration:none}.admin-messaging__bot[_ngcontent-%COMP%]:hover{text-decoration:underline}.admin-messaging__status[_ngcontent-%COMP%]{padding:.1rem .5rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);font-size:.75rem;font-weight:600}.admin-messaging__status--ok[_ngcontent-%COMP%]{border-color:var(--color-success, #2e7d32);color:var(--color-success, #2e7d32)}.admin-messaging__status--off[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.admin-messaging__status--warn[_ngcontent-%COMP%]{border-color:var(--color-warning, #b26a00);color:var(--color-warning, #b26a00)}.admin-messaging__token[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.admin-messaging__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.admin-messaging__input[_ngcontent-%COMP%]{flex:1;min-width:16rem;padding:.4rem .6rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);background:var(--color-bg);color:var(--color-text);font-family:var(--font-mono, monospace);font-size:.875rem}.admin-messaging__btn[_ngcontent-%COMP%]{padding:.4rem .9rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;text-decoration:none;cursor:pointer}.admin-messaging__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.admin-messaging__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.admin-messaging__btn--primary[_ngcontent-%COMP%]{border-color:var(--color-accent);color:var(--color-accent)}.admin-messaging__btn--danger[_ngcontent-%COMP%]{border-color:var(--color-error, #c62828);color:var(--color-error, #c62828)}.admin-messaging__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.admin-messaging__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.admin-messaging__steps[_ngcontent-%COMP%]{margin:0;padding-left:1.25rem;font-size:.875rem;color:var(--color-text);line-height:1.6}"]})};export{D as AdminMessagingComponent};
@@ -0,0 +1 @@
1
+ import {r as k,O,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-2KFuV5E5.js';import {g,W as W$1,F,v as we,ak as U$1,a3 as vr,M as Mi,a5 as Ys,ag as Gm,a6 as Zs,ae as Dr,x as U$2,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-EPHSXFSY.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let t=Lw();IE(),lg(t.deletion.error());}}function z(n,e){n&1&&(os(0,"p",4),pC(1,"Loading agent configs\u2026"),zu());}function G(n,e){n&1&&(os(0,"p",5),pC(1,"No agent configs available."),zu());}function Q(n,e){n&1&&(os(0,"p",4),pC(1,"No agent configs match the current filter."),zu());}function W(n,e){n&1&&(os(0,"ds-tag",18),pC(1,"Read-only"),zu());}function X(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw(2).$implicit,d=Lw(2);return Ld(d.launch(s))}),pC(1," Launch "),zu();}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw(2).$implicit,d=Lw(2);return Ld(d.edit(s))}),pC(1," Edit "),zu();}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw().$implicit,d=Lw(2);return Ld(d.inspect(s))}),pC(1," Inspect "),zu(),Iw(2,X,2,1,"button",23),Iw(3,Y,2,1,"button",23);}if(n&2){let t=Lw().$implicit,i=Lw(2);Bh("aria-label","Inspect "+t.config.name),IE(2),ww(i.canLaunch(t)?2:-1),IE(),ww(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Rw();os(0,"agentos-row-delete-action",24),qh("deleteRequested",function(){Pd(t);let s=Lw().$implicit,d=Lw(2);return Ld(d.deletion.request(s.key))})("deleteConfirmed",function(){Pd(t);let s=Lw().$implicit,d=Lw(2);return Ld(d.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Lw(3);return Ld(s.deletion.cancel())}),zu();}if(n&2){let t=Lw().$implicit,i=Lw(2);Vh("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14),pC(6),zu(),os(7,"td",15)(8,"div",16)(9,"ds-tag",17),pC(10),zu(),Iw(11,W,2,0,"ds-tag",18),zu()(),os(12,"td",19)(13,"div",20),Iw(14,Z,4,3),Iw(15,ee,1,3,"agentos-row-delete-action",21),zu()()()),n&2){let t=e.$implicit,i=Lw(2);IE(2),lg(t.config.name),IE(2),Yu(" ",t.config.description||"\u2014"," "),IE(2),lg(i.mode(t)),IE(3),Vh("variant",t.scope==="platform"?"neutral":"accent"),IE(),lg(t.scope==="platform"?"Platform":"Namespace"),IE(),ww(t.scope==="platform"?11:-1),IE(3),ww(i.deletion.confirmingId()!==t.key?14:-1),IE(),ww(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Description"),zu(),os(8,"th",10),pC(9,"Execution mode"),zu(),os(10,"th",10),pC(11,"Scope"),zu(),os(12,"th",10)(13,"span",11),pC(14,"Actions"),zu()()()(),os(15,"tbody",8),Tw(16,te,16,8,"tr",9,J),zu()()()),n&2){let t=Lw();IE(16),_w(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(we);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();rows=Mi([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),Gm({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(Zs(()=>Dr([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(d){return i.rowFilter.query.set(d)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),pC(3,"New agent config"),zu()(),Iw(4,U,2,1,"p",3),Iw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(IE(),Vh("query",i.rowFilter.query()),IE(3),ww(i.deletion.error()?4:-1),IE(),ww(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-CL0y_n4N.js';import {g,W,v as we,M as Mi,x as U,a as ew,o as os,H as Hh,I as Iw,z as zu,c as IE,w as ww,b as pC,L as Lw,l as lg}from'./main-EPHSXFSY.js';import {v as vn,d as yn,l as dn,_ as _n,m as mn,A as Ao}from'./chunk-2KFuV5E5.js';import'./chunk-BMbtNfWQ.js';function O(r,e){r&1&&(os(0,"p",1),pC(1,"Loading integration\u2026"),zu());}function T(r,e){r&1&&(os(0,"ds-notice"),pC(1,"Failed to load this integration configuration."),zu());}function L(r,e){r&1&&(os(0,"div",3)(1,"ds-tag",9),pC(2,"YAML"),zu(),os(3,"ds-tag",10),pC(4,"Read-only"),zu()());}function k(r,e){if(r&1&&(os(0,"ds-card",2),Iw(1,L,5,0,"div",3),os(2,"dl",4)(3,"dt"),pC(4,"Name"),zu(),os(5,"dd"),pC(6),zu(),os(7,"dt"),pC(8,"Type"),zu(),os(9,"dd",5),pC(10),zu(),os(11,"dt"),pC(12,"Description"),zu(),os(13,"dd"),pC(14),zu(),os(15,"dt"),pC(16,"Scope"),zu(),os(17,"dd"),pC(18),zu(),os(19,"dt"),pC(20,"Source"),zu(),os(21,"dd"),pC(22),zu(),os(23,"dt"),pC(24,"Auto grant"),zu(),os(25,"dd"),pC(26),zu(),os(27,"dt"),pC(28,"Auth setting"),zu(),os(29,"dd"),pC(30),zu()()(),os(31,"ds-card",6)(32,"p",7),pC(33,"Sensitive values are always redacted."),zu(),os(34,"pre",8),pC(35),zu()()),r&2){let o=e,a=Lw();IE(),ww(a.source()==="FILESYSTEM"?1:-1),IE(5),lg(o.name),IE(4),lg(o.integrationType),IE(4),lg(o.description||"\u2014"),IE(4),lg(a.scopeOf(o)),IE(4),lg(a.source()),IE(4),lg(o.autoGrant?"Enabled":"Disabled"),IE(4),lg(o.authSettingName||"None"),IE(5),lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Mi(true);hasError=Mi(false);config=Mi(null);source=Mi("NEO4J");parameters=Mi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=ew({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(os(0,"ds-page"),Hh(1,"ds-section-header",0),Iw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),zu()),o&2){let m;IE(2),ww(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -0,0 +1 @@
1
+ import {x as m,p as pt,W as Wt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,N as Nn,R as Rn,E as Ea,z as yo,B as bo,v as vn,d as yn,e as fn,n as pn,h as hn,_ as _n,i as at,u as un}from'./chunk-2KFuV5E5.js';import {g,W,F,v as we,ak as U,M as Mi,x as U$1,a6 as Zs,ae as Dr,E as x,C as w,a as ew,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,Y as Yu,w as ww,R as Rw,H as Hh,N as lI,T as Tw,aq as Cw,L as Lw,Q as fI,l as lg,_ as _w,h as Bh,P as Pd,n as Ld}from'./main-EPHSXFSY.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function fe(o,t){if(o&1&&(os(0,"ds-form-field",20),Hh(1,"input",22),zu()),o&2){let e=Lw(3);IE(),Vh("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(os(0,"option",24),pC(1),zu()),o&2){let e=t.$implicit;Vh("ngValue",e.id),IE(),lg(e.name);}}function Ce(o,t){if(o&1&&(os(0,"ds-form-field",21)(1,"select",23)(2,"option",24),pC(3,"\u2014 None \u2014"),zu(),Tw(4,ge,2,2,"option",24,ce),zu(),lI(),zu()),o&2){let e=Lw(3);IE(),Vh("formControl",e.agentConfigIdControl),fI(),IE(),Vh("ngValue",null),IE(2),_w(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Iw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=Lw(2);ww(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(os(0,"p",2),pC(1,"No parameters defined."),zu());}function he(o,t){if(o&1){let e=Rw();os(0,"div",11)(1,"div",25)(2,"ds-form-field",26),Hh(3,"input",27),lI(),zu(),os(4,"ds-form-field",28),Hh(5,"input",29),lI(),zu(),os(6,"ds-form-field",30),Hh(7,"input",31),lI(),zu()(),os(8,"button",32),qh("click",function(){let d=Pd(e).$index,m=Lw(2);return Ld(m.removeParameter(d))}),pC(9," \xD7 "),zu()();}if(o&2){let e=t.$implicit,r=t.$index;Vh("formGroupName",r),IE(2),Vh("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),IE(),Vh("id","param-name-"+r),fI(),IE(),Vh("controlId","param-desc-"+r),IE(),Vh("id","param-desc-"+r),fI(),IE(),Vh("controlId","param-default-"+r),IE(),Vh("id","param-default-"+r),fI();}}function _e(o,t){if(o&1){let e=Rw();os(0,"div",14)(1,"span",33),pC(2),zu(),os(3,"ds-form-field",34),Hh(4,"textarea",35),lI(),zu(),os(5,"button",36),qh("click",function(){let d=Pd(e).$index,m=Lw(2);return Ld(m.removeContentEntry(d))}),pC(6," \xD7 "),zu()();}if(o&2){let e=t.$implicit,r=t.$index,d=Lw(2);IE(2),lg(r+1),IE(),Vh("error",e.invalid&&e.touched?"Content entry must not be blank.":null),IE(),Vh("formControlName",r),Bh("aria-label","Content entry "+(r+1)),fI(),IE(),Vh("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(os(0,"ds-notice"),pC(1),zu()),o&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function be(o,t){if(o&1){let e=Rw();os(0,"button",37),qh("click",function(){Pd(e);let d=Lw(2);return Ld(d.exportYaml())}),pC(1),zu();}if(o&2){let e=Lw(2);Vh("disabled",e.isExporting()),IE(),Yu(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let d=Lw();return Ld(d.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"input",8),lI(),zu(),Iw(5,ye,2,1),os(6,"ds-fieldset",9)(7,"p",2),pC(8," Each parameter must have a name and a default value. Use "),os(9,"code"),pC(10),zu(),pC(11," in content entries to reference them. "),zu(),os(12,"div",10),Iw(13,ve,2,0,"p",2),Tw(14,he,10,8,"div",11,Cw),os(16,"div")(17,"button",12),qh("click",function(){Pd(e);let d=Lw();return Ld(d.addParameter())}),pC(18,"+ Add parameter"),zu()()()(),os(19,"ds-fieldset",13)(20,"p",2),pC(21," Each content entry is a command. Use "),os(22,"code"),pC(23,"@AgentName"),zu(),pC(24," to target an agent, "),os(25,"code"),pC(26,"/promptName param1 param2"),zu(),pC(27," to call another prompt, and "),os(28,"code"),pC(29),zu(),pC(30," for parameter placeholders. "),zu(),os(31,"div",10),Tw(32,_e,7,5,"div",14,Cw),os(34,"div")(35,"button",12),qh("click",function(){Pd(e);let d=Lw();return Ld(d.addContentEntry())}),pC(36,"+ Add content entry"),zu()()()(),Iw(37,xe,2,1,"ds-notice"),os(38,"ds-form-field",15),Hh(39,"textarea",16),lI(),zu(),os(40,"ds-form-actions")(41,"button",17),pC(42),zu(),Iw(43,be,2,2,"button",18),os(44,"button",19),qh("click",function(){Pd(e);let d=Lw();return Ld(d.cancel())}),pC(45,"Cancel"),zu()()();}if(o&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(),ww(e.availableAgentConfigs().length>0?5:-1),IE(5),lg(e.paramPlaceholderSyntax),IE(2),Vh("formArrayName","parameters"),IE(),ww(e.parametersArray.length===0?13:-1),IE(),_w(e.parametersArray.controls),IE(15),lg(e.paramPlaceholderSyntax),IE(2),Vh("formArrayName","content"),IE(),_w(e.contentArray.controls),IE(5),ww(e.errorMessage()?37:-1),IE(),Vh("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),IE(),Vh("formControl",e.externalMetadataJsonControl),fI(),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create"," "),IE(),ww(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(we);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Wt([this.createContentControl()],{validators:[bn.required]}),parameters:new Wt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);isExporting=Mi(false);errorMessage=Mi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Mi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),Zs(()=>Dr([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),Zs(()=>Dr([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[bn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=ew({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value",3,"controlId"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return r.cancel()}),pC(3),zu()(),Iw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),zu()),e&2&&(IE(),Vh("title",r.isEditMode()?"Edit prompt":"New prompt"),IE(2),Yu(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),IE(),ww(r.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Nn,Rn,Ea,yo,bo,vn,yn,fn,pn,hn,_n,at,un],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
@@ -0,0 +1,2 @@
1
+ import {g,V,A as A$1,p as pe$1,W as W$1,e as ee$1,B,a as ew,o as os,H as Hh,I as Iw,b as pC,z as zu,c as IE,w as ww,r as rg,G as Gu,Z as Zh,d as Wu,U as Uh,f as Gh,h as Bh,M as Mi,i as VC,T as Tw,_ as _w,j as f,l as lg,k as TC,F,s as sf,m as go,Y as Yu,L as Lw,R as Rw,P as Pd,n as Ld,O as Op,q as nC,t as ng}from'./main-EPHSXFSY.js';function ne(t,n){if(t&1&&(Gu(0,"p",7),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.state.error());}}var K=class t{state=g(V);onInput(n){this.state.email.set(n.target.value);}submit(n){n.preventDefault(),this.state.submitEmail();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["app-email-step"]],decls:16,vars:4,consts:[["novalidate","",1,"step",3,"submit"],[1,"step__title"],[1,"step__lead"],[1,"field"],[1,"field__label"],["type","email","name","email","autocomplete","email","placeholder","you@company.com","data-testid","email-input",1,"field__input",3,"input","value"],[1,"field__hint"],["role","alert",1,"step__error"],[1,"step__actions"],["type","submit","data-testid","email-next",1,"btn","btn--primary",3,"disabled"]],template:function(e,o){e&1&&(Gu(0,"form",0),Zh("submit",function(c){return o.submit(c)}),Gu(1,"h2",1),pC(2,"What is your email?"),Wu(),Gu(3,"p",2),pC(4," It identifies you in Coday and makes you the administrator of this installation. Nothing is sent anywhere: it stays on this machine. "),Wu(),Gu(5,"label",3)(6,"span",4),pC(7,"Email"),Wu(),Gu(8,"input",5),Zh("input",function(c){return o.onInput(c)}),Wu(),Gu(9,"span",6),pC(10,"We are already downloading AgentOS in the background while you answer."),Wu()(),Iw(11,ne,2,1,"p",7),Gu(12,"div",8),Uh(13,"span"),Gu(14,"button",9),pC(15," Continue "),Wu()()()),e&2&&(IE(8),Gh("value",o.state.email()),Bh("aria-invalid",o.state.email()&&!o.state.emailValid()?"true":null),IE(3),ww(o.state.error()?11:-1),IE(3),Gh("disabled",!o.state.emailValid()||o.state.busy()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}"]})};var oe=()=>[],re=(t,n)=>n.path;function ie(t,n){t&1&&(Gu(0,"span",21),pC(1,"link"),Wu());}function ae(t,n){if(t&1){let e=Rw();Gu(0,"li")(1,"button",18),Zh("click",function(){let d=Pd(e).$implicit,c=Lw();return Ld(c.navigate(d.path))}),Gu(2,"span",19),pC(3,"\u{1F4C1}"),Wu(),Gu(4,"span",20),pC(5),Wu(),Iw(6,ie,2,0,"span",21),Wu()();}if(t&2){let e=n.$implicit;IE(5),lg(e.name),IE(),ww(e.symlink?6:-1);}}function le(t,n){t&1&&(Gu(0,"li",22),pC(1,"No sub-folders here."),Wu());}function de(t,n){if(t&1&&Iw(0,le,2,0,"li",22),t&2){let e=Lw();ww(e.loading()?-1:0);}}function se(t,n){if(t&1){let e=Rw();Gu(0,"form",23),Zh("submit",function(d){Pd(e);let c=Lw();return Ld(c.create(d))}),Gu(1,"input",24),Zh("input",function(d){Pd(e);let c=Lw();return Ld(c.onName(d))}),Wu(),Gu(2,"button",25),pC(3,"Create"),Wu(),Gu(4,"button",16),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.creating.set(false))}),pC(5,"Cancel"),Wu()();}if(t&2){let e=Lw();IE(),Gh("value",e.newName()),IE(),Gh("disabled",!e.newName().trim());}}function ce(t,n){if(t&1&&(Gu(0,"span"),pC(1),Wu()),t&2){let e=Lw(2);IE(),Yu("(",e.listing()?.hiddenCount,")");}}function pe(t,n){if(t&1){let e=Rw();Gu(0,"button",26),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.startCreate())}),pC(1," + New folder "),Wu(),Gu(2,"label",27)(3,"input",28),Zh("change",function(){Pd(e);let d=Lw();return Ld(d.toggleHidden())}),Wu(),pC(4," Show hidden "),Iw(5,ce,2,1,"span"),Wu();}if(t&2){let e=Lw();IE(3),Gh("checked",e.showHidden()),IE(2),ww(e.listing()?.hiddenCount?5:-1);}}function me(t,n){if(t&1&&(Gu(0,"p",14),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.browseError());}}function _e(t,n){if(t&1&&(Gu(0,"p",14),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.state.error());}}var $=class t{state=g(V);listing=Mi(null);loading=Mi(false);browseError=Mi(null);showHidden=Mi(false);creating=Mi(false);newName=Mi("");ngOnInit(){this.open(this.parentOfSelection());}parentOfSelection(){let n=this.state.folder(),e=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));return e>0?n.slice(0,e):void 0}navigate(n){return this.open(n,true)}open(n,e=false){return B(this,null,function*(){this.loading.set(true),this.browseError.set(null);try{let o=yield this.state.browse(n,this.showHidden());this.listing.set(o),e&&this.state.selectFolder(o.path);}catch(o){if(e){this.browseError.set(f(o,"Cannot open this folder."));return}if(n)return this.open(void 0);this.browseError.set(f(o,"Cannot list this folder."));}finally{this.loading.set(false);}})}toggleHidden(){this.showHidden.update(n=>!n),this.open(this.listing()?.path);}startCreate(){this.creating.set(true),this.newName.set("");}onName(n){this.newName.set(n.target.value);}create(n){return B(this,null,function*(){n.preventDefault();let e=this.listing()?.path,o=this.newName().trim();if(!(!e||!o))try{let d=yield this.state.mkdir(e,o);this.creating.set(!1),this.state.selectFolder(d.path),yield this.open(d.path,!0);}catch(d){this.browseError.set(f(d,"Could not create this folder."));}})}submit(){this.state.submitFolderAndApply();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["app-folder-step"]],decls:32,vars:11,consts:[[1,"step"],[1,"step__title"],[1,"step__lead"],["data-testid","selected-folder",1,"selected"],[1,"selected__label"],[1,"selected__path"],[1,"browser"],[1,"browser__bar"],["type","button","aria-label","Parent folder",1,"browser__icon",3,"click","disabled"],["type","button","aria-label","Home folder",1,"browser__icon",3,"click"],[1,"browser__path",3,"title"],["role","list",1,"browser__list"],[1,"browser__footer"],[1,"browser__new"],["role","alert",1,"step__error"],[1,"step__actions"],["type","button",1,"btn","btn--ghost",3,"click"],["type","button","data-testid","folder-next",1,"btn","btn--primary",3,"click","disabled"],["type","button",1,"entry",3,"click"],["aria-hidden","true"],[1,"entry__name"],[1,"entry__tag"],[1,"browser__empty"],[1,"browser__new",3,"submit"],["type","text","placeholder","New folder name","aria-label","New folder name","data-testid","new-folder-name",1,"field__input",3,"input","value"],["type","submit",1,"btn",3,"disabled"],["type","button","data-testid","new-folder",1,"btn","btn--ghost",3,"click"],[1,"browser__hidden"],["type","checkbox",3,"change","checked"]],template:function(e,o){e&1&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Where should Coday keep your files?"),Wu(),Gu(3,"p",2),pC(4," The agent reads and writes the files of your personal workspace in this folder. The default is fine for most people; it is created if it does not exist. To choose another one, open it below. "),Wu(),Gu(5,"div",3)(6,"span",4),pC(7,"Selected folder"),Wu(),Gu(8,"code",5),pC(9),Wu()(),Gu(10,"div",6)(11,"div",7)(12,"button",8),Zh("click",function(){return o.navigate(o.listing()?.parent??void 0)}),pC(13," \u2191 "),Wu(),Gu(14,"button",9),Zh("click",function(){return o.navigate(o.listing()?.home)}),pC(15," \u2302 "),Wu(),Gu(16,"code",10),pC(17),Wu()(),Gu(18,"ul",11),Tw(19,ae,7,2,"li",null,re,false,de,1,1),Wu(),Gu(22,"div",12),Iw(23,se,6,2,"form",13)(24,pe,6,2),Wu()(),Iw(25,me,2,1,"p",14),Iw(26,_e,2,1,"p",14),Gu(27,"div",15)(28,"button",16),Zh("click",function(){return o.state.back()}),pC(29,"Back"),Wu(),Gu(30,"button",17),Zh("click",function(){return o.submit()}),pC(31," Set everything up "),Wu()()()),e&2&&(IE(9),lg(o.state.folder()),IE(3),Gh("disabled",!o.listing()?.parent),IE(4),Gh("title",o.listing()?.path??""),IE(),lg(o.listing()?.path),IE(),Bh("aria-busy",o.loading()),IE(),_w(o.listing()?.entries??TC(10,oe)),IE(4),ww(o.creating()?23:24),IE(2),ww(o.browseError()?25:-1),IE(),ww(o.state.error()?26:-1),IE(4),Gh("disabled",!o.state.folderValid()||o.state.busy()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".selected[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--color-primary) 8%,transparent)}.selected__label[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-secondary)}.selected__path[_ngcontent-%COMP%]{font-size:14px;word-break:break-all}.browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid var(--color-border);border-radius:14px;overflow:hidden}.browser__bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px;background:var(--color-surface-muted);border-bottom:1px solid var(--color-border)}.browser__icon[_ngcontent-%COMP%]{flex:none;width:32px;height:32px;font:inherit;color:var(--color-text);background:var(--color-bg-hover);border:none;border-radius:8px;cursor:pointer}.browser__icon[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:default}.browser__path[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.browser__list[_ngcontent-%COMP%]{margin:0;padding:4px;max-height:220px;overflow-y:auto;list-style:none}.browser__empty[_ngcontent-%COMP%]{padding:18px;text-align:center;font-size:13px;color:var(--color-text-tertiary)}.browser__footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-top:1px solid var(--color-border)}.browser__new[_ngcontent-%COMP%]{display:flex;flex:1;gap:8px}.browser__new[_ngcontent-%COMP%] .field__input[_ngcontent-%COMP%]{padding:8px 12px}.browser__hidden[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--color-text-secondary)}.entry[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;font:inherit;color:var(--color-text);text-align:left;background:transparent;border:none;border-radius:8px;cursor:pointer}.entry[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.entry[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary)}.entry__name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entry__tag[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-tertiary)}"]})};var ge=(t,n)=>n.key;function ue(t,n){if(t&1){let e=Rw();Gu(0,"div",1)(1,"div",2),pC(2,"\u2713"),Wu(),Gu(3,"h2",3),pC(4,"You are all set"),Wu(),Gu(5,"p",4),pC(6,"Your workspace is ready and the Coday agent is waiting for you."),Wu(),Gu(7,"button",5),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.start())}),pC(8," Start with Coday "),Wu()();}}function xe(t,n){t&1&&(Gu(0,"h2",11),pC(1,"Starting Coday"),Wu(),Gu(2,"p",4),pC(3,"Just a moment, you will land in the app by yourself."),Wu());}function be(t,n){t&1&&(Gu(0,"h2",3),pC(1,"Setting things up"),Wu(),Gu(2,"p",4),pC(3,"This only happens once. You can keep this page open."),Wu());}function fe(t,n){t&1&&Uh(0,"span",14);}function ye(t,n){if(t&1&&pC(0),t&2){let e=Lw().$implicit,o=Lw(2);Yu(" ",o.icon(e.state)," ");}}function ve(t,n){if(t&1&&(Gu(0,"span",18),Uh(1,"span",19),Wu(),Gu(2,"span",17),pC(3),Wu()),t&2){let e=Lw().$implicit;Bh("aria-valuenow",e.percent??0),IE(),ng("width",e.percent??0,"%"),IE(2),Yu("",e.percent??0,"%");}}function Ce(t,n){if(t&1&&(Gu(0,"span",17),pC(1),Wu()),t&2){let e=Lw().$implicit;IE(),lg(e.message);}}function he(t,n){if(t&1&&(Gu(0,"li",12)(1,"span",13),Iw(2,fe,1,0,"span",14)(3,ye,1,1),Wu(),Gu(4,"span",15)(5,"span",16),pC(6),Wu(),Iw(7,ve,4,4)(8,Ce,2,1,"span",17),Wu()()),t&2){let e=n.$implicit;nC("item item--"+e.state),Bh("data-testid","step-"+e.key)("data-state",e.state),IE(2),ww(e.state==="running"?2:3),IE(4),lg(e.label),IE(),ww(e.key==="download"&&e.state==="running"?7:e.message?8:-1);}}function Ee(t,n){if(t&1&&(Gu(0,"div",8)(1,"strong"),pC(2,"Java 25 is required."),Wu(),Gu(3,"span"),pC(4),Wu(),Gu(5,"span"),pC(6,"Install it, then come back: this page continues by itself."),Wu()()),t&2){let e=Lw(2);IE(4),lg(e.javaHint());}}function Pe(t,n){if(t&1){let e=Rw();Gu(0,"div",9)(1,"strong"),pC(2,"Something went wrong."),Wu(),Gu(3,"span"),pC(4),Wu(),Gu(5,"span"),pC(6,"Fix your answers and run the setup again, or retry as is."),Wu(),Gu(7,"div",20)(8,"button",21),Zh("click",function(){Pd(e);let d=Lw(2);return Ld(d.state.editAfterFailure("providers"))}),pC(9," Change the API keys "),Wu(),Gu(10,"button",22),Zh("click",function(){Pd(e);let d=Lw(2);return Ld(d.state.editAfterFailure("folder"))}),pC(11," Change the folder "),Wu(),Gu(12,"button",23),Zh("click",function(){Pd(e);let d=Lw(2);return Ld(d.retry())}),pC(13," Try again "),Wu()()();}if(t&2){let e=Lw(2);IE(4),lg(e.applyError()),IE(4),Gh("disabled",e.state.busy()),IE(2),Gh("disabled",e.state.busy()),IE(2),Gh("disabled",e.state.busy());}}function we(t,n){if(t&1&&(Gu(0,"p",10),pC(1),Wu()),t&2){let e=Lw(2);IE(),lg(e.state.statusError());}}function Me(t,n){if(t&1&&(Iw(0,xe,4,0)(1,be,4,0),Gu(2,"ul",6),Tw(3,he,9,7,"li",7,ge),Wu(),Iw(5,Ee,7,1,"div",8),Iw(6,Pe,14,4,"div",9),Iw(7,we,2,1,"p",10)),t&2){let e=Lw();ww(e.loading()?0:1),IE(3),_w(e.items()),IE(2),ww(e.state.javaBlocked()?5:-1),IE(),ww(!e.loading()&&e.state.failed()?6:-1),IE(),ww(e.state.statusError()?7:-1);}}var Se={pending:"\u25CB",running:"",done:"\u2713",error:"!",blocked:"!"},j=class t{state=g(V);router=g(F);icon=n=>Se[n];javaHint=VC(()=>this.state.status()?.steps.java.hint??"");applyError=VC(()=>this.state.status()?.apply.error??null);loading=VC(()=>this.state.mode()==="loading");items=VC(()=>this.loading()?this.state.loadingChecklist():this.state.checklist());leaving=false;constructor(){sf(()=>{!this.loading()||!this.state.loadingReady()||this.state.preview()||go(()=>{this.leaveToPersonalNamespace();});});}start(){let n=this.state.landingCommands();n&&this.leave(n);}leaveToPersonalNamespace(){return B(this,null,function*(){this.leaving||(this.leaving=true,this.state.stopPolling(),this.leave(yield this.state.loadingTarget()));})}leave(n){this.state.stopPolling(),this.router.navigate([n.path],{queryParams:n.queryParams});}retry(){this.state.retry();}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["app-progress-step"]],decls:3,vars:1,consts:[[1,"step"],["data-testid","ready",1,"ready"],["aria-hidden","true",1,"ready__badge"],[1,"step__title"],[1,"step__lead"],["type","button","data-testid","start-with-coday",1,"btn","btn--primary","btn--big",3,"click"],["role","list","data-testid","checklist",1,"checklist"],[1,"item",3,"class"],["role","alert","data-testid","java-hint",1,"callout"],["role","alert","data-testid","apply-error",1,"callout","callout--error"],["role","status",1,"step__error"],["data-testid","loading-title",1,"step__title"],[1,"item"],["aria-hidden","true",1,"item__icon"],[1,"spinner"],[1,"item__body"],[1,"item__label"],[1,"item__note"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"bar"],[1,"bar__fill"],[1,"callout__actions"],["type","button","data-testid","edit-providers",1,"btn",3,"click","disabled"],["type","button","data-testid","edit-folder",1,"btn",3,"click","disabled"],["type","button","data-testid","retry",1,"btn","btn--ghost",3,"click","disabled"]],template:function(e,o){e&1&&(Gu(0,"section",0),Iw(1,ue,9,0,"div",1)(2,Me,8,4),Wu()),e&2&&(IE(),ww(!o.loading()&&o.state.ready()?1:2));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".checklist[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;padding:10px 12px;border-radius:12px;color:var(--color-text-tertiary);transition:color .2s,background .2s}.item--running[_ngcontent-%COMP%]{color:var(--color-text);background:color-mix(in srgb,var(--color-primary) 8%,transparent)}.item--done[_ngcontent-%COMP%]{color:var(--color-text)}.item--error[_ngcontent-%COMP%], .item--blocked[_ngcontent-%COMP%]{color:var(--color-text);background:color-mix(in srgb,var(--color-warning) 12%,transparent)}.item--error[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-error) 12%,transparent)}.item__icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:none;width:22px;height:22px;font-size:13px;font-weight:700;border-radius:50%;border:1.5px solid currentColor}.item--done[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-success);border-color:var(--color-success)}.item--error[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-error);border-color:var(--color-error)}.item--blocked[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-warning);border-color:var(--color-warning)}.item--running[_ngcontent-%COMP%] .item__icon[_ngcontent-%COMP%]{border-color:transparent}.item__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}.item__label[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:22px;font-size:14px;font-weight:540;line-height:1.3}.item__note[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-secondary);word-break:break-word}.spinner[_ngcontent-%COMP%]{width:18px;height:18px;border-radius:50%;border:2px solid color-mix(in srgb,var(--color-primary) 25%,transparent);border-top-color:var(--color-primary);animation:_ngcontent-%COMP%_spin .8s linear infinite}.bar[_ngcontent-%COMP%]{display:block;height:6px;border-radius:999px;overflow:hidden;background:var(--color-border)}.bar__fill[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--color-primary),var(--color-accent));transition:width .4s ease}.callout[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 16px;border-radius:12px;font-size:13px;line-height:1.5;background:color-mix(in srgb,var(--color-warning) 14%,transparent)}.callout[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .callout[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{word-break:break-word}.callout--error[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-error) 12%,transparent)}.callout__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}.ready[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:16px;padding:24px 0;text-align:center;animation:_ngcontent-%COMP%_pop .42s cubic-bezier(.2,.9,.3,1.2) both}.ready__badge[_ngcontent-%COMP%]{display:grid;place-items:center;width:64px;height:64px;font-size:32px;color:var(--color-text-inverse);border-radius:50%;background:var(--color-success);box-shadow:0 8px 24px color-mix(in srgb,var(--color-success) 40%,transparent)}@media(prefers-reduced-motion:reduce){.spinner[_ngcontent-%COMP%]{animation-duration:2.4s}.ready[_ngcontent-%COMP%]{animation:none}.bar__fill[_ngcontent-%COMP%]{transition:none}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_pop{0%{opacity:0;transform:scale(.92)}}"]})};var Oe=(t,n)=>n.draft.id;function ke(t,n){if(t&1){let e=Rw();Gu(0,"span",17)(1,"button",18),Zh("click",function(){Pd(e);let d=Lw(2).$implicit,c=Lw();return Ld(c.state.moveProvider(d.draft.id,-1))}),pC(2," \u2191 "),Wu(),Gu(3,"button",19),Zh("click",function(){Pd(e);let d=Lw(2).$implicit,c=Lw();return Ld(c.state.moveProvider(d.draft.id,1))}),pC(4," \u2193 "),Wu()();}if(t&2){let e=Lw(2).$implicit,o=Lw();IE(),Gh("disabled",e.rank===1),IE(2),Gh("disabled",e.rank===o.enabledCount());}}function Te(t,n){if(t&1&&(Gu(0,"span",16),pC(1),Wu(),Iw(2,ke,5,2,"span",17)),t&2){let e=Lw().$implicit,o=Lw();Bh("aria-label","Rank "+e.rank),IE(),Yu("#",e.rank),IE(),ww(o.enabledCount()>1?2:-1);}}function Ie(t,n){if(t&1){let e=Rw();Gu(0,"label",15)(1,"span",20),pC(2,"API key"),Wu(),Gu(3,"input",21),Zh("input",function(d){Pd(e);let c=Lw().$implicit,h=Lw();return Ld(h.onKey(c.draft.id,d))})("keydown",function(d){Pd(e);let c=Lw().$implicit,h=Lw();return Ld(h.onCardKeydown(c.draft.id,d))}),Wu(),Gu(4,"span",22),pC(5," Stored on this machine only. "),Gu(6,"a",23),pC(7,"Get a key"),Wu()()();}if(t&2){let e=Lw().$implicit,o=Lw();IE(3),Gh("value",e.draft.apiKey),Bh("data-testid","provider-key-"+e.draft.id)("aria-invalid",o.keyTooShort(e.draft.id)?"true":null),IE(3),Gh("href",e.info.keyUrl,Op);}}function De(t,n){if(t&1){let e=Rw();Gu(0,"li",9),Zh("dragstart",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onDragStart(c.draft.id,d))})("dragover",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onDragOver(c.draft.id,d))})("drop",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onDrop(c.draft.id,d))})("dragend",function(){Pd(e);let d=Lw();return Ld(d.onDragEnd())}),Gu(1,"div",10)(2,"label",11)(3,"input",12),Zh("change",function(){let d=Pd(e).$implicit,c=Lw();return Ld(c.state.toggleProvider(d.draft.id))})("keydown",function(d){let c=Pd(e).$implicit,h=Lw();return Ld(h.onCardKeydown(c.draft.id,d))}),Wu(),Gu(4,"span",13),pC(5),Wu()(),Iw(6,Te,3,3),Wu(),Gu(7,"p",14),pC(8),Wu(),Iw(9,Ie,8,4,"label",15),Wu();}if(t&2){let e=n.$implicit,o=Lw();rg("card--on",e.draft.enabled)("card--dragging",o.dragging()===e.draft.id)("card--over",o.dragOver()===e.draft.id&&o.dragging()!==e.draft.id),Bh("draggable",e.draft.enabled&&o.enabledCount()>1?"true":null)("data-testid","provider-"+e.draft.id),IE(3),Gh("checked",e.draft.enabled),Bh("data-testid","provider-toggle-"+e.draft.id),IE(2),lg(e.info.label),IE(),ww(e.rank!==null?6:-1),IE(2),lg(e.info.description),IE(),ww(e.draft.enabled?9:-1);}}function Fe(t,n){if(t&1&&(Gu(0,"p",5),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.state.error());}}function Ve(t,n){if(t&1){let e=Rw();Gu(0,"button",24),Zh("click",function(){Pd(e);let d=Lw();return Ld(d.state.back())}),pC(1,"Back"),Wu();}}var ee=[{id:"anthropic",label:"Anthropic",description:"Claude models, directly from Anthropic.",keyUrl:"https://console.anthropic.com/settings/keys"},{id:"openai",label:"OpenAI",description:"GPT models, directly from OpenAI.",keyUrl:"https://platform.openai.com/api-keys"},{id:"requesty",label:"Requesty",description:"Requires Requesty policies named claude-fable, claude-opus, claude-sonnet and claude-haiku configured in your account.",keyUrl:"https://app.requesty.ai/api-keys"}],W=class t{state=g(V);dragging=Mi(null);dragOver=Mi(null);info=VC(()=>this.state.status()?.providers??ee);cards=VC(()=>this.state.providers().map(n=>({draft:n,info:this.info().find(e=>e.id===n.id)??ee.find(e=>e.id===n.id),rank:this.state.rankOf(n.id)})));enabledCount=VC(()=>this.state.enabledProviders().length);onKey(n,e){this.state.setApiKey(n,e.target.value);}keyTooShort(n){let e=this.state.providers().find(o=>o.id===n);return !!e&&e.enabled&&e.apiKey.length>0&&e.apiKey.trim().length<8}onDragStart(n,e){this.dragging.set(n),e.dataTransfer?.setData("text/plain",n),e.dataTransfer&&(e.dataTransfer.effectAllowed="move");}onDragOver(n,e){!this.dragging()||this.state.rankOf(n)===null||(e.preventDefault(),this.dragOver.set(n));}onDrop(n,e){e.preventDefault();let o=this.dragging();o&&this.state.moveProviderTo(o,n),this.onDragEnd();}onDragEnd(){this.dragging.set(null),this.dragOver.set(null);}onCardKeydown(n,e){e.altKey&&(e.key==="ArrowUp"?(e.preventDefault(),this.state.moveProvider(n,-1)):e.key==="ArrowDown"&&(e.preventDefault(),this.state.moveProvider(n,1)));}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["app-providers-step"]],decls:13,vars:3,consts:[[1,"step"],[1,"step__title"],[1,"step__lead"],["role","list",1,"cards"],[1,"card",3,"card--on","card--dragging","card--over"],["role","alert",1,"step__error"],[1,"step__actions"],["type","button",1,"btn","btn--ghost"],["type","button","data-testid","providers-next",1,"btn","btn--primary",3,"click","disabled"],[1,"card",3,"dragstart","dragover","drop","dragend"],[1,"card__head"],[1,"card__toggle"],["type","checkbox",3,"change","keydown","checked"],[1,"card__name"],[1,"card__desc"],[1,"field"],[1,"card__rank"],[1,"card__move"],["type","button","aria-label","Prefer this provider more",1,"card__arrow",3,"click","disabled"],["type","button","aria-label","Prefer this provider less",1,"card__arrow",3,"click","disabled"],[1,"field__label"],["type","password","autocomplete","off","spellcheck","false","placeholder","Paste your key",1,"field__input",3,"input","keydown","value"],[1,"field__hint"],["target","_blank","rel","noopener noreferrer",3,"href"],["type","button",1,"btn","btn--ghost",3,"click"]],template:function(e,o){e&1&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Which models do you want to use?"),Wu(),Gu(3,"p",2),pC(4," Pick at least one provider and paste its API key. With several, drag the cards (or use the arrows) to say which one you prefer for shared model aliases. The default alias for utility calls is currently provided only by Requesty, regardless of this order. "),Wu(),Gu(5,"ul",3),Tw(6,De,10,14,"li",4,Oe),Wu(),Iw(8,Fe,2,1,"p",5),Gu(9,"div",6),Iw(10,Ve,2,0,"button",7),Gu(11,"button",8),Zh("click",function(){return o.state.submitProviders()}),pC(12," Continue "),Wu()()()),e&2&&(IE(6),_w(o.cards()),IE(2),ww(o.state.error()?8:-1),IE(2),ww(o.state.emailLocked()?-1:10),IE(),Gh("disabled",!o.state.providersValid()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin:0;padding:0;list-style:none}.card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--color-border);border-radius:14px;background:var(--color-surface-muted);transition:border-color .18s,background .18s,box-shadow .18s,transform .18s}.card--on[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--color-primary) 60%,transparent);background:color-mix(in srgb,var(--color-primary) 7%,transparent)}.card[draggable=true][_ngcontent-%COMP%]{cursor:grab}.card--dragging[_ngcontent-%COMP%]{opacity:.5;transform:scale(.99)}.card--over[_ngcontent-%COMP%]{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.card__head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.card__toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;flex:1;cursor:pointer}.card__toggle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:18px;height:18px;accent-color:var(--color-primary)}.card__name[_ngcontent-%COMP%]{font-weight:620;font-size:16px}.card__rank[_ngcontent-%COMP%]{padding:2px 10px;font-size:12px;font-weight:650;border-radius:999px;color:var(--color-text-inverse);background:var(--color-primary)}.card__move[_ngcontent-%COMP%]{display:inline-flex;gap:4px}.card__arrow[_ngcontent-%COMP%]{width:28px;height:28px;font:inherit;color:var(--color-text);background:var(--color-bg-hover);border:none;border-radius:8px;cursor:pointer}.card__arrow[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:default}.card__arrow[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary)}.card__desc[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--color-text-secondary)}a[_ngcontent-%COMP%]{color:var(--color-link)}@media(prefers-reduced-motion:reduce){.card[_ngcontent-%COMP%]{transition:none}}"]})};var ze=(t,n)=>n.name;function Ne(t,n){if(t&1){let e=Rw();Gu(0,"label",3)(1,"span",7),pC(2,"Email"),Wu(),Gu(3,"input",8),Zh("input",function(d){Pd(e);let c=Lw();return Ld(c.onEmail(d))}),Wu(),Gu(4,"span",9),pC(5,"Saved in your personal settings."),Wu()();}if(t&2){let e=Lw();IE(3),Gh("value",e.state.profileEmail()),Bh("aria-invalid",e.state.profileEmail()&&!e.state.profileEmailValid()?"true":null);}}function Le(t,n){if(t&1){let e=Rw();Gu(0,"li")(1,"label",3)(2,"span",7),pC(3),Wu(),Gu(4,"input",11),Zh("input",function(d){let c=Pd(e).$implicit,h=Lw(2);return Ld(h.onKey(c.name,d))}),Wu(),Gu(5,"span",9),pC(6,"Saved in your personal settings, used for you only."),Wu()()();}if(t&2){let e=n.$implicit,o=Lw(2);IE(3),lg(e.name),IE(),Gh("value",e.apiKey),Bh("data-testid","user-key-"+e.name)("aria-invalid",o.keyTooShort(e.apiKey)?"true":null);}}function Ke(t,n){if(t&1&&(Gu(0,"p",2),pC(1,"Paste a key for at least one of these providers, the others are optional."),Wu(),Gu(2,"ul",10),Tw(3,Le,7,4,"li",null,ze),Wu()),t&2){let e=Lw();IE(3),_w(e.state.userKeys());}}function $e(t,n){if(t&1&&(Gu(0,"p",4),pC(1),Wu()),t&2){let e=Lw();IE(),lg(e.state.error());}}var je=8,A=class t{state=g(V);onEmail(n){this.state.setProfileEmail(n.target.value);}onKey(n,e){this.state.setUserKey(n,e.target.value);}keyTooShort(n){return n.length>0&&n.trim().length<je}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["app-user-keys-step"]],decls:12,vars:4,consts:[[1,"step"],[1,"step__title"],[1,"step__lead"],[1,"field"],["role","alert",1,"step__error"],[1,"step__actions"],["type","button","data-testid","user-keys-save",1,"btn","btn--primary",3,"click","disabled"],[1,"field__label"],["type","email","autocomplete","email","placeholder","you@company.com","data-testid","profile-email",1,"field__input",3,"input","value"],[1,"field__hint"],["role","list","data-testid","user-keys",1,"keys"],["type","password","autocomplete","off","spellcheck","false","placeholder","Paste your key",1,"field__input",3,"input","value"]],template:function(e,o){e&1&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Complete your profile"),Wu(),Gu(3,"p",2),pC(4," Your platform provides the AI providers, and Coday needs your email and at least one personal API key to start. "),Wu(),Iw(5,Ne,6,2,"label",3),Iw(6,Ke,5,0),Iw(7,$e,2,1,"p",4),Gu(8,"div",5),Uh(9,"span"),Gu(10,"button",6),Zh("click",function(){return o.state.submitProfile()}),pC(11," Save and continue "),Wu()()()),e&2&&(IE(5),ww(o.state.needsEmail()?5:-1),IE(),ww(o.state.needsUserKeys()?6:-1),IE(),ww(o.state.error()?7:-1),IE(3),Gh("disabled",!o.state.profileValid()||o.state.busy()));},styles:[".step[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.step__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:620}.step__lead[_ngcontent-%COMP%]{margin:-8px 0 0;font-size:14px;color:var(--color-text-secondary);line-height:1.5}.step__error[_ngcontent-%COMP%]{margin:0;padding:10px 14px;border-radius:10px;font-size:13px;color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.step__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.field__label[_ngcontent-%COMP%]{font-size:13px;font-weight:560}.field__hint[_ngcontent-%COMP%]{font-size:12px;color:var(--color-text-tertiary)}.field__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:12px 14px;font:inherit;color:var(--color-text);background:var(--color-input-bg);border:1px solid var(--color-border);border-radius:12px;outline:none;transition:border-color .15s,box-shadow .15s}.field__input[_ngcontent-%COMP%]:focus-visible{border-color:var(--color-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-primary) 25%,transparent)}.field__input[aria-invalid=true][_ngcontent-%COMP%]{border-color:var(--color-error)}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;font:inherit;font-weight:580;color:var(--color-text);background:transparent;border:1px solid var(--color-border);border-radius:12px;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s,opacity .15s}.btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.btn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.btn--primary[_ngcontent-%COMP%]{color:var(--color-text-inverse);background:var(--color-primary);border-color:transparent;box-shadow:0 4px 14px color-mix(in srgb,var(--color-primary) 35%,transparent)}.btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover)}.btn--big[_ngcontent-%COMP%]{padding:16px 32px;font-size:17px;border-radius:14px}.btn--ghost[_ngcontent-%COMP%]{border-color:transparent;color:var(--color-text-secondary)}",".keys[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;margin:0;padding:0;list-style:none}"]})};var We=(t,n)=>n.id;function Ae(t,n){t&1&&(os(0,"p",3),pC(1),zu()),t&2&&(IE(),Yu(" Preview: ",n,". Nothing is saved and this page stays here. "));}function Ue(t,n){t&1&&(os(0,"h1",6),pC(1,"Coday"),zu());}function He(t,n){t&1&&(os(0,"h1",6),pC(1,"Welcome to Coday"),zu(),os(2,"p",10),pC(3,"A few questions, then you are working with your first agent."),zu());}function Re(t,n){if(t&1&&(os(0,"li",12)(1,"span",13),pC(2),zu(),os(3,"span",14),pC(4),zu()()),t&2){let e=n.$implicit,o=n.$index,d=Lw(2);rg("stepper__item--active",d.state.step()===e.id)("stepper__item--done",o<d.state.stepIndex()),Bh("aria-current",d.state.step()===e.id?"step":null),IE(2),lg(o<d.state.stepIndex()?"\u2713":o+1),IE(2),lg(e.label);}}function Ye(t,n){if(t&1&&(os(0,"ol",7),Tw(1,Re,5,7,"li",11,We),zu()),t&2){let e=Lw();IE(),_w(e.steps);}}function qe(t,n){if(t&1&&(os(0,"p",8),pC(1),zu()),t&2){let e=Lw();IE(),lg(e.state.statusError());}}function Be(t,n){t&1&&Hh(0,"app-email-step");}function Ge(t,n){t&1&&Hh(0,"app-providers-step");}function Je(t,n){t&1&&Hh(0,"app-folder-step");}function Ze(t,n){t&1&&Hh(0,"app-user-keys-step");}function Qe(t,n){t&1&&Hh(0,"app-progress-step");}function Xe(t,n){if(t&1&&Iw(0,Ze,1,0,"app-user-keys-step")(1,Qe,1,0,"app-progress-step"),t&2){let e=Lw();ww(e.state.mode()==="loading"&&e.state.needsProfile()?0:1);}}var et={email:"You",providers:"Models",folder:"Files",progress:"Launch"},te=class t{state=g(V);steps=A$1.map(n=>({id:n,label:et[n]}));injector=g(pe$1);route=g(W$1);ngOnInit(){this.applyTheme(),this.state.init(ee$1(this.route.snapshot.queryParamMap.get("preview")));}ngOnDestroy(){this.state.stopPolling();}applyTheme(){return B(this,null,function*(){try{let{THEME_PORT:n}=yield import('./chunk-2KFuV5E5.js').then(function(n){return n.ag});this.injector.get(n);}catch(n){}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["app-welcome"]],decls:17,vars:7,consts:[[1,"welcome"],["aria-hidden","true",1,"welcome__aurora"],["aria-live","polite",1,"welcome__card"],["data-testid","preview-badge",1,"welcome__preview"],[1,"welcome__header"],["aria-hidden","true",1,"welcome__logo"],[1,"welcome__title"],["aria-label","Setup progress",1,"stepper"],["role","alert",1,"welcome__banner","welcome__banner--error"],[1,"welcome__step"],[1,"welcome__subtitle"],[1,"stepper__item",3,"stepper__item--active","stepper__item--done"],[1,"stepper__item"],[1,"stepper__dot"],[1,"stepper__label"]],template:function(e,o){if(e&1&&(os(0,"main",0),Hh(1,"div",1),os(2,"section",2),Iw(3,Ae,2,1,"p",3),os(4,"header",4)(5,"div",5),pC(6,"C"),zu(),os(7,"div"),Iw(8,Ue,2,0,"h1",6)(9,He,4,0),zu()(),Iw(10,Ye,3,0,"ol",7),Iw(11,qe,2,1,"p",8),os(12,"div",9),Iw(13,Be,1,0,"app-email-step")(14,Ge,1,0,"app-providers-step")(15,Je,1,0,"app-folder-step")(16,Xe,2,1),zu()()()),e&2){let d,c;IE(3),ww((d=o.state.preview())?3:-1,d),IE(5),ww(o.state.mode()==="loading"?8:9),IE(2),ww(o.state.mode()==="wizard"?10:-1),IE(),ww(o.state.statusError()&&!o.state.status()?11:-1),IE(),rg("welcome__step--loading",o.state.mode()==="loading"),IE(),ww((c=o.state.step())==="email"?13:c==="providers"?14:c==="folder"?15:c==="progress"?16:-1);}},dependencies:[K,W,$,j,A],styles:['[_nghost-%COMP%]{display:block;min-height:100vh;background:var(--color-bg);color:var(--color-text)}.welcome[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;min-height:100vh;padding:32px 16px;overflow:hidden}.welcome__aurora[_ngcontent-%COMP%]{position:absolute;inset:-20%;background:radial-gradient(40% 40% at 20% 25%,color-mix(in srgb,var(--color-primary) 28%,transparent),transparent 70%),radial-gradient(35% 35% at 80% 20%,color-mix(in srgb,var(--color-accent) 24%,transparent),transparent 70%),radial-gradient(45% 45% at 60% 85%,color-mix(in srgb,var(--color-info) 18%,transparent),transparent 70%);pointer-events:none}.welcome__card[_ngcontent-%COMP%]{position:relative;width:100%;max-width:640px;padding:32px;border-radius:20px;background:var(--glass-bg);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);animation:_ngcontent-%COMP%_rise .48s cubic-bezier(.2,.8,.2,1) both}.welcome__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-bottom:24px}.welcome__preview[_ngcontent-%COMP%]{margin:0 0 16px;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:560;color:var(--color-text-secondary);background:color-mix(in srgb,var(--color-warning) 14%,transparent)}.welcome__logo[_ngcontent-%COMP%]{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;font-size:24px;font-weight:700;color:var(--color-text-inverse);background:linear-gradient(135deg,var(--color-primary),var(--color-accent));box-shadow:0 6px 18px color-mix(in srgb,var(--color-primary) 40%,transparent)}.welcome__title[_ngcontent-%COMP%]{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.welcome__subtitle[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--color-text-secondary);font-size:14px}.welcome__banner[_ngcontent-%COMP%]{margin:0 0 16px;padding:10px 14px;border-radius:10px;font-size:13px}.welcome__banner--error[_ngcontent-%COMP%]{color:var(--color-error);background:color-mix(in srgb,var(--color-error) 12%,transparent)}.welcome__step[_ngcontent-%COMP%]{min-height:280px;animation:_ngcontent-%COMP%_fade .24s ease both}.welcome__step--loading[_ngcontent-%COMP%]{min-height:0}.stepper[_ngcontent-%COMP%]{display:flex;gap:8px;margin:0 0 28px;padding:0;list-style:none}.stepper__item[_ngcontent-%COMP%]{display:flex;flex:1;align-items:center;gap:8px;font-size:12px;font-weight:500;color:var(--color-text-tertiary);transition:color .2s}.stepper__item[_ngcontent-%COMP%]:after{content:"";flex:1;height:2px;border-radius:2px;background:var(--color-border)}.stepper__item[_ngcontent-%COMP%]:last-child:after{display:none}.stepper__item--active[_ngcontent-%COMP%]{color:var(--color-text)}.stepper__item--done[_ngcontent-%COMP%]{color:var(--color-success)}.stepper__item--done[_ngcontent-%COMP%]:after{background:var(--color-success)}.stepper__dot[_ngcontent-%COMP%]{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;font-size:12px;border:1.5px solid currentColor;transition:background .2s,color .2s}.stepper__item--active[_ngcontent-%COMP%] .stepper__dot[_ngcontent-%COMP%]{background:var(--color-primary);border-color:var(--color-primary);color:var(--color-text-inverse)}.stepper__item--done[_ngcontent-%COMP%] .stepper__dot[_ngcontent-%COMP%]{background:var(--color-success);border-color:var(--color-success);color:var(--color-text-inverse)}@media(max-width:520px){.welcome__card[_ngcontent-%COMP%]{padding:22px 18px}.stepper__label[_ngcontent-%COMP%]{display:none}}@media(prefers-reduced-motion:reduce){.welcome__card[_ngcontent-%COMP%], .welcome__step[_ngcontent-%COMP%]{animation:none}}@keyframes _ngcontent-%COMP%_rise{0%{opacity:0;transform:translateY(14px)}}@keyframes _ngcontent-%COMP%_fade{0%{opacity:0}}']})};
2
+ export{te as WelcomeComponent};
@@ -0,0 +1 @@
1
+ import {r as k$1,O,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-2KFuV5E5.js';import {g,F,v as we,at as F$1,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-EPHSXFSY.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let t=Lw();IE(),lg(t.deletion.error());}}function U(i,e){i&1&&(os(0,"p",4),pC(1,"Loading AI providers\u2026"),zu());}function j(i,e){i&1&&(os(0,"p",5),pC(1,"No platform AI providers defined yet."),zu());}function K(i,e){i&1&&(os(0,"p",4),pC(1,"No AI providers match the current filter."),zu());}function H(i,e){if(i&1){let t=Rw();os(0,"button",19),qh("click",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.edit(s))}),pC(1," Edit "),zu();}if(i&2){let t=Lw().$implicit;Bh("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=Rw();os(0,"agentos-row-delete-action",20),qh("deleteRequested",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(s.id))})("deleteConfirmed",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Lw(3);return Ld(s.deletion.cancel())}),zu();}if(i&2){let t=Lw().$implicit,r=Lw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14),pC(6),zu(),os(7,"td",15)(8,"div",16),Iw(9,H,2,1,"button",17),Iw(10,z,1,3,"agentos-row-delete-action",18),zu()()()),i&2){let t=e.$implicit,r=Lw(2);IE(2),lg(t.name),IE(2),lg(t.apiType),IE(2),lg(t.baseUrl||"\u2014"),IE(3),ww(r.deletion.confirmingId()!==t.id?9:-1),IE(),ww(t.id?10:-1);}}function J(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"API type"),zu(),os(8,"th",10),pC(9,"Base URL"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,G,11,5,"tr",9,B),zu()()()),i&2){let t=Lw();IE(14),_w(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(we);aiProviderController=g(F$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k$1();providers=Mi([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return r.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return r.openCreateForm()}),pC(3,"New AI provider"),zu()(),Iw(4,M,2,1,"p",3),Iw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(IE(),Vh("query",r.rowFilter.query()),IE(3),ww(r.deletion.error()?4:-1),IE(),ww(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
@@ -1 +1 @@
1
- import {g,aJ as fe,a6 as x}from'./main-G2NDWI4S.js';var c=class r{api=g(fe);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,aQ as he,aa as k}from'./main-EPHSXFSY.js';var c=class r{api=g(he);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
@@ -0,0 +1 @@
1
+ import {I as I$1}from'./chunk-x7GGjcqr.js';import {g,F,v as we,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-EPHSXFSY.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-2KFuV5E5.js';import'./chunk-BMbtNfWQ.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(os(0,"p",3),pC(1),zu()),e&2){let n=Lw();IE(),lg(n.deletion.error());}}function K(e,t){e&1&&(os(0,"p",4),pC(1,"Loading auth settings\u2026"),zu());}function H(e,t){e&1&&(os(0,"p",5),pC(1,"No platform auth settings defined yet."),zu());}function U(e,t){e&1&&(os(0,"p",4),pC(1,"No auth settings match the current filter."),zu());}function z(e,t){if(e&1){let n=Rw();os(0,"button",18),qh("click",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.onEdit(d))}),pC(1," Edit "),zu();}if(e&2){let n=Lw().$implicit;Bh("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=Rw();os(0,"agentos-row-delete-action",19),qh("deleteRequested",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(d.id))})("deleteConfirmed",function(){Pd(n);let d=Lw().$implicit,m=Lw(2);return Ld(m.onDelete(d))})("deleteCancelled",function(){Pd(n);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(e&2){let n=Lw().$implicit,a=Lw(2);Vh("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14)(6,"div",15),Iw(7,z,2,1,"button",16),Iw(8,G,1,3,"agentos-row-delete-action",17),zu()()()),e&2){let n=t.$implicit,a=Lw(2);IE(2),lg(n.name),IE(2),Yu(" ",n.authType," "),IE(3),ww(a.deletion.confirmingId()!==n.id?7:-1),IE(),ww(n.id?8:-1);}}function O(e,t){if(e&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Authentication type"),zu(),os(8,"th",10)(9,"span",11),pC(10,"Actions"),zu()()()(),os(11,"tbody",8),Tw(12,J,9,4,"tr",9,B),zu()()()),e&2){let n=Lw();IE(12),_w(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();settings=Mi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ew({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return a.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),pC(3,"New auth setting"),zu()(),Iw(4,j,2,1,"p",3),Iw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(IE(),Vh("query",a.rowFilter.query()),IE(3),ww(a.deletion.error()?4:-1),IE(),ww(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -1 +1 @@
1
- import {o}from'./chunk-BB9Gq9LM.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-BZjbpPBa.js';import {g,W,t as F,K as we,$ as $i,U,N as x,L as w,D as Dw,au as $t,E as Es,R as vg,b as AC,c as hl,a as Bw,d as VE,P as dg,i as Vw,v as tC,Q as Qw,f as fg,S as NI,q as $w,am as Hw,T as AI,z as zw,u as Dl,w as pf,x as hf,F as Fg}from'./main-G2NDWI4S.js';function ie(i,t){if(i&1&&(Es(0,"a",2),AC(1,"View skill \u2192"),hl()),i&2){let e=tC();dg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Es(0,"ds-tag",3),AC(1,"Platform level"),hl());}function ne(i,t){i&1&&(Es(0,"p",4),AC(1,"Loading\u2026"),hl());}function re(i,t){if(i&1){let e=Qw();Es(0,"div",15)(1,"div",19),fg(2,"input",20),NI(),Es(3,"button",21),vg("click",function(){let l=pf(e).$implicit,te=tC(2);return hf(te.removeResource(l))}),AC(4," \xD7 "),hl()(),fg(5,"textarea",22),NI(),hl();}if(i&2){let e=t.$implicit;VE(2),dg("formControl",e.path),AI(),VE(3),dg("formControl",e.content),AI();}}function ae(i,t){if(i&1&&(Es(0,"ds-notice"),AC(1),hl()),i&2){let e=tC(2);VE(),Fg(e.errorMessage());}}function se(i,t){if(i&1){let e=Qw();Es(0,"form",6),vg("ngSubmit",function(){pf(e);let l=tC();return hf(l.submit())}),Es(1,"ds-form-field",7),fg(2,"input",8),NI(),hl(),Es(3,"ds-form-field",9),fg(4,"textarea",10),NI(),hl(),Es(5,"ds-form-field",11),fg(6,"textarea",12),NI(),hl(),Es(7,"ds-form-field",13)(8,"div",14),$w(9,re,6,2,"div",15,Hw),Es(11,"div")(12,"button",16),vg("click",function(){pf(e);let l=tC();return hf(l.addResource())}),AC(13,"+ Add resource"),hl()()()(),Bw(14,ae,2,1,"ds-notice"),Es(15,"ds-form-actions")(16,"button",17),AC(17),hl(),Es(18,"button",18),vg("click",function(){pf(e);let l=tC();return hf(l.cancel())}),AC(19,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),VE(),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.bodyControl),AI(),VE(3),zw(e.resourceRows()),VE(5),Vw(e.errorMessage()?14:-1),VE(2),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=$i(false);isLoading=$i(false);isSubmitting=$i(false);errorMessage=$i(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=$i([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.cancel()}),AC(3,"\u2190 Skills"),hl(),Bw(4,ie,2,1,"a",2),Bw(5,oe,2,0,"ds-tag",3),hl(),Bw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),hl()),e&2&&(VE(),dg("title",o.isEditMode()?"Edit skill":"New skill"),VE(3),Vw(o.isEditMode()?4:-1),VE(),Vw(o.isPlatformMode?5:-1),VE(),Vw(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
1
+ import {o}from'./chunk-BuwHCrKf.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-2KFuV5E5.js';import {g,W,F,v as we,M as Mi,x as U,E as x,C as w,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,L as Lw,R as Rw,H as Hh,N as lI,T as Tw,aq as Cw,Q as fI,_ as _w,Y as Yu,P as Pd,n as Ld,l as lg}from'./main-EPHSXFSY.js';function ie(i,t){if(i&1&&(os(0,"a",2),pC(1,"View skill \u2192"),zu()),i&2){let e=Lw();Vh("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(os(0,"ds-tag",3),pC(1,"Platform level"),zu());}function ne(i,t){i&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function re(i,t){if(i&1){let e=Rw();os(0,"div",15)(1,"div",19),Hh(2,"input",20),lI(),os(3,"button",21),qh("click",function(){let l=Pd(e).$implicit,te=Lw(2);return Ld(te.removeResource(l))}),pC(4," \xD7 "),zu()(),Hh(5,"textarea",22),lI(),zu();}if(i&2){let e=t.$implicit;IE(2),Vh("formControl",e.path),fI(),IE(3),Vh("formControl",e.content),fI();}}function ae(i,t){if(i&1&&(os(0,"ds-notice"),pC(1),zu()),i&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function se(i,t){if(i&1){let e=Rw();os(0,"form",6),qh("ngSubmit",function(){Pd(e);let l=Lw();return Ld(l.submit())}),os(1,"ds-form-field",7),Hh(2,"input",8),lI(),zu(),os(3,"ds-form-field",9),Hh(4,"textarea",10),lI(),zu(),os(5,"ds-form-field",11),Hh(6,"textarea",12),lI(),zu(),os(7,"ds-form-field",13)(8,"div",14),Tw(9,re,6,2,"div",15,Cw),os(11,"div")(12,"button",16),qh("click",function(){Pd(e);let l=Lw();return Ld(l.addResource())}),pC(13,"+ Add resource"),zu()()()(),Iw(14,ae,2,1,"ds-notice"),os(15,"ds-form-actions")(16,"button",17),pC(17),zu(),os(18,"button",18),qh("click",function(){Pd(e);let l=Lw();return Ld(l.cancel())}),pC(19,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.bodyControl),fI(),IE(3),_w(e.resourceRows()),IE(5),ww(e.errorMessage()?14:-1),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Mi(false);isLoading=Mi(false);isSubmitting=Mi(false);errorMessage=Mi(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=Mi([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return o.cancel()}),pC(3,"\u2190 Skills"),zu(),Iw(4,ie,2,1,"a",2),Iw(5,oe,2,0,"ds-tag",3),zu(),Iw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),zu()),e&2&&(IE(),Vh("title",o.isEditMode()?"Edit skill":"New skill"),IE(3),ww(o.isEditMode()?4:-1),IE(),ww(o.isPlatformMode?5:-1),IE(),ww(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
@@ -0,0 +1 @@
1
+ import {o}from'./chunk-BuwHCrKf.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-2KFuV5E5.js';import {g,F,v as we,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-EPHSXFSY.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let t=Lw();IE(),lg(t.deletion.error());}}function A(i,e){i&1&&(os(0,"p",4),pC(1,"Loading skills\u2026"),zu());}function H(i,e){i&1&&(os(0,"p",5),pC(1,"No platform skills defined yet."),zu());}function U(i,e){i&1&&(os(0,"p",4),pC(1,"No skills match the current filter."),zu());}function z(i,e){i&1&&(os(0,"ds-tag",15),pC(1,"SKILL.md"),zu());}function G(i,e){if(i&1){let t=Rw();os(0,"button",21),qh("click",function(){Pd(t);let d=Lw(2).$implicit,m=Lw(2);return Ld(m.edit(d))}),pC(1,"Edit"),zu();}if(i&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Rw();os(0,"button",21),qh("click",function(){Pd(t);let d=Lw().$implicit,m=Lw(2);return Ld(m.inspect(d))}),pC(1,"View"),zu(),Iw(2,G,2,1,"button",22);}if(i&2){let t=Lw().$implicit;Bh("aria-label","View "+t.name),IE(2),ww(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Rw();os(0,"agentos-row-delete-action",23),qh("deleteRequested",function(){Pd(t);let d=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(d.id))})("deleteConfirmed",function(){Pd(t);let d=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(d))})("deleteCancelled",function(){Pd(t);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(i&2){let t=Lw().$implicit,l=Lw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),pC(4),zu(),Iw(5,z,2,0,"ds-tag",15),zu()(),os(6,"td",16),pC(7),zu(),os(8,"td",17),pC(9),zu(),os(10,"td",18)(11,"div",19),Iw(12,J,3,2),Iw(13,Q,1,3,"agentos-row-delete-action",20),zu()()()),i&2){let t=e.$implicit,l=Lw(2);IE(4),lg(t.name),IE(),ww(t.readOnly?5:-1),IE(2),Yu(" ",t.description||"\u2014"," "),IE(2),lg(l.resourceCount(t)),IE(3),ww(l.deletion.confirmingId()!==t.id?12:-1),IE(),ww(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Description"),zu(),os(8,"th",10),pC(9,"Resources"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,W,14,6,"tr",9,K),zu()()()),i&2){let t=Lw();IE(14),_w(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();skills=Mi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return l.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return l.openCreateForm()}),pC(3,"New skill"),zu()(),Iw(4,O,2,1,"p",3),Iw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(IE(),Vh("query",l.rowFilter.query()),IE(3),ww(l.deletion.error()?4:-1),IE(),ww(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
@@ -0,0 +1 @@
1
+ import {y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,h as hn,l as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-2KFuV5E5.js';import {g,v as we,W,u as L,M as Mi,x as U,a as ew,o as os,H as Hh,K as qh,I as Iw,z as zu,N as lI,b as pC,c as IE,J as Vh,w as ww,Q as fI,Y as Yu,a8 as Re,a9 as Hl,aa as k,L as Lw,R as Rw,l as lg,ab as Sn,P as Pd,n as Ld,T as Tw,_ as _w}from'./main-EPHSXFSY.js';var I=class e{api=g(Re);isLoading=Mi(false);result=Mi(null);errorMessage=Mi(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(Hl({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Sn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(os(0,"p",14),pC(1,"Loading namespaces\u2026"),zu());}function pe(e,t){if(e&1&&(os(0,"option",17),pC(1),zu()),e&2){let n=t.$implicit;Vh("value",n.id),IE(),lg(n.name);}}function ce(e,t){if(e&1&&(os(0,"select",15)(1,"option",16),pC(2,"Select a namespace"),zu(),Tw(3,pe,2,2,"option",17,de),zu(),lI()),e&2){let n=Lw(2);fI(),IE(3),_w(n.namespaces());}}function ue(e,t){if(e&1&&Iw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=Lw();ww(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&Hh(0,"input",3),e&2){let n=Lw();Vh("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Rw();os(0,"button",18),qh("click",function(){Pd(n);let l=Lw();return Ld(l.reset())}),pC(1,"Clear result"),zu();}}function ve(e,t){e&1&&(os(0,"ds-card",12)(1,"pre",19),pC(2),zu()()),e&2&&(IE(2),lg(t));}function ye(e,t){e&1&&(os(0,"span",21),pC(1,"Metadata"),zu(),os(2,"pre",19),pC(3),zu()),e&2&&(IE(3),lg(t));}function Ce(e,t){if(e&1&&(os(0,"dt"),pC(1,"Type"),zu(),os(2,"dd",23),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.errorType);}}function _e(e,t){if(e&1&&(os(0,"dt"),pC(1,"Message"),zu(),os(2,"dd"),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.errorMessage);}}function be(e,t){if(e&1&&(os(0,"span",21),pC(1,"Tool error details"),zu(),os(2,"dl",22),Iw(3,Ce,4,1),Iw(4,_e,4,1),zu()),e&2){let n=Lw();IE(3),ww(n.errorType?3:-1),IE(),ww(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(os(0,"ds-card",13)(1,"div")(2,"ds-tag",20),pC(3),zu()(),os(4,"span",21),pC(5,"Output"),zu(),os(6,"pre",19),pC(7),zu(),Iw(8,ye,4,1),os(9,"span",21),pC(10,"Structured output"),zu(),os(11,"pre",19),pC(12),zu(),Iw(13,be,5,2),zu()),e&2){let n,o=t,l=Lw();Vh("heading","Result \u2014 "+o.toolName),IE(2),Vh("variant",o.success?"accent":"outline"),IE(),lg(o.success?"Success":"Tool error"),IE(4),lg(o.output),IE(),ww((n=l.formatMetadata(o.metadata))?8:-1,n),IE(4),lg(l.formatStructuredOutput(o.structuredOutput)??"null"),IE(),ww(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(L);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Mi([]);namespacesLoading=Mi(true);namespaceName=Mi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ew({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(os(0,"ds-page"),Hh(1,"ds-section-header",0),os(2,"form",1),qh("ngSubmit",function(){return o.submit()}),os(3,"ds-form-field",2),Iw(4,ue,2,1)(5,fe,1,1,"input",3),zu(),os(6,"ds-form-field",4),Hh(7,"input",5),lI(),zu(),os(8,"ds-form-field",6),Hh(9,"input",7),lI(),zu(),os(10,"ds-form-field",8),Hh(11,"textarea",9),lI(),zu(),os(12,"ds-form-actions")(13,"button",10),pC(14),zu(),Iw(15,ge,2,0,"button",11),zu()(),Iw(16,ve,3,1,"ds-card",12),Iw(17,he,14,7,"ds-card",13),zu()),n&2){let l,v;IE(),Vh("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),IE(),Vh("formGroup",o.form),IE(2),ww(o.isPlatformMode?4:5),IE(3),fI(),IE(2),fI(),IE(2),fI(),IE(2),Vh("disabled",o.form.invalid||o.state.isLoading()),IE(),Yu(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),IE(),ww(o.state.result()||o.state.errorMessage()?15:-1),IE(),ww((l=o.state.errorMessage())?16:-1,l),IE(),ww((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-DPNOnAOU.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,q as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,n as pn,h as hn,_ as _n,i as at,u as un,o as cn}from'./chunk-2KFuV5E5.js';import {g,W,F,v as we$1,ak as U,al as We,am as De$1,M as Mi,an as Ge,ad as F$1,ao as Vl,i as VC,ag as Gm,x as U$1,a6 as Zs,ae as Dr,E as x,C as w,a as ew,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,Y as Yu,w as ww,R as Rw,H as Hh,N as lI,T as Tw,L as Lw,Q as fI,_ as _w,l as lg,P as Pd,n as Ld,O as Op}from'./main-EPHSXFSY.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function _e(n,t){if(n&1&&(os(0,"ds-form-field",9),Hh(1,"input",38),zu()),n&2){let e=Lw(2);IE(),Vh("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(os(0,"a",39),pC(1,"Add an agent config"),zu(),pC(2," first. ")),n&2){let e=Lw(3);Vh("href","/agentos/"+e.namespaceId+"/agent-configs/new",Op);}}function xe(n,t){if(n&1&&(os(0,"ds-form-field",10)(1,"p",2),pC(2," No agent configs available in this scope yet. "),Iw(3,Se,3,1),zu()()),n&2){let e=Lw(2);IE(3),ww(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(os(0,"option",17),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.id),IE(),lg(e.name);}}function De(n,t){if(n&1&&(os(0,"ds-form-field",11)(1,"select",40)(2,"option",41),pC(3,"Select an agent config\u2026"),zu(),Tw(4,Ee,2,2,"option",17,ve),zu(),lI(),zu()),n&2){let e=Lw(2);Vh("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),IE(),Vh("formControl",e.agentConfigIdControl),fI(),IE(3),_w(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(os(0,"option",17),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function Ne(n,t){if(n&1){let e=Rw();os(0,"label",31)(1,"input",43),qh("change",function(){let f=Pd(e).$implicit,h=Lw(3);return Ld(h.toggleDay(f.value))}),zu(),pC(2),zu();}if(n&2){let e=t.$implicit,l=Lw(3);IE(),Vh("checked",l.isDaySelected(e.value)),IE(),Yu(" ",e.label," ");}}function Ie(n,t){if(n&1&&(os(0,"ds-form-field",18)(1,"div",42),Tw(2,Ne,3,2,"label",31,V),zu()()),n&2){let e=Lw(2);IE(2),_w(e.dayOptions);}}function Me(n,t){if(n&1&&(os(0,"option",17),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function Pe(n,t){if(n&1&&(os(0,"ds-form-field",28),Hh(1,"input",44),lI(),zu()),n&2){let e=Lw(2);Vh("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),IE(),Vh("formControl",e.endDateControl),fI();}}function we(n,t){if(n&1&&(os(0,"ds-form-field",29),Hh(1,"input",45),lI(),zu()),n&2){let e=Lw(2);Vh("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),IE(),Vh("formControl",e.occurrenceCountControl),fI();}}function Fe(n,t){if(n&1&&(os(0,"ds-notice"),pC(1),zu()),n&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let f=Lw();return Ld(f.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"input",8),lI(),zu(),Iw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),os(8,"ds-form-field",12),Hh(9,"textarea",13),lI(),zu(),os(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Tw(13,Te,2,2,"option",17,V),zu(),lI(),zu(),Iw(15,Ie,4,0,"ds-form-field",18),os(16,"ds-form-field",19)(17,"div",20),Hh(18,"input",21),lI(),os(19,"span",22),pC(20,"UTC"),zu()()()(),os(21,"ds-fieldset",23)(22,"ds-form-field",24),Hh(23,"input",25),lI(),zu(),os(24,"ds-form-field",26)(25,"select",27),Tw(26,Me,2,2,"option",17,V),zu(),lI(),zu(),Iw(28,Pe,2,2,"ds-form-field",28),Iw(29,we,2,2,"ds-form-field",29),zu(),os(30,"div",30)(31,"label",31),Hh(32,"input",32),lI(),pC(33," Enabled "),zu(),os(34,"p",33),pC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),zu()(),os(36,"ds-form-field",34),Hh(37,"textarea",35),lI(),zu(),Iw(38,Fe,2,1,"ds-notice"),os(39,"ds-form-actions")(40,"button",36),pC(41),zu(),os(42,"button",37),qh("click",function(){Pd(e);let f=Lw();return Ld(f.cancel())}),pC(43,"Cancel"),zu()()();}if(n&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(),ww(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),IE(3),Vh("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),IE(),Vh("formControl",e.promptContentControl),fI(),IE(3),Vh("formControl",e.unitControl),fI(),IE(),_w(e.schedulerUnits),IE(2),ww(e.showDayFilter()?15:-1),IE(),Vh("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),IE(2),Vh("formControl",e.timeUtcControl),fI(),IE(4),Vh("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),IE(),Vh("formControl",e.startDateControl),fI(),IE(2),Vh("formControl",e.endTypeControl),fI(),IE(),_w(e.endTypes),IE(2),ww(e.showEndDate()?28:-1),IE(),ww(e.showOccurrenceCount()?29:-1),IE(3),Vh("formControl",e.enabledControl),fI(),IE(4),Vh("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),IE(),Vh("formControl",e.externalMetadataJsonControl),fI(),IE(),ww(e.errorMessage()?38:-1),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(De$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(We.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);errorMessage=Mi(null);SchedulerUnit=De$1;SchedulerEndType=We;schedulerUnits=[{value:De$1.WEEK,label:"Week(s)"},{value:De$1.MONTH,label:"Month(s)"}];endTypes=[{value:We.NEVER,label:"Never"},{value:We.ON_DATE,label:"On date"},{value:We.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ge).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Vl(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Vl(this.endTypeControl.value)));showDayFilter=VC(()=>this.unitSignal()===De$1.WEEK);showEndDate=VC(()=>this.endTypeSignal()===We.ON_DATE);showOccurrenceCount=VC(()=>this.endTypeSignal()===We.OCCURRENCES);agentConfigs=Mi([]);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),Gm({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(Zs(()=>Dr([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===We.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===We.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return l.cancel()}),pC(3),zu()(),Iw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),zu()),e&2&&(IE(),Vh("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),IE(2),Yu(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),IE(),ww(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===We.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===We.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
@@ -0,0 +1 @@
1
+ import {q as q$1}from'./chunk-CIeSnHU_.js';import'./chunk-C57t194y.js';import'./chunk-C7nsTLJX.js';import {v as vn,d as yn,l as dn,_ as _n,i as at,m as mn,G as Ni,H as On}from'./chunk-2KFuV5E5.js';import {g,W as W$1,F,v as we,ak as U$1,M as Mi,i as VC,x as U$2,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,r as rg,Y as Yu,T as Tw,_ as _w,H as Hh,R as Rw,a0 as RC,ay as kC,P as Pd,n as Ld,az as xD}from'./main-EPHSXFSY.js';var z=(t,n)=>n.id,q=(t,n)=>n.name;function Q(t,n){t&1&&(os(0,"p",3),pC(1,"Loading\u2026"),zu());}function W(t,n){t&1&&(os(0,"ds-notice"),pC(1,"Failed to load agent definition."),zu());}function X(t,n){if(t&1&&(os(0,"dt"),pC(1,"User context"),zu(),os(2,"dd",6),pC(3),zu()),t&2){let e=Lw();IE(3),lg(e.userId);}}function Y(t,n){if(t&1){let e=Rw();os(0,"ds-card")(1,"ds-disclosure",13),qh("toggled",function(){Pd(e);let m=Lw(2);return Ld(m.toggleSystemPrompt())}),os(2,"pre",14),pC(3),zu()()();}if(t&2){let e=Lw(),d=Lw();IE(),Vh("open",!d.systemPromptCollapsed()),IE(2),lg(e.systemPrompt);}}function Z(t,n){if(t&1){let e=Rw();os(0,"ds-card")(1,"ds-disclosure",15),qh("toggled",function(){Pd(e);let m=Lw(2);return Ld(m.toggleInstructions())}),os(2,"pre",14),pC(3),zu()()();}if(t&2){let e=Lw(),d=Lw();IE(),Vh("open",!d.instructionsCollapsed()),IE(2),lg(e.instructions);}}function ee(t,n){t&1&&(os(0,"p",3),pC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),zu());}function te(t,n){t&1&&(os(0,"span",18),pC(1,"platform"),zu());}function ne(t,n){t&1&&(os(0,"span",18),pC(1,"SKILL.md"),zu());}function ie(t,n){if(t&1&&(os(0,"li",16)(1,"span")(2,"span",17),pC(3),zu(),Iw(4,te,2,0,"span",18),Iw(5,ne,2,0,"span",18),zu(),os(6,"p",3),pC(7),zu()()),t&2){let e=n.$implicit;IE(3),lg(e.name),IE(),ww(e.namespaceId?-1:4),IE(),ww(e.readOnly?5:-1),IE(2),lg(e.description);}}function oe(t,n){if(t&1&&(os(0,"ul",11),Tw(1,ie,8,4,"li",16,z),zu()),t&2){let e=Lw(2);IE(),_w(e.resolvedSkills());}}function ae(t,n){t&1&&(os(0,"p",3),pC(1,"No tools available for this agent."),zu());}function de(t,n){if(t&1&&(Hh(0,"div",20),RC(1,"agentosMarkdown")),t&2){let e=Lw().$implicit;Vh("innerHTML",kC(1,1,e.description),xD);}}function re(t,n){if(t&1){let e=Rw();os(0,"li")(1,"ds-disclosure",19),qh("toggled",function(){let m=Pd(e).$implicit,j=Lw(3);return Ld(j.toggleTool(m))}),Iw(2,de,2,3,"div",20),os(3,"pre",21),pC(4),zu()()();}if(t&2){let e=n.$implicit,d=Lw(3);IE(),Vh("heading",e.name)("open",d.isToolExpanded(e)),IE(),ww(e.description?2:-1),IE(2),lg(d.formatSchema(e.inputSchema));}}function se(t,n){if(t&1&&(os(0,"ul",11),Tw(1,re,5,4,"li",null,q),zu()),t&2){let e=Lw();IE(),_w(e.tools);}}function le(t,n){if(t&1&&Hh(0,"agentos-agent-messaging",12),t&2){let e=Lw(2);Vh("namespaceId",e.namespaceId)("agentId",e.agentConfigId);}}function ce(t,n){if(t&1&&(os(0,"ds-card",4)(1,"dl",5)(2,"dt"),pC(3,"Name"),zu(),os(4,"dd"),pC(5),zu(),os(6,"dt"),pC(7,"Resolved model"),zu(),os(8,"dd",6),pC(9),zu(),os(10,"dt"),pC(11,"Provider"),zu(),os(12,"dd"),pC(13),zu(),os(14,"dt",7),pC(15,"Execution mode"),zu(),os(16,"dd",8)(17,"span",9),pC(18),zu()(),Iw(19,X,4,1),zu()(),Iw(20,Y,4,2,"ds-card"),Iw(21,Z,4,2,"ds-card"),os(22,"ds-card",10),Iw(23,ee,2,0,"p",3)(24,oe,3,0,"ul",11),zu(),os(25,"ds-card",10),Iw(26,ae,2,0,"p",3)(27,se,3,0,"ul",11),zu(),Iw(28,le,1,2,"agentos-agent-messaging",12)),t&2){let e=n,d=Lw();IE(5),lg(e.name),IE(4),lg(e.resolvedModelApiName),IE(4),lg(e.resolvedProviderName),IE(4),rg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),IE(),Yu(" ",e.executionMode," "),IE(),ww(e.userId?19:-1),IE(),ww(e.systemPrompt?20:-1),IE(),ww(e.instructions?21:-1),IE(),Vh("heading","Skills ("+d.resolvedSkills().length+")"),IE(),ww(d.resolvedSkills().length===0?23:24),IE(2),Vh("heading","Tools ("+e.tools.length+")"),IE(),ww(e.tools.length===0?26:27),IE(2),ww(d.namespaceId?28:-1);}}var U=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Mi(true);hasError=Mi(false);definition=Mi(null);expandedTools=Mi(new Set);resolvedSkills=VC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Mi(true);instructionsCollapsed=Mi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$2(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let d=new Set(e);return d.has(n.name)?d.delete(n.name):d.add(n.name),d});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}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||t)};static \u0275cmp=ew({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],[3,"namespaceId","agentId"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,d){if(e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return d.back()}),pC(3," \u2190 Agent configs "),zu(),os(4,"a",2),pC(5,"Edit config \u2192"),zu()(),Iw(6,Q,2,0,"p",3)(7,W,2,0,"ds-notice")(8,ce,29,14),zu()),e&2){let m;IE(4),Vh("routerLink",d.editRoute()),IE(2),ww(d.isLoading()?6:d.hasError()?7:(m=d.definition())?8:-1,m);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ni,q$1,On],encapsulation:2})};export{U as AgentConfigInspectComponent};
@@ -1,4 +1,4 @@
1
- import {aY as A,aZ as z$1}from'./main-G2NDWI4S.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
1
+ import {b2 as A,b3 as z$1}from'./main-EPHSXFSY.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
2
2
  `});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
3
3
  `?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
4
4
  `&&(E.last=l.length==0||l[0].tag==`