@whoz-oss/coday-client 0.0.0-workstream-forge.170 → 0.0.0-workstream-forge.171

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 (75) hide show
  1. package/browser/chunk-71J15-v3.js +1 -0
  2. package/browser/{chunk-B8I4f-Tr.js → chunk-8jObMYuf.js} +1 -1
  3. package/browser/{chunk-CwkXYTZA.js → chunk-B3NozCkD.js} +1 -1
  4. package/browser/chunk-BE2gr3p6.js +1 -0
  5. package/browser/{chunk-DjhKeD1b.js → chunk-BIQHTDel.js} +1 -1
  6. package/browser/chunk-BKo5gTaz.js +1 -0
  7. package/browser/{chunk-T-MyQ60v.js → chunk-BPKteNGV.js} +1 -1
  8. package/browser/chunk-BT-NlYaf.js +1 -0
  9. package/browser/{chunk-DpihPg3o.js → chunk-BTy6yKH4.js} +1 -1
  10. package/browser/{chunk-DJo3_Udm.js → chunk-BU3k32e3.js} +1 -1
  11. package/browser/chunk-B_QodpYG.js +1 -0
  12. package/browser/{chunk-YAdCsA0W.js → chunk-Blgx9AFm.js} +1 -1
  13. package/browser/chunk-Bq24Rml2.js +1 -0
  14. package/browser/{chunk-D2AQLKBp.js → chunk-BvstaQVd.js} +1 -1
  15. package/browser/{chunk-DsFj5ou4.js → chunk-C5m9mgHu.js} +1 -1
  16. package/browser/{chunk-BksPDz1g.js → chunk-CNU0caUf.js} +1 -1
  17. package/browser/chunk-C_OMTp5P.js +1 -0
  18. package/browser/{chunk-BDyOxfSx.js → chunk-CeHH5awD.js} +1 -1
  19. package/browser/{chunk-BMwQO1aF.js → chunk-CnV27gYr.js} +1 -1
  20. package/browser/{chunk-t7hrk6-r.js → chunk-Co0A853g.js} +1 -1
  21. package/browser/{chunk-QAL0dGUf.js → chunk-CoRwPlfd.js} +1 -1
  22. package/browser/chunk-D-BPxKQ6.js +1 -0
  23. package/browser/chunk-D2S3Krd9.js +1 -0
  24. package/browser/chunk-D8_LjQNu.js +668 -0
  25. package/browser/chunk-DDOr2TDF.js +1 -0
  26. package/browser/{chunk-B6iOc9hF.js → chunk-DFBs-RE9.js} +1 -1
  27. package/browser/{chunk-D8BdDsLf.js → chunk-DLChehGS.js} +1 -1
  28. package/browser/chunk-DQWi-xSi.js +1 -0
  29. package/browser/chunk-DVl0k4as.js +1 -0
  30. package/browser/chunk-DW2g7bf8.js +1 -0
  31. package/browser/{chunk-D1sMiX8H.js → chunk-DYTKtJg4.js} +1 -1
  32. package/browser/{chunk-DOdWgrVq.js → chunk-DZQmSPQb.js} +1 -1
  33. package/browser/{chunk-iSSo0lPZ.js → chunk-DcZyBFc0.js} +1 -1
  34. package/browser/chunk-DrWMSNHn.js +1 -0
  35. package/browser/chunk-DrpC3fGm.js +1 -0
  36. package/browser/chunk-DsTtqeXD.js +1 -0
  37. package/browser/chunk-DviWI6ZH.js +1 -0
  38. package/browser/chunk-EVTfRXob.js +1 -0
  39. package/browser/chunk-EnGHXwUB.js +1 -0
  40. package/browser/chunk-P4r1dEyn.js +2 -0
  41. package/browser/chunk-dhR_kF8u.js +1 -0
  42. package/browser/chunk-m9jY08fz.js +1 -0
  43. package/browser/chunk-w5fqwHg4.js +1 -0
  44. package/browser/chunk-xALPtt6X.js +1 -0
  45. package/browser/chunk-xgxXbGGi.js +1 -0
  46. package/browser/index.html +3 -3
  47. package/browser/{main-UDKVTVAZ.js → main-YWZOZ7BG.js} +1 -1
  48. package/browser/{styles-MKNSQU7Y.css → styles-FNIV4SFO.css} +1 -1
  49. package/package.json +1 -1
  50. package/browser/chunk-9BCVk9NQ.js +0 -1
  51. package/browser/chunk-9MylQlFX.js +0 -1
  52. package/browser/chunk-BAVg53Gi.js +0 -1
  53. package/browser/chunk-BB_dA66R.js +0 -1
  54. package/browser/chunk-BGhzqfFE.js +0 -1
  55. package/browser/chunk-BSyalGSH.js +0 -1
  56. package/browser/chunk-Bfn_agkT.js +0 -1
  57. package/browser/chunk-CCbfhj2G.js +0 -1
  58. package/browser/chunk-CGCJZ64O.js +0 -1
  59. package/browser/chunk-CJHYrcx3.js +0 -1
  60. package/browser/chunk-CXDCRruq.js +0 -1
  61. package/browser/chunk-CgAHFQGb.js +0 -2
  62. package/browser/chunk-CxFvnhVl.js +0 -1
  63. package/browser/chunk-D0KyNALN.js +0 -1
  64. package/browser/chunk-DB2QUY1u.js +0 -1
  65. package/browser/chunk-DGErIFJc.js +0 -668
  66. package/browser/chunk-DJxwfugY.js +0 -1
  67. package/browser/chunk-DT9JiqnH.js +0 -1
  68. package/browser/chunk-DTD__Dn_.js +0 -1
  69. package/browser/chunk-DUCp8ptZ.js +0 -1
  70. package/browser/chunk-DglVEB0S.js +0 -1
  71. package/browser/chunk-DuNCuAwy.js +0 -1
  72. package/browser/chunk-Dvoa2pcH.js +0 -1
  73. package/browser/chunk-Dz6l4scy.js +0 -1
  74. package/browser/chunk-QJCDzExw.js +0 -1
  75. package/browser/chunk-q29IcxwC.js +0 -1
@@ -0,0 +1 @@
1
+ import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-CnV27gYr.js';import {R}from'./chunk-CeHH5awD.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,av as ne$1,a8 as fa,a3 as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';import {z as A,F as F$1,i as at,h as hn,I as Io,q as ko,E,O}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function J(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function Q(n,e){n&1&&(Ds(0,"p",5),MC(1,"No auth settings available."),pl());}function W(n,e){n&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function X(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.duplicate(c))}),MC(1," Duplicate "),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let c=Xw(2).$implicit,d=Xw(2);return ff(d.edit(c))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function ee(n,e){if(n&1){let t=qw();Pw(0,Z,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(c.key))})("deleteConfirmed",function(){df(t);let c=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(c))})("deleteCancelled",function(){df(t);let c=Xw(3);return ff(c.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);Lw(a.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function te(n,e){n&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function ne(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,X,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,1,"button",20),Pw(13,ee,2,4)(14,te,2,0,"button",21),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.authType," "),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(a.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ne,15,7,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var K=class n$1{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=A();rowFilter=F$1(this.rows,e=>[e.config.name,e.config.authType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,a,c){return e.map((d,H)=>({key:`${t}:${d.id??H}`,config:d,scope:t,scopeLabel:a,canMutate:c}))}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=mw({type:n$1,selectors:[["agentos-auth-settings-all-scopes"]],decls:9,vars:3,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["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&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return a.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New auth setting"),pl()(),Pw(4,z,2,1,"p",3),Pw(5,J,2,0,"p",4)(6,Q,2,0,"p",5)(7,W,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,E,O],encapsulation:2})};export{K as AuthSettingsAllScopesComponent};
@@ -1 +1 @@
1
- import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-B8I4f-Tr.js';import {g,W,I as Ie,U as Ui,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,X as Xw,O as Og}from'./main-UDKVTVAZ.js';import {x as xt,w as wt,u as ut,C as Ct,j as gt,k as Wn}from'./chunk-DGErIFJc.js';import'./chunk-BAVg53Gi.js';function O(r,e){r&1&&(Ds(0,"p",1),MC(1,"Loading integration\u2026"),pl());}function T(r,e){r&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load this integration configuration."),pl());}function L(r,e){r&1&&(Ds(0,"div",3)(1,"ds-tag",9),MC(2,"YAML"),pl(),Ds(3,"ds-tag",10),MC(4,"Read-only"),pl()());}function k(r,e){if(r&1&&(Ds(0,"ds-card",2),Pw(1,L,5,0,"div",3),Ds(2,"dl",4)(3,"dt"),MC(4,"Name"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"Type"),pl(),Ds(9,"dd",5),MC(10),pl(),Ds(11,"dt"),MC(12,"Description"),pl(),Ds(13,"dd"),MC(14),pl(),Ds(15,"dt"),MC(16,"Scope"),pl(),Ds(17,"dd"),MC(18),pl(),Ds(19,"dt"),MC(20,"Source"),pl(),Ds(21,"dd"),MC(22),pl(),Ds(23,"dt"),MC(24,"Auto grant"),pl(),Ds(25,"dd"),MC(26),pl(),Ds(27,"dt"),MC(28,"Auth setting"),pl(),Ds(29,"dd"),MC(30),pl()()(),Ds(31,"ds-card",6)(32,"p",7),MC(33,"Sensitive values are always redacted."),pl(),Ds(34,"pre",8),MC(35),pl()()),r&2){let o=e,a=Xw();jE(),Lw(a.source()==="FILESYSTEM"?1:-1),jE(5),Og(o.name),jE(4),Og(o.integrationType),jE(4),Og(o.description||"\u2014"),jE(4),Og(a.scopeOf(o)),jE(4),Og(a.source()),jE(4),Og(o.autoGrant?"Enabled":"Disabled"),jE(4),Og(o.authSettingName||"None"),jE(5),Og(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(Ie);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Ui(true);hasError=Ui(false);config=Ui(null);source=Ui("NEO4J");parameters=Ui("{}");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=mw({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&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Pw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),pl()),o&2){let m;jE(2),Lw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[xt,wt,ut,Ct,gt,Wn],encapsulation:2})};export{V as IntegrationConfigViewComponent};
1
+ import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-8jObMYuf.js';import {g,W,I as Ie,U as Ui,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,X as Xw,O as Og}from'./main-YWZOZ7BG.js';import {d as pn,h as hn,o as on,B as mn,s as sn,q as ko}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';function O(r,e){r&1&&(Ds(0,"p",1),MC(1,"Loading integration\u2026"),pl());}function T(r,e){r&1&&(Ds(0,"ds-notice"),MC(1,"Failed to load this integration configuration."),pl());}function L(r,e){r&1&&(Ds(0,"div",3)(1,"ds-tag",9),MC(2,"YAML"),pl(),Ds(3,"ds-tag",10),MC(4,"Read-only"),pl()());}function k(r,e){if(r&1&&(Ds(0,"ds-card",2),Pw(1,L,5,0,"div",3),Ds(2,"dl",4)(3,"dt"),MC(4,"Name"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"Type"),pl(),Ds(9,"dd",5),MC(10),pl(),Ds(11,"dt"),MC(12,"Description"),pl(),Ds(13,"dd"),MC(14),pl(),Ds(15,"dt"),MC(16,"Scope"),pl(),Ds(17,"dd"),MC(18),pl(),Ds(19,"dt"),MC(20,"Source"),pl(),Ds(21,"dd"),MC(22),pl(),Ds(23,"dt"),MC(24,"Auto grant"),pl(),Ds(25,"dd"),MC(26),pl(),Ds(27,"dt"),MC(28,"Auth setting"),pl(),Ds(29,"dd"),MC(30),pl()()(),Ds(31,"ds-card",6)(32,"p",7),MC(33,"Sensitive values are always redacted."),pl(),Ds(34,"pre",8),MC(35),pl()()),r&2){let o=e,a=Xw();jE(),Lw(a.source()==="FILESYSTEM"?1:-1),jE(5),Og(o.name),jE(4),Og(o.integrationType),jE(4),Og(o.description||"\u2014"),jE(4),Og(a.scopeOf(o)),jE(4),Og(a.source()),jE(4),Og(o.autoGrant?"Enabled":"Disabled"),jE(4),Og(o.authSettingName||"None"),jE(5),Og(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(Ie);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Ui(true);hasError=Ui(false);config=Ui(null);source=Ui("NEO4J");parameters=Ui("{}");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=mw({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&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Pw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),pl()),o&2){let m;jE(2),Lw(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[pn,hn,on,mn,sn,ko],encapsulation:2})};export{V as IntegrationConfigViewComponent};
@@ -1 +1 @@
1
- import {p}from'./chunk-DGErIFJc.js';import {g,W,t as Xm,u as y,m as mw,h as hl,M as MC,b as gl,j as jE,O as Og}from'./main-UDKVTVAZ.js';var A=class r{route=g(W);http=g(Xm);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=mw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(hl(0,"p",0),MC(1),gl()),t&2&&(jE(),Og(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
1
+ import {p}from'./chunk-D8_LjQNu.js';import {g,W,t as Xm,u as y,m as mw,h as hl,M as MC,b as gl,j as jE,O as Og}from'./main-YWZOZ7BG.js';var A=class r{route=g(W);http=g(Xm);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=mw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(hl(0,"p",0),MC(1),gl()),t&2&&(jE(),Og(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
@@ -0,0 +1 @@
1
+ import {C as m,a as pt,D as Bt,T as Te,b as fn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,V as Vn,A as An,v as va,H as go,_ as _o,d as pn,h as hn,e as cn,r as ln,g as dn,B as mn,i as at,j as an}from'./chunk-D8_LjQNu.js';import {g,W,F,I as Ie,a9 as $,U as Ui,x as U,af as da,a3 as Cr,C as x,z as w,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,v as vl,L as Lw,q as qw,l as lg,Q as SI,V as Vw,ah as jw,X as Xw,T as MI,O as Og,H as Hw,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function fe(o,t){if(o&1&&(Ds(0,"ds-form-field",20),lg(1,"input",22),pl()),o&2){let e=Xw(3);jE(),ug("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Ds(0,"option",24),MC(1),pl()),o&2){let e=t.$implicit;ug("ngValue",e.id),jE(),Og(e.name);}}function Ce(o,t){if(o&1&&(Ds(0,"ds-form-field",21)(1,"select",23)(2,"option",24),MC(3,"\u2014 None \u2014"),pl(),Vw(4,ge,2,2,"option",24,ce),pl(),SI(),pl()),o&2){let e=Xw(3);jE(),ug("formControl",e.agentConfigIdControl),MI(),jE(),ug("ngValue",null),jE(2),Hw(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Pw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=Xw(2);Lw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Ds(0,"p",2),MC(1,"No parameters defined."),pl());}function he(o,t){if(o&1){let e=qw();Ds(0,"div",11)(1,"div",25)(2,"ds-form-field",26),lg(3,"input",27),SI(),pl(),Ds(4,"ds-form-field",28),lg(5,"input",29),SI(),pl(),Ds(6,"ds-form-field",30),lg(7,"input",31),SI(),pl()(),Ds(8,"button",32),mg("click",function(){let d=df(e).$index,m=Xw(2);return ff(m.removeParameter(d))}),MC(9," \xD7 "),pl()();}if(o&2){let e=t.$implicit,r=t.$index;ug("formGroupName",r),jE(2),ug("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),jE(),ug("id","param-name-"+r),MI(),jE(),ug("controlId","param-desc-"+r),jE(),ug("id","param-desc-"+r),MI(),jE(),ug("controlId","param-default-"+r),jE(),ug("id","param-default-"+r),MI();}}function _e(o,t){if(o&1){let e=qw();Ds(0,"div",14)(1,"span",33),MC(2),pl(),Ds(3,"ds-form-field",34),lg(4,"textarea",35),SI(),pl(),Ds(5,"button",36),mg("click",function(){let d=df(e).$index,m=Xw(2);return ff(m.removeContentEntry(d))}),MC(6," \xD7 "),pl()();}if(o&2){let e=t.$implicit,r=t.$index,d=Xw(2);jE(2),Og(r+1),jE(),ug("error",e.invalid&&e.touched?"Content entry must not be blank.":null),jE(),ug("formControlName",r),cg("aria-label","Content entry "+(r+1)),MI(),jE(),ug("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Ds(0,"ds-notice"),MC(1),pl()),o&2){let e=Xw(2);jE(),Og(e.errorMessage());}}function be(o,t){if(o&1){let e=qw();Ds(0,"button",37),mg("click",function(){df(e);let d=Xw(2);return ff(d.exportYaml())}),MC(1),pl();}if(o&2){let e=Xw(2);ug("disabled",e.isExporting()),jE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let d=Xw();return ff(d.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"input",8),SI(),pl(),Pw(5,ye,2,1),Ds(6,"ds-fieldset",9)(7,"p",2),MC(8," Each parameter must have a name and a default value. Use "),Ds(9,"code"),MC(10),pl(),MC(11," in content entries to reference them. "),pl(),Ds(12,"div",10),Pw(13,ve,2,0,"p",2),Vw(14,he,10,8,"div",11,jw),Ds(16,"div")(17,"button",12),mg("click",function(){df(e);let d=Xw();return ff(d.addParameter())}),MC(18,"+ Add parameter"),pl()()()(),Ds(19,"ds-fieldset",13)(20,"p",2),MC(21," Each content entry is a command. Use "),Ds(22,"code"),MC(23,"@AgentName"),pl(),MC(24," to target an agent, "),Ds(25,"code"),MC(26,"/promptName param1 param2"),pl(),MC(27," to call another prompt, and "),Ds(28,"code"),MC(29),pl(),MC(30," for parameter placeholders. "),pl(),Ds(31,"div",10),Vw(32,_e,7,5,"div",14,jw),Ds(34,"div")(35,"button",12),mg("click",function(){df(e);let d=Xw();return ff(d.addContentEntry())}),MC(36,"+ Add content entry"),pl()()()(),Pw(37,xe,2,1,"ds-notice"),Ds(38,"ds-form-field",15),lg(39,"textarea",16),SI(),pl(),Ds(40,"ds-form-actions")(41,"button",17),MC(42),pl(),Pw(43,be,2,2,"button",18),Ds(44,"button",19),mg("click",function(){df(e);let d=Xw();return ff(d.cancel())}),MC(45,"Cancel"),pl()()();}if(o&2){let e=Xw();ug("formGroup",e.form),jE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),jE(),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.availableAgentConfigs().length>0?5:-1),jE(5),Og(e.paramPlaceholderSyntax),jE(2),ug("formArrayName","parameters"),jE(),Lw(e.parametersArray.length===0?13:-1),jE(),Hw(e.parametersArray.controls),jE(15),Og(e.paramPlaceholderSyntax),jE(2),ug("formArrayName","content"),jE(),Hw(e.contentArray.controls),jE(5),Lw(e.errorMessage()?37:-1),jE(),ug("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),jE(),ug("formControl",e.externalMetadataJsonControl),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),jE(),Lw(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(Ie);promptState=g(m);agentConfigController=g($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Bt([this.createContentControl()],{validators:[fn.required]}),parameters:new Bt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);errorMessage=Ui(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Ui([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U(this.destroyRef),da(()=>Cr([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U(this.destroyRef),da(()=>Cr([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[fn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value",3,"controlId"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.cancel()}),MC(3),pl()(),Pw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),pl()),e&2&&(jE(),ug("title",r.isEditMode()?"Edit prompt":"New prompt"),jE(2),vl(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),jE(),Lw(r.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,Vn,An,va,go,_o,pn,hn,cn,ln,dn,mn,at,an],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
@@ -0,0 +1 @@
1
+ import {a8 as fa,af as da,a3 as Cr,ay as Uy}from'./main-YWZOZ7BG.js';function i(t,o,p){return t.pipe(fa(()=>o().pipe(da(()=>Cr(p)))),Uy({bufferSize:1,refCount:true}))}export{i};
@@ -0,0 +1 @@
1
+ import {O as O$1}from'./chunk-Co0A853g.js';import {R}from'./chunk-CeHH5awD.js';import {O}from'./chunk-8jObMYuf.js';import {g,I as Ie$1,U as Ui,K as KC,a2 as F,an as wy,av as ne,x as U,m as mw,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,M as MC,q as qw,N as mg,X as Xw,J as ug,Q as SI,V as Vw,O as Og,T as MI,H as Hw,v as vl,a4 as kw,k as df,n as ff,C as x,z as w}from'./main-YWZOZ7BG.js';import {y,P as D,Q as B,R as a,a as pt,T as Te$1,X as f,Y as A,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,c as po,A as An,v as va,d as pn,h as hn,e as cn,Z as un,g as dn,i as at,j as an,s as sn,a0 as Ti,M as Oi,a1 as d,a2 as v}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function xe(o,e){if(o&1&&(Ds(0,"option",27),MC(1),pl()),o&2){let t=e.$implicit;ug("value",t.value),jE(),Og(t.label);}}function Se(o,e){if(o&1){let t=qw();Ds(0,"form",15),mg("ngSubmit",function(){df(t);let s=Xw(2);return ff(s.save())}),Ds(1,"ds-group",16)(2,"dl",17)(3,"dt"),MC(4,"Email"),pl(),Ds(5,"dd"),MC(6),pl(),Ds(7,"dt"),MC(8,"External ID"),pl(),Ds(9,"dd"),MC(10),pl()()(),Ds(11,"ds-group",18)(12,"ds-form-field",19),lg(13,"input",20),SI(),pl(),Ds(14,"ds-form-field",21),lg(15,"input",22),SI(),pl(),Ds(16,"ds-form-field",23),lg(17,"textarea",24),SI(),pl(),Ds(18,"ds-form-field",25)(19,"select",26),Vw(20,xe,2,2,"option",27,ye),pl(),SI(),pl()(),Ds(22,"ds-form-actions")(23,"button",28),MC(24),pl(),Ds(25,"button",29),mg("click",function(){df(t);let s=Xw(2);return ff(s.cancelEditing())}),MC(26,"Cancel"),pl()()();}if(o&2){let t=Xw(),l=Xw();ug("formGroup",l.form),jE(6),Og(t.email),jE(4),Og(t.externalId),jE(3),MI(),jE(2),MI(),jE(2),MI(),jE(2),MI(),jE(),Hw(l.languageOptions),jE(3),ug("disabled",l.isSaving()),jE(),vl(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Ds(0,"p",2),MC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),pl());}function Pe(o,e){if(o&1){let t=qw();Ds(0,"span",38),MC(1,"Delete?"),pl(),Ds(2,"button",39),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(5);return ff(m.confirmDelete(s))}),MC(3,"Confirm"),pl(),Ds(4,"button",40),mg("click",function(){df(t);let s=Xw(6);return ff(s.cancelDelete())}),MC(5,"Cancel"),pl();}}function Te(o,e){if(o&1){let t=qw();Ds(0,"button",40),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(5);return ff(m.armDelete(s))}),MC(1,"Delete"),pl();}}function De(o,e){if(o&1&&(Ds(0,"li",34)(1,"span",35),MC(2),pl(),Ds(3,"span",36),MC(4),pl(),Pw(5,Pe,6,0)(6,Te,2,0,"button",37),pl()),o&2){let t=e.$implicit,l=Xw(5);jE(2),Og(t.name),jE(2),Og(t.subtitle),jE(),Lw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Ds(0,"span",32),MC(1),pl(),Ds(2,"ul",33),Vw(3,De,7,3,"li",34,kw().trackEntry,true),pl()),o&2){let t=e.$implicit;jE(),Og(t.title),jE(2),Hw(t.entries);}}function Ve(o,e){if(o&1&&Vw(0,we,5,1,null,null,Ce),o&2){let t=Xw(3);Hw(t.recapSections());}}function Ue(o,e){if(o&1){let t=qw();Ds(0,"ds-group",16)(1,"dl",17)(2,"dt"),MC(3,"Email"),pl(),Ds(4,"dd"),MC(5),pl(),Ds(6,"dt"),MC(7,"External ID"),pl(),Ds(8,"dd"),MC(9),pl()()(),Ds(10,"ds-group",18)(11,"dl",17)(12,"dt"),MC(13,"First name"),pl(),Ds(14,"dd"),MC(15),pl(),Ds(16,"dt"),MC(17,"Last name"),pl(),Ds(18,"dd"),MC(19),pl(),Ds(20,"dt"),MC(21,"Bio"),pl(),Ds(22,"dd"),MC(23),pl(),Ds(24,"dt"),MC(25,"Language"),pl(),Ds(26,"dd"),MC(27),pl()()(),Ds(28,"ds-form-actions")(29,"button",30),mg("click",function(){df(t);let s=Xw(2);return ff(s.startEditing())}),MC(30,"Edit profile"),pl()(),Ds(31,"ds-disclosure",31),mg("toggled",function(){df(t);let s=Xw(2);return ff(s.toggleOverrides())}),Pw(32,Ee,2,0,"p",2)(33,Ve,2,0),pl();}if(o&2){let t=Xw(),l=Xw();jE(5),Og(t.email),jE(4),Og(t.externalId),jE(6),Og(t.firstname||"\u2014"),jE(4),Og(t.lastname||"\u2014"),jE(4),Og(t.bio||"\u2014"),jE(4),Og(t.preferredLanguage||"\u2014"),jE(4),ug("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),jE(),Lw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=qw();Ds(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setThemeVariant(s))}),pl()(),Ds(3,"ds-form-field",6)(4,"ds-segmented",7),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setTheme(s))}),pl()()(),Ds(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setEnterKeyBehavior(s))}),pl()()(),Ds(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),mg("valueChange",function(s){df(t);let m=Xw();return ff(m.setShowTechnical(s))}),pl()()(),Pw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=Xw();jE(),ug("hint",t.activeVariantDescription()),jE(),ug("options",t.themeVariantOptions)("value",t.themeVariant()),jE(),ug("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),jE(),ug("options",t.modeOptions())("value",t.shownMode()),jE(3),ug("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),jE(3),ug("options",t.showTechnicalOptions)("value",t.showTechnical()),jE(),Lw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Ds(0,"p",2),MC(1,"Unable to load profile."),pl());}var ve=class o{userState=g(y);destroyRef=g(Ie$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(R);themePort=g(D);preferencesPort=g(B);isEditing=Ui(false);isLoading=Ui(false);isSaving=Ui(false);isOverridesExpanded=Ui(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=KC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=KC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=KC(()=>!A(this.themeVariant(),this.themeMode()));activeVariantLabel=KC(()=>d(this.themeVariant()).label);activeVariantDescription=KC(()=>d(this.themeVariant()).description);modeOptions=KC(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=KC(()=>this.modeOverridden()?v(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(wy([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=KC(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){f(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !A(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=Ui(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=mw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),pl()),t&2){let s;jE(2),Lw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,un,dn,at,an,sn,Ti,Oi],encapsulation:2})};export{ve as UserProfileComponent};
@@ -1 +1 @@
1
- import {O as O$1}from'./chunk-B8I4f-Tr.js';import {g,F,I as Ie,a6 as D,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-UDKVTVAZ.js';import {A as A$1,r as F$1,g as We,w as wt,s as qn,E,O as O$2}from'./chunk-DGErIFJc.js';import'./chunk-BAVg53Gi.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),MC(1),pl()),t&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform integrations defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function z(t,e){if(t&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.edit(d))}),MC(1,"Edit"),pl();}if(t&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(t&2){let n=Xw().$implicit,r=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Xw(2);jE(2),Og(n.name),jE(2),Og(n.integrationType),jE(3),Lw(r.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);state=g(O$1);integrationConfigController=g(D);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A$1();configs=Ui([]);rowFilter=F$1(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=mw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,A,2,1,"p",3),Pw(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&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[We,wt,qn,E,O$2],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
1
+ import {O as O$1}from'./chunk-8jObMYuf.js';import {g,F,I as Ie,a6 as D,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';import {z as A$1,F as F$1,i as at,h as hn,I as Io,E,O as O$2}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Ds(0,"p",3),MC(1),pl()),t&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(t,e){t&1&&(Ds(0,"p",4),MC(1,"Loading integrations\u2026"),pl());}function H(t,e){t&1&&(Ds(0,"p",5),MC(1,"No platform integrations defined yet."),pl());}function U(t,e){t&1&&(Ds(0,"p",4),MC(1,"No integrations match the current filter."),pl());}function z(t,e){if(t&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.edit(d))}),MC(1,"Edit"),pl();}if(t&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(t&2){let n=Xw().$implicit,r=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),t&2){let n=e.$implicit,r=Xw(2);jE(2),Og(n.name),jE(2),Og(n.integrationType),jE(3),Lw(r.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(t,e){if(t&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,j),pl()()()),t&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(Ie);state=g(O$1);integrationConfigController=g(D);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A$1();configs=Ui([]);rowFilter=F$1(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=mw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New integration"),pl()(),Pw(4,A,2,1,"p",3),Pw(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&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,E,O$2],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
@@ -1 +1 @@
1
- import {g,aC as be,$ as x}from'./main-UDKVTVAZ.js';var o=class r{skillController=g(be);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
1
+ import {g,aC as be,$ as x}from'./main-YWZOZ7BG.js';var o=class r{skillController=g(be);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
@@ -1 +1 @@
1
- import {g,aB as de,$ as x}from'./main-UDKVTVAZ.js';var c=class r{api=g(de);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,aB as de,$ as x}from'./main-YWZOZ7BG.js';var c=class r{api=g(de);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
@@ -0,0 +1 @@
1
+ import {z as A,F as F$1,i as at,h as hn,I as Io,q as ko,E,O}from'./chunk-D8_LjQNu.js';import {g,W as W$1,F,I as Ie,a9 as $,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-YWZOZ7BG.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function z(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading agent configs\u2026"),pl());}function G(n,e){n&1&&(Ds(0,"p",5),MC(1,"No agent configs available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),MC(1,"No agent configs match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",18),MC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,d=Xw(2);return ff(d.launch(s))}),MC(1," Launch "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw(2).$implicit,d=Xw(2);return ff(d.edit(s))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.inspect(s))}),MC(1," Inspect "),pl(),Pw(2,X,2,1,"button",23),Pw(3,Y,2,1,"button",23);}if(n&2){let t=Xw().$implicit,i=Xw(2);cg("aria-label","Inspect "+t.config.name),jE(2),Lw(i.canLaunch(t)?2:-1),jE(),Lw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.deletion.request(s.key))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,d=Xw(2);return ff(d.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,i=Xw(2);ug("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16)(9,"ds-tag",17),MC(10),pl(),Pw(11,W,2,0,"ds-tag",18),pl()(),Ds(12,"td",19)(13,"div",20),Pw(14,Z,4,3),Pw(15,ee,1,3,"agentos-row-delete-action",21),pl()()()),n&2){let t=e.$implicit,i=Xw(2);jE(2),Og(t.config.name),jE(2),vl(" ",t.config.description||"\u2014"," "),jE(2),Og(i.mode(t)),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?11:-1),jE(3),Lw(i.deletion.confirmingId()!==t.key?14:-1),jE(),Lw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Execution mode"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,te,16,8,"tr",9,J),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);controller=g($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(da(()=>Cr([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(d){return i.rowFilter.query.set(d)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New agent config"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,E,O],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import {f,y,a as pt,T as Te,b as fn,U as Ut,n as nd,L as Lt,k as kn,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-D8_LjQNu.js';import {g,W,F,G,I as Ie,K as KC,U as Ui,A as Af,x as U,z as w,C as x,m as mw,D as Ds,l as lg,P as Pw,a as pl,J as ug,j as jE,L as Lw,M as MC,q as qw,N as mg,Q as SI,X as Xw,T as MI,e as cg,v as vl,k as df,n as ff}from'./main-YWZOZ7BG.js';var ne=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function re(i){return ne.test(i)}function ee(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||re(e)?null:{absolutePath:true}}}function ae(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ie(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Xw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),SI(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),SI(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),SI(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),SI(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),SI(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),SI(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let oe=Xw();return ff(oe.onMaxToolRoundsInput(p))}),pl(),SI(),pl(),Ds(17,"ds-form-actions")(18,"button",21),MC(19),pl(),Ds(20,"button",22),mg("click",function(){df(e);let p=Xw();return ff(p.cancel())}),MC(21,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(2),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.externalIdControl),MI(),jE(2),ug("formControl",e.defaultAgentNameControl),MI(),jE(2),ug("formControl",e.configPathControl),MI(),jE(),ug("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),jE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),MI(),jE(),ug("hint",e.runCostThresholdHint()),jE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),MI(),jE(),ug("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),jE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var le=1,se=2147483647,te=class i{route=g(W);router=g(F);namespaceController=g(G);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=KC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=KC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=KC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=KC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ee(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(le),fn.max(se),fn.pattern(/^\d+$/)]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,ae,2,0,"p",2)(3,ie,22,19,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),jE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),jE(),Lw(u.isLoading()?2:3));},dependencies:[Ut,nd,Lt,kn,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{te as NamespaceFormComponent};
@@ -0,0 +1 @@
1
+ import {C as m,z as A,F as F$1,i as at,h as hn,I as Io,q as ko,E,O as O$1}from'./chunk-D8_LjQNu.js';import {g,W as W$1,F,I as Ie,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-YWZOZ7BG.js';var U=(n,e)=>e.key;function z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function G(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading prompts\u2026"),pl());}function O(n,e){n&1&&(Ds(0,"p",5),MC(1,"No prompts available."),pl());}function Q(n,e){n&1&&(Ds(0,"p",4),MC(1,"No prompts match the current filter."),pl());}function W(n,e){n&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function X(n,e){if(n&1){let t=qw();Ds(0,"button",23),mg("click",function(){df(t);let l=Xw(2).$implicit,m=Xw(2);return ff(m.edit(l))}),MC(1," Edit "),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=qw();Pw(0,X,2,1,"button",21),Ds(1,"agentos-row-delete-action",22),mg("deleteRequested",function(){df(t);let l=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(l.key))})("deleteConfirmed",function(){df(t);let l=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(l))})("deleteCancelled",function(){df(t);let l=Xw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,i=Xw(2);Lw(i.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(Ds(0,"button",20),MC(1,"Inherited"),pl());}function ee(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,W,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,Y,2,4)(13,Z,2,0,"button",20),pl()()()),n&2){let t=e.$implicit;jE(2),Og(t.prompt.name),jE(2),vl(" ",t.prompt.description||"\u2014"," "),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?9:-1),jE(3),Lw(t.scope==="namespace"?12:13);}}function te(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,ee,14,6,"tr",9,U),pl()()()),n&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(Ie);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.promptState.listPlatform().pipe(da(()=>Cr([]))),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=mw({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&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return i.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New prompt"),pl()(),Pw(4,z,2,1,"p",3),Pw(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&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,E,O$1],encapsulation:2})};export{J as NamespacePromptsComponent};
@@ -0,0 +1 @@
1
+ import {o}from'./chunk-DZQmSPQb.js';import {a as pt,T as Te,b as fn,U as Ut,n as nd,L as Lt,m as mo,c as po,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,B as mn,i as at,j as an,q as ko}from'./chunk-D8_LjQNu.js';import {g,W,F,I as Ie,U as Ui,x as U,C as x,z as w,m as mw,ao as $t,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,X as Xw,q as qw,l as lg,Q as SI,V as Vw,ah as jw,T as MI,H as Hw,v as vl,k as df,n as ff,O as Og}from'./main-YWZOZ7BG.js';function ie(i,t){if(i&1&&(Ds(0,"a",2),MC(1,"View skill \u2192"),pl()),i&2){let e=Xw();ug("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Ds(0,"ds-tag",3),MC(1,"Platform level"),pl());}function ne(i,t){i&1&&(Ds(0,"p",4),MC(1,"Loading\u2026"),pl());}function re(i,t){if(i&1){let e=qw();Ds(0,"div",15)(1,"div",19),lg(2,"input",20),SI(),Ds(3,"button",21),mg("click",function(){let l=df(e).$implicit,te=Xw(2);return ff(te.removeResource(l))}),MC(4," \xD7 "),pl()(),lg(5,"textarea",22),SI(),pl();}if(i&2){let e=t.$implicit;jE(2),ug("formControl",e.path),MI(),jE(3),ug("formControl",e.content),MI();}}function ae(i,t){if(i&1&&(Ds(0,"ds-notice"),MC(1),pl()),i&2){let e=Xw(2);jE(),Og(e.errorMessage());}}function se(i,t){if(i&1){let e=qw();Ds(0,"form",6),mg("ngSubmit",function(){df(e);let l=Xw();return ff(l.submit())}),Ds(1,"ds-form-field",7),lg(2,"input",8),SI(),pl(),Ds(3,"ds-form-field",9),lg(4,"textarea",10),SI(),pl(),Ds(5,"ds-form-field",11),lg(6,"textarea",12),SI(),pl(),Ds(7,"ds-form-field",13)(8,"div",14),Vw(9,re,6,2,"div",15,jw),Ds(11,"div")(12,"button",16),mg("click",function(){df(e);let l=Xw();return ff(l.addResource())}),MC(13,"+ Add resource"),pl()()()(),Pw(14,ae,2,1,"ds-notice"),Ds(15,"ds-form-actions")(16,"button",17),MC(17),pl(),Ds(18,"button",18),mg("click",function(){df(e);let l=Xw();return ff(l.cancel())}),MC(19,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(),ug("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),jE(),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.bodyControl),MI(),jE(3),Hw(e.resourceRows()),jE(5),Lw(e.errorMessage()?14:-1),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Ui(false);isLoading=Ui(false);isSubmitting=Ui(false);errorMessage=Ui(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(100),fn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[fn.required,fn.maxLength(500),fn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[fn.required,fn.pattern(/\S/)]})});resourceRows=Ui([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.cancel()}),MC(3,"\u2190 Skills"),pl(),Pw(4,ie,2,1,"a",2),Pw(5,oe,2,0,"ds-tag",3),pl(),Pw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),pl()),e&2&&(jE(),ug("title",o.isEditMode()?"Edit skill":"New skill"),jE(3),Lw(o.isEditMode()?4:-1),jE(),Lw(o.isPlatformMode?5:-1),jE(),Lw(o.isLoading()?6:7));},dependencies:[Ut,nd,Lt,mo,po,Vn,An,$t,pn,hn,cn,dn,mn,at,an,ko],encapsulation:2})};export{ee as SkillFormComponent};
@@ -0,0 +1 @@
1
+ import {R}from'./chunk-CeHH5awD.js';import {g,F,I as Ie,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';import {z as A,F as F$1,i as at,h as hn,I as Io,E,O as O$1}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Ds(0,"p",3),MC(1),pl()),e&2){let n=Xw();jE(),Og(n.deletion.error());}}function K(e,t){e&1&&(Ds(0,"p",4),MC(1,"Loading auth settings\u2026"),pl());}function H(e,t){e&1&&(Ds(0,"p",5),MC(1,"No platform auth settings defined yet."),pl());}function U(e,t){e&1&&(Ds(0,"p",4),MC(1,"No auth settings match the current filter."),pl());}function z(e,t){if(e&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.onEdit(d))}),MC(1," Edit "),pl();}if(e&2){let n=Xw().$implicit;cg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=qw();Ds(0,"agentos-row-delete-action",19),mg("deleteRequested",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(d.id))})("deleteConfirmed",function(){df(n);let d=Xw().$implicit,m=Xw(2);return ff(m.onDelete(d))})("deleteCancelled",function(){df(n);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(e&2){let n=Xw().$implicit,a=Xw(2);ug("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15),Pw(7,z,2,1,"button",16),Pw(8,G,1,3,"agentos-row-delete-action",17),pl()()()),e&2){let n=t.$implicit,a=Xw(2);jE(2),Og(n.name),jE(2),vl(" ",n.authType," "),jE(3),Lw(a.deletion.confirmingId()!==n.id?7:-1),jE(),Lw(n.id?8:-1);}}function O(e,t){if(e&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Authentication type"),pl(),Ds(8,"th",10)(9,"span",11),MC(10,"Actions"),pl()()()(),Ds(11,"tbody",8),Vw(12,J,9,4,"tr",9,B),pl()()()),e&2){let n=Xw();jE(12),Hw(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(Ie);state=g(R);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();settings=Ui([]);rowFilter=F$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return a.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New auth setting"),pl()(),Pw(4,j,2,1,"p",3),Pw(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&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,E,O$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
@@ -0,0 +1 @@
1
+ import {z as A,F as F$1,i as at,h as hn,I as Io,E,O as O$1}from'./chunk-D8_LjQNu.js';import {g,F,I as Ie,a9 as $,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,q as qw,k as df,n as ff,e as cg}from'./main-YWZOZ7BG.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function K(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading agent configs\u2026"),pl());}function H(n,e){n&1&&(Ds(0,"p",5),MC(1,"No platform agent configs defined yet."),pl());}function U(n,e){n&1&&(Ds(0,"p",4),MC(1,"No agent configs match the current filter."),pl());}function z(n,e){if(n&1){let t=qw();Ds(0,"button",19),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.inspect(d))}),MC(1," Inspect "),pl(),Ds(2,"button",19),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.edit(d))}),MC(3,"Edit"),pl();}if(n&2){let t=Xw().$implicit;cg("aria-label","Inspect "+t.name),jE(2),cg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(d.id))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15),MC(8),pl(),Ds(9,"td",16)(10,"div",17),Pw(11,z,4,2),Pw(12,G,1,3,"agentos-row-delete-action",18),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(2),Og(t.name),jE(2),vl(" ",t.description||"\u2014"," "),jE(2),Og(t.modelName||"\u2014"),jE(2),Og(a.mode(t)),jE(3),Lw(a.deletion.confirmingId()!==t.id?11:-1),jE(),Lw(t.id?12:-1);}}function O(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Model"),pl(),Ds(10,"th",10),MC(11,"Execution mode"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,J,13,6,"tr",9,B),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(Ie);agentConfigController=g($);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();configs=Ui([]);rowFilter=F$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$1(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$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({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&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New agent config"),pl()(),Pw(4,j,2,1,"p",3),Pw(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&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,E,O$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
@@ -0,0 +1,2 @@
1
+ import {v}from'./chunk-CnV27gYr.js';import {R,q,J}from'./chunk-CeHH5awD.js';import {g,W,F,I as Ie,U as Ui,a2 as F$1,K as KC,A as Af,x as U,C as x,z as w,m as mw,D as Ds,N as mg,M as MC,a as pl,P as Pw,j as jE,J as ug,L as Lw,q as qw,V as Vw,a5 as Bw,Q as SI,l as lg,X as Xw,T as MI,H as Hw,v as vl,a4 as kw,O as Og,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';import {T as Te,b as fn,a as pt,d as pn,h as hn,e as cn,r as ln,g as dn,i as at,j as an,t as rn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';function Ce(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ye(i,t){if(i&1&&(Ds(0,"label",16),lg(1,"input",17),SI(),MC(2),pl()),i&2){let e=t.$implicit,n=Xw(3);jE(),ug("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),MI(),jE(),vl(" ",e.label," ");}}function ge(i,t){if(i&1&&(Ds(0,"ds-fieldset",5),Vw(1,ye,3,4,"label",16,kw().trackByScope,true),pl()),i&2){let e=Xw(2);ug("disabled",e.isEditMode()),jE(),Hw(e.scopeOptions);}}function fe(i,t){if(i&1&&(Ds(0,"option",8),MC(1),pl()),i&2){let e=t.$implicit,n=Xw(2);ug("value",e),jE(),Og(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Ds(0,"ds-form-field",18),lg(1,"input",19),SI(),pl()),i&2){let e=Xw().$implicit;ug("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),jE(),ug("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),cg("aria-describedby",e.hint?"as-hint-"+e.key:null),MI();}}function Ae(i,t){if(i&1&&Pw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=Xw(3);Lw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Ds(0,"ds-fieldset",13),Vw(1,Ae,1,1,null,null,kw().trackByField,true),pl()),i&2){let e=Xw(2);ug("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),jE(),Hw(e.credentialFields());}}function be(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let o=Xw();return ff(o.submit())}),Pw(1,ge,3,1,"ds-fieldset",5),Ds(2,"ds-form-field",6)(3,"select",7),Vw(4,fe,2,2,"option",8,Bw),pl(),SI(),pl(),Ds(6,"ds-form-field",9),lg(7,"input",10),SI(),pl(),Ds(8,"ds-form-field",11),lg(9,"input",12),SI(),pl(),Pw(10,ve,3,1,"ds-fieldset",13),Ds(11,"ds-form-actions")(12,"button",14),MC(13),pl(),Ds(14,"button",15),mg("click",function(){df(e);let o=Xw();return ff(o.cancel())}),MC(15,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(),Lw(e.isPlatformMode?-1:1),jE(2),ug("formControl",e.authTypeControl),MI(),jE(),Hw(e.authTypeOptions),jE(3),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(),Lw(e.credentialFields().length>0?10:-1),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(Ie);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Ui(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[fn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=KC(()=>_e[this.selectedAuthType()]);isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Af(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),MC(3," \u2190 Auth settings "),pl()(),Pw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),pl()),e&2&&(jE(),ug("title",n.isEditMode()?"Edit auth setting":"New auth setting"),jE(3),Lw(n.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,rn,Ut,nd,bo,xo,Lt,Gt,pa,mo,po,Vn,An],encapsulation:2})};
2
+ export{me as AuthSettingFormComponent};
@@ -0,0 +1 @@
1
+ import {f,a3 as id,n as nd,L as Lt,m as mo,c as po,a4 as so,a5 as da,a6 as ra,d as pn,h as hn,e as cn,B as mn,i as at,j as an,I as Io,a7 as f$1}from'./chunk-D8_LjQNu.js';import {g,W,aD as J,U as Ui,aE as ue$1,A as Af,m as mw,aF as pb,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,ad as md,a8 as fa,aG as nn,ae as Ty,af as da$1,M as MC,q as qw,N as mg,aH as Bg,Q as SI,X as Xw,aI as jg,T as MI,V as Vw,H as Hw,aJ as UC,aK as HC,O as Og,e as cg,ap as $C,aq as GC,am as kg,v as vl,aL as WC,k as df,n as ff,aM as kC}from'./main-YWZOZ7BG.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Ds(0,"p",2),MC(1,"Loading usage settings\u2026"),pl());}function fe(e,a){if(e&1){let t=qw();Ds(0,"ds-notice"),MC(1,"Could not load usage settings. Please try again."),pl(),Ds(2,"div")(3,"button",3),mg("click",function(){df(t);let s=Xw();return ff(s.configuration.retry())}),MC(4,"Retry usage settings"),pl()();}}function ye(e,a){e&1&&(Ds(0,"p",2),MC(1,"Usage tracking is disabled."),pl());}function be(e,a){e&1&&(Ds(0,"ds-notice"),MC(1),pl()),e&2&&(jE(),Og(a));}function xe(e,a){e&1&&(Ds(0,"p",2),MC(1,"Loading usage\u2026"),pl());}function he(e,a){e&1&&(Ds(0,"p",12),MC(1,"No recorded usage for this period."),pl());}function Se(e,a){if(e&1&&(Ds(0,"p",10),MC(1),pl()),e&2){let t=Xw().$implicit;jE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Ds(0,"tr",16)(1,"td",18),MC(2),pl(),Ds(3,"td",19),MC(4),$C(5,"number"),pl(),Ds(6,"td",20),MC(7),$C(8,"number"),$C(9,"number"),pl(),Ds(10,"td",21),MC(11),$C(12,"number"),$C(13,"number"),pl(),Ds(14,"td",22),MC(15),$C(16,"agentosCost"),Pw(17,Se,2,1,"p",10),pl()()),e&2){let t=a.$implicit;jE(2),Og(t.key),jE(2),Og(GC(5,8,t.aggregate.totalTokens)),jE(3),kg(" ",GC(8,10,t.aggregate.inputTokens)," / ",GC(9,12,t.aggregate.outputTokens)," "),jE(4),kg(" ",GC(12,14,t.aggregate.cacheReadTokens)," / ",GC(13,16,t.aggregate.cacheWriteTokens)," "),jE(4),vl(" ",WC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),jE(2),Lw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Ds(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),MC(5,"Name"),pl(),Ds(6,"th",17),MC(7,"Tokens"),pl(),Ds(8,"th",17),MC(9,"Input / output"),pl(),Ds(10,"th",17),MC(11,"Cache read / write"),pl(),Ds(12,"th",17),MC(13,"Estimated cost"),pl()()(),Ds(14,"tbody",15),Vw(15,we,18,21,"tr",16,_e),pl()()()),e&2){let t=Xw().$implicit;jE(),cg("aria-label","Usage "+t.title.toLowerCase()),jE(14),Hw(t.rows);}}function Ne(e,a){if(e&1&&(Ds(0,"h3",11),MC(1),pl(),Pw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;jE(),Og(t.title),jE(),Lw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Vw(0,Ne,4,2,null,null,ue),Ds(2,"p",10),MC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),pl()),e&2){let t=Xw(2);Hw(UC(4,ge,HC(0,ce,t.agents()),HC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(t);let s=Xw();return ff(s.load())}),Ds(1,"ds-form-field",5)(2,"input",6),Bg("ngModelChange",function(s){df(t);let m=Xw();return kC(m.from,s)||(m.from=s),ff(s)}),pl(),SI(),pl(),Ds(3,"ds-form-field",7)(4,"input",8),Bg("ngModelChange",function(s){df(t);let m=Xw();return kC(m.to,s)||(m.to=s),ff(s)}),pl(),SI(),pl(),Ds(5,"button",9),MC(6,"Refresh"),pl()(),Pw(7,be,2,1,"ds-notice"),Pw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=Xw();jE(2),jg("ngModel",r.from),MI(),jE(2),jg("ngModel",r.to),MI(),jE(3),Lw((t=r.error())?7:-1,t),jE(),Lw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(J);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=Ui([]);models=Ui([]);error=Ui(null);loading=Ui(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Af(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(md(void 0),fa(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),nn):(this.loading.set(true),Ty({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(da$1(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),nn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),pl()),t&2&&(jE(2),Lw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[id,nd,Lt,mo,po,so,da,ra,pn,hn,cn,mn,at,an,Io,pb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
@@ -0,0 +1 @@
1
+ import {z as A,F as F$1,i as at,h as hn,I as Io,E,O}from'./chunk-D8_LjQNu.js';import {g,F,I as Ie,aj as k$1,a7 as wr,U as Ui,a8 as fa,x as U$1,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function U(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI providers\u2026"),pl());}function j(i,e){i&1&&(Ds(0,"p",5),MC(1,"No platform AI providers defined yet."),pl());}function K(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI providers match the current filter."),pl());}function H(i,e){if(i&1){let t=qw();Ds(0,"button",19),mg("click",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.edit(s))}),MC(1," Edit "),pl();}if(i&2){let t=Xw().$implicit;cg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=qw();Ds(0,"agentos-row-delete-action",20),mg("deleteRequested",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.deletion.request(s.id))})("deleteConfirmed",function(){df(t);let s=Xw().$implicit,m=Xw(2);return ff(m.confirmDelete(s))})("deleteCancelled",function(){df(t);let s=Xw(3);return ff(s.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,r=Xw(2);ug("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14),MC(6),pl(),Ds(7,"td",15)(8,"div",16),Pw(9,H,2,1,"button",17),Pw(10,z,1,3,"agentos-row-delete-action",18),pl()()()),i&2){let t=e.$implicit,r=Xw(2);jE(2),Og(t.name),jE(2),Og(t.apiType),jE(2),Og(t.baseUrl||"\u2014"),jE(3),Lw(r.deletion.confirmingId()!==t.id?9:-1),jE(),Lw(t.id?10:-1);}}function J(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"API type"),pl(),Ds(8,"th",10),MC(9,"Base URL"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,G,11,5,"tr",9,B),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(Ie);aiProviderController=g(k$1);refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();providers=Ui([]);rowFilter=F$1(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(m){return r.rowFilter.query.set(m)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New AI provider"),pl()(),Pw(4,M,2,1,"p",3),Pw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,E,O],encapsulation:2})};export{k as PlatformAiProvidersComponent};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DZQmSPQb.js';import {K as s,z as A,F as F$1,i as at,h as hn,I as Io,q as ko,E,O}from'./chunk-D8_LjQNu.js';import {g,W,F,I as Ie,a7 as wr,U as Ui,a8 as fa,ae as Ty,af as da,a3 as Cr,av as ne$1,x as U,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,v as vl,am as kg,q as qw,k as df,n as ff,e as cg}from'./main-YWZOZ7BG.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let t=Xw();jE(),Og(t.deletion.error());}}function ee(n,e){n&1&&(Ds(0,"p",4),MC(1,"Loading skills\u2026"),pl());}function te(n,e){n&1&&(Ds(0,"p",5),MC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),pl());}function ne(n,e){n&1&&(Ds(0,"p",4),MC(1,"No skills match the current filter."),pl());}function ie(n,e){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let t=Xw().$implicit;jE(),kg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Ds(0,"ds-tag",20),MC(1,"Read-only"),pl());}function oe(n,e){n&1&&(Ds(0,"ds-tag",21),MC(1,"SKILL.md"),pl());}function le(n,e){if(n&1){let t=qw();Ds(0,"button",25),mg("click",function(){df(t);let d=Xw(2).$implicit,c=Xw(2);return ff(c.edit(d))}),MC(1,"Edit"),pl();}if(n&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=qw();Ds(0,"button",25),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.inspect(d))}),MC(1," View "),pl(),Pw(2,le,2,1,"button",26);}if(n&2){let t=Xw().$implicit,a=Xw(2);cg("aria-label","View "+t.skill.name),jE(2),Lw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=qw();Ds(0,"agentos-row-delete-action",27),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.requestDelete(d))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Xw().$implicit,a=Xw(2);ug("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,ie,2,2,"span",14),pl(),Ds(5,"td",15),MC(6),pl(),Ds(7,"td",16),MC(8),pl(),Ds(9,"td",17)(10,"div",18)(11,"ds-tag",19),MC(12),pl(),Pw(13,ae,2,0,"ds-tag",20),Pw(14,oe,2,0,"ds-tag",21),pl()(),Ds(15,"td",22)(16,"div",23),Pw(17,re,3,2),Pw(18,se,1,3,"agentos-row-delete-action",24),pl()()()),n&2){let t=e.$implicit,a=Xw(2);jE(3),Og(t.skill.name),jE(),Lw(t.namedByAgents>0?4:-1),jE(2),vl(" ",t.skill.description||"\u2014"," "),jE(2),Og(a.resourceCount(t.skill)),jE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),jE(),Og(t.scope==="platform"?"Platform":"Namespace"),jE(),Lw(t.scope==="platform"?13:-1),jE(),Lw(t.skill.readOnly?14:-1),jE(3),Lw(a.deletion.confirmingId()!==t.key?17:-1),jE(),Lw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Description"),pl(),Ds(8,"th",10),MC(9,"Resources"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ce,19,10,"tr",9,Y),pl()()()),n&2){let t=Xw();jE(16),Hw(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new wr(void 0);isLoading=Ui(true);deletion=A();rows=Ui([]);rowFilter=F$1(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.skillState.listPlatform().pipe(da(()=>Cr([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Cr([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),da(()=>Cr([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["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","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),MC(3,"New skill"),pl()(),Pw(4,Z,2,1,"p",3),Pw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(jE(),ug("query",a.rowFilter.query()),jE(3),Lw(a.deletion.error()?4:-1),jE(),Lw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,E,O],encapsulation:2})};export{Q as NamespaceSkillsComponent};
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-DcZyBFc0.js';import {z as A,F as F$1,i as at,h as hn,I as Io,q as ko,E,O as O$1}from'./chunk-D8_LjQNu.js';import {g,W,F,I as Ie,U as Ui,ae as Ty,af as da,a3 as Cr,x as U,C as x,z as w,ab as Ee,ag as Se,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,k as df,n as ff,e as cg}from'./main-YWZOZ7BG.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Ds(0,"p",3),MC(1),pl()),n&2){let e=Xw();jE(),Og(e.deletion.error());}}function Y(n,t){n&1&&(Ds(0,"p",4),MC(1,"Loading scheduled prompts\u2026"),pl());}function z(n,t){n&1&&(Ds(0,"p",5),MC(1,"No scheduled prompts available."),pl());}function G(n,t){n&1&&(Ds(0,"p",4),MC(1,"No scheduled prompts match the current filter."),pl());}function Q(n,t){if(n&1&&(Ds(0,"span",14),MC(1),pl()),n&2){let e=Xw().$implicit;jE(),Og(e.prompt.description);}}function X(n,t){n&1&&(Ds(0,"ds-tag",20),MC(1,"Read-only"),pl());}function Z(n,t){if(n&1){let e=qw();Ds(0,"button",25),mg("click",function(){df(e);let l=Xw(2).$implicit,p=Xw(2);return ff(p.toggle(l))}),MC(1),pl(),Ds(2,"button",25),mg("click",function(){df(e);let l=Xw(2).$implicit,p=Xw(2);return ff(p.edit(l))}),MC(3," Edit "),pl();}if(n&2){let e=Xw(2).$implicit;jE(),Og(e.prompt.enabled?"Disable":"Enable"),jE(),cg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=qw();Pw(0,Z,4,2),Ds(1,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(e);let l=Xw().$implicit,p=Xw(2);return ff(p.deletion.request(l.key))})("deleteConfirmed",function(){df(e);let l=Xw().$implicit,p=Xw(2);return ff(p.confirmDelete(l))})("deleteCancelled",function(){df(e);let l=Xw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let e=Xw().$implicit,i=Xw(2);Lw(i.deletion.confirmingId()!==e.key?0:-1),jE(),ug("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Ds(0,"button",23),MC(1,"Inherited"),pl());}function ne(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),MC(3),pl(),Pw(4,Q,2,1,"span",14),pl(),Ds(5,"td",15),MC(6),pl(),Ds(7,"td",16)(8,"ds-tag",17),MC(9),pl()(),Ds(10,"td",18)(11,"div",19)(12,"ds-tag",17),MC(13),pl(),Pw(14,X,2,0,"ds-tag",20),pl()(),Ds(15,"td",21)(16,"div",22),Pw(17,ee,2,4)(18,te,2,0,"button",23),pl()()()),n&2){let e=t.$implicit,i=Xw(2);jE(3),Og(e.prompt.name),jE(),Lw(e.prompt.description?4:-1),jE(2),Og(i.scheduleLabel(e.prompt)),jE(2),ug("variant",e.prompt.enabled?"accent":"outline"),jE(),Og(e.prompt.enabled?"Enabled":"Disabled"),jE(3),ug("variant",e.scope==="platform"?"neutral":"accent"),jE(),Og(e.scope==="platform"?"Platform":"Namespace"),jE(),Lw(e.scope==="platform"?14:-1),jE(3),Lw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"Schedule"),pl(),Ds(8,"th",10),MC(9,"Status"),pl(),Ds(10,"th",10),MC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),MC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Vw(16,ne,19,9,"tr",9,J),pl()()()),n&2){let e=Xw();jE(16),Hw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(Ie);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Ui([]);isLoading=Ui(true);deletion=A();rowFilter=F$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ty({platform:this.state.listPlatform().pipe(da(()=>Cr([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.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,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===Ee.WEEK?"week":"month",l=e.unit===Ee.WEEK&&e.days?.length?` (${e.days.map(p=>Se[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=mw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["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","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","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return i.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),MC(3,"New scheduled prompt"),pl()(),Pw(4,O,2,1,"p",3),Pw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(jE(),ug("query",i.rowFilter.query()),jE(3),Lw(i.deletion.error()?4:-1),jE(),Lw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,E,O$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
@@ -0,0 +1 @@
1
+ import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-Co0A853g.js';import {v}from'./chunk-CnV27gYr.js';import {g,W as W$1,F,I as Ie,U as Ui,x as U$1,av as ne,a8 as fa,a3 as Cr,m as mw,D as Ds,N as mg,a as pl,M as MC,P as Pw,j as jE,J as ug,L as Lw,X as Xw,O as Og,V as Vw,H as Hw,q as qw,e as cg,k as df,n as ff}from'./main-YWZOZ7BG.js';import {z as A,F as F$1,i as at,h as hn,I as Io,q as ko,E,O as O$1}from'./chunk-D8_LjQNu.js';import'./chunk-DVl0k4as.js';var H=(i,e)=>e.key;function U(i,e){if(i&1&&(Ds(0,"p",3),MC(1),pl()),i&2){let t=Xw();jE(),Og(t.deletion.error());}}function z(i,e){i&1&&(Ds(0,"p",4),MC(1,"Loading AI providers\u2026"),pl());}function J(i,e){i&1&&(Ds(0,"p",5),MC(1,"No AI providers available."),pl());}function Q(i,e){i&1&&(Ds(0,"p",4),MC(1,"No AI providers match the current filter."),pl());}function W(i,e){i&1&&(Ds(0,"ds-tag",17),MC(1,"Read-only"),pl());}function X(i,e){if(i&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.duplicate(d))}),MC(1," Duplicate "),pl();}if(i&2){let t=Xw().$implicit;cg("aria-label","Duplicate "+t.config.name);}}function Y(i,e){if(i&1){let t=qw();Ds(0,"button",22),mg("click",function(){df(t);let d=Xw(2).$implicit,c=Xw(2);return ff(c.edit(d))}),MC(1," Edit "),pl();}if(i&2){let t=Xw(2).$implicit;cg("aria-label","Edit "+t.config.name);}}function Z(i,e){if(i&1){let t=qw();Pw(0,Y,2,1,"button",20),Ds(1,"agentos-row-delete-action",23),mg("deleteRequested",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.deletion.request(d.key))})("deleteConfirmed",function(){df(t);let d=Xw().$implicit,c=Xw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Xw(3);return ff(d.deletion.cancel())}),pl();}if(i&2){let t=Xw().$implicit,r=Xw(2);Lw(r.deletion.confirmingId()!==t.key?0:-1),jE(),ug("rowKey",t.key)("rowLabel",t.config.name)("state",r.deletion);}}function ee(i,e){i&1&&(Ds(0,"button",21),MC(1,"Inherited"),pl());}function te(i,e){if(i&1&&(Ds(0,"tr",9)(1,"td",12),MC(2),pl(),Ds(3,"td",13),MC(4),pl(),Ds(5,"td",14)(6,"div",15)(7,"ds-tag",16),MC(8),pl(),Pw(9,W,2,0,"ds-tag",17),pl()(),Ds(10,"td",18)(11,"div",19),Pw(12,X,2,1,"button",20),Pw(13,Z,2,4)(14,ee,2,0,"button",21),pl()()()),i&2){let t=e.$implicit,r=Xw(2);jE(2),Og(t.config.name),jE(2),Og(t.config.apiType),jE(3),ug("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),jE(),Og(t.scopeLabel),jE(),Lw(t.canMutate?-1:9),jE(3),Lw(r.deletion.confirmingId()!==t.key?12:-1),jE(),Lw(t.canMutate?13:14);}}function ie(i,e){if(i&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),MC(5,"Name"),pl(),Ds(6,"th",10),MC(7,"API type"),pl(),Ds(8,"th",10),MC(9,"Scope"),pl(),Ds(10,"th",10)(11,"span",11),MC(12,"Actions"),pl()()()(),Ds(13,"tbody",8),Vw(14,te,15,7,"tr",9,H),pl()()()),i&2){let t=Xw();jE(14),Hw(t.rowFilter.filteredRows());}}var G=class i{route=g(W$1);router=g(F);destroyRef=g(Ie);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Ui(false);isLoading=Ui(true);rows=Ui([]);deletion=A();rowFilter=F$1(this.rows,e=>[e.config.name,e.config.apiType,e.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ne(e=>e.get("namespaceId")??""),fa(e=>e?this.namespaceRole.isAdminOfNamespace$(e):Cr(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}confirmDelete(e){!e.canMutate||!e.config.id||this.deletion.execute(e.key,{request$:this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,r,d){return e.map((c,K)=>({key:`${t}:${c.id??K}`,config:c,scope:t,scopeLabel:r,canMutate:d}))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=mw({type:i,selectors:[["agentos-ai-providers-all-scopes"]],decls:9,vars:3,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type",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"],["type","button","disabled",""],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return r.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return r.openCreateForm()}),MC(3,"New AI provider"),pl()(),Pw(4,U,2,1,"p",3),Pw(5,z,2,0,"p",4)(6,J,2,0,"p",5)(7,Q,2,0,"p",4)(8,ie,16,0,"div",6)),t&2&&(jE(),ug("query",r.rowFilter.query()),jE(3),Lw(r.deletion.error()?4:-1),jE(),Lw(r.isLoading()?5:r.rows().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,E,O$1],encapsulation:2})};export{G as AiProvidersAllScopesComponent};