@whoz-oss/coday-client 0.0.0-workstream-forge.285 → 0.0.0-workstream-forge.286

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 (56) hide show
  1. package/3rdpartylicenses.txt +52 -0
  2. package/browser/{chunk-DXhOdsyd.js → chunk-5mGW4E0G.js} +1 -1
  3. package/browser/{chunk-BozaX28A.js → chunk-B4ZKQxLi.js} +1 -1
  4. package/browser/{chunk-waXaFQA6.js → chunk-B6Jjbp7r.js} +1 -1
  5. package/browser/{chunk-E7h9aRjY.js → chunk-BDdxWZSD.js} +1 -1
  6. package/browser/{chunk-BWZH94Ql.js → chunk-BFMfi7bN.js} +1 -1
  7. package/browser/{chunk-CimgVrmo.js → chunk-BGKOG_jF.js} +1 -1
  8. package/browser/{chunk-DoEqcxIp.js → chunk-BIv3GA0j.js} +1 -1
  9. package/browser/{chunk-Bj2SgFTY.js → chunk-BRKEdS-H.js} +1 -1
  10. package/browser/{chunk-B4IxKhfN.js → chunk-BSLGGdgS.js} +1 -1
  11. package/browser/{chunk-BvWC7yF9.js → chunk-BWOdgPpL.js} +1 -1
  12. package/browser/{chunk-UivSyOHl.js → chunk-BYBCnWol.js} +1 -1
  13. package/browser/{chunk-BU4BNqKl.js → chunk-BaZs2cqq.js} +1 -1
  14. package/browser/{chunk-CHXLjpvB.js → chunk-BecFkRj3.js} +1 -1
  15. package/browser/{chunk-DaKshFXh.js → chunk-BgspkyJn.js} +1 -1
  16. package/browser/chunk-BtNRYep-.js +16 -0
  17. package/browser/{chunk-BsMXvlMY.js → chunk-BuupDt2w.js} +1 -1
  18. package/browser/{chunk-DpaqV0I8.js → chunk-C-TFPDAn.js} +1 -1
  19. package/browser/{chunk-BpRfgEmz.js → chunk-C4AQsMm0.js} +1 -1
  20. package/browser/{chunk-D-9iMQv_.js → chunk-C8kRHbPY.js} +1 -1
  21. package/browser/{chunk-C3n9w6Vo.js → chunk-C9I0IDkC.js} +1 -1
  22. package/browser/{chunk-D7CYFO8e.js → chunk-C9Im1XQZ.js} +1 -1
  23. package/browser/{chunk-C6jMH6l0.js → chunk-CBa63htl.js} +1 -1
  24. package/browser/{chunk-BRhWdEcv.js → chunk-CR2ZgYm1.js} +1 -1
  25. package/browser/{chunk-DLUw6xZL.js → chunk-CTnGJhEu.js} +1 -1
  26. package/browser/chunk-CV72_wbg.js +690 -0
  27. package/browser/{chunk-DYFgJfm3.js → chunk-Cgng0NyG.js} +1 -1
  28. package/browser/{chunk-9lPOnBh7.js → chunk-Cht3Sl44.js} +1 -1
  29. package/browser/{chunk-DT7DFzXk.js → chunk-CpXnuzhL.js} +1 -1
  30. package/browser/chunk-Cw_G-BTP.js +1 -0
  31. package/browser/{chunk-Ch9IS2VK.js → chunk-D48e7Jxo.js} +1 -1
  32. package/browser/{chunk-Ca-YJxkj.js → chunk-DEd4dYEy.js} +1 -1
  33. package/browser/{chunk-ByMpO_2J.js → chunk-DII4lC8r.js} +1 -1
  34. package/browser/chunk-DTHI-QLx.js +61 -0
  35. package/browser/{chunk-BuXYpWqH.js → chunk-DUksmlzj.js} +1 -1
  36. package/browser/{chunk-CX2QtdIw.js → chunk-DWnk-InR.js} +1 -1
  37. package/browser/{chunk-BGaBu_yG.js → chunk-DZzoCiPa.js} +1 -1
  38. package/browser/chunk-Da_8VPJd.js +1 -0
  39. package/browser/{chunk-VqtB1BzG.js → chunk-DeS6UHdw.js} +1 -1
  40. package/browser/{chunk-DNO_UKkx.js → chunk-DtO-loh9.js} +1 -1
  41. package/browser/{chunk-Cnq159eN.js → chunk-DvgyKpON.js} +1 -1
  42. package/browser/{chunk-Deoyp47K.js → chunk-O_4Rn5qq.js} +1 -1
  43. package/browser/{chunk-DaMEeyR0.js → chunk-RNbGWl1w.js} +1 -1
  44. package/browser/{chunk-BQrs6HKm.js → chunk-YSYGmtzS.js} +1 -1
  45. package/browser/{chunk-DCU0O5Ka.js → chunk-cs0QcDnt.js} +1 -1
  46. package/browser/chunk-gOvITjLx.js +1 -0
  47. package/browser/{chunk-CfcxICq5.js → chunk-hqzAiSeU.js} +1 -1
  48. package/browser/{chunk-KqBRRBxT.js → chunk-spovbUSX.js} +1 -1
  49. package/browser/{chunk-DC3rgpMh.js → chunk-wS9pwsFZ.js} +1 -1
  50. package/browser/index.html +1 -1
  51. package/browser/{main-OLEL3JTU.js → main-2W2EKPFF.js} +1 -1
  52. package/package.json +1 -1
  53. package/browser/chunk-Bx5RArn6.js +0 -1
  54. package/browser/chunk-C7Y0YglE.js +0 -1
  55. package/browser/chunk-CFyknSSV.js +0 -1
  56. package/browser/chunk-anaDHfEv.js +0 -680
@@ -638,6 +638,58 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
638
638
  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
639
639
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
640
640
 
641
+ --------------------------------------------------------------------------------
642
+ Package: turndown
643
+ License: "MIT"
644
+
645
+ MIT License
646
+
647
+ Copyright (c) 2017 Dom Christie
648
+
649
+ Permission is hereby granted, free of charge, to any person obtaining a copy
650
+ of this software and associated documentation files (the "Software"), to deal
651
+ in the Software without restriction, including without limitation the rights
652
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
653
+ copies of the Software, and to permit persons to whom the Software is
654
+ furnished to do so, subject to the following conditions:
655
+
656
+ The above copyright notice and this permission notice shall be included in all
657
+ copies or substantial portions of the Software.
658
+
659
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
660
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
661
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
662
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
663
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
664
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
665
+ SOFTWARE.
666
+
667
+ --------------------------------------------------------------------------------
668
+ Package: turndown-plugin-gfm
669
+ License: "MIT"
670
+
671
+ MIT License
672
+
673
+ Copyright (c) 2017 Dom Christie
674
+
675
+ Permission is hereby granted, free of charge, to any person obtaining a copy
676
+ of this software and associated documentation files (the "Software"), to deal
677
+ in the Software without restriction, including without limitation the rights
678
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
679
+ copies of the Software, and to permit persons to whom the Software is
680
+ furnished to do so, subject to the following conditions:
681
+
682
+ The above copyright notice and this permission notice shall be included in all
683
+ copies or substantial portions of the Software.
684
+
685
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
686
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
687
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
688
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
689
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
690
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
691
+ SOFTWARE.
692
+
641
693
  --------------------------------------------------------------------------------
642
694
  Package: @angular/forms
643
695
  License: "MIT"
@@ -1 +1 @@
1
- import {g,aK as ue,a6 as A}from'./main-OLEL3JTU.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
1
+ import {g,aK as ue,a6 as A}from'./main-2W2EKPFF.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
@@ -1 +1 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-DNO_UKkx.js';import {g,W,K as we,z as zi,U,N as Nw,I as Is,a as hg,Y as Yw,m as ml,Q as QE,b as Qw,H as HC,p as dC,L as Lg}from'./main-OLEL3JTU.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-anaDHfEv.js';import'./chunk-C7Y0YglE.js';function O(r,e){r&1&&(Is(0,"p",1),HC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),HC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),HC(2,"YAML"),ml(),Is(3,"ds-tag",10),HC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Yw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),HC(4,"Name"),ml(),Is(5,"dd"),HC(6),ml(),Is(7,"dt"),HC(8,"Type"),ml(),Is(9,"dd",5),HC(10),ml(),Is(11,"dt"),HC(12,"Description"),ml(),Is(13,"dd"),HC(14),ml(),Is(15,"dt"),HC(16,"Scope"),ml(),Is(17,"dd"),HC(18),ml(),Is(19,"dt"),HC(20,"Source"),ml(),Is(21,"dd"),HC(22),ml(),Is(23,"dt"),HC(24,"Auto grant"),ml(),Is(25,"dd"),HC(26),ml(),Is(27,"dt"),HC(28,"Auth setting"),ml(),Is(29,"dd"),HC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),HC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),HC(35),ml()()),r&2){let o=e,a=dC();QE(),Qw(a.source()==="FILESYSTEM"?1:-1),QE(5),Lg(o.name),QE(4),Lg(o.integrationType),QE(4),Lg(o.description||"\u2014"),QE(4),Lg(a.scopeOf(o)),QE(4),Lg(a.source()),QE(4),Lg(o.autoGrant?"Enabled":"Disabled"),QE(4),Lg(o.authSettingName||"None"),QE(5),Lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;QE(2),Qw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
1
+ import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-DtO-loh9.js';import {g,W,K as we,z as zi,U,N as Nw,I as Is,a as hg,Y as Yw,m as ml,Q as QE,b as Qw,H as HC,p as dC,L as Lg}from'./main-2W2EKPFF.js';import {v as vn,d as yn,k as dn,_ as _n,m as mn,A as Ao}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';function O(r,e){r&1&&(Is(0,"p",1),HC(1,"Loading integration\u2026"),ml());}function T(r,e){r&1&&(Is(0,"ds-notice"),HC(1,"Failed to load this integration configuration."),ml());}function L(r,e){r&1&&(Is(0,"div",3)(1,"ds-tag",9),HC(2,"YAML"),ml(),Is(3,"ds-tag",10),HC(4,"Read-only"),ml()());}function k(r,e){if(r&1&&(Is(0,"ds-card",2),Yw(1,L,5,0,"div",3),Is(2,"dl",4)(3,"dt"),HC(4,"Name"),ml(),Is(5,"dd"),HC(6),ml(),Is(7,"dt"),HC(8,"Type"),ml(),Is(9,"dd",5),HC(10),ml(),Is(11,"dt"),HC(12,"Description"),ml(),Is(13,"dd"),HC(14),ml(),Is(15,"dt"),HC(16,"Scope"),ml(),Is(17,"dd"),HC(18),ml(),Is(19,"dt"),HC(20,"Source"),ml(),Is(21,"dd"),HC(22),ml(),Is(23,"dt"),HC(24,"Auto grant"),ml(),Is(25,"dd"),HC(26),ml(),Is(27,"dt"),HC(28,"Auth setting"),ml(),Is(29,"dd"),HC(30),ml()()(),Is(31,"ds-card",6)(32,"p",7),HC(33,"Sensitive values are always redacted."),ml(),Is(34,"pre",8),HC(35),ml()()),r&2){let o=e,a=dC();QE(),Qw(a.source()==="FILESYSTEM"?1:-1),QE(5),Lg(o.name),QE(4),Lg(o.integrationType),QE(4),Lg(o.description||"\u2014"),QE(4),Lg(a.scopeOf(o)),QE(4),Lg(a.source()),QE(4),Lg(o.autoGrant?"Enabled":"Disabled"),QE(4),Lg(o.authSettingName||"None"),QE(5),Lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=zi(true);hasError=zi(false);config=zi(null);source=zi("NEO4J");parameters=zi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),ml()),o&2){let m;QE(2),Qw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-DaKshFXh.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-anaDHfEv.js';import {g,F,K as we,z as zi,U as U$1,ai as Fe,al as We,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,s as sC,q as mf,r as yf,i as fg}from'./main-OLEL3JTU.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let e=dC();QE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),HC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),HC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function O(n,t){if(n&1){let e=sC();Is(0,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.toggle(s))}),HC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.edit(s))}),HC(3,"Edit"),ml();}if(n&2){let e=dC().$implicit;QE(),Lg(e.enabled?"Disable":"Enable"),QE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=sC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=dC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=dC().$implicit,i=dC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),HC(3),ml(),Yw(4,H,2,1,"span",14),ml(),Is(5,"td",15),HC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),HC(9),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,O,4,2),Yw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=dC(2);QE(3),Lg(e.name),QE(),Qw(e.description?4:-1),QE(2),Lg(i.scheduleLabel(e)),QE(2),pg("variant",e.enabled?"accent":"outline"),QE(),Lg(e.enabled?"Enabled":"Disabled"),QE(3),Qw(i.deletion.confirmingId()!==e.id?12:-1),QE(),Qw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Schedule"),ml(),Is(8,"th",10),HC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=dC();QE(14),eC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Fe.WEEK?"week":"month",s=e.unit===Fe.WEEK&&e.days?.length?` (${e.days.map(c=>We[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New scheduled prompt"),ml()(),Yw(4,U,2,1,"p",3),Yw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
1
+ import {c}from'./chunk-BgspkyJn.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,F,K as we,z as zi,U as U$1,ai as Fe,al as We,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let e=dC();QE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),HC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),HC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function O(n,t){if(n&1){let e=sC();Is(0,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.toggle(s))}),HC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.edit(s))}),HC(3,"Edit"),ml();}if(n&2){let e=dC().$implicit;QE(),Lg(e.enabled?"Disable":"Enable"),QE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=sC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=dC().$implicit,c=dC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=dC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=dC().$implicit,i=dC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),HC(3),ml(),Yw(4,H,2,1,"span",14),ml(),Is(5,"td",15),HC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),HC(9),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,O,4,2),Yw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=dC(2);QE(3),Lg(e.name),QE(),Qw(e.description?4:-1),QE(2),Lg(i.scheduleLabel(e)),QE(2),pg("variant",e.enabled?"accent":"outline"),QE(),Lg(e.enabled?"Enabled":"Disabled"),QE(3),Qw(i.deletion.confirmingId()!==e.id?12:-1),QE(),Qw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Schedule"),ml(),Is(8,"th",10),HC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=dC();QE(14),eC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===Fe.WEEK?"week":"month",s=e.unit===Fe.WEEK&&e.days?.length?` (${e.days.map(c=>We[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New scheduled prompt"),ml()(),Yw(4,U,2,1,"p",3),Yw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
@@ -1,2 +1,2 @@
1
- import {I}from'./chunk-Ca-YJxkj.js';import {g,W,aX as L,K as we,z as zi,j as mT,aY as Ue,ac as Ny,U,a2 as ga,aa as _r,N as Nw,I as Is,a as hg,Y as Yw,m as ml,R as Eg,Q as QE,b as Qw,P as pg,H as HC,s as sC,S as BI,J as Jw,p as dC,T as HI,k as eC,o as Il,as as jg,q as mf,r as yf,L as Lg}from'./main-OLEL3JTU.js';import {a6 as gd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,c as fo,a8 as _a,ac as Bi,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-anaDHfEv.js';import'./chunk-C7Y0YglE.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Is(0,"p",1),HC(1,"Loading\u2026"),ml());}function se(i,t){if(i&1&&(Is(0,"ds-notice"),HC(1),ml()),i&2){let e=dC(2);QE(),Lg(e.errorMessage());}}function re(i,t){if(i&1){let e=sC();Is(0,"div")(1,"button",23),Eg("click",function(){mf(e);let s=dC(2);return yf(s.retryLoad())}),HC(2,"Retry loading"),ml()();}}function ce(i,t){if(i&1&&(hg(0,"br"),HC(1)),i&2){let e=dC(3);QE(),Il("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Is(0,"ds-notice",3),HC(1),Yw(2,ce,2,1),ml()),i&2){let e=dC(2);pg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),QE(),Il(" Repository: ",e.checkoutStatus()," "),QE(),Qw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Is(0,"option",12),HC(1),ml()),i&2){let e=t.$implicit,c=dC(2);pg("value",e.id),QE(),jg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Is(0,"p",13),HC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),ml());}function pe(i,t){if(i&1){let e=sC();Is(0,"button",24),Eg("click",function(){mf(e);let s=dC(2);return yf(s.remove())}),HC(1," Remove association "),ml();}if(i&2){let e=dC(2);pg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=sC();Yw(0,se,2,1,"ds-notice"),Yw(1,re,3,0,"div"),Yw(2,de,3,3,"ds-notice",3),Is(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.repositoryUrl.set(s))}),ml(),BI(),ml(),Is(6,"ds-form-field",7)(7,"input",8),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.mainBranch.set(s))}),ml(),BI(),ml(),Is(8,"ds-form-field",9)(9,"select",10),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.serviceAuthSettingId.set(s))}),Is(10,"option",11),HC(11,"Select an auth setting\u2026"),ml(),Jw(12,le,2,3,"option",12,oe),ml(),BI(),Yw(14,me,2,0,"p",13),ml()(),Is(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.autoWorktree.set(s))}),ml(),BI(),HC(19," Offer a worktree to every new top-level case "),ml(),Is(20,"p",18),HC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),ml()(),Is(22,"ds-form-field",19)(23,"input",20),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.setupCommand.set(s))}),ml(),BI(),Is(24,"p",13),HC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),ml()()(),Is(26,"ds-form-actions")(27,"button",21),Eg("click",function(){mf(e);let s=dC();return yf(s.save())}),HC(28),ml(),Yw(29,pe,2,1,"button",22),ml();}if(i&2){let e=dC();Qw(e.errorMessage()?0:-1),QE(),Qw(e.associationLoaded()?-1:1),QE(),Qw(e.isAssociated()&&e.checkoutStatus()?2:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(2),pg("ngModel",e.repositoryUrl()),HI(),QE(2),pg("ngModel",e.mainBranch()),HI(),QE(2),pg("ngModel",e.serviceAuthSettingId()),HI(),QE(3),eC(e.eligibleAuthSettings()),QE(2),Qw(e.eligibleAuthSettings().length===0?14:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(3),pg("ngModel",e.autoWorktree()),HI(),QE(5),pg("ngModel",e.setupCommand()),HI(),QE(4),pg("disabled",!e.canSave()),QE(),Il(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),QE(),Qw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=zi(true);isSaving=zi(false);confirmingRemove=zi(false);associationLoaded=zi(false);errorMessage=zi(null);association=zi(null);authSettings=zi([]);repositoryUrl=zi("");mainBranch=zi("main");serviceAuthSettingId=zi("");autoWorktree=zi(false);setupCommand=zi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ny({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,ae,2,0,"p",1)(3,ue,30,14),ml(),Is(4,"ds-confirm-dialog",2),Eg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),ml()),e&2&&(QE(2),Qw(c.isLoading()?2:3),QE(2),pg("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
1
+ import {I}from'./chunk-DEd4dYEy.js';import {g,W,aX as L,K as we,z as zi,j as mT,aY as Ue,ac as Ny,U,a2 as ga,aa as _r,N as Nw,I as Is,a as hg,Y as Yw,m as ml,R as Eg,Q as QE,b as Qw,P as pg,H as HC,s as sC,S as BI,J as Jw,p as dC,T as HI,k as eC,o as Il,as as jg,q as mf,r as yf,L as Lg}from'./main-2W2EKPFF.js';import {a6 as gd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,c as fo,a8 as _a,ac as Bi,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Is(0,"p",1),HC(1,"Loading\u2026"),ml());}function se(i,t){if(i&1&&(Is(0,"ds-notice"),HC(1),ml()),i&2){let e=dC(2);QE(),Lg(e.errorMessage());}}function re(i,t){if(i&1){let e=sC();Is(0,"div")(1,"button",23),Eg("click",function(){mf(e);let s=dC(2);return yf(s.retryLoad())}),HC(2,"Retry loading"),ml()();}}function ce(i,t){if(i&1&&(hg(0,"br"),HC(1)),i&2){let e=dC(3);QE(),Il("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Is(0,"ds-notice",3),HC(1),Yw(2,ce,2,1),ml()),i&2){let e=dC(2);pg("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),QE(),Il(" Repository: ",e.checkoutStatus()," "),QE(),Qw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Is(0,"option",12),HC(1),ml()),i&2){let e=t.$implicit,c=dC(2);pg("value",e.id),QE(),jg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Is(0,"p",13),HC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),ml());}function pe(i,t){if(i&1){let e=sC();Is(0,"button",24),Eg("click",function(){mf(e);let s=dC(2);return yf(s.remove())}),HC(1," Remove association "),ml();}if(i&2){let e=dC(2);pg("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=sC();Yw(0,se,2,1,"ds-notice"),Yw(1,re,3,0,"div"),Yw(2,de,3,3,"ds-notice",3),Is(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.repositoryUrl.set(s))}),ml(),BI(),ml(),Is(6,"ds-form-field",7)(7,"input",8),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.mainBranch.set(s))}),ml(),BI(),ml(),Is(8,"ds-form-field",9)(9,"select",10),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.serviceAuthSettingId.set(s))}),Is(10,"option",11),HC(11,"Select an auth setting\u2026"),ml(),Jw(12,le,2,3,"option",12,oe),ml(),BI(),Yw(14,me,2,0,"p",13),ml()(),Is(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.autoWorktree.set(s))}),ml(),BI(),HC(19," Offer a worktree to every new top-level case "),ml(),Is(20,"p",18),HC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),ml()(),Is(22,"ds-form-field",19)(23,"input",20),Eg("ngModelChange",function(s){mf(e);let u=dC();return yf(u.setupCommand.set(s))}),ml(),BI(),Is(24,"p",13),HC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),ml()()(),Is(26,"ds-form-actions")(27,"button",21),Eg("click",function(){mf(e);let s=dC();return yf(s.save())}),HC(28),ml(),Yw(29,pe,2,1,"button",22),ml();}if(i&2){let e=dC();Qw(e.errorMessage()?0:-1),QE(),Qw(e.associationLoaded()?-1:1),QE(),Qw(e.isAssociated()&&e.checkoutStatus()?2:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(2),pg("ngModel",e.repositoryUrl()),HI(),QE(2),pg("ngModel",e.mainBranch()),HI(),QE(2),pg("ngModel",e.serviceAuthSettingId()),HI(),QE(3),eC(e.eligibleAuthSettings()),QE(2),Qw(e.eligibleAuthSettings().length===0?14:-1),QE(),pg("disabled",!e.associationLoaded()||e.isSaving()),QE(3),pg("ngModel",e.autoWorktree()),HI(),QE(5),pg("ngModel",e.setupCommand()),HI(),QE(4),pg("disabled",!e.canSave()),QE(),Il(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),QE(),Qw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(we);isLoading=zi(true);isSaving=zi(false);confirmingRemove=zi(false);associationLoaded=zi(false);errorMessage=zi(null);association=zi(null);authSettings=zi([]);repositoryUrl=zi("");mainBranch=zi("main");serviceAuthSettingId=zi("");autoWorktree=zi(false);setupCommand=zi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ue;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ny({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ga(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),_r(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Yw(2,ae,2,0,"p",1)(3,ue,30,14),ml(),Is(4,"ds-confirm-dialog",2),Eg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),ml()),e&2&&(QE(2),Qw(c.isLoading()?2:3),QE(2),pg("open",c.confirmingRemove()));},dependencies:[gd,Mo,Do,Ut,Mn,Qt,fo,_a,Bi,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};
2
2
  export{ne as NamespaceGitComponent};
@@ -1 +1 @@
1
- import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-anaDHfEv.js';import {g,F,K as we,ag as U$1,$ as Sr,z as zi,a1 as ma,U as U$2,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-OLEL3JTU.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading agent configs\u2026"),ml());}function H(n,e){n&1&&(Is(0,"p",5),HC(1,"No platform agent configs defined yet."),ml());}function U(n,e){n&1&&(Is(0,"p",4),HC(1,"No agent configs match the current filter."),ml());}function z(n,e){if(n&1){let t=sC();Is(0,"button",19),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.inspect(d))}),HC(1," Inspect "),ml(),Is(2,"button",19),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.edit(d))}),HC(3,"Edit"),ml();}if(n&2){let t=dC().$implicit;fg("aria-label","Inspect "+t.name),QE(2),fg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=sC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=dC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,a=dC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14),HC(6),ml(),Is(7,"td",15),HC(8),ml(),Is(9,"td",16)(10,"div",17),Yw(11,z,4,2),Yw(12,G,1,3,"agentos-row-delete-action",18),ml()()()),n&2){let t=e.$implicit,a=dC(2);QE(2),Lg(t.name),QE(2),Il(" ",t.description||"\u2014"," "),QE(2),Lg(t.modelName||"\u2014"),QE(2),Lg(a.mode(t)),QE(3),Qw(a.deletion.confirmingId()!==t.id?11:-1),QE(),Qw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Model"),ml(),Is(10,"th",10),HC(11,"Execution mode"),ml(),Is(12,"th",10)(13,"span",11),HC(14,"Actions"),ml()()()(),Is(15,"tbody",8),Jw(16,J,13,6,"tr",9,B),ml()()()),n&2){let t=dC();QE(16),eC(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),HC(3,"New agent config"),ml()(),Yw(4,j,2,1,"p",3),Yw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(QE(),pg("query",a.rowFilter.query()),QE(3),Qw(a.deletion.error()?4:-1),QE(),Qw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
1
+ import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,F,K as we,ag as U$1,$ as Sr,z as zi,a1 as ma,U as U$2,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading agent configs\u2026"),ml());}function H(n,e){n&1&&(Is(0,"p",5),HC(1,"No platform agent configs defined yet."),ml());}function U(n,e){n&1&&(Is(0,"p",4),HC(1,"No agent configs match the current filter."),ml());}function z(n,e){if(n&1){let t=sC();Is(0,"button",19),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.inspect(d))}),HC(1," Inspect "),ml(),Is(2,"button",19),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.edit(d))}),HC(3,"Edit"),ml();}if(n&2){let t=dC().$implicit;fg("aria-label","Inspect "+t.name),QE(2),fg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=sC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=dC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,a=dC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14),HC(6),ml(),Is(7,"td",15),HC(8),ml(),Is(9,"td",16)(10,"div",17),Yw(11,z,4,2),Yw(12,G,1,3,"agentos-row-delete-action",18),ml()()()),n&2){let t=e.$implicit,a=dC(2);QE(2),Lg(t.name),QE(2),Il(" ",t.description||"\u2014"," "),QE(2),Lg(t.modelName||"\u2014"),QE(2),Lg(a.mode(t)),QE(3),Qw(a.deletion.confirmingId()!==t.id?11:-1),QE(),Qw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Model"),ml(),Is(10,"th",10),HC(11,"Execution mode"),ml(),Is(12,"th",10)(13,"span",11),HC(14,"Actions"),ml()()()(),Is(15,"tbody",8),Jw(16,J,13,6,"tr",9,B),ml()()()),n&2){let t=dC();QE(16),eC(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),HC(3,"New agent config"),ml()(),Yw(4,j,2,1,"p",3),Yw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(QE(),pg("query",a.rowFilter.query()),QE(3),Qw(a.deletion.error()?4:-1),QE(),Qw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -1 +1 @@
1
- import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-anaDHfEv.js';import {g,W,F,K as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Ne,j as mT,z as zi,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,a as hg,S as BI,J as Jw,ao as Xw,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,as as jg,q as mf,r as yf}from'./main-OLEL3JTU.js';function he(r,t){r&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=dC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),HC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),QE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),HC(2,"Select provider"),ml(),Jw(3,ye,2,3,"option",44,qw().trackByProvider,true),ml(),BI()),r&2){let e=dC(2);pg("formControl",e.aiProviderIdControl),HI(),QE(3),eC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),HC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),QE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),HC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),HC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),HC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=dC();return yf(u.submit())}),Is(1,"ds-form-field",5),Yw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),BI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),BI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),BI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),BI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),BI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),BI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),HC(22,"Provider default"),ml(),Jw(23,xe,2,2,"option",25,Xw),ml(),BI(),Yw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Yw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),BI(),Is(31,"span",30),HC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),HC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),BI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),BI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),BI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),BI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),HC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=dC();return yf(u.cancel())}),HC(50,"Cancel"),ml()()();}if(r&2){let e=dC();pg("formGroup",e.form),QE(2),Qw(e.isEditMode()?2:3),QE(3),pg("formControl",e.apiModelNameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.aliasControl),HI(),QE(2),pg("formControl",e.priorityControl),HI(),QE(3),pg("formControl",e.temperatureControl),HI(),QE(2),pg("formControl",e.contextWindowControl),HI(),QE(2),pg("formControl",e.maxCompletionTokensControl),HI(),QE(2),pg("formControl",e.reasoningEffortControl),HI(),QE(),pg("ngValue",null),QE(2),eC(e.reasoningEffortOptions),QE(2),Qw(e.reasoningEffortUnsupported()?25:26),QE(2),Qw(e.temperatureMayConflictWithEffort()?27:-1),QE(3),pg("formControl",e.supportsAdvancedExecutionControl),HI(),QE(5),pg("formGroup",e.pricingGroup),QE(3),HI(),QE(2),HI(),QE(3),HI(),QE(2),HI(),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=mT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=mT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=mT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),HC(3," \u2190 AI models "),ml()(),Yw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(QE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),QE(3),Qw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
1
+ import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-CV72_wbg.js';import {g,W,F,K as we,aq as F$1,ap as k,a9 as F$2,a2 as ga,aa as _r,ar as Ne,j as mT,z as zi,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,a as hg,S as BI,J as Jw,ao as Xw,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,as as jg,q as mf,r as yf}from'./main-2W2EKPFF.js';function he(r,t){r&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ve(r,t){if(r&1&&hg(0,"input",6),r&2){let e=dC(2);pg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Is(0,"option",44),HC(1),ml()),r&2){let e=t.$implicit;pg("value",e.id),QE(),jg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Is(0,"select",7)(1,"option",43),HC(2,"Select provider"),ml(),Jw(3,ye,2,3,"option",44,qw().trackByProvider,true),ml(),BI()),r&2){let e=dC(2);pg("formControl",e.aiProviderIdControl),HI(),QE(3),eC(e.providers());}}function xe(r,t){if(r&1&&(Is(0,"option",25),HC(1),ml()),r&2){let e=t.$implicit;pg("ngValue",e),QE(),Lg(e.toLowerCase());}}function _e(r,t){r&1&&(Is(0,"p",2),HC(1,"Not supported yet for Anthropic and Gemini providers."),ml());}function Me(r,t){r&1&&(Is(0,"p",2),HC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),ml());}function Ee(r,t){r&1&&(Is(0,"p",26),HC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),ml());}function Ae(r,t){if(r&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let u=dC();return yf(u.submit())}),Is(1,"ds-form-field",5),Yw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),ml(),Is(4,"ds-form-field",8),hg(5,"input",9),BI(),ml(),Is(6,"ds-form-field",10),hg(7,"input",11),BI(),ml(),Is(8,"ds-form-field",12),hg(9,"input",13),BI(),ml(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"div",16)(13,"ds-form-field",17),hg(14,"input",18),BI(),ml(),Is(15,"ds-form-field",19),hg(16,"input",20),BI(),ml()(),Is(17,"ds-form-field",21),hg(18,"input",22),BI(),ml(),Is(19,"ds-form-field",23)(20,"select",24)(21,"option",25),HC(22,"Provider default"),ml(),Jw(23,xe,2,2,"option",25,Xw),ml(),BI(),Yw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Yw(27,Ee,2,0,"p",26),ml(),Is(28,"div",27)(29,"label",28),hg(30,"input",29),BI(),Is(31,"span",30),HC(32,"Supports advanced execution"),ml()(),Is(33,"p",31),HC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),ml()(),Is(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),hg(38,"input",34),BI(),ml(),Is(39,"ds-form-field",35),hg(40,"input",36),BI(),ml()(),Is(41,"div",16)(42,"ds-form-field",37),hg(43,"input",38),BI(),ml(),Is(44,"ds-form-field",39),hg(45,"input",40),BI(),ml()()(),Is(46,"ds-form-actions")(47,"button",41),HC(48),ml(),Is(49,"button",42),Eg("click",function(){mf(e);let u=dC();return yf(u.cancel())}),HC(50,"Cancel"),ml()()();}if(r&2){let e=dC();pg("formGroup",e.form),QE(2),Qw(e.isEditMode()?2:3),QE(3),pg("formControl",e.apiModelNameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.aliasControl),HI(),QE(2),pg("formControl",e.priorityControl),HI(),QE(3),pg("formControl",e.temperatureControl),HI(),QE(2),pg("formControl",e.contextWindowControl),HI(),QE(2),pg("formControl",e.maxCompletionTokensControl),HI(),QE(2),pg("formControl",e.reasoningEffortControl),HI(),QE(),pg("ngValue",null),QE(2),eC(e.reasoningEffortOptions),QE(2),Qw(e.reasoningEffortUnsupported()?25:26),QE(2),Qw(e.temperatureMayConflictWithEffort()?27:-1),QE(3),pg("formControl",e.supportsAdvancedExecutionControl),HI(),QE(5),pg("formGroup",e.pricingGroup),QE(3),HI(),QE(2),HI(),QE(3),HI(),QE(2),HI(),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ga(()=>_r([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ne);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=mT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=mT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);selectedProviderLabel=mT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Ff(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Nw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return c.cancel()}),HC(3," \u2190 AI models "),ml()(),Yw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),ml()),e&2&&(QE(),pg("title",c.isEditMode()?"Edit AI model":"New AI model"),QE(3),Qw(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
@@ -1 +1 @@
1
- import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-anaDHfEv.js';import {g,F,K as we,$ as Sr,z as zi,a1 as ma,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,i as fg,q as mf,r as yf}from'./main-OLEL3JTU.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),HC(1),ml()),t&2){let n=dC();QE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),HC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),HC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),HC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=sC();Is(0,"button",18),Eg("click",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.edit(m))}),HC(1,"Edit"),ml();}if(t&2){let n=dC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=sC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=dC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=dC().$implicit,r=dC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15),Yw(7,z,2,1,"button",16),Yw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=dC(2);QE(2),Lg(n.name),QE(2),Il(" ",n.description||"\u2014"," "),QE(3),Qw(r.deletion.confirmingId()!==n.id?7:-1),QE(),Qw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),HC(10,"Actions"),ml()()()(),Is(11,"tbody",8),Jw(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=dC();QE(12),eC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Nw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["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","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),HC(3,"New prompt"),ml()(),Yw(4,A,2,1,"p",3),Yw(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&&(QE(),pg("query",r.rowFilter.query()),QE(3),Qw(r.deletion.error()?4:-1),QE(),Qw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
1
+ import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,F,K as we,$ as Sr,z as zi,a1 as ma,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,i as fg,q as mf,r as yf}from'./main-2W2EKPFF.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),HC(1),ml()),t&2){let n=dC();QE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),HC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),HC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),HC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=sC();Is(0,"button",18),Eg("click",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.edit(m))}),HC(1,"Edit"),ml();}if(t&2){let n=dC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=sC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=dC().$implicit,p=dC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=dC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=dC().$implicit,r=dC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15),Yw(7,z,2,1,"button",16),Yw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=dC(2);QE(2),Lg(n.name),QE(2),Il(" ",n.description||"\u2014"," "),QE(3),Qw(r.deletion.confirmingId()!==n.id?7:-1),QE(),Qw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),HC(10,"Actions"),ml()()()(),Is(11,"tbody",8),Jw(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=dC();QE(12),eC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Nw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["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","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),HC(3,"New prompt"),ml()(),Yw(4,A,2,1,"p",3),Yw(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&&(QE(),pg("query",r.rowFilter.query()),QE(3),Qw(r.deletion.error()?4:-1),QE(),Qw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
@@ -1 +1 @@
1
- import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-anaDHfEv.js';import {g,W as W$1,F,K as we,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-OLEL3JTU.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function G(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading prompts\u2026"),ml());}function O(n,e){n&1&&(Is(0,"p",5),HC(1,"No prompts available."),ml());}function Q(n,e){n&1&&(Is(0,"p",4),HC(1,"No prompts match the current filter."),ml());}function W(n,e){n&1&&(Is(0,"ds-tag",17),HC(1,"Read-only"),ml());}function X(n,e){if(n&1){let t=sC();Is(0,"button",23),Eg("click",function(){mf(t);let l=dC(2).$implicit,m=dC(2);return yf(m.edit(l))}),HC(1," Edit "),ml();}if(n&2){let t=dC(2).$implicit;fg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=sC();Yw(0,X,2,1,"button",21),Is(1,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(t);let l=dC().$implicit,m=dC(2);return yf(m.deletion.request(l.key))})("deleteConfirmed",function(){mf(t);let l=dC().$implicit,m=dC(2);return yf(m.confirmDelete(l))})("deleteCancelled",function(){mf(t);let l=dC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,i=dC(2);Qw(i.deletion.confirmingId()!==t.key?0:-1),QE(),pg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Is(0,"button",20),HC(1,"Inherited"),ml());}function ee(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15)(7,"ds-tag",16),HC(8),ml(),Yw(9,W,2,0,"ds-tag",17),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,Y,2,4)(13,Z,2,0,"button",20),ml()()()),n&2){let t=e.$implicit;QE(2),Lg(t.prompt.name),QE(2),Il(" ",t.prompt.description||"\u2014"," "),QE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),QE(),Lg(t.scope==="platform"?"Platform":"Namespace"),QE(),Qw(t.scope==="platform"?9:-1),QE(3),Qw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Scope"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,ee,14,6,"tr",9,U),ml()()()),n&2){let t=dC();QE(14),eC(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({platform:this.promptState.listPlatform().pipe(ga(()=>_r([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return i.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New prompt"),ml()(),Yw(4,z,2,1,"p",3),Yw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(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{J as NamespacePromptsComponent};
1
+ import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,W as W$1,F,K as we,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,U as U$1,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function G(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading prompts\u2026"),ml());}function O(n,e){n&1&&(Is(0,"p",5),HC(1,"No prompts available."),ml());}function Q(n,e){n&1&&(Is(0,"p",4),HC(1,"No prompts match the current filter."),ml());}function W(n,e){n&1&&(Is(0,"ds-tag",17),HC(1,"Read-only"),ml());}function X(n,e){if(n&1){let t=sC();Is(0,"button",23),Eg("click",function(){mf(t);let l=dC(2).$implicit,m=dC(2);return yf(m.edit(l))}),HC(1," Edit "),ml();}if(n&2){let t=dC(2).$implicit;fg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=sC();Yw(0,X,2,1,"button",21),Is(1,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(t);let l=dC().$implicit,m=dC(2);return yf(m.deletion.request(l.key))})("deleteConfirmed",function(){mf(t);let l=dC().$implicit,m=dC(2);return yf(m.confirmDelete(l))})("deleteCancelled",function(){mf(t);let l=dC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,i=dC(2);Qw(i.deletion.confirmingId()!==t.key?0:-1),QE(),pg("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Is(0,"button",20),HC(1,"Inherited"),ml());}function ee(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14)(6,"div",15)(7,"ds-tag",16),HC(8),ml(),Yw(9,W,2,0,"ds-tag",17),ml()(),Is(10,"td",18)(11,"div",19),Yw(12,Y,2,4)(13,Z,2,0,"button",20),ml()()()),n&2){let t=e.$implicit;QE(2),Lg(t.prompt.name),QE(2),Il(" ",t.prompt.description||"\u2014"," "),QE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),QE(),Lg(t.scope==="platform"?"Platform":"Namespace"),QE(),Qw(t.scope==="platform"?9:-1),QE(3),Qw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Scope"),ml(),Is(10,"th",10)(11,"span",11),HC(12,"Actions"),ml()()()(),Is(13,"tbody",8),Jw(14,ee,14,6,"tr",9,U),ml()()()),n&2){let t=dC();QE(14),eC(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({platform:this.promptState.listPlatform().pipe(ga(()=>_r([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["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","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return i.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),HC(3,"New prompt"),ml()(),Yw(4,z,2,1,"p",3),Yw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(QE(),pg("query",i.rowFilter.query()),QE(3),Qw(i.deletion.error()?4:-1),QE(),Qw(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{J as NamespacePromptsComponent};
@@ -1,4 +1,4 @@
1
- import {aZ as A,a_ as z$1}from'./main-OLEL3JTU.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 {aZ as A,a_ as z$1}from'./main-2W2EKPFF.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
2
2
  `});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
3
3
  `?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
4
4
  `&&(E.last=l.length==0||l[0].tag==`
@@ -1 +1 @@
1
- import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DXhOdsyd.js';import {O}from'./chunk-DNO_UKkx.js';import {g,W,F as F$1,K as we,ag as U,ay as N,z as zi,az as Q,a8 as _,j as mT,a9 as F$2,aA as Me,U as U$1,a2 as ga,aa as _r,ac as Ny,ad as ne,O as x,M as w,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,s as sC,a as hg,S as BI,T as HI,i as fg,o as Il,J as Jw,k as eC,L as Lg,q as mf,r as yf,as as jg}from'./main-OLEL3JTU.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-anaDHfEv.js';import'./chunk-C7Y0YglE.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),HC(1,"View resolved definition \u2192"),ml()),n&2){let e=dC();pg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),HC(1,"Platform level"),ml());}function Qe(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function Ze(n,t){if(n&1&&(hg(0,"input",17),BI()),n&2){let e=dC(2);pg("formControl",e.modelNameControl),HI();}}function et(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t;pg("ngValue",e.value),QE(),Lg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),QE(),Lg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),Jw(1,tt,2,2,"option",41,je),ml()),n&2){let e=dC(3);QE(),eC(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),QE(),Lg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),Jw(1,it,2,2,"option",41,je),ml()),n&2){let e=dC(3);QE(),eC(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),HC(2,"Select a model"),ml(),Yw(3,et,2,2,"option",41),Yw(4,nt,3,0,"optgroup",42),Yw(5,ot,3,0,"optgroup",43),ml(),BI()),n&2){let e,i=dC(2);pg("formControl",i.modelNameControl),HI(),QE(),pg("ngValue",null),QE(2),Qw((e=i.modelOptions().current)?3:-1,e),QE(),Qw(i.modelOptions().aliases.length>0?4:-1),QE(),Qw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.config.integrationType);}}function rt(n,t){if(n&1&&(hg(0,"input",45),BI()),n&2){let e=dC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),HI();}}function st(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",11)(2,"input",23),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleIntegration(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,lt,2,1,"span",44),ml(),Yw(6,rt,1,2,"input",45),ml();}if(n&2){let e=t.$implicit;QE(2),pg("checked",e.enabled()),QE(2),Lg(e.config.name),QE(),Qw(e.config.integrationType?5:-1),QE(),Qw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",24),HC(2),Is(3,"span",44),HC(4,"built-in"),ml()(),Is(5,"select",47),Eg("change",function(s){let c=mf(e).$implicit,C=dC(4);return yf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),HC(7),ml(),Is(8,"option",49),HC(9,"Enabled"),ml(),Is(10,"option",50),HC(11,"Disabled"),ml()(),Yw(12,dt,2,1,"p",13),Is(13,"p",13),HC(14),ml()();}if(n&2){let e=t.$implicit,i=dC(4);QE(),fg("for","built-in-"+e.type),QE(),Il(" ",e.displayName," "),QE(3),pg("id","built-in-"+e.type)("value",e.state()),QE(2),Lg(i.builtInDefaultLabel(e)),QE(5),Qw(e.state()==="on"&&e.restrictedTools?12:-1),QE(2),Lg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),HC(1,"Built-in integrations"),ml(),Jw(2,ct,15,7,"div",10,qe)),n&2){let e=dC(3);QE(2),eC(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),HC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),Jw(1,st,7,4,"div",10,Ye),Yw(3,mt,4,0),Yw(4,ut,2,0,"ds-notice",26),ml()),n&2){let e=dC(2);QE(),eC(e.integrationRows()),QE(2),Qw(e.builtInRows().length>0?3:-1),QE(),Qw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&HC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),HC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),HC(3,"*"),ml(),HC(4,". "),ml());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),HC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function _t(n,t){n&1&&(Is(0,"p",4),HC(1,"No skill available in this scope yet."),ml());}function bt(n,t){n&1&&(Is(0,"span",44),HC(1,"platform"),ml());}function ht(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC(4);QE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function vt(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",11)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleSkill(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,bt,2,0,"span",44),Yw(6,ht,2,1,"span",44),ml(),Yw(7,yt,2,1,"p",13),ml();}if(n&2){let e=t.$implicit,i=dC(3);QE(2),pg("checked",e.selected())("disabled",i.allSkillsSelected()),QE(2),Lg(e.name),QE(),Qw(e.platform?5:-1),QE(),Qw(e.unresolved?6:-1),QE(),Qw(e.description?7:-1);}}function xt(n,t){if(n&1&&Jw(0,vt,8,6,"div",10,We),n&2){let e=dC(2);eC(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),hg(1,"textarea",52),BI(),Is(2,"p",4),HC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),HC(5,"AgentLoopPayload"),ml(),HC(6,". Leave empty if you always provide the payload at launch. "),ml()()),n&2){let e=dC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),QE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),HI();}}function At(n,t){n&1&&HC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&HC(0),n&2){let e=dC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),HC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),HC(3,"*"),ml(),HC(4,". "),Yw(5,wt,1,2),ml()),n&2){let e=dC(2);QE(5),Qw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),HC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function kt(n,t){n&1&&(Is(0,"p",4),HC(1,"No other agent is available in this scope yet."),ml());}function It(n,t){n&1&&(Is(0,"span",44),HC(1,"pattern"),ml());}function Rt(n,t){n&1&&(Is(0,"span",44),HC(1,"via pattern"),ml());}function Mt(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC(4);QE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=sC();Is(0,"button",55),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(3);return yf(c.removeSubAgent(s))}),HC(1," \xD7 "),ml();}if(n&2){let e=dC().$implicit;fg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=sC();Is(0,"div",32)(1,"label",53)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleSubAgent(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),ml(),Yw(8,Ft,2,1,"button",54),ml();}if(n&2){let e=t.$implicit,i=dC(3);QE(2),pg("checked",e.selected())("disabled",i.allSubAgentsSelected()),QE(2),Lg(e.name),QE(),Qw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),QE(3),Qw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Jw(0,Nt,9,5,"div",32,We),n&2){let e=dC(2);eC(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=sC();Is(0,"div")(1,"button",56),Eg("click",function(){mf(e);let s=dC(2);return yf(s.useDefaultDelegationTimeout())}),HC(2," Use server default "),ml()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),HC(1),ml()),n&2&&(QE(),Lg(t));}function Pt(n,t){if(n&1){let e=sC();Is(0,"button",57),Eg("click",function(){mf(e);let s=dC(2);return yf(s.exportYaml())}),HC(1),ml();}if(n&2){let e=dC(2);pg("disabled",e.isExporting()),QE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=sC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let s=dC();return yf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),hg(3,"input",9),BI(),ml(),Is(4,"div",10)(5,"label",11),hg(6,"input",12),BI(),HC(7," Enabled "),ml(),Is(8,"p",13),HC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"ds-form-field",16),Yw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),ml(),Is(15,"ds-form-field",19),hg(16,"textarea",20),BI(),ml()(),Yw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),HC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),HC(22,"readSkill"),ml(),HC(23," and "),Is(24,"code"),HC(25,"readSkillResource"),ml(),HC(26," tools; selecting none grants neither. "),Yw(27,pt,1,0),ml(),Is(28,"label",11)(29,"input",23),Eg("change",function(){mf(e);let s=dC();return yf(s.toggleAllSkills())}),ml(),Is(30,"span",24),HC(31,"Every skill in the catalogue ("),Is(32,"code",25),HC(33,"*"),ml(),HC(34,")"),ml()(),Is(35,"p",13),HC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Yw(37,ft,5,0,"ds-notice",26),Yw(38,Ct,2,0,"ds-notice"),Yw(39,_t,2,0,"p",4)(40,xt,2,0),ml(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),HC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(45,"option",29),HC(46,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(47,"option",29),HC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),BI(),ml(),Yw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),HC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),HC(54,"DELEGATE__delegate"),ml(),HC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Yw(56,At,1,0),ml(),Is(57,"label",11)(58,"input",23),Eg("change",function(){mf(e);let s=dC();return yf(s.toggleAllSubAgents())}),ml(),Is(59,"span",24),HC(60,"Every agent it can reach ("),Is(61,"code",25),HC(62,"*"),ml(),HC(63,")"),ml()(),Is(64,"p",13),HC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Yw(66,Et,6,1,"ds-notice",26),Yw(67,Tt,2,0,"ds-notice"),Yw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),HC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),HC(73,"*Fixer"),ml(),HC(74," to cover BugFixer and StoryFixer. "),ml(),Is(75,"div",32)(76,"input",33),Eg("keydown.enter",function(){mf(e);let s=dC();return yf(s.addSubAgent())}),ml(),BI(),Is(77,"button",34),Eg("click",function(){mf(e);let s=dC();return yf(s.addSubAgent())}),HC(78," + "),ml()(),Is(79,"ds-form-field",35),hg(80,"input",36),BI(),Yw(81,Lt,3,0,"div"),ml()(),Yw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),HC(85),ml(),Yw(86,Pt,2,2,"button",38),Is(87,"button",39),Eg("click",function(){mf(e);let s=dC();return yf(s.cancel())}),HC(88,"Cancel"),ml()()();}if(n&2){let e,i=dC();pg("formGroup",i.form),QE(3),pg("formControl",i.nameControl),HI(),QE(3),pg("formControl",i.enabledControl),HI(),QE(5),pg("formControl",i.descriptionControl),HI(),QE(2),Qw(i.modelAsFreeText()?13:14),QE(3),pg("formControl",i.instructionsControl),HI(),QE(),Qw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),QE(10),Qw(i.isPlatformMode?27:-1),QE(2),pg("checked",i.allSkillsSelected()),QE(8),Qw(i.namedSkillSelectionDropped()?37:-1),QE(),Qw(i.skillCatalogueUnavailable()?38:-1),QE(),Qw(i.skillRows().length===0?39:40),QE(3),pg("formControl",i.executionModeControl),HI(),QE(),pg("value",i.ExecutionMode.SIMPLE),QE(2),pg("value",i.ExecutionMode.ADVANCED),QE(2),pg("value",i.ExecutionMode.LOOP),QE(2),Qw(i.isLoopMode()?49:-1),QE(7),Qw(i.isPlatformMode?56:-1),QE(2),pg("checked",i.allSubAgentsSelected()),QE(8),Qw(i.namedSubAgentSelectionDropped()?66:-1),QE(),Qw(i.subAgentCandidatesUnavailable()?67:-1),QE(),Qw(i.subAgentRows().length===0?68:69),QE(8),pg("formControl",i.newSubAgentControl),HI(),QE(),pg("disabled",!i.newSubAgentControl.value.trim()),QE(2),pg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),QE(),pg("formControl",i.delegationTimeoutControl),fg("aria-invalid",i.delegationTimeoutControl.invalid),HI(),QE(),Qw(i.delegationTimeoutControl.value!==null?81:-1),QE(),Qw((e=i.submitError())?82:-1,e),QE(2),pg("disabled",i.form.invalid||i.isSubmitting()),QE(),Il(" ",i.isEditMode()?"Save changes":"Create"," "),QE(),Qw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=mT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=mT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=mT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=mT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=mT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Me;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=mT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=mT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=mT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return i.cancel()}),HC(3," \u2190 Agent configs "),ml(),Yw(4,ze,2,1,"a",2),Yw(5,Xe,2,0,"ds-tag",3),ml(),Yw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),ml()),e&2&&(QE(),pg("title",i.isEditMode()?"Edit agent config":"New agent config"),QE(3),Qw(i.isEditMode()?4:-1),QE(),Qw(i.isPlatformMode?5:-1),QE(),Qw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};
1
+ import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-5mGW4E0G.js';import {O}from'./chunk-DtO-loh9.js';import {g,W,F as F$1,K as we,ag as U,ay as N,z as zi,az as Q,a8 as _,j as mT,a9 as F$2,aA as Me,U as U$1,a2 as ga,aa as _r,ac as Ny,ad as ne,O as x,M as w,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,s as sC,a as hg,S as BI,T as HI,i as fg,o as Il,J as Jw,k as eC,L as Lg,q as mf,r as yf,as as jg}from'./main-2W2EKPFF.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';var F="*";function Be(n){return (n??[]).some(t=>t.trim()===F)}function $e(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function He(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>He(e)?.test(n)??false)}var Ge="AGENTOS_CONFIG",Je=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ue(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Je.has(t)))}var je=(n,t)=>t.value,Ye=(n,t)=>t.config.id,qe=(n,t)=>t.type,We=(n,t)=>t.selector;function ze(n,t){if(n&1&&(Is(0,"a",2),HC(1,"View resolved definition \u2192"),ml()),n&2){let e=dC();pg("routerLink",e.inspectRoute());}}function Xe(n,t){n&1&&(Is(0,"ds-tag",3),HC(1,"Platform level"),ml());}function Qe(n,t){n&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function Ze(n,t){if(n&1&&(hg(0,"input",17),BI()),n&2){let e=dC(2);pg("formControl",e.modelNameControl),HI();}}function et(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t;pg("ngValue",e.value),QE(),Lg(e.label);}}function tt(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),QE(),Lg(e.label);}}function nt(n,t){if(n&1&&(Is(0,"optgroup",42),Jw(1,tt,2,2,"option",41,je),ml()),n&2){let e=dC(3);QE(),eC(e.modelOptions().aliases);}}function it(n,t){if(n&1&&(Is(0,"option",41),HC(1),ml()),n&2){let e=t.$implicit;pg("ngValue",e.value),QE(),Lg(e.label);}}function ot(n,t){if(n&1&&(Is(0,"optgroup",43),Jw(1,it,2,2,"option",41,je),ml()),n&2){let e=dC(3);QE(),eC(e.modelOptions().apiNames);}}function at(n,t){if(n&1&&(Is(0,"select",18)(1,"option",40),HC(2,"Select a model"),ml(),Yw(3,et,2,2,"option",41),Yw(4,nt,3,0,"optgroup",42),Yw(5,ot,3,0,"optgroup",43),ml(),BI()),n&2){let e,i=dC(2);pg("formControl",i.modelNameControl),HI(),QE(),pg("ngValue",null),QE(2),Qw((e=i.modelOptions().current)?3:-1,e),QE(),Qw(i.modelOptions().aliases.length>0?4:-1),QE(),Qw(i.modelOptions().apiNames.length>0?5:-1);}}function lt(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.config.integrationType);}}function rt(n,t){if(n&1&&(hg(0,"input",45),BI()),n&2){let e=dC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),HI();}}function st(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",11)(2,"input",23),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleIntegration(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,lt,2,1,"span",44),ml(),Yw(6,rt,1,2,"input",45),ml();}if(n&2){let e=t.$implicit;QE(2),pg("checked",e.enabled()),QE(2),Lg(e.config.name),QE(),Qw(e.config.integrationType?5:-1),QE(),Qw(e.enabled()?6:-1);}}function dt(n,t){if(n&1&&(Is(0,"p",13),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ct(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",24),HC(2),Is(3,"span",44),HC(4,"built-in"),ml()(),Is(5,"select",47),Eg("change",function(s){let c=mf(e).$implicit,C=dC(4);return yf(C.setBuiltInState(c,s.target.value))}),Is(6,"option",48),HC(7),ml(),Is(8,"option",49),HC(9,"Enabled"),ml(),Is(10,"option",50),HC(11,"Disabled"),ml()(),Yw(12,dt,2,1,"p",13),Is(13,"p",13),HC(14),ml()();}if(n&2){let e=t.$implicit,i=dC(4);QE(),fg("for","built-in-"+e.type),QE(),Il(" ",e.displayName," "),QE(3),pg("id","built-in-"+e.type)("value",e.state()),QE(2),Lg(i.builtInDefaultLabel(e)),QE(5),Qw(e.state()==="on"&&e.restrictedTools?12:-1),QE(2),Lg(e.description);}}function mt(n,t){if(n&1&&(Is(0,"span",46),HC(1,"Built-in integrations"),ml(),Jw(2,ct,15,7,"div",10,qe)),n&2){let e=dC(3);QE(2),eC(e.builtInRows());}}function ut(n,t){n&1&&(Is(0,"ds-notice",26),HC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),ml());}function gt(n,t){if(n&1&&(Is(0,"ds-fieldset",21),Jw(1,st,7,4,"div",10,Ye),Yw(3,mt,4,0),Yw(4,ut,2,0,"ds-notice",26),ml()),n&2){let e=dC(2);QE(),eC(e.integrationRows()),QE(2),Qw(e.builtInRows().length>0?3:-1),QE(),Qw(e.configAgentExposureWarning()?4:-1);}}function pt(n,t){n&1&&HC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function ft(n,t){n&1&&(Is(0,"ds-notice",26),HC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),HC(3,"*"),ml(),HC(4,". "),ml());}function Ct(n,t){n&1&&(Is(0,"ds-notice"),HC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function _t(n,t){n&1&&(Is(0,"p",4),HC(1,"No skill available in this scope yet."),ml());}function bt(n,t){n&1&&(Is(0,"span",44),HC(1,"platform"),ml());}function ht(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC(4);QE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function yt(n,t){if(n&1&&(Is(0,"p",13),HC(1),ml()),n&2){let e=dC().$implicit;QE(),Lg(e.description);}}function vt(n,t){if(n&1){let e=sC();Is(0,"div",10)(1,"label",11)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleSkill(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,bt,2,0,"span",44),Yw(6,ht,2,1,"span",44),ml(),Yw(7,yt,2,1,"p",13),ml();}if(n&2){let e=t.$implicit,i=dC(3);QE(2),pg("checked",e.selected())("disabled",i.allSkillsSelected()),QE(2),Lg(e.name),QE(),Qw(e.platform?5:-1),QE(),Qw(e.unresolved?6:-1),QE(),Qw(e.description?7:-1);}}function xt(n,t){if(n&1&&Jw(0,vt,8,6,"div",10,We),n&2){let e=dC(2);eC(e.skillRows());}}function St(n,t){if(n&1&&(Is(0,"ds-form-field",30),hg(1,"textarea",52),BI(),Is(2,"p",4),HC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),HC(5,"AgentLoopPayload"),ml(),HC(6,". Leave empty if you always provide the payload at launch. "),ml()()),n&2){let e=dC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),QE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),HI();}}function At(n,t){n&1&&HC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function wt(n,t){if(n&1&&HC(0),n&2){let e=dC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Et(n,t){if(n&1&&(Is(0,"ds-notice",26),HC(1," Saving with this on replaces the selection below with "),Is(2,"code",25),HC(3,"*"),ml(),HC(4,". "),Yw(5,wt,1,2),ml()),n&2){let e=dC(2);QE(5),Qw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Tt(n,t){n&1&&(Is(0,"ds-notice"),HC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function kt(n,t){n&1&&(Is(0,"p",4),HC(1,"No other agent is available in this scope yet."),ml());}function It(n,t){n&1&&(Is(0,"span",44),HC(1,"pattern"),ml());}function Rt(n,t){n&1&&(Is(0,"span",44),HC(1,"via pattern"),ml());}function Mt(n,t){if(n&1&&(Is(0,"span",44),HC(1),ml()),n&2){let e=dC(4);QE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Ft(n,t){if(n&1){let e=sC();Is(0,"button",55),Eg("click",function(){mf(e);let s=dC().$implicit,c=dC(3);return yf(c.removeSubAgent(s))}),HC(1," \xD7 "),ml();}if(n&2){let e=dC().$implicit;fg("aria-label","Remove "+e.selector);}}function Nt(n,t){if(n&1){let e=sC();Is(0,"div",32)(1,"label",53)(2,"input",51),Eg("change",function(){let s=mf(e).$implicit,c=dC(3);return yf(c.toggleSubAgent(s))}),ml(),Is(3,"span",24),HC(4),ml(),Yw(5,It,2,0,"span",44)(6,Rt,2,0,"span",44)(7,Mt,2,1,"span",44),ml(),Yw(8,Ft,2,1,"button",54),ml();}if(n&2){let e=t.$implicit,i=dC(3);QE(2),pg("checked",e.selected())("disabled",i.allSubAgentsSelected()),QE(2),Lg(e.name),QE(),Qw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),QE(3),Qw(e.unresolved?8:-1);}}function Dt(n,t){if(n&1&&Jw(0,Nt,9,5,"div",32,We),n&2){let e=dC(2);eC(e.subAgentRows());}}function Lt(n,t){if(n&1){let e=sC();Is(0,"div")(1,"button",56),Eg("click",function(){mf(e);let s=dC(2);return yf(s.useDefaultDelegationTimeout())}),HC(2," Use server default "),ml()();}}function Vt(n,t){n&1&&(Is(0,"ds-notice"),HC(1),ml()),n&2&&(QE(),Lg(t));}function Pt(n,t){if(n&1){let e=sC();Is(0,"button",57),Eg("click",function(){mf(e);let s=dC(2);return yf(s.exportYaml())}),HC(1),ml();}if(n&2){let e=dC(2);pg("disabled",e.isExporting()),QE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ot(n,t){if(n&1){let e=sC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let s=dC();return yf(s.submit())}),Is(1,"ds-fieldset",7)(2,"ds-form-field",8),hg(3,"input",9),BI(),ml(),Is(4,"div",10)(5,"label",11),hg(6,"input",12),BI(),HC(7," Enabled "),ml(),Is(8,"p",13),HC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",14),hg(11,"input",15),BI(),ml(),Is(12,"ds-form-field",16),Yw(13,Ze,1,1,"input",17)(14,at,6,5,"select",18),ml(),Is(15,"ds-form-field",19),hg(16,"textarea",20),BI(),ml()(),Yw(17,gt,5,2,"ds-fieldset",21),Is(18,"ds-fieldset",22)(19,"p",4),HC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(21,"code"),HC(22,"readSkill"),ml(),HC(23," and "),Is(24,"code"),HC(25,"readSkillResource"),ml(),HC(26," tools; selecting none grants neither. "),Yw(27,pt,1,0),ml(),Is(28,"label",11)(29,"input",23),Eg("change",function(){mf(e);let s=dC();return yf(s.toggleAllSkills())}),ml(),Is(30,"span",24),HC(31,"Every skill in the catalogue ("),Is(32,"code",25),HC(33,"*"),ml(),HC(34,")"),ml()(),Is(35,"p",13),HC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Yw(37,ft,5,0,"ds-notice",26),Yw(38,Ct,2,0,"ds-notice"),Yw(39,_t,2,0,"p",4)(40,xt,2,0),ml(),Is(41,"ds-form-field",27)(42,"select",28)(43,"option",29),HC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(45,"option",29),HC(46,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(47,"option",29),HC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),BI(),ml(),Yw(49,St,7,3,"ds-form-field",30),Is(50,"ds-fieldset",31)(51,"p",4),HC(52," The agents this one may delegate to. Selecting at least one grants it the "),Is(53,"code"),HC(54,"DELEGATE__delegate"),ml(),HC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Yw(56,At,1,0),ml(),Is(57,"label",11)(58,"input",23),Eg("change",function(){mf(e);let s=dC();return yf(s.toggleAllSubAgents())}),ml(),Is(59,"span",24),HC(60,"Every agent it can reach ("),Is(61,"code",25),HC(62,"*"),ml(),HC(63,")"),ml()(),Is(64,"p",13),HC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Yw(66,Et,6,1,"ds-notice",26),Yw(67,Tt,2,0,"ds-notice"),Yw(68,kt,2,0,"p",4)(69,Dt,2,0),Is(70,"p",4),HC(71," Advanced \u2014 add a glob instead of picking a name, for example "),Is(72,"code"),HC(73,"*Fixer"),ml(),HC(74," to cover BugFixer and StoryFixer. "),ml(),Is(75,"div",32)(76,"input",33),Eg("keydown.enter",function(){mf(e);let s=dC();return yf(s.addSubAgent())}),ml(),BI(),Is(77,"button",34),Eg("click",function(){mf(e);let s=dC();return yf(s.addSubAgent())}),HC(78," + "),ml()(),Is(79,"ds-form-field",35),hg(80,"input",36),BI(),Yw(81,Lt,3,0,"div"),ml()(),Yw(82,Vt,2,1,"ds-notice"),Is(83,"ds-form-actions")(84,"button",37),HC(85),ml(),Yw(86,Pt,2,2,"button",38),Is(87,"button",39),Eg("click",function(){mf(e);let s=dC();return yf(s.cancel())}),HC(88,"Cancel"),ml()()();}if(n&2){let e,i=dC();pg("formGroup",i.form),QE(3),pg("formControl",i.nameControl),HI(),QE(3),pg("formControl",i.enabledControl),HI(),QE(5),pg("formControl",i.descriptionControl),HI(),QE(2),Qw(i.modelAsFreeText()?13:14),QE(3),pg("formControl",i.instructionsControl),HI(),QE(),Qw(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),QE(10),Qw(i.isPlatformMode?27:-1),QE(2),pg("checked",i.allSkillsSelected()),QE(8),Qw(i.namedSkillSelectionDropped()?37:-1),QE(),Qw(i.skillCatalogueUnavailable()?38:-1),QE(),Qw(i.skillRows().length===0?39:40),QE(3),pg("formControl",i.executionModeControl),HI(),QE(),pg("value",i.ExecutionMode.SIMPLE),QE(2),pg("value",i.ExecutionMode.ADVANCED),QE(2),pg("value",i.ExecutionMode.LOOP),QE(2),Qw(i.isLoopMode()?49:-1),QE(7),Qw(i.isPlatformMode?56:-1),QE(2),pg("checked",i.allSubAgentsSelected()),QE(8),Qw(i.namedSubAgentSelectionDropped()?66:-1),QE(),Qw(i.subAgentCandidatesUnavailable()?67:-1),QE(),Qw(i.subAgentRows().length===0?68:69),QE(8),pg("formControl",i.newSubAgentControl),HI(),QE(),pg("disabled",!i.newSubAgentControl.value.trim()),QE(2),pg("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),QE(),pg("formControl",i.delegationTimeoutControl),fg("aria-invalid",i.delegationTimeoutControl.invalid),HI(),QE(),Qw(i.delegationTimeoutControl.value!==null?81:-1),QE(),Qw((e=i.submitError())?82:-1,e),QE(2),pg("disabled",i.form.invalid||i.isSubmitting()),QE(),Il(" ",i.isEditMode()?"Save changes":"Create"," "),QE(),Qw(i.isEditMode()?86:-1);}}var Ke=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=mT(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=mT(()=>this.executionModeValue()==="LOOP");subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=mT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=mT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=mT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Me;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=zi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=mT(()=>Ue({configEnabled:this.builtInRows().some(t=>t.type===Ge&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=mT(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=mT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:c,skillCatalogue:C,delegationCandidates:E,models:T})=>{this.existingConfig=e,this.applyModelCatalogue(T,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,e.integrations??void 0)),this.allSubAgentsSelected.set(Be(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:c,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let T=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(T,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(c,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),c=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(c.has(f.name.toLowerCase()))})),T=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||T.has(N)||(T.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:i,namespace:s})=>[...i,...s]),ne(i=>i.map(s=>s.name).filter(s=>s.length>0)),ne(i=>n.dedupeByKey(i)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=$e(e),c=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==c||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),T=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),T.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return T}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",c=e?.[s],C=e!=null&&s in e,E=Array.isArray(c)?c.join(", "):"";return {config:i,enabled:zi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,c=e?.[i.type],C=s?Array.isArray(c)&&c.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(c)&&c.length>0?c:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",c=i.toolsControl.value.trim();t[s]=c===""?null:c.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),c=document.createElement("a");c.href=s,c.download=`${this.existingConfig?.name??"agent"}.yaml`,c.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return i.cancel()}),HC(3," \u2190 Agent configs "),ml(),Yw(4,ze,2,1,"a",2),Yw(5,Xe,2,0,"ds-tag",3),ml(),Yw(6,Qe,2,0,"p",4)(7,Ot,89,33,"form",5),ml()),e&2&&(QE(),pg("title",i.isEditMode()?"Edit agent config":"New agent config"),QE(3),Qw(i.isEditMode()?4:-1),QE(),Qw(i.isPlatformMode?5:-1),QE(),Qw(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],encapsulation:2})};export{Ke as AgentConfigFormComponent};