@whoz-oss/coday-client 0.0.0-workstream-forge.234 → 0.0.0-workstream-forge.236
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.
- package/browser/{chunk-DMaZtyPG.js → chunk-1eRn_62f.js} +1 -1
- package/browser/{chunk-iEPxdwNo.js → chunk-2_zz7NAC.js} +1 -1
- package/browser/{chunk-D5fiBKR6.js → chunk-AyHTO4Sx.js} +1 -1
- package/browser/{chunk-6YBD0GhT.js → chunk-B-B5NvWL.js} +1 -1
- package/browser/{chunk-CWww3DEx.js → chunk-B1vEKrz_.js} +1 -1
- package/browser/{chunk-BwLhUg85.js → chunk-B6qP3Hvp.js} +1 -1
- package/browser/{chunk-BtAgB7lp.js → chunk-BRida568.js} +1 -1
- package/browser/{chunk-C57r8bJB.js → chunk-BXNum5Uv.js} +1 -1
- package/browser/{chunk-CjEtYpc7.js → chunk-BXWcQ9nJ.js} +1 -1
- package/browser/{chunk-D2h70wlj.js → chunk-BiTjjS7f.js} +1 -1
- package/browser/{chunk-Cii8kID2.js → chunk-BmA5vDQy.js} +1 -1
- package/browser/{chunk-BZQ9JxtK.js → chunk-BxmI0rEJ.js} +1 -1
- package/browser/{chunk-CHLgsXpc.js → chunk-BzHtPq4J.js} +1 -1
- package/browser/{chunk-paKwZTsF.js → chunk-C9uCCw8u.js} +1 -1
- package/browser/{chunk-C4CShhcg.js → chunk-CFbt2W-4.js} +1 -1
- package/browser/{chunk-NuH8shYm.js → chunk-CJA7LP9I.js} +1 -1
- package/browser/{chunk-BUfak7ZR.js → chunk-CMTE1K7b.js} +1 -1
- package/browser/{chunk-CyEpqhHA.js → chunk-CQe9V6Kx.js} +1 -1
- package/browser/{chunk-AtCYApei.js → chunk-CRTm3TW7.js} +1 -1
- package/browser/{chunk-TWv3ObgU.js → chunk-CWVqBlP_.js} +1 -1
- package/browser/{chunk-BlPBulzu.js → chunk-Ck42W3Td.js} +1 -1
- package/browser/{chunk-DRUw-4Lk.js → chunk-ClfOew6l.js} +1 -1
- package/browser/{chunk-OhgFuyjp.js → chunk-CuBq-gTP.js} +1 -1
- package/browser/{chunk-C4FZ3_Nh.js → chunk-CxGrMAsv.js} +1 -1
- package/browser/{chunk-Dz39nB4A.js → chunk-D0VIctP9.js} +1 -1
- package/browser/{chunk-Bqg4NsQw.js → chunk-D4dSdxUc.js} +1 -1
- package/browser/{chunk-BLevlpuu.js → chunk-D6Jd9h9a.js} +1 -1
- package/browser/{chunk-B1xRCZ-V.js → chunk-DGjD1lCO.js} +1 -1
- package/browser/{chunk-DKN9kTwu.js → chunk-DHNEs7J8.js} +1 -1
- package/browser/{chunk-CYwBGwuM.js → chunk-DKozzs8J.js} +1 -1
- package/browser/{chunk-CrvFTHbA.js → chunk-DWhB9E6K.js} +1 -1
- package/browser/{chunk-BHKhFWCm.js → chunk-DZLxIPvO.js} +1 -1
- package/browser/chunk-DbZbECFq.js +1 -0
- package/browser/{chunk-DFkt8tY0.js → chunk-DdQVnFkx.js} +1 -1
- package/browser/{chunk-58tiRI-H.js → chunk-DgjvisKR.js} +1 -1
- package/browser/{chunk-KQaRB5fZ.js → chunk-DrL2kj2Q.js} +1 -1
- package/browser/{chunk-XnJGN0OJ.js → chunk-Dsli5F3b.js} +1 -1
- package/browser/{chunk-BjniM4kn.js → chunk-Dv--4A7A.js} +1 -1
- package/browser/{chunk-DKkNMT3S.js → chunk-HNne7KzG.js} +1 -1
- package/browser/{chunk-bCI6skcH.js → chunk-Ncao0R2n.js} +16 -16
- package/browser/{chunk-CseRCWgR.js → chunk-Xi-gu1fS.js} +1 -1
- package/browser/{chunk-B97Q0PCu.js → chunk-h4Ucvwue.js} +1 -1
- package/browser/{chunk-BRekDeCw.js → chunk-jbtuI0D4.js} +1 -1
- package/browser/{chunk-pbgW0Sdk.js → chunk-kgDzsPcI.js} +1 -1
- package/browser/{chunk-Ct896VFa.js → chunk-ldd-YZJ3.js} +1 -1
- package/browser/{chunk-d7XsX4kM.js → chunk-pTZfve8g.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-PUOSMZMX.js → main-6MVJZWGK.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-2gGq060a.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-B6qP3Hvp.js';import {O}from'./chunk-Xi-gu1fS.js';import {g,W as W$1,q as F,I as we,H as J,$ as $i,K as U$1,ad as ne$1,a1 as ga,aa as br,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,P as dg,b as BE,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,l as lg,u as pf,w as hf}from'./main-6MVJZWGK.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-Ncao0R2n.js';import'./chunk-DbZbECFq.js';var Q=(n,e)=>e.key;function W(n,e){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let t=eC();BE(),Fg(t.deletion.error());}}function X(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading integrations\u2026"),hl());}function Z(n,e){n&1&&(Es(0,"p",5),xC(1,"No integrations available."),hl());}function ee(n,e){n&1&&(Es(0,"p",4),xC(1,"No integrations match the current filter."),hl());}function te(n,e){n&1&&(Es(0,"ds-tag",20),xC(1,"YAML"),hl(),Es(2,"ds-tag",21),xC(3,"Read-only"),hl());}function ne(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC().$implicit,c=eC(2);return hf(c.view(s))}),xC(1,"View"),hl();}if(n&2){let t=eC().$implicit;lg("aria-label","View "+t.config.name);}}function ie(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(3).$implicit,c=eC(2);return hf(c.edit(s))}),xC(1," Edit "),hl();}if(n&2){let t=eC(3).$implicit;lg("aria-label","Edit "+t.config.name);}}function oe(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(2).$implicit,c=eC(2);return hf(c.duplicate(s))}),xC(1," Duplicate "),hl(),jw(2,ie,2,1,"button",19);}if(n&2){let t=eC(2).$implicit;lg("aria-label","Duplicate "+t.config.name),BE(2),Bw(t.canEdit?2:-1);}}function ae(n,e){if(n&1){let t=Yw();Es(0,"agentos-row-delete-action",25),vg("deleteRequested",function(){pf(t);let s=eC(2).$implicit,c=eC(2);return hf(c.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=eC(2).$implicit,c=eC(2);return hf(c.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(4);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=eC(2).$implicit,a=eC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",a.deletion);}}function re(n,e){n&1&&(Es(0,"button",24),xC(1,"Inherited"),hl());}function le(n,e){if(n&1&&(jw(0,oe,3,2),jw(1,ae,1,3,"agentos-row-delete-action",23),jw(2,re,2,0,"button",24)),n&2){let t=eC().$implicit,a=eC(2);Bw(a.deletion.confirmingId()!==t.key?0:-1),BE(),Bw(t.canDelete?1:-1),BE(),Bw(!t.canEdit&&!t.canDelete?2:-1);}}function se(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14)(6,"div",15)(7,"ds-tag",16),xC(8),hl(),jw(9,te,4,0),hl()(),Es(10,"td",17)(11,"div",18),jw(12,ne,2,1,"button",19)(13,le,3,3),hl()()()),n&2){let t=e.$implicit;BE(2),Fg(t.config.name),BE(2),Dl(" ",t.config.integrationType," "),BE(3),dg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),BE(),Dl(" ",t.scopeLabel," "),BE(),Bw(t.source==="FILESYSTEM"?9:-1),BE(3),Bw(t.source==="FILESYSTEM"?12:13);}}function ce(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Type"),hl(),Es(8,"th",10),xC(9,"Scope"),hl(),Es(10,"th",10)(11,"span",11),xC(12,"Actions"),hl()()()(),Es(13,"tbody",8),Uw(14,se,14,6,"tr",9,Q),hl()()()),n&2){let t=eC();BE(14),$w(t.rowFilter.filteredRows());}}var U=class n$1{route=g(W$1);router=g(F);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceApi=g(J);namespaceId=this.route.snapshot.params.namespaceId;namespaceName=$i("this namespace");isAdmin=$i(false);isLoading=$i(true);rows=$i([]);deletion=k();rowFilter=O$1(this.rows,e=>[e.config.name,e.config.integrationType,e.scopeLabel,e.source].join(" "));ngOnInit(){this.state.setNamespace(this.namespaceId),this.namespaceId&&this.namespaceApi.getByIdNamespace(this.namespaceId).pipe(U$1(this.destroyRef)).subscribe({next:e=>this.namespaceName.set(e.name)}),this.route.paramMap.pipe(ne$1(e=>e.get("namespaceId")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(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,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}view(e){e.config.id&&this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"view"]);}edit(e){!e.canEdit||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"integrations",e.config.id,"edit"],{queryParams:{scope:e.scope}});}duplicate(e){if(e.source==="FILESYSTEM"||!e.config.id)return;let a=(e.scope==="platform"||e.scope==="namespace")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:a,template:e.config.id,templateScope:e.scope}});}confirmDelete(e){!e.canDelete||!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.`});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",true),...this.mapScope(e.namespace,"namespace","Namespace",!this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",false),...this.mapScope(e.userGlobal,"userGlobal","Personal",false)]}mapScope(e$1,t,a,s){return e$1.map((c,z)=>{let h=e(c),w=h==="NEO4J"&&!s;return {key:`${t}:${c.id??z}`,config:c,scope:t,scopeLabel:a,source:h,canEdit:w,canDelete:w}})}static \u0275fac=function(t){return new(t||n$1)};static \u0275cmp=vw({type:n$1,selectors:[["agentos-integrations-all-scopes"]],decls:9,vars:4,consts:[["title","Integrations",3,"description"],["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","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","Scope"],[1,"settings-table__tags"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["variant","neutral"],["variant","outline"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(c){return a.rowFilter.query.set(c)}),hl(),Es(2,"button",2),vg("click",function(){return a.openCreateForm()}),xC(3,"New integration"),hl()(),jw(4,W,2,1,"p",3),jw(5,X,2,0,"p",4)(6,Z,2,0,"p",5)(7,ee,2,0,"p",4)(8,ce,16,0,"div",6)),t&2&&(dg("description","Integrations for "+a.namespaceName()+", including entries inherited from the platform."),BE(),dg("query",a.rowFilter.query()),BE(3),Bw(a.deletion.error()?4:-1),BE(),Bw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{U as IntegrationsAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {S}from'./chunk-
|
|
1
|
+
import {S}from'./chunk-Ncao0R2n.js';import {v as vw,T as br,E as Es,x as xC,a as hl,f as fg,P as dg}from'./main-6MVJZWGK.js';var c=class a{groups=[{label:"Access",items:[{label:"Users & Groups",commands:["users"]},{label:"Auth settings",commands:["auth-settings"]}]},{label:"Connections",items:[{label:"Platform integrations",commands:["integration-configs"]}]},{label:"AI",items:[{label:"Platform agents",commands:["agent-configs"]},{label:"Platform AI providers",commands:["ai-providers"]},{label:"Platform AI models",commands:["ai-models"]},{label:"Platform skills",commands:["skills"]},{label:"Platform prompts",commands:["prompts"]}]},{label:"Automation",items:[{label:"Scheduled prompts",commands:["scheduled-prompts"]},{label:"Tool invoke",commands:["tool-invoke"]}]},{label:"System",items:[{label:"Configuration",commands:["configuration"]}]}];static \u0275fac=function(e){return new(e||a)};static \u0275cmp=vw({type:a,selectors:[["agentos-admin-settings-layout"]],decls:9,vars:1,consts:[["title","Admin \xB7 Configuration","mark","A","navigationLabel","Admin settings",3,"groups"],["settingsBreadcrumb","","aria-label","Breadcrumb"],["aria-hidden","true"]],template:function(e,g){e&1&&(Es(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),xC(3,"Platform"),hl(),Es(4,"span",2),xC(5,"/"),hl(),Es(6,"span"),xC(7,"Administration"),hl()(),fg(8,"router-outlet"),hl()),e&2&&dg("groups",g.groups);},dependencies:[br,S],styles:["nav[settingsBreadcrumb][_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-accent-700);text-decoration:none}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}nav[settingsBreadcrumb][_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}"]})};export{c as AdminSettingsLayoutComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-2_zz7NAC.js';import {J as s,d as pn,h as hn,o as on,C as mn,i as at,q as sn,l as ko,K as Oi,M as On}from'./chunk-Ncao0R2n.js';import {g,W,q as F,I as we,$ as $i,r as rT,K as U,ac as by,a2 as ha,aa as br,v as vw,au as $t,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,c as Bw,t as eC,P as dg,Y as Yw,f as fg,av as YC,F as Fg,s as Dl,aw as KC,U as Uw,k as $w,ao as Hw,u as pf,w as hf,ax as YD}from'./main-6MVJZWGK.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Es(0,"a",2),xC(1,"Edit skill \u2192"),hl()),e&2){let n=eC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Es(0,"ds-tag",3),xC(1,"Platform level"),hl());}function te(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function ne(e,t){e&1&&(Es(0,"ds-notice"),xC(1,"Failed to load skill."),hl());}function ie(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Created by"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Last updated"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(jw(0,ie,4,1),jw(1,oe,4,1)),e&2){let n=eC();Bw(n.createdBy?0:-1),BE(),Bw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Es(0,"p",4),xC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),hl());}function se(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function re(e,t){e&1&&(Es(0,"ds-notice"),xC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),hl());}function de(e,t){e&1&&(Es(0,"p",4),xC(1,"No agent references this skill."),hl());}function ce(e,t){e&1&&(Es(0,"ds-tag",15),xC(1,"platform agent"),hl());}function me(e,t){e&1&&(Es(0,"ds-tag",15),xC(1,"via *"),hl());}function pe(e,t){if(e&1&&(Es(0,"li",13)(1,"span",14),xC(2),hl(),jw(3,ce,2,0,"ds-tag",15),jw(4,me,2,0,"ds-tag",15),hl()),e&2){let n=t.$implicit;BE(2),Fg(n.name),BE(),Bw(n.platform?3:-1),BE(),Bw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Es(0,"ul",12),Uw(1,pe,5,3,"li",13,Y),hl(),Es(3,"p",4),xC(4," An agent listed "),Es(5,"code"),xC(6,"via *"),hl(),xC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),hl()),e&2){let n=eC(2);BE(),$w(n.consumers());}}function _e(e,t){e&1&&(Es(0,"p",4),xC(1,"No resources bundled with this skill."),hl());}function ge(e,t){if(e&1){let n=Yw();Es(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=pf(n).$implicit,g=eC(3);return hf(g.toggleResource(r))}),Es(2,"pre",17),xC(3),hl()()();}if(e&2){let n=t.$implicit,o=eC(3);BE(),dg("heading",n)("open",o.isResourceExpanded(n)),BE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Es(0,"ul",12),Uw(1,ge,4,3,"li",null,Hw),hl()),e&2){let n=eC(2);BE(),$w(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Yw();Es(0,"ds-card",5)(1,"dl",6)(2,"dt"),xC(3,"Name"),hl(),Es(4,"dd",7),xC(5),hl(),Es(6,"dt"),xC(7,"Description"),hl(),Es(8,"dd"),xC(9),hl(),Es(10,"dt"),xC(11,"Scope"),hl(),Es(12,"dd"),xC(13),hl(),Es(14,"dt"),xC(15,"Storage"),hl(),Es(16,"dd")(17,"ds-tag",8),xC(18),hl()(),jw(19,ae,2,2),hl()(),Es(20,"ds-card",9),jw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),hl(),Es(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){pf(n);let r=eC();return hf(r.toggleBody())}),fg(28,"div",11),YC(29,"agentosMarkdown"),hl()(),Es(30,"ds-card",9),jw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),hl();}if(e&2){let n=t,o=eC();BE(5),Fg(n.name),BE(4),Fg(n.description),BE(4),Fg(n.namespaceId?"Namespace":"Platform"),BE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),BE(),Dl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),BE(),Bw(o.isFilesystemBacked()?-1:19),BE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),BE(),Bw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),BE(6),dg("open",!o.bodyCollapsed()),BE(),dg("innerHTML",KC(29,12,n.body),YD),BE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),BE(),Bw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);skill=$i(null);bodyCollapsed=$i(false);expandedResources=$i(new Set);resourcePaths=rT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=rT(()=>this.skill()?.readOnly===true);consumers=$i([]);consumersUnavailable=$i(false);consumersLoading=$i(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=vw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),xC(3,"\u2190 Skills"),hl(),jw(4,Z,2,1,"a",2),jw(5,ee,2,0,"ds-tag",3),hl(),jw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),hl()),n&2){let r;BE(4),Bw(o.skill()&&!o.isFilesystemBacked()?4:-1),BE(),Bw(o.isPlatformMode?5:-1),BE(),Bw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,pn,hn,on,mn,at,sn,ko,Oi,On],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,y,p as pt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-bCI6skcH.js';import {g,W,q as F,H as J,I as we,r as rT,$ as $i,O as Of,K as U,L as w,N as x,v as vw,E as Es,f as fg,j as jw,a as hl,P as dg,b as BE,c as Bw,x as xC,Y as Yw,Q as vg,R as MI,U as Uw,t as eC,S as xI,l as lg,k as $w,s as Dl,F as Fg,u as pf,w as hf}from'./main-PUOSMZMX.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),xC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=eC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),MI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),MI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),MI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),MI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),MI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),MI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=eC();return hf(se.onMaxToolRoundsInput(p))}),hl(),MI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),Uw(19,he,2,2,"option",23,ce),hl(),MI(),hl(),Es(21,"ds-form-actions")(22,"button",24),xC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=eC();return hf(p.cancel())}),xC(25,"Cancel"),hl()()();}if(i&2){let e=eC();dg("formGroup",e.form),BE(2),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.externalIdControl),xI(),BE(2),dg("formControl",e.defaultAgentNameControl),xI(),BE(2),dg("formControl",e.configPathControl),xI(),BE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),BE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),xI(),BE(),dg("hint",e.runCostThresholdHint()),BE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),xI(),BE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),BE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),xI(),BE(2),dg("formControl",e.adminCaseListingControl),xI(),BE(),$w(e.adminCaseListingOptions),BE(3),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=rT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=rT(()=>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=rT(()=>{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=rT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(fe),fn.max(ge),fn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),jw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),BE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),BE(),Bw(u.isLoading()?2:3));},dependencies:[Ut,nd,bo,xo,Lt,kn,Gt,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
|
|
1
|
+
import {f,y,p as pt,T as Te,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,g as dn,i as at,j as an}from'./chunk-Ncao0R2n.js';import {g,W,q as F,H as J,I as we,r as rT,$ as $i,O as Of,K as U,L as w,N as x,v as vw,E as Es,f as fg,j as jw,a as hl,P as dg,b as BE,c as Bw,x as xC,Y as Yw,Q as vg,R as MI,U as Uw,t as eC,S as xI,l as lg,k as $w,s as Dl,F as Fg,u as pf,w as hf}from'./main-6MVJZWGK.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),xC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=eC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),MI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),MI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),MI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),MI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),MI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),MI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=eC();return hf(se.onMaxToolRoundsInput(p))}),hl(),MI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),Uw(19,he,2,2,"option",23,ce),hl(),MI(),hl(),Es(21,"ds-form-actions")(22,"button",24),xC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=eC();return hf(p.cancel())}),xC(25,"Cancel"),hl()()();}if(i&2){let e=eC();dg("formGroup",e.form),BE(2),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.externalIdControl),xI(),BE(2),dg("formControl",e.defaultAgentNameControl),xI(),BE(2),dg("formControl",e.configPathControl),xI(),BE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),BE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),xI(),BE(),dg("hint",e.runCostThresholdHint()),BE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),xI(),BE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),BE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),xI(),BE(2),dg("formControl",e.adminCaseListingControl),xI(),BE(),$w(e.adminCaseListingOptions),BE(3),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=rT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=rT(()=>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=rT(()=>{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=rT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(fe),fn.max(ge),fn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),jw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),BE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),BE(),Bw(u.isLoading()?2:3));},dependencies:[Ut,nd,bo,xo,Lt,kn,Gt,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-Ncao0R2n.js';import {g,W as W$1,q as F,I as we,ag as U$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,K as U$2,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-6MVJZWGK.js';var J=(n,e)=>e.key;function U(n,e){if(n&1&&(Es(0,"p",3),xC(1),hl()),n&2){let t=eC();BE(),Fg(t.deletion.error());}}function z(n,e){n&1&&(Es(0,"p",4),xC(1,"Loading agent configs\u2026"),hl());}function G(n,e){n&1&&(Es(0,"p",5),xC(1,"No agent configs available."),hl());}function Q(n,e){n&1&&(Es(0,"p",4),xC(1,"No agent configs match the current filter."),hl());}function W(n,e){n&1&&(Es(0,"ds-tag",18),xC(1,"Read-only"),hl());}function X(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(2).$implicit,d=eC(2);return hf(d.launch(s))}),xC(1," Launch "),hl();}if(n&2){let t=eC(2).$implicit;lg("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC(2).$implicit,d=eC(2);return hf(d.edit(s))}),xC(1," Edit "),hl();}if(n&2){let t=eC(2).$implicit;lg("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Yw();Es(0,"button",22),vg("click",function(){pf(t);let s=eC().$implicit,d=eC(2);return hf(d.inspect(s))}),xC(1," Inspect "),hl(),jw(2,X,2,1,"button",23),jw(3,Y,2,1,"button",23);}if(n&2){let t=eC().$implicit,i=eC(2);lg("aria-label","Inspect "+t.config.name),BE(2),Bw(i.canLaunch(t)?2:-1),BE(),Bw(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Yw();Es(0,"agentos-row-delete-action",24),vg("deleteRequested",function(){pf(t);let s=eC().$implicit,d=eC(2);return hf(d.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=eC().$implicit,d=eC(2);return hf(d.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(3);return hf(s.deletion.cancel())}),hl();}if(n&2){let t=eC().$implicit,i=eC(2);dg("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14),xC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),xC(10),hl(),jw(11,W,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),jw(14,Z,4,3),jw(15,ee,1,3,"agentos-row-delete-action",21),hl()()()),n&2){let t=e.$implicit,i=eC(2);BE(2),Fg(t.config.name),BE(2),Dl(" ",t.config.description||"\u2014"," "),BE(2),Fg(i.mode(t)),BE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),BE(),Fg(t.scope==="platform"?"Platform":"Namespace"),BE(),Bw(t.scope==="platform"?11:-1),BE(3),Bw(i.deletion.confirmingId()!==t.key?14:-1),BE(),Bw(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10),xC(9,"Execution mode"),hl(),Es(10,"th",10),xC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),xC(14,"Actions"),hl()()()(),Es(15,"tbody",8),Uw(16,te,16,8,"tr",9,J),hl()()()),n&2){let t=eC();BE(16),$w(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(we);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();rows=$i([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(ha(()=>br([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=vw({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&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(d){return i.rowFilter.query.set(d)}),hl(),Es(2,"button",2),vg("click",function(){return i.openCreateForm()}),xC(3,"New agent config"),hl()(),jw(4,U,2,1,"p",3),jw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(BE(),dg("query",i.rowFilter.query()),BE(3),Bw(i.deletion.error()?4:-1),BE(),Bw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,a6 as id,n as nd,L as Lt,m as mo,c as po,a7 as so,a8 as da,a9 as ra,d as pn,h as hn,e as cn,C as mn,i as at,j as an,I as Io,aa as f$1}from'./chunk-
|
|
1
|
+
import {f,a6 as id,n as nd,L as Lt,m as mo,c as po,a7 as so,a8 as da,a9 as ra,d as pn,h as hn,e as cn,C as mn,i as at,j as an,I as Io,aa as f$1}from'./chunk-Ncao0R2n.js';import {g,W,aM as Y,$ as $i,ab as le,O as Of,v as vw,aN as Db,E as Es,f as fg,j as jw,a as hl,b as BE,c as Bw,ak as yd,a1 as ga,a3 as rn,ac as by,a2 as ha,x as xC,Y as Yw,Q as vg,aO as Hg,R as MI,t as eC,aP as Vg,S as xI,U as Uw,k as $w,aQ as zC,aR as $C,F as Fg,l as lg,av as YC,aw as KC,as as Pg,s as Dl,aS as XC,u as pf,w as hf,aT as PC}from'./main-6MVJZWGK.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&&(Es(0,"p",2),xC(1,"Loading usage settings\u2026"),hl());}function fe(e,a){if(e&1){let t=Yw();Es(0,"ds-notice"),xC(1,"Could not load usage settings. Please try again."),hl(),Es(2,"div")(3,"button",3),vg("click",function(){pf(t);let s=eC();return hf(s.configuration.retry())}),xC(4,"Retry usage settings"),hl()();}}function ye(e,a){e&1&&(Es(0,"p",2),xC(1,"Usage tracking is disabled."),hl());}function be(e,a){e&1&&(Es(0,"ds-notice"),xC(1),hl()),e&2&&(BE(),Fg(a));}function xe(e,a){e&1&&(Es(0,"p",2),xC(1,"Loading usage\u2026"),hl());}function he(e,a){e&1&&(Es(0,"p",12),xC(1,"No recorded usage for this period."),hl());}function Se(e,a){if(e&1&&(Es(0,"p",10),xC(1),hl()),e&2){let t=eC().$implicit;BE(),Dl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Es(0,"tr",16)(1,"td",18),xC(2),hl(),Es(3,"td",19),xC(4),YC(5,"number"),hl(),Es(6,"td",20),xC(7),YC(8,"number"),YC(9,"number"),hl(),Es(10,"td",21),xC(11),YC(12,"number"),YC(13,"number"),hl(),Es(14,"td",22),xC(15),YC(16,"agentosCost"),jw(17,Se,2,1,"p",10),hl()()),e&2){let t=a.$implicit;BE(2),Fg(t.key),BE(2),Fg(KC(5,8,t.aggregate.totalTokens)),BE(3),Pg(" ",KC(8,10,t.aggregate.inputTokens)," / ",KC(9,12,t.aggregate.outputTokens)," "),BE(4),Pg(" ",KC(12,14,t.aggregate.cacheReadTokens)," / ",KC(13,16,t.aggregate.cacheWriteTokens)," "),BE(4),Dl(" ",XC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),BE(2),Bw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Es(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),xC(5,"Name"),hl(),Es(6,"th",17),xC(7,"Tokens"),hl(),Es(8,"th",17),xC(9,"Input / output"),hl(),Es(10,"th",17),xC(11,"Cache read / write"),hl(),Es(12,"th",17),xC(13,"Estimated cost"),hl()()(),Es(14,"tbody",15),Uw(15,we,18,21,"tr",16,_e),hl()()()),e&2){let t=eC().$implicit;BE(),lg("aria-label","Usage "+t.title.toLowerCase()),BE(14),$w(t.rows);}}function Ne(e,a){if(e&1&&(Es(0,"h3",11),xC(1),hl(),jw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;BE(),Fg(t.title),BE(),Bw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Uw(0,Ne,4,2,null,null,ue),Es(2,"p",10),xC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),hl()),e&2){let t=eC(2);$w(zC(4,ge,$C(0,ce,t.agents()),$C(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(t);let s=eC();return hf(s.load())}),Es(1,"ds-form-field",5)(2,"input",6),Hg("ngModelChange",function(s){pf(t);let m=eC();return PC(m.from,s)||(m.from=s),hf(s)}),hl(),MI(),hl(),Es(3,"ds-form-field",7)(4,"input",8),Hg("ngModelChange",function(s){pf(t);let m=eC();return PC(m.to,s)||(m.to=s),hf(s)}),hl(),MI(),hl(),Es(5,"button",9),xC(6,"Refresh"),hl()(),jw(7,be,2,1,"ds-notice"),jw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=eC();BE(2),Vg("ngModel",r.from),xI(),BE(2),Vg("ngModel",r.to),xI(),BE(3),Bw((t=r.error())?7:-1,t),BE(),Bw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Y);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=$i([]);models=$i([]);error=$i(null);loading=$i(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Of(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(yd(void 0),ga(()=>{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),rn):(this.loading.set(true),by({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ha(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."),rn))))})).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=vw({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&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),jw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),hl()),t&2&&(BE(2),Bw(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,Db,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as pt,T as Te,a as fn,d as pn,h as hn,e as cn,r as ln,g as dn,i as at,j as an,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,v as va}from'./chunk-bCI6skcH.js';import {g,W,q as F,I as we,aq as k,ap as F$1,a9 as F$2,a2 as ha,aa as br,ar as Ue,r as rT,$ as $i,O as Of,K as U,N as x,L as w,v as vw,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,c as Bw,Y as Yw,f as fg,R as MI,U as Uw,ao as Hw,t as eC,S as xI,k as $w,s as Dl,ae as Pw,F as Fg,as as Pg,u as pf,w as hf}from'./main-PUOSMZMX.js';function he(r,t){r&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function ve(r,t){if(r&1&&fg(0,"input",6),r&2){let e=eC(2);dg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Es(0,"option",44),xC(1),hl()),r&2){let e=t.$implicit;dg("value",e.id),BE(),Pg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Es(0,"select",7)(1,"option",43),xC(2,"Select provider"),hl(),Uw(3,ye,2,3,"option",44,Pw().trackByProvider,true),hl(),MI()),r&2){let e=eC(2);dg("formControl",e.aiProviderIdControl),xI(),BE(3),$w(e.providers());}}function xe(r,t){if(r&1&&(Es(0,"option",25),xC(1),hl()),r&2){let e=t.$implicit;dg("ngValue",e),BE(),Fg(e.toLowerCase());}}function _e(r,t){r&1&&(Es(0,"p",2),xC(1,"Not supported yet for Anthropic and Gemini providers."),hl());}function Me(r,t){r&1&&(Es(0,"p",2),xC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),hl());}function Ee(r,t){r&1&&(Es(0,"p",26),xC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),hl());}function Ae(r,t){if(r&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let u=eC();return hf(u.submit())}),Es(1,"ds-form-field",5),jw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),hl(),Es(4,"ds-form-field",8),fg(5,"input",9),MI(),hl(),Es(6,"ds-form-field",10),fg(7,"input",11),MI(),hl(),Es(8,"ds-form-field",12),fg(9,"input",13),MI(),hl(),Es(10,"ds-form-field",14),fg(11,"input",15),MI(),hl(),Es(12,"div",16)(13,"ds-form-field",17),fg(14,"input",18),MI(),hl(),Es(15,"ds-form-field",19),fg(16,"input",20),MI(),hl()(),Es(17,"ds-form-field",21),fg(18,"input",22),MI(),hl(),Es(19,"ds-form-field",23)(20,"select",24)(21,"option",25),xC(22,"Provider default"),hl(),Uw(23,xe,2,2,"option",25,Hw),hl(),MI(),jw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),jw(27,Ee,2,0,"p",26),hl(),Es(28,"div",27)(29,"label",28),fg(30,"input",29),MI(),Es(31,"span",30),xC(32,"Supports advanced execution"),hl()(),Es(33,"p",31),xC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),hl()(),Es(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),fg(38,"input",34),MI(),hl(),Es(39,"ds-form-field",35),fg(40,"input",36),MI(),hl()(),Es(41,"div",16)(42,"ds-form-field",37),fg(43,"input",38),MI(),hl(),Es(44,"ds-form-field",39),fg(45,"input",40),MI(),hl()()(),Es(46,"ds-form-actions")(47,"button",41),xC(48),hl(),Es(49,"button",42),vg("click",function(){pf(e);let u=eC();return hf(u.cancel())}),xC(50,"Cancel"),hl()()();}if(r&2){let e=eC();dg("formGroup",e.form),BE(2),Bw(e.isEditMode()?2:3),BE(3),dg("formControl",e.apiModelNameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.aliasControl),xI(),BE(2),dg("formControl",e.priorityControl),xI(),BE(3),dg("formControl",e.temperatureControl),xI(),BE(2),dg("formControl",e.contextWindowControl),xI(),BE(2),dg("formControl",e.maxCompletionTokensControl),xI(),BE(2),dg("formControl",e.reasoningEffortControl),xI(),BE(),dg("ngValue",null),BE(2),$w(e.reasoningEffortOptions),BE(2),Bw(e.reasoningEffortUnsupported()?25:26),BE(2),Bw(e.temperatureMayConflictWithEffort()?27:-1),BE(3),dg("formControl",e.supportsAdvancedExecutionControl),xI(),BE(5),dg("formGroup",e.pricingGroup),BE(3),xI(),BE(2),xI(),BE(3),xI(),BE(2),xI(),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ha(()=>br([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[fn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ue);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=rT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=rT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);selectedProviderLabel=rT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Of(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=vw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return c.cancel()}),xC(3," \u2190 AI models "),hl()(),jw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),hl()),e&2&&(BE(),dg("title",c.isEditMode()?"Edit AI model":"New AI model"),BE(3),Bw(c.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,qr,Vn,An,va],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
1
|
+
import {p as pt,T as Te,a as fn,d as pn,h as hn,e as cn,r as ln,g as dn,i as at,j as an,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,H as qr,V as Vn,A as An,v as va}from'./chunk-Ncao0R2n.js';import {g,W,q as F,I as we,aq as k,ap as F$1,a9 as F$2,a2 as ha,aa as br,ar as Ue,r as rT,$ as $i,O as Of,K as U,N as x,L as w,v as vw,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,c as Bw,Y as Yw,f as fg,R as MI,U as Uw,ao as Hw,t as eC,S as xI,k as $w,s as Dl,ae as Pw,F as Fg,as as Pg,u as pf,w as hf}from'./main-6MVJZWGK.js';function he(r,t){r&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function ve(r,t){if(r&1&&fg(0,"input",6),r&2){let e=eC(2);dg("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(Es(0,"option",44),xC(1),hl()),r&2){let e=t.$implicit;dg("value",e.id),BE(),Pg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(Es(0,"select",7)(1,"option",43),xC(2,"Select provider"),hl(),Uw(3,ye,2,3,"option",44,Pw().trackByProvider,true),hl(),MI()),r&2){let e=eC(2);dg("formControl",e.aiProviderIdControl),xI(),BE(3),$w(e.providers());}}function xe(r,t){if(r&1&&(Es(0,"option",25),xC(1),hl()),r&2){let e=t.$implicit;dg("ngValue",e),BE(),Fg(e.toLowerCase());}}function _e(r,t){r&1&&(Es(0,"p",2),xC(1,"Not supported yet for Anthropic and Gemini providers."),hl());}function Me(r,t){r&1&&(Es(0,"p",2),xC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),hl());}function Ee(r,t){r&1&&(Es(0,"p",26),xC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),hl());}function Ae(r,t){if(r&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let u=eC();return hf(u.submit())}),Es(1,"ds-form-field",5),jw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),hl(),Es(4,"ds-form-field",8),fg(5,"input",9),MI(),hl(),Es(6,"ds-form-field",10),fg(7,"input",11),MI(),hl(),Es(8,"ds-form-field",12),fg(9,"input",13),MI(),hl(),Es(10,"ds-form-field",14),fg(11,"input",15),MI(),hl(),Es(12,"div",16)(13,"ds-form-field",17),fg(14,"input",18),MI(),hl(),Es(15,"ds-form-field",19),fg(16,"input",20),MI(),hl()(),Es(17,"ds-form-field",21),fg(18,"input",22),MI(),hl(),Es(19,"ds-form-field",23)(20,"select",24)(21,"option",25),xC(22,"Provider default"),hl(),Uw(23,xe,2,2,"option",25,Hw),hl(),MI(),jw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),jw(27,Ee,2,0,"p",26),hl(),Es(28,"div",27)(29,"label",28),fg(30,"input",29),MI(),Es(31,"span",30),xC(32,"Supports advanced execution"),hl()(),Es(33,"p",31),xC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),hl()(),Es(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),fg(38,"input",34),MI(),hl(),Es(39,"ds-form-field",35),fg(40,"input",36),MI(),hl()(),Es(41,"div",16)(42,"ds-form-field",37),fg(43,"input",38),MI(),hl(),Es(44,"ds-form-field",39),fg(45,"input",40),MI(),hl()()(),Es(46,"ds-form-actions")(47,"button",41),xC(48),hl(),Es(49,"button",42),vg("click",function(){pf(e);let u=eC();return hf(u.cancel())}),xC(50,"Cancel"),hl()()();}if(r&2){let e=eC();dg("formGroup",e.form),BE(2),Bw(e.isEditMode()?2:3),BE(3),dg("formControl",e.apiModelNameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.aliasControl),xI(),BE(2),dg("formControl",e.priorityControl),xI(),BE(3),dg("formControl",e.temperatureControl),xI(),BE(2),dg("formControl",e.contextWindowControl),xI(),BE(2),dg("formControl",e.maxCompletionTokensControl),xI(),BE(2),dg("formControl",e.reasoningEffortControl),xI(),BE(),dg("ngValue",null),BE(2),$w(e.reasoningEffortOptions),BE(2),Bw(e.reasoningEffortUnsupported()?25:26),BE(2),Bw(e.temperatureMayConflictWithEffort()?27:-1),BE(3),dg("formControl",e.supportsAdvancedExecutionControl),xI(),BE(5),dg("formGroup",e.pricingGroup),BE(3),xI(),BE(2),xI(),BE(3),xI(),BE(2),xI(),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(ha(()=>br([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[fn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Ue);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=rT(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=rT(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);selectedProviderLabel=rT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){Of(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=vw({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return c.cancel()}),xC(3," \u2190 AI models "),hl()(),jw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),hl()),e&2&&(BE(),dg("title",c.isEditMode()?"Edit AI model":"New AI model"),BE(3),Bw(c.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,at,an,Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,qr,Vn,An,va],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z as k$1,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-
|
|
1
|
+
import {z as k$1,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-Ncao0R2n.js';import {g,W as W$1,q as F,I as we,aq as k,ap as F$1,Z as Tr,$ as $i,a1 as ga,ac as by,a2 as ha,aa as br,K as U,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-6MVJZWGK.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Es(0,"p",3),xC(1),hl()),i&2){let t=eC();BE(),Fg(t.deletion.error());}}function W(i,e){i&1&&(Es(0,"p",4),xC(1,"Loading AI models\u2026"),hl());}function X(i,e){i&1&&(Es(0,"p",5),xC(1,"No AI models configured."),hl());}function Y(i,e){i&1&&(Es(0,"p",4),xC(1,"No AI models match the current filter."),hl());}function Z(i,e){i&1&&(Es(0,"ds-tag",18),xC(1,"Read-only"),hl());}function ee(i,e){if(i&1){let t=Yw();Es(0,"button",24),vg("click",function(){pf(t);let s=eC(2).$implicit,m=eC(2);return hf(m.edit(s))}),xC(1,"Edit"),hl();}if(i&2){let t=eC(2).$implicit,n=eC(2);lg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=Yw();jw(0,ee,2,1,"button",22),Es(1,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.deletion.request(s.key))})("deleteConfirmed",function(){pf(t);let s=eC().$implicit,m=eC(2);return hf(m.confirmDelete(s))})("deleteCancelled",function(){pf(t);let s=eC(3);return hf(s.deletion.cancel())}),hl();}if(i&2){let t=eC().$implicit,n=eC(2);Bw(n.deletion.confirmingId()!==t.key?0:-1),BE(),dg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Es(0,"button",21),xC(1,"Inherited"),hl());}function ne(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14),xC(6),hl(),Es(7,"td",15)(8,"div",16)(9,"ds-tag",17),xC(10),hl(),jw(11,Z,2,0,"ds-tag",18),hl()(),Es(12,"td",19)(13,"div",20),jw(14,te,2,4)(15,ie,2,0,"button",21),hl()()()),i&2){let t=e.$implicit,n=eC(2);BE(2),Fg(n.title(t)),BE(2),Fg(t.providerName),BE(2),Dl(" ",t.model.apiModelName," "),BE(3),dg("variant",t.scope==="platform"?"neutral":"accent"),BE(),Fg(t.scope==="platform"?"Platform":"Namespace"),BE(),Bw(t.scope==="platform"?11:-1),BE(3),Bw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Provider"),hl(),Es(8,"th",10),xC(9,"API model name"),hl(),Es(10,"th",10),xC(11,"Scope"),hl(),Es(12,"th",10)(13,"span",11),xC(14,"Actions"),hl()()()(),Es(15,"tbody",8),Uw(16,ne,16,7,"tr",9,G),hl()()()),i&2){let t=eC();BE(16),$w(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=$i(true);deletion=k$1();rows=$i([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(ga(()=>(this.isLoading.set(true),by({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ha(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(ga(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return by({namespace:br(e),platform:br(t),providers:br(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(ha(()=>br([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["label","Filter AI models","placeholder","Filter AI models\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 models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",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,n){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return n.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return n.openCreateForm()}),xC(3,"New AI model"),hl()(),jw(4,Q,2,1,"p",3),jw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(BE(),dg("query",n.rowFilter.query()),BE(3),Bw(n.deletion.error()?4:-1),BE(),Bw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-paKwZTsF.js';import {p as pt,T as Te$1,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-bCI6skcH.js';import {g,W,q as F,I as we$1,ag as U,ah as ke$1,ai as Ne$1,$ as $i,aj as Fe$1,a9 as F$1,ak as yd,r as rT,ac as by,K as U$1,a2 as ha,aa as br,N as x,L as w,v as vw,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,s as Dl,c as Bw,Y as Yw,f as fg,R as MI,U as Uw,t as eC,S as xI,k as $w,F as Fg,u as pf,w as hf,y as sh}from'./main-PUOSMZMX.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function _e(n,t){if(n&1&&(Es(0,"ds-form-field",9),fg(1,"input",38),hl()),n&2){let e=eC(2);BE(),dg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Es(0,"a",39),xC(1,"Add an agent config"),hl(),xC(2," first. ")),n&2){let e=eC(3);dg("href","/agentos/"+e.namespaceId+"/agent-configs/new",sh);}}function xe(n,t){if(n&1&&(Es(0,"ds-form-field",10)(1,"p",2),xC(2," No agent configs available in this scope yet. "),jw(3,Se,3,1),hl()()),n&2){let e=eC(2);BE(3),Bw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.id),BE(),Fg(e.name);}}function De(n,t){if(n&1&&(Es(0,"ds-form-field",11)(1,"select",40)(2,"option",41),xC(3,"Select an agent config\u2026"),hl(),Uw(4,Ee,2,2,"option",17,ve),hl(),MI(),hl()),n&2){let e=eC(2);dg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),BE(),dg("formControl",e.agentConfigIdControl),xI(),BE(3),$w(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function Ne(n,t){if(n&1){let e=Yw();Es(0,"label",31)(1,"input",43),vg("change",function(){let f=pf(e).$implicit,h=eC(3);return hf(h.toggleDay(f.value))}),hl(),xC(2),hl();}if(n&2){let e=t.$implicit,l=eC(3);BE(),dg("checked",l.isDaySelected(e.value)),BE(),Dl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Es(0,"ds-form-field",18)(1,"div",42),Uw(2,Ne,3,2,"label",31,V),hl()()),n&2){let e=eC(2);BE(2),$w(e.dayOptions);}}function Me(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function Pe(n,t){if(n&1&&(Es(0,"ds-form-field",28),fg(1,"input",44),MI(),hl()),n&2){let e=eC(2);dg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),BE(),dg("formControl",e.endDateControl),xI();}}function we(n,t){if(n&1&&(Es(0,"ds-form-field",29),fg(1,"input",45),MI(),hl()),n&2){let e=eC(2);dg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),BE(),dg("formControl",e.occurrenceCountControl),xI();}}function Fe(n,t){if(n&1&&(Es(0,"ds-notice"),xC(1),hl()),n&2){let e=eC(2);BE(),Fg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let f=eC();return hf(f.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"input",8),MI(),hl(),jw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Es(8,"ds-form-field",12),fg(9,"textarea",13),MI(),hl(),Es(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Uw(13,Te,2,2,"option",17,V),hl(),MI(),hl(),jw(15,Ie,4,0,"ds-form-field",18),Es(16,"ds-form-field",19)(17,"div",20),fg(18,"input",21),MI(),Es(19,"span",22),xC(20,"UTC"),hl()()()(),Es(21,"ds-fieldset",23)(22,"ds-form-field",24),fg(23,"input",25),MI(),hl(),Es(24,"ds-form-field",26)(25,"select",27),Uw(26,Me,2,2,"option",17,V),hl(),MI(),hl(),jw(28,Pe,2,2,"ds-form-field",28),jw(29,we,2,2,"ds-form-field",29),hl(),Es(30,"div",30)(31,"label",31),fg(32,"input",32),MI(),xC(33," Enabled "),hl(),Es(34,"p",33),xC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),hl()(),Es(36,"ds-form-field",34),fg(37,"textarea",35),MI(),hl(),jw(38,Fe,2,1,"ds-notice"),Es(39,"ds-form-actions")(40,"button",36),xC(41),hl(),Es(42,"button",37),vg("click",function(){pf(e);let f=eC();return hf(f.cancel())}),xC(43,"Cancel"),hl()()();}if(n&2){let e=eC();dg("formGroup",e.form),BE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),BE(),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(),Bw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),BE(3),dg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),BE(),dg("formControl",e.promptContentControl),xI(),BE(3),dg("formControl",e.unitControl),xI(),BE(),$w(e.schedulerUnits),BE(2),Bw(e.showDayFilter()?15:-1),BE(),dg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),BE(2),dg("formControl",e.timeUtcControl),xI(),BE(4),dg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),BE(),dg("formControl",e.startDateControl),xI(),BE(2),dg("formControl",e.endTypeControl),xI(),BE(),$w(e.endTypes),BE(2),Bw(e.showEndDate()?28:-1),BE(),Bw(e.showOccurrenceCount()?29:-1),BE(3),dg("formControl",e.enabledControl),xI(),BE(4),dg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),BE(),dg("formControl",e.externalMetadataJsonControl),xI(),BE(),Bw(e.errorMessage()?38:-1),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[fn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[fn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[fn.required]}),unit:new Te$1(Ne$1.WEEK,{nonNullable:true,validators:[fn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[fn.required,fn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[fn.required]}),endType:new Te$1(ke$1.NEVER,{nonNullable:true,validators:[fn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);errorMessage=$i(null);SchedulerUnit=Ne$1;SchedulerEndType=ke$1;schedulerUnits=[{value:Ne$1.WEEK,label:"Week(s)"},{value:Ne$1.MONTH,label:"Month(s)"}];endTypes=[{value:ke$1.NEVER,label:"Never"},{value:ke$1.ON_DATE,label:"On date"},{value:ke$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Fe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(yd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(yd(this.endTypeControl.value)));showDayFilter=rT(()=>this.unitSignal()===Ne$1.WEEK);showEndDate=rT(()=>this.endTypeSignal()===ke$1.ON_DATE);showOccurrenceCount=rT(()=>this.endTypeSignal()===ke$1.OCCURRENCES);agentConfigs=$i([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),by({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ha(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===ke$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ke$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=vw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return l.cancel()}),xC(3),hl()(),jw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),hl()),e&2&&(BE(),dg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),BE(2),Dl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),BE(),Bw(l.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,Vn,An,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ke$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ke$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
|
|
1
|
+
import {c}from'./chunk-C9uCCw8u.js';import {p as pt,T as Te$1,a as fn,U as Ut,n as nd,b as bo,x as xo,L as Lt,k as kn,u as vn,G as Gt,m as mo,c as po,$ as $r,V as Vn,A as An,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-Ncao0R2n.js';import {g,W,q as F,I as we$1,ag as U,ah as ke$1,ai as Ne$1,$ as $i,aj as Fe$1,a9 as F$1,ak as yd,r as rT,ac as by,K as U$1,a2 as ha,aa as br,N as x,L as w,v as vw,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,P as dg,s as Dl,c as Bw,Y as Yw,f as fg,R as MI,U as Uw,t as eC,S as xI,k as $w,F as Fg,u as pf,w as hf,y as sh}from'./main-6MVJZWGK.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function _e(n,t){if(n&1&&(Es(0,"ds-form-field",9),fg(1,"input",38),hl()),n&2){let e=eC(2);BE(),dg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Es(0,"a",39),xC(1,"Add an agent config"),hl(),xC(2," first. ")),n&2){let e=eC(3);dg("href","/agentos/"+e.namespaceId+"/agent-configs/new",sh);}}function xe(n,t){if(n&1&&(Es(0,"ds-form-field",10)(1,"p",2),xC(2," No agent configs available in this scope yet. "),jw(3,Se,3,1),hl()()),n&2){let e=eC(2);BE(3),Bw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.id),BE(),Fg(e.name);}}function De(n,t){if(n&1&&(Es(0,"ds-form-field",11)(1,"select",40)(2,"option",41),xC(3,"Select an agent config\u2026"),hl(),Uw(4,Ee,2,2,"option",17,ve),hl(),MI(),hl()),n&2){let e=eC(2);dg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),BE(),dg("formControl",e.agentConfigIdControl),xI(),BE(3),$w(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function Ne(n,t){if(n&1){let e=Yw();Es(0,"label",31)(1,"input",43),vg("change",function(){let f=pf(e).$implicit,h=eC(3);return hf(h.toggleDay(f.value))}),hl(),xC(2),hl();}if(n&2){let e=t.$implicit,l=eC(3);BE(),dg("checked",l.isDaySelected(e.value)),BE(),Dl(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Es(0,"ds-form-field",18)(1,"div",42),Uw(2,Ne,3,2,"label",31,V),hl()()),n&2){let e=eC(2);BE(2),$w(e.dayOptions);}}function Me(n,t){if(n&1&&(Es(0,"option",17),xC(1),hl()),n&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function Pe(n,t){if(n&1&&(Es(0,"ds-form-field",28),fg(1,"input",44),MI(),hl()),n&2){let e=eC(2);dg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),BE(),dg("formControl",e.endDateControl),xI();}}function we(n,t){if(n&1&&(Es(0,"ds-form-field",29),fg(1,"input",45),MI(),hl()),n&2){let e=eC(2);dg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),BE(),dg("formControl",e.occurrenceCountControl),xI();}}function Fe(n,t){if(n&1&&(Es(0,"ds-notice"),xC(1),hl()),n&2){let e=eC(2);BE(),Fg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let f=eC();return hf(f.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"input",8),MI(),hl(),jw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Es(8,"ds-form-field",12),fg(9,"textarea",13),MI(),hl(),Es(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Uw(13,Te,2,2,"option",17,V),hl(),MI(),hl(),jw(15,Ie,4,0,"ds-form-field",18),Es(16,"ds-form-field",19)(17,"div",20),fg(18,"input",21),MI(),Es(19,"span",22),xC(20,"UTC"),hl()()()(),Es(21,"ds-fieldset",23)(22,"ds-form-field",24),fg(23,"input",25),MI(),hl(),Es(24,"ds-form-field",26)(25,"select",27),Uw(26,Me,2,2,"option",17,V),hl(),MI(),hl(),jw(28,Pe,2,2,"ds-form-field",28),jw(29,we,2,2,"ds-form-field",29),hl(),Es(30,"div",30)(31,"label",31),fg(32,"input",32),MI(),xC(33," Enabled "),hl(),Es(34,"p",33),xC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),hl()(),Es(36,"ds-form-field",34),fg(37,"textarea",35),MI(),hl(),jw(38,Fe,2,1,"ds-notice"),Es(39,"ds-form-actions")(40,"button",36),xC(41),hl(),Es(42,"button",37),vg("click",function(){pf(e);let f=eC();return hf(f.cancel())}),xC(43,"Cancel"),hl()()();}if(n&2){let e=eC();dg("formGroup",e.form),BE(),dg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),BE(),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(),Bw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),BE(3),dg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),BE(),dg("formControl",e.promptContentControl),xI(),BE(3),dg("formControl",e.unitControl),xI(),BE(),$w(e.schedulerUnits),BE(2),Bw(e.showDayFilter()?15:-1),BE(),dg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),BE(2),dg("formControl",e.timeUtcControl),xI(),BE(4),dg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),BE(),dg("formControl",e.startDateControl),xI(),BE(2),dg("formControl",e.endTypeControl),xI(),BE(),$w(e.endTypes),BE(2),Bw(e.showEndDate()?28:-1),BE(),Bw(e.showOccurrenceCount()?29:-1),BE(3),dg("formControl",e.enabledControl),xI(),BE(4),dg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),BE(),dg("formControl",e.externalMetadataJsonControl),xI(),BE(),Bw(e.errorMessage()?38:-1),BE(2),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[fn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[fn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[fn.required]}),unit:new Te$1(Ne$1.WEEK,{nonNullable:true,validators:[fn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[fn.required,fn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[fn.required]}),endType:new Te$1(ke$1.NEVER,{nonNullable:true,validators:[fn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);errorMessage=$i(null);SchedulerUnit=Ne$1;SchedulerEndType=ke$1;schedulerUnits=[{value:Ne$1.WEEK,label:"Week(s)"},{value:Ne$1.MONTH,label:"Month(s)"}];endTypes=[{value:ke$1.NEVER,label:"Never"},{value:ke$1.ON_DATE,label:"On date"},{value:ke$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Fe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(yd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(yd(this.endTypeControl.value)));showDayFilter=rT(()=>this.unitSignal()===Ne$1.WEEK);showEndDate=rT(()=>this.endTypeSignal()===ke$1.ON_DATE);showOccurrenceCount=rT(()=>this.endTypeSignal()===ke$1.OCCURRENCES);agentConfigs=$i([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),by({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ha(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===ke$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ke$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=vw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return l.cancel()}),xC(3),hl()(),jw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),hl()),e&2&&(BE(),dg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),BE(2),Dl(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),BE(),Bw(l.isLoading()?4:5));},dependencies:[Ut,nd,bo,xo,Lt,kn,vn,Gt,mo,po,$r,Vn,An,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ke$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ke$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-
|
|
1
|
+
import {D as m,z as k,O as O$1,i as at,h as hn,I as Io,P,B as P$1}from'./chunk-Ncao0R2n.js';import {g,q as F,I as we,Z as Tr,$ as $i,a1 as ga,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,l as lg,u as pf,w as hf}from'./main-6MVJZWGK.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Es(0,"p",3),xC(1),hl()),t&2){let n=eC();BE(),Fg(n.deletion.error());}}function K(t,e){t&1&&(Es(0,"p",4),xC(1,"Loading prompts\u2026"),hl());}function H(t,e){t&1&&(Es(0,"p",5),xC(1,"No platform prompts defined yet."),hl());}function U(t,e){t&1&&(Es(0,"p",4),xC(1,"No prompts match the current filter."),hl());}function z(t,e){if(t&1){let n=Yw();Es(0,"button",18),vg("click",function(){pf(n);let m=eC().$implicit,p=eC(2);return hf(p.edit(m))}),xC(1,"Edit"),hl();}if(t&2){let n=eC().$implicit;lg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Yw();Es(0,"agentos-row-delete-action",19),vg("deleteRequested",function(){pf(n);let m=eC().$implicit,p=eC(2);return hf(p.deletion.request(m.id))})("deleteConfirmed",function(){pf(n);let m=eC().$implicit,p=eC(2);return hf(p.confirmDelete(m))})("deleteCancelled",function(){pf(n);let m=eC(3);return hf(m.deletion.cancel())}),hl();}if(t&2){let n=eC().$implicit,r=eC(2);dg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Es(0,"tr",9)(1,"td",12),xC(2),hl(),Es(3,"td",13),xC(4),hl(),Es(5,"td",14)(6,"div",15),jw(7,z,2,1,"button",16),jw(8,G,1,3,"agentos-row-delete-action",17),hl()()()),t&2){let n=e.$implicit,r=eC(2);BE(2),Fg(n.name),BE(2),Dl(" ",n.description||"\u2014"," "),BE(3),Bw(r.deletion.confirmingId()!==n.id?7:-1),BE(),Bw(n.id?8:-1);}}function O(t,e){if(t&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10)(9,"span",11),xC(10,"Actions"),hl()()()(),Es(11,"tbody",8),Uw(12,J,9,4,"tr",9,j),hl()()()),t&2){let n=eC();BE(12),$w(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();prompts=$i([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=vw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(p){return r.rowFilter.query.set(p)}),hl(),Es(2,"button",2),vg("click",function(){return r.openCreateForm()}),xC(3,"New prompt"),hl()(),jw(4,A,2,1,"p",3),jw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(BE(),dg("query",r.rowFilter.query()),BE(3),Bw(r.deletion.error()?4:-1),BE(),Bw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-2_zz7NAC.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-Ncao0R2n.js';import {g,q as F,I as we,Z as Tr,$ as $i,a1 as ga,K as U$1,v as vw,E as Es,Q as vg,a as hl,x as xC,j as jw,b as BE,P as dg,c as Bw,t as eC,F as Fg,U as Uw,k as $w,s as Dl,Y as Yw,u as pf,w as hf,l as lg}from'./main-6MVJZWGK.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Es(0,"p",3),xC(1),hl()),i&2){let t=eC();BE(),Fg(t.deletion.error());}}function A(i,e){i&1&&(Es(0,"p",4),xC(1,"Loading skills\u2026"),hl());}function H(i,e){i&1&&(Es(0,"p",5),xC(1,"No platform skills defined yet."),hl());}function U(i,e){i&1&&(Es(0,"p",4),xC(1,"No skills match the current filter."),hl());}function z(i,e){i&1&&(Es(0,"ds-tag",15),xC(1,"SKILL.md"),hl());}function G(i,e){if(i&1){let t=Yw();Es(0,"button",21),vg("click",function(){pf(t);let d=eC(2).$implicit,m=eC(2);return hf(m.edit(d))}),xC(1,"Edit"),hl();}if(i&2){let t=eC(2).$implicit;lg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Yw();Es(0,"button",21),vg("click",function(){pf(t);let d=eC().$implicit,m=eC(2);return hf(m.inspect(d))}),xC(1,"View"),hl(),jw(2,G,2,1,"button",22);}if(i&2){let t=eC().$implicit;lg("aria-label","View "+t.name),BE(2),Bw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Yw();Es(0,"agentos-row-delete-action",23),vg("deleteRequested",function(){pf(t);let d=eC().$implicit,m=eC(2);return hf(m.deletion.request(d.id))})("deleteConfirmed",function(){pf(t);let d=eC().$implicit,m=eC(2);return hf(m.confirmDelete(d))})("deleteCancelled",function(){pf(t);let d=eC(3);return hf(d.deletion.cancel())}),hl();}if(i&2){let t=eC().$implicit,l=eC(2);dg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Es(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),xC(4),hl(),jw(5,z,2,0,"ds-tag",15),hl()(),Es(6,"td",16),xC(7),hl(),Es(8,"td",17),xC(9),hl(),Es(10,"td",18)(11,"div",19),jw(12,J,3,2),jw(13,Q,1,3,"agentos-row-delete-action",20),hl()()()),i&2){let t=e.$implicit,l=eC(2);BE(4),Fg(t.name),BE(),Bw(t.readOnly?5:-1),BE(2),Dl(" ",t.description||"\u2014"," "),BE(2),Fg(l.resourceCount(t)),BE(3),Bw(l.deletion.confirmingId()!==t.id?12:-1),BE(),Bw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Es(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),xC(5,"Name"),hl(),Es(6,"th",10),xC(7,"Description"),hl(),Es(8,"th",10),xC(9,"Resources"),hl(),Es(10,"th",10)(11,"span",11),xC(12,"Actions"),hl()()()(),Es(13,"tbody",8),Uw(14,W,14,6,"tr",9,K),hl()()()),i&2){let t=eC();BE(14),$w(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Tr(void 0);isLoading=$i(true);deletion=k();skills=$i([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ga(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(Es(0,"ds-section-header",0)(1,"agentos-table-filter",1),vg("queryChange",function(m){return l.rowFilter.query.set(m)}),hl(),Es(2,"button",2),vg("click",function(){return l.openCreateForm()}),xC(3,"New skill"),hl()(),jw(4,O,2,1,"p",3),jw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(BE(),dg("query",l.rowFilter.query()),BE(3),Bw(l.deletion.error()?4:-1),BE(),Bw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {aY as A,aZ as z$1}from'./main-
|
|
1
|
+
import {aY as A,aZ as z$1}from'./main-6MVJZWGK.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
|
|
2
2
|
`});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
|
|
3
3
|
`?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
|
|
4
4
|
`&&(E.last=l.length==0||l[0].tag==`
|