@whoz-oss/coday-client 0.0.0-workstream-forge.307 → 0.0.0-workstream-forge.314
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-CN9Fd9u0.js → chunk-2LSaNWBr.js} +1 -1
- package/browser/{chunk-nXzIdvrn.js → chunk-6RyVZcCh.js} +1 -1
- package/browser/chunk-B--OOc-e.js +1 -0
- package/browser/{chunk-Tr_JjO6b.js → chunk-B4TyM5Qg.js} +1 -1
- package/browser/{chunk-B0eHxgci.js → chunk-B7E-kJFG.js} +1 -1
- package/browser/{chunk-sLzhy0Up.js → chunk-BAm0N6oT.js} +1 -1
- package/browser/{chunk-DjS8Dvjk.js → chunk-BIO65n02.js} +1 -1
- package/browser/{chunk-BCog1UaJ.js → chunk-BSt-rjMy.js} +1 -1
- package/browser/{chunk-IxT8086h.js → chunk-B_r_EE8o.js} +1 -1
- package/browser/{chunk-hws9FxUt.js → chunk-BisHIJ8B.js} +1 -1
- package/browser/{chunk--FNFLRDT.js → chunk-BmvVAi2u.js} +1 -1
- package/browser/{chunk-BT6UzCxf.js → chunk-BqqYrnBg.js} +1 -1
- package/browser/{chunk-CpPTgCB_.js → chunk-C6SPy3Iy.js} +1 -1
- package/browser/{chunk-DbdlZfWp.js → chunk-CAz7jHFc.js} +1 -1
- package/browser/{chunk-Bu0ccdr8.js → chunk-CLcM8cT9.js} +1 -1
- package/browser/{chunk-DkJ3QAxm.js → chunk-CO4GC4Cz.js} +1 -1
- package/browser/{chunk-BbgSm4CI.js → chunk-CPeA9y6f.js} +1 -1
- package/browser/{chunk-Bi6SxDMh.js → chunk-CRaMaZkb.js} +1 -1
- package/browser/{chunk-CuChgDmJ.js → chunk-CTVuEzaU.js} +1 -1
- package/browser/{chunk-DDGYxARA.js → chunk-CU0kGemX.js} +1 -1
- package/browser/{chunk-BJ1zFFps.js → chunk-CV4mHiB5.js} +1 -1
- package/browser/{chunk-oMuzSDaX.js → chunk-CVTK_mqi.js} +1 -1
- package/browser/{chunk-SWiZLd08.js → chunk-CW7TjD9-.js} +1 -1
- package/browser/{chunk-DRdCkC5Y.js → chunk-Cae9zslx.js} +1 -1
- package/browser/{chunk-BJyGEW7T.js → chunk-Cb3n7jZx.js} +1 -1
- package/browser/{chunk-C3qyrvj1.js → chunk-CsLYTAOW.js} +1 -1
- package/browser/{chunk-CqOpmDij.js → chunk-D1npCb8o.js} +1 -1
- package/browser/{chunk-Al6GR_hf.js → chunk-D2eEvJfY.js} +1 -1
- package/browser/{chunk-B9QejRf8.js → chunk-D3ruyvvh.js} +1 -1
- package/browser/chunk-DHU0Ap86.js +1 -0
- package/browser/{chunk-6gjcqKIy.js → chunk-DIMUeOuo.js} +1 -1
- package/browser/{chunk-BU7axmzu.js → chunk-DNXokVBg.js} +1 -1
- package/browser/{chunk-CgUDp7GS.js → chunk-DSZb2FYR.js} +1 -1
- package/browser/chunk-Dn4zozYE.js +854 -0
- package/browser/chunk-Fi6x3Mr0.js +1 -0
- package/browser/{chunk-JGTJHpTi.js → chunk-IDxhashq.js} +1 -1
- package/browser/{chunk-oiQFtllx.js → chunk-NHthUReQ.js} +1 -1
- package/browser/{chunk-D7NecoRJ.js → chunk-OHt1u0AN.js} +1 -1
- package/browser/{chunk-Bxm5X6iI.js → chunk-RJymiUOx.js} +1 -1
- package/browser/chunk-Vnl6LJnb.js +1 -0
- package/browser/{chunk-D-2ZvJkQ.js → chunk-YVPEbfVY.js} +1 -1
- package/browser/{chunk-BoXayaJA.js → chunk-duY4r4Nk.js} +1 -1
- package/browser/{chunk-DvOfi4de.js → chunk-nqBYEJ0q.js} +1 -1
- package/browser/{chunk-BXzpDMqb.js → chunk-oXSS9zSc.js} +1 -1
- package/browser/{chunk-CeWSwjXE.js → chunk-vG503tip.js} +1 -1
- package/browser/{chunk-DZPQ_9kb.js → chunk-xTb-nFS-.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-2UMSYJ2Z.js → main-5H45CWBF.js} +3 -3
- package/package.json +1 -1
- package/browser/chunk-B5yHUXsb.js +0 -1
- package/browser/chunk-Bh6fIPe1.js +0 -1
- package/browser/chunk-ByYeYdQg.js +0 -1
- package/browser/chunk-Cp8ULs7k.js +0 -1
- package/browser/chunk-DJQT-u6K.js +0 -855
|
@@ -1 +1 @@
|
|
|
1
|
-
import {q as k$1,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {q as k$1,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dn4zozYE.js';import {g,F,H as we,aq as F$1,ap as k,$ as Sr,z as zi,a1 as ma,at as _y,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,q as Il,j as fg}from'./main-5H45CWBF.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(Is(0,"p",3),UC(1),ml()),o&2){let e=fC();KE(),Lg(e.deletion.error());}}function U(o,t){o&1&&(Is(0,"p",4),UC(1,"Loading AI models\u2026"),ml());}function z(o,t){o&1&&(Is(0,"p",5),UC(1,"No platform AI models defined yet."),ml());}function G(o,t){o&1&&(Is(0,"p",4),UC(1,"No AI models match the current filter."),ml());}function J(o,t){if(o&1){let e=aC();Is(0,"button",21),Eg("click",function(){mf(e);let r=fC().$implicit,m=fC(2);return yf(m.edit(r))}),UC(1,"Edit"),ml();}if(o&2){let e=fC().$implicit;fg("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=aC();Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14),UC(6),ml(),Is(7,"td",15),UC(8),ml(),Is(9,"td",16),UC(10),ml(),Is(11,"td",17)(12,"div",18),Qw(13,J,2,1,"button",19),Is(14,"agentos-row-delete-action",20),Eg("deleteRequested",function(){let r=mf(e).$implicit,m=fC(2);return yf(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=mf(e).$implicit,m=fC(2);return yf(m.confirmDelete(r))})("deleteCancelled",function(){mf(e);let r=fC(2);return yf(r.deletion.cancel())}),ml()()()();}if(o&2){let e=t.$implicit,a=fC(2);KE(2),Lg(e.title),KE(2),Lg(e.providerName),KE(2),Il(" ",e.model.apiModelName," "),KE(2),Lg(e.model.priority),KE(2),Il(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),KE(3),Kw(a.deletion.confirmingId()!==e.key?13:-1),KE(),pg("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Provider"),ml(),Is(8,"th",10),UC(9,"API model name"),ml(),Is(10,"th",10),UC(11,"Priority"),ml(),Is(12,"th",10),UC(13,"Reasoning effort"),ml(),Is(14,"th",10)(15,"span",11),UC(16,"Actions"),ml()()()(),Is(17,"tbody",8),eC(18,O,15,9,"tr",9,K),ml()()()),o&2){let e=fC();KE(18),tC(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k$1();rows=zi([]);rowFilter=O$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),_y([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let a=new Map(e.map(r=>[r.id??"",r.name]));this.rows.set(t.map((r,m)=>({key:r.id??`model:${m}`,model:r,title:r.alias??r.apiModelName,providerName:a.get(r.aiProviderId)??r.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["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","Platform 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","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,a){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return a.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New AI model"),ml()(),Qw(4,H,2,1,"p",3),Qw(5,U,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,Q,20,0,"div",6)),e&2&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{j as PlatformAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P}from'./chunk-
|
|
1
|
+
import {O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P}from'./chunk-Dn4zozYE.js';import {g,H as we,Z as W,$ as Sr,z as zi,k as yT,a0 as Ue,a1 as ma,a2 as ga,a3 as rn,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,l as eC,r as fC,t as tC,q as Il,L as Lg}from'./main-5H45CWBF.js';function q(e){if(e.sensitive)return e.configured?{status:"hidden",text:"set (hidden)"}:{status:"unset",text:"not set"};if(!e.configured)return {status:"unset",text:"unset"};let t=e.value??"",i=t.trim().toLowerCase();return i==="true"?{status:"on",text:"on"}:i==="false"?{status:"off",text:"off"}:{status:"value",text:t===""?"(empty)":t}}var U=(e,t)=>t.key;function B(e,t){e&1&&(Is(0,"p",10),UC(1,"Loading the configuration failed. Try refreshing."),ml());}function V(e,t){e&1&&(Is(0,"p",11),UC(1,"Loading configuration\u2026"),ml());}function j(e,t){e&1&&(Is(0,"p",12),UC(1,"The service reported no settings."),ml());}function O(e,t){e&1&&(Is(0,"p",11),UC(1,"No settings match the current filters."),ml());}function Y(e,t){e&1&&(Is(0,"ds-tag",22),UC(1,"on"),ml());}function z(e,t){e&1&&(Is(0,"ds-tag",20),UC(1,"off"),ml());}function H(e,t){if(e&1&&(Is(0,"ds-tag",20),UC(1),ml()),e&2){let i=fC().$implicit;KE(),Lg(i.display.text);}}function G(e,t){if(e&1&&(Is(0,"ds-tag",23),UC(1),ml()),e&2){let i=fC().$implicit;KE(),Lg(i.display.text);}}function J(e,t){if(e&1&&(Is(0,"span",24),UC(1),ml()),e&2){let i=fC().$implicit;KE(),Lg(i.display.text);}}function K(e,t){if(e&1&&(Is(0,"tr",16)(1,"td",18),UC(2),ml(),Is(3,"td",19)(4,"ds-tag",20),UC(5),ml()(),Is(6,"td",21),Qw(7,Y,2,0,"ds-tag",22)(8,z,2,0,"ds-tag",20)(9,H,2,1,"ds-tag",20)(10,G,2,1,"ds-tag",23)(11,J,2,1,"span",24),ml(),Is(12,"td",25),UC(13),ml()()),e&2){let i,a=t.$implicit,m=fC(2);KE(2),Il(" ",a.entry.key," "),KE(3),Il(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),KE(2),Kw((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),KE(6),Il(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),UC(5,"Setting"),ml(),Is(6,"th",17),UC(7,"Source"),ml(),Is(8,"th",17),UC(9,"Value"),ml(),Is(10,"th",17),UC(11,"Description"),ml()()(),Is(12,"tbody",15),eC(13,K,14,4,"tr",16,U),ml()()()),e&2){let i=fC();KE(13),tC(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new Sr(void 0);isLoading=zi(true);loadError=zi(false);rows=zi([]);source=zi("ALL");status=zi("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=yT(()=>this.rowFilter.filteredRows().filter(t=>{let i=this.source(),a=this.status();return i!=="ALL"&&t.entry.source!==i?false:a==="SET"?t.entry.configured:a==="UNSET"?!t.entry.configured:true}));Source=Ue;constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(ga(()=>(this.loadError.set(true),this.isLoading.set(false),rn))))),U$1(this.destroyRef)).subscribe(t=>{this.rows.set(t.map(i=>({key:`${i.source}:${i.key}`,entry:i,display:q(i)}))),this.isLoading.set(false);});}reload(){this.refresh$.next();}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-platform-configuration"]],decls:24,vars:6,consts:[["title","Configuration","description","Effective environment variables and Spring properties of the running service. Secrets are never shown, only whether they are set."],["label","Filter settings","placeholder","Filter settings\u2026",3,"queryChange","query"],["dsButton","","type","button",3,"click"],[1,"settings-table__toolbar"],["aria-label","Filter by source",1,"ds-control",2,"width","auto",3,"change","value"],["value","ALL"],[3,"value"],["aria-label","Filter by state",1,"ds-control",2,"width","auto",3,"change","value"],["value","SET"],["value","UNSET"],["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","Effective configuration"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Setting","data-title","",1,"settings-table__name","ds-mono"],["role","cell","data-label","Source"],["variant","neutral"],["role","cell","data-label","Value"],["variant","accent"],["variant","outline"],[1,"ds-mono"],["role","cell","data-label","Description",1,"settings-table__secondary"]],template:function(i,a){i&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.reload()}),UC(3,"Refresh"),ml()(),Is(4,"div",3)(5,"select",4),Eg("change",function(c){return a.source.set(c.target.value)}),Is(6,"option",5),UC(7,"All sources"),ml(),Is(8,"option",6),UC(9,"Environment variables"),ml(),Is(10,"option",6),UC(11,"Spring properties"),ml()(),Is(12,"select",7),Eg("change",function(c){return a.status.set(c.target.value)}),Is(13,"option",5),UC(14,"Set and unset"),ml(),Is(15,"option",8),UC(16,"Set only"),ml(),Is(17,"option",9),UC(18,"Unset only"),ml()()(),Qw(19,B,2,0,"p",10)(20,V,2,0,"p",11)(21,j,2,0,"p",12)(22,O,2,0,"p",11)(23,Q,15,0,"div",13)),i&2&&(KE(),pg("query",a.rowFilter.query()),KE(4),pg("value",a.source()),KE(3),pg("value",a.Source.ENVIRONMENT),KE(2),pg("value",a.Source.PROPERTY),KE(2),pg("value",a.status()),KE(7),Kw(a.loadError()?19:a.isLoading()?20:a.rows().length===0?21:a.visibleRows().length===0?22:23));},dependencies:[at,yn,Vo,Ao,P],encapsulation:2})};export{A as PlatformConfigurationComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {O as O$1}from'./chunk-BqqYrnBg.js';import {O}from'./chunk-IDxhashq.js';import {I}from'./chunk-DSZb2FYR.js';import {g,H as we$1,z as zi,k as yT,a9 as F,at as _y,ad as ne,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,s as aC,S as Eg,r as fC,R as pg,T as VI,l as eC,L as Lg,X as UI,t as tC,q as Il,ae as Zw,u as mf,w as yf,P as x,O as w}from'./main-5H45CWBF.js';import {y,J as k,L as B,X as a,p as pt,T as Te$1,$ as v,a0 as V,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,a1 as gn,h as hn,i as at,u as un,m as mn,a2 as ji,F as Ni,a3 as m,a4 as S}from'./chunk-Dn4zozYE.js';import'./chunk-Fi6x3Mr0.js';var ye=(o,e)=>e.value,Ce=(o,e)=>e.title;function be(o,e){o&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function xe(o,e){if(o&1&&(Is(0,"option",27),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Se(o,e){if(o&1){let t=aC();Is(0,"form",15),Eg("ngSubmit",function(){mf(t);let s=fC(2);return yf(s.save())}),Is(1,"ds-group",16)(2,"dl",17)(3,"dt"),UC(4,"Email"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"External ID"),ml(),Is(9,"dd"),UC(10),ml()()(),Is(11,"ds-group",18)(12,"ds-form-field",19),hg(13,"input",20),VI(),ml(),Is(14,"ds-form-field",21),hg(15,"input",22),VI(),ml(),Is(16,"ds-form-field",23),hg(17,"textarea",24),VI(),ml(),Is(18,"ds-form-field",25)(19,"select",26),eC(20,xe,2,2,"option",27,ye),ml(),VI(),ml()(),Is(22,"ds-form-actions")(23,"button",28),UC(24),ml(),Is(25,"button",29),Eg("click",function(){mf(t);let s=fC(2);return yf(s.cancelEditing())}),UC(26,"Cancel"),ml()()();}if(o&2){let t=fC(),l=fC();pg("formGroup",l.form),KE(6),Lg(t.email),KE(4),Lg(t.externalId),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),UI(),KE(),tC(l.languageOptions),KE(3),pg("disabled",l.isSaving()),KE(),Il(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Ee(o,e){o&1&&(Is(0,"p",2),UC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),ml());}function Pe(o,e){if(o&1){let t=aC();Is(0,"span",38),UC(1,"Delete?"),ml(),Is(2,"button",39),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(5);return yf(m.confirmDelete(s))}),UC(3,"Confirm"),ml(),Is(4,"button",40),Eg("click",function(){mf(t);let s=fC(6);return yf(s.cancelDelete())}),UC(5,"Cancel"),ml();}}function Te(o,e){if(o&1){let t=aC();Is(0,"button",40),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(5);return yf(m.armDelete(s))}),UC(1,"Delete"),ml();}}function De(o,e){if(o&1&&(Is(0,"li",34)(1,"span",35),UC(2),ml(),Is(3,"span",36),UC(4),ml(),Qw(5,Pe,6,0)(6,Te,2,0,"button",37),ml()),o&2){let t=e.$implicit,l=fC(5);KE(2),Lg(t.name),KE(2),Lg(t.subtitle),KE(),Kw(l.isPendingDelete(t)?5:6);}}function we(o,e){if(o&1&&(Is(0,"span",32),UC(1),ml(),Is(2,"ul",33),eC(3,De,7,3,"li",34,Zw().trackEntry,true),ml()),o&2){let t=e.$implicit;KE(),Lg(t.title),KE(2),tC(t.entries);}}function Ve(o,e){if(o&1&&eC(0,we,5,1,null,null,Ce),o&2){let t=fC(3);tC(t.recapSections());}}function Ue(o,e){if(o&1){let t=aC();Is(0,"ds-group",16)(1,"dl",17)(2,"dt"),UC(3,"Email"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"External ID"),ml(),Is(8,"dd"),UC(9),ml()()(),Is(10,"ds-group",18)(11,"dl",17)(12,"dt"),UC(13,"First name"),ml(),Is(14,"dd"),UC(15),ml(),Is(16,"dt"),UC(17,"Last name"),ml(),Is(18,"dd"),UC(19),ml(),Is(20,"dt"),UC(21,"Bio"),ml(),Is(22,"dd"),UC(23),ml(),Is(24,"dt"),UC(25,"Language"),ml(),Is(26,"dd"),UC(27),ml()()(),Is(28,"ds-form-actions")(29,"button",30),Eg("click",function(){mf(t);let s=fC(2);return yf(s.startEditing())}),UC(30,"Edit profile"),ml()(),Is(31,"ds-disclosure",31),Eg("toggled",function(){mf(t);let s=fC(2);return yf(s.toggleOverrides())}),Qw(32,Ee,2,0,"p",2)(33,Ve,2,0),ml();}if(o&2){let t=fC(),l=fC();KE(5),Lg(t.email),KE(4),Lg(t.externalId),KE(6),Lg(t.firstname||"\u2014"),KE(4),Lg(t.lastname||"\u2014"),KE(4),Lg(t.bio||"\u2014"),KE(4),Lg(t.preferredLanguage||"\u2014"),KE(4),pg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),KE(),Kw(l.recap().total===0?32:33);}}function Me(o,e){if(o&1){let t=aC();Is(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setThemeVariant(s))}),ml()(),Is(3,"ds-form-field",6)(4,"ds-segmented",7),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setTheme(s))}),ml()()(),Is(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setEnterKeyBehavior(s))}),ml()()(),Is(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),Eg("valueChange",function(s){mf(t);let m=fC();return yf(m.setShowTechnical(s))}),ml()()(),Qw(11,Se,27,5,"form",14)(12,Ue,34,9);}if(o&2){let t=fC();KE(),pg("hint",t.activeVariantDescription()),KE(),pg("options",t.themeVariantOptions)("value",t.themeVariant()),KE(),pg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),KE(),pg("options",t.modeOptions())("value",t.shownMode()),KE(3),pg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),KE(3),pg("options",t.showTechnicalOptions)("value",t.showTechnical()),KE(),Kw(t.isEditing()?11:12);}}function Ie(o,e){o&1&&(Is(0,"p",2),UC(1,"Unable to load profile."),ml());}var ve=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=zi(false);isLoading=zi(false);isSaving=zi(false);isOverridesExpanded=zi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=yT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=yT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=yT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=yT(()=>m(this.themeVariant()).label);activeVariantDescription=yT(()=>m(this.themeVariant()).description);modeOptions=yT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=yT(()=>this.modeOverridden()?S(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true})});recap=F(_y([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:I,total:s.length+m.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=yT(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){v(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !V(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=zi(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??""});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Qw(2,be,2,0,"p",2)(3,Me,13,11)(4,Ie,2,0,"p",2),ml()),t&2){let s;KE(2),Kw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,gn,hn,at,un,mn,ji,Ni],encapsulation:2})};export{ve as UserProfileComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {ab as N,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un}from'./chunk-
|
|
1
|
+
import {ab as N,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un}from'./chunk-Dn4zozYE.js';import {g,W,F,aX as D,ag as U,H as we,z as zi,M as U$1,B,aY as Dy,x as xw,I as Is,S as Eg,U as UC,m as ml,a as hg,Q as Qw,K as KE,R as pg,b as Kw,q as Il,r as fC,L as Lg}from'./main-5H45CWBF.js';function P(l,t){if(l&1&&(Is(0,"ds-notice"),UC(1),ml()),l&2){let n=fC();KE(),Lg(n.launchError());}}var T=class l{route=g(W);router=g(F);caseController=g(D);caseState=g(N);agentConfigController=g(U);destroyRef=g(we);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;resolvedAgentConfig=null;payloadJson=zi("");launchError=zi(null);isLaunching=zi(false);isLoading=zi(false);ngOnInit(){this.isLoading.set(true),this.agentConfigController.getByIdAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.resolvedAgentConfig=t,t.loopConfig!=null&&this.payloadJson.set(JSON.stringify(t.loopConfig,null,2)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}launch(){return B(this,null,function*(){this.launchError.set(null),this.isLaunching.set(true);try{let t=this.resolvedAgentConfig??(yield Dy(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield Dy(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield Dy(this.caseController.addMessageCase(e,d)),this.router.navigate(["/agentos/home"],{queryParams:{ns:this.namespaceId,case:e}});}catch(t){console.error("[AgentConfigLaunch] Failed to launch loop agent",t),this.launchError.set("Failed to launch the agent loop. Please check the console for details."),this.isLaunching.set(false);}})}back(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]);}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=xw({type:l,selectors:[["agentos-agent-config-launch"]],decls:17,vars:6,consts:[["title","Launch loop agent"],["dsButton","","variant","ghost","type","button","title","Back to agent config",3,"click"],[1,"ds-hint"],["label","Loop configuration (read-only)","controlId","agent-loop-payload"],["dsControl","","mono","","id","agent-loop-payload","rows","15","readonly","","spellcheck","false","autocomplete","off",3,"value","disabled"],["dsButton","","variant","primary","type","button",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(n,e){n&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return e.back()}),UC(3," \u2190 Edit agent config "),ml()(),Is(4,"p",2),UC(5," The loop configuration below is read from "),Is(6,"code"),UC(7,"AgentConfig.loopConfig"),ml(),UC(8," and will be used by the backend when the agent loop starts. A new Case will be created and one child case will be launched per entity found. "),ml(),Is(9,"ds-form-field",3),hg(10,"textarea",4),ml(),Qw(11,P,2,1,"ds-notice"),Is(12,"ds-form-actions")(13,"button",5),Eg("click",function(){return e.launch()}),UC(14),ml(),Is(15,"button",6),Eg("click",function(){return e.back()}),UC(16,"Cancel"),ml()()()),n&2&&(KE(10),pg("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),KE(),Kw(e.launchError()?11:-1),KE(2),pg("disabled",e.isLaunching()),KE(),Il(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),KE(),pg("disabled",e.isLaunching()));},dependencies:[vn,yn,fn,hn,_n,at,un],encapsulation:2})};export{T as AgentConfigLaunchComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dn4zozYE.js';import {I as I$1}from'./chunk-DSZb2FYR.js';import {g,F,H as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-5H45CWBF.js';import'./chunk-Fi6x3Mr0.js';var B=(e,t)=>t.id??t.name;function j(e,t){if(e&1&&(Is(0,"p",3),UC(1),ml()),e&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading auth settings\u2026"),ml());}function H(e,t){e&1&&(Is(0,"p",5),UC(1,"No platform auth settings defined yet."),ml());}function U(e,t){e&1&&(Is(0,"p",4),UC(1,"No auth settings match the current filter."),ml());}function z(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onEdit(d))}),UC(1," Edit "),ml();}if(e&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(e,t){if(e&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.onDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(e&2){let n=fC().$implicit,a=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function J(e,t){if(e&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),e&2){let n=t.$implicit,a=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.authType," "),KE(3),Kw(a.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(e,t){if(e&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Authentication type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,B),ml()()()),e&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var I=class e{router=g(F);destroyRef=g(we);state=g(I$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();settings=zi([]);rowFilter=O$1(this.settings,t=>[t.name,t.authType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())),U$1(this.destroyRef)).subscribe({next:t=>{this.settings.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.state.delete(t.id,"platform").pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-platform-auth-settings"]],decls:9,vars:3,consts:[["title","Platform auth settings","description","Authentication settings shared across every namespace."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return a.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New auth setting"),ml()(),Qw(4,j,2,1,"p",3),Qw(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&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.settings().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAuthSettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CLcM8cT9.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as c}from'./chunk-Dn4zozYE.js';import {g,W,F,H as we,z as zi,k as yT,M as U,ac as Ny,a2 as ga,aa as _r,x as xw,au as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,b as Kw,r as fC,R as pg,s as aC,a as hg,av as uT,L as Lg,q as Il,aw as dT,l as eC,t as tC,ao as Jw,u as mf,w as yf,ax as iE}from'./main-5H45CWBF.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Is(0,"a",2),UC(1,"Edit skill \u2192"),ml()),e&2){let n=fC();pg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function te(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function ne(e,t){e&1&&(Is(0,"ds-notice"),UC(1,"Failed to load skill."),ml());}function ie(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Created by"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.createdBy);}}function oe(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Last updated"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Qw(0,ie,4,1),Qw(1,oe,4,1)),e&2){let n=fC();Kw(n.createdBy?0:-1),KE(),Kw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Is(0,"p",4),UC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),ml());}function se(e,t){e&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(e,t){e&1&&(Is(0,"ds-notice"),UC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),ml());}function de(e,t){e&1&&(Is(0,"p",4),UC(1,"No agent references this skill."),ml());}function ce(e,t){e&1&&(Is(0,"ds-tag",15),UC(1,"platform agent"),ml());}function me(e,t){e&1&&(Is(0,"ds-tag",15),UC(1,"via *"),ml());}function pe(e,t){if(e&1&&(Is(0,"li",13)(1,"span",14),UC(2),ml(),Qw(3,ce,2,0,"ds-tag",15),Qw(4,me,2,0,"ds-tag",15),ml()),e&2){let n=t.$implicit;KE(2),Lg(n.name),KE(),Kw(n.platform?3:-1),KE(),Kw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Is(0,"ul",12),eC(1,pe,5,3,"li",13,Y),ml(),Is(3,"p",4),UC(4," An agent listed "),Is(5,"code"),UC(6,"via *"),ml(),UC(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. "),ml()),e&2){let n=fC(2);KE(),tC(n.consumers());}}function _e(e,t){e&1&&(Is(0,"p",4),UC(1,"No resources bundled with this skill."),ml());}function ge(e,t){if(e&1){let n=aC();Is(0,"li")(1,"ds-disclosure",16),Eg("toggled",function(){let r=mf(n).$implicit,g=fC(3);return yf(g.toggleResource(r))}),Is(2,"pre",17),UC(3),ml()()();}if(e&2){let n=t.$implicit,o=fC(3);KE(),pg("heading",n)("open",o.isResourceExpanded(n)),KE(2),Lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Is(0,"ul",12),eC(1,ge,4,3,"li",null,Jw),ml()),e&2){let n=fC(2);KE(),tC(n.resourcePaths());}}function fe(e,t){if(e&1){let n=aC();Is(0,"ds-card",5)(1,"dl",6)(2,"dt"),UC(3,"Name"),ml(),Is(4,"dd",7),UC(5),ml(),Is(6,"dt"),UC(7,"Description"),ml(),Is(8,"dd"),UC(9),ml(),Is(10,"dt"),UC(11,"Scope"),ml(),Is(12,"dd"),UC(13),ml(),Is(14,"dt"),UC(15,"Storage"),ml(),Is(16,"dd")(17,"ds-tag",8),UC(18),ml()(),Qw(19,ae,2,2),ml()(),Is(20,"ds-card",9),Qw(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),ml(),Is(26,"ds-card")(27,"ds-disclosure",10),Eg("toggled",function(){mf(n);let r=fC();return yf(r.toggleBody())}),hg(28,"div",11),uT(29,"agentosMarkdown"),ml()(),Is(30,"ds-card",9),Qw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),ml();}if(e&2){let n=t,o=fC();KE(5),Lg(n.name),KE(4),Lg(n.description),KE(4),Lg(n.namespaceId?"Namespace":"Platform"),KE(4),pg("variant",o.isFilesystemBacked()?"outline":"neutral"),KE(),Il(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),KE(),Kw(o.isFilesystemBacked()?-1:19),KE(),pg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),KE(),Kw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),KE(6),pg("open",!o.bodyCollapsed()),KE(),pg("innerHTML",dT(29,12,n.body),iE),KE(2),pg("heading","Resources ("+o.resourcePaths().length+")"),KE(),Kw(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=zi(true);hasError=zi(false);skill=zi(null);bodyCollapsed=zi(false);expandedResources=zi(new Set);resourcePaths=yT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=yT(()=>this.skill()?.readOnly===true);consumers=zi([]);consumersUnavailable=zi(false);consumersLoading=zi(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),Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.back()}),UC(3,"\u2190 Skills"),ml(),Qw(4,Z,2,1,"a",2),Qw(5,ee,2,0,"ds-tag",3),ml(),Qw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),ml()),n&2){let r;KE(4),Kw(o.skill()&&!o.isFilesystemBacked()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,c],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-BU7axmzu.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-DJQT-u6K.js';import {g,W,F,H as we$1,ag as U,ah as De$1,ai as ke$1,z as zi,aj as We,a9 as F$1,ak as Dd,k as yT,ac as Ny,M as U$1,a2 as ga,aa as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,r as fC,X as UI,t as tC,L as Lg,u as mf,w as yf,C as ch}from'./main-2UMSYJ2Z.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function _e(n,t){if(n&1&&(Is(0,"ds-form-field",9),hg(1,"input",38),ml()),n&2){let e=fC(2);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Is(0,"a",39),UC(1,"Add an agent config"),ml(),UC(2," first. ")),n&2){let e=fC(3);pg("href","/agentos/"+e.namespaceId+"/agent-configs/new",ch);}}function xe(n,t){if(n&1&&(Is(0,"ds-form-field",10)(1,"p",2),UC(2," No agent configs available in this scope yet. "),Qw(3,Se,3,1),ml()()),n&2){let e=fC(2);KE(3),Kw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.id),KE(),Lg(e.name);}}function De(n,t){if(n&1&&(Is(0,"ds-form-field",11)(1,"select",40)(2,"option",41),UC(3,"Select an agent config\u2026"),ml(),eC(4,Ee,2,2,"option",17,ve),ml(),VI(),ml()),n&2){let e=fC(2);pg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(3),tC(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Ne(n,t){if(n&1){let e=aC();Is(0,"label",31)(1,"input",43),Eg("change",function(){let f=mf(e).$implicit,h=fC(3);return yf(h.toggleDay(f.value))}),ml(),UC(2),ml();}if(n&2){let e=t.$implicit,l=fC(3);KE(),pg("checked",l.isDaySelected(e.value)),KE(),Il(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Is(0,"ds-form-field",18)(1,"div",42),eC(2,Ne,3,2,"label",31,V),ml()()),n&2){let e=fC(2);KE(2),tC(e.dayOptions);}}function Me(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Pe(n,t){if(n&1&&(Is(0,"ds-form-field",28),hg(1,"input",44),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),KE(),pg("formControl",e.endDateControl),UI();}}function we(n,t){if(n&1&&(Is(0,"ds-form-field",29),hg(1,"input",45),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),KE(),pg("formControl",e.occurrenceCountControl),UI();}}function Fe(n,t){if(n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let f=fC();return yf(f.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Is(8,"ds-form-field",12),hg(9,"textarea",13),VI(),ml(),Is(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),eC(13,Te,2,2,"option",17,V),ml(),VI(),ml(),Qw(15,Ie,4,0,"ds-form-field",18),Is(16,"ds-form-field",19)(17,"div",20),hg(18,"input",21),VI(),Is(19,"span",22),UC(20,"UTC"),ml()()()(),Is(21,"ds-fieldset",23)(22,"ds-form-field",24),hg(23,"input",25),VI(),ml(),Is(24,"ds-form-field",26)(25,"select",27),eC(26,Me,2,2,"option",17,V),ml(),VI(),ml(),Qw(28,Pe,2,2,"ds-form-field",28),Qw(29,we,2,2,"ds-form-field",29),ml(),Is(30,"div",30)(31,"label",31),hg(32,"input",32),VI(),UC(33," Enabled "),ml(),Is(34,"p",33),UC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),ml()(),Is(36,"ds-form-field",34),hg(37,"textarea",35),VI(),ml(),Qw(38,Fe,2,1,"ds-notice"),Is(39,"ds-form-actions")(40,"button",36),UC(41),ml(),Is(42,"button",37),Eg("click",function(){mf(e);let f=fC();return yf(f.cancel())}),UC(43,"Cancel"),ml()()();}if(n&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),KE(3),pg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),KE(),pg("formControl",e.promptContentControl),UI(),KE(3),pg("formControl",e.unitControl),UI(),KE(),tC(e.schedulerUnits),KE(2),Kw(e.showDayFilter()?15:-1),KE(),pg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),KE(2),pg("formControl",e.timeUtcControl),UI(),KE(4),pg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),KE(),pg("formControl",e.startDateControl),UI(),KE(2),pg("formControl",e.endTypeControl),UI(),KE(),tC(e.endTypes),KE(2),Kw(e.showEndDate()?28:-1),KE(),Kw(e.showOccurrenceCount()?29:-1),KE(3),pg("formControl",e.enabledControl),UI(),KE(4),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(),Kw(e.errorMessage()?38:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(ke$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(De$1.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);errorMessage=zi(null);SchedulerUnit=ke$1;SchedulerEndType=De$1;schedulerUnits=[{value:ke$1.WEEK,label:"Week(s)"},{value:ke$1.MONTH,label:"Month(s)"}];endTypes=[{value:De$1.NEVER,label:"Never"},{value:De$1.ON_DATE,label:"On date"},{value:De$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(We).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Dd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Dd(this.endTypeControl.value)));showDayFilter=yT(()=>this.unitSignal()===ke$1.WEEK);showEndDate=yT(()=>this.endTypeSignal()===De$1.ON_DATE);showOccurrenceCount=yT(()=>this.endTypeSignal()===De$1.OCCURRENCES);agentConfigs=zi([]);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),Ny({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(ga(()=>_r([])))}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===De$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===De$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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return l.cancel()}),UC(3),ml()(),Qw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),ml()),e&2&&(KE(),pg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),KE(2),Il(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),KE(),Kw(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===De$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===De$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-DNXokVBg.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-Dn4zozYE.js';import {g,W,F,H as we$1,ag as U,ah as De$1,ai as ke$1,z as zi,aj as We,a9 as F$1,ak as Dd,k as yT,ac as Ny,M as U$1,a2 as ga,aa as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,r as fC,X as UI,t as tC,L as Lg,u as mf,w as yf,C as ch}from'./main-5H45CWBF.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function _e(n,t){if(n&1&&(Is(0,"ds-form-field",9),hg(1,"input",38),ml()),n&2){let e=fC(2);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Is(0,"a",39),UC(1,"Add an agent config"),ml(),UC(2," first. ")),n&2){let e=fC(3);pg("href","/agentos/"+e.namespaceId+"/agent-configs/new",ch);}}function xe(n,t){if(n&1&&(Is(0,"ds-form-field",10)(1,"p",2),UC(2," No agent configs available in this scope yet. "),Qw(3,Se,3,1),ml()()),n&2){let e=fC(2);KE(3),Kw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.id),KE(),Lg(e.name);}}function De(n,t){if(n&1&&(Is(0,"ds-form-field",11)(1,"select",40)(2,"option",41),UC(3,"Select an agent config\u2026"),ml(),eC(4,Ee,2,2,"option",17,ve),ml(),VI(),ml()),n&2){let e=fC(2);pg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(3),tC(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Ne(n,t){if(n&1){let e=aC();Is(0,"label",31)(1,"input",43),Eg("change",function(){let f=mf(e).$implicit,h=fC(3);return yf(h.toggleDay(f.value))}),ml(),UC(2),ml();}if(n&2){let e=t.$implicit,l=fC(3);KE(),pg("checked",l.isDaySelected(e.value)),KE(),Il(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Is(0,"ds-form-field",18)(1,"div",42),eC(2,Ne,3,2,"label",31,V),ml()()),n&2){let e=fC(2);KE(2),tC(e.dayOptions);}}function Me(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Pe(n,t){if(n&1&&(Is(0,"ds-form-field",28),hg(1,"input",44),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),KE(),pg("formControl",e.endDateControl),UI();}}function we(n,t){if(n&1&&(Is(0,"ds-form-field",29),hg(1,"input",45),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),KE(),pg("formControl",e.occurrenceCountControl),UI();}}function Fe(n,t){if(n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let f=fC();return yf(f.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Is(8,"ds-form-field",12),hg(9,"textarea",13),VI(),ml(),Is(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),eC(13,Te,2,2,"option",17,V),ml(),VI(),ml(),Qw(15,Ie,4,0,"ds-form-field",18),Is(16,"ds-form-field",19)(17,"div",20),hg(18,"input",21),VI(),Is(19,"span",22),UC(20,"UTC"),ml()()()(),Is(21,"ds-fieldset",23)(22,"ds-form-field",24),hg(23,"input",25),VI(),ml(),Is(24,"ds-form-field",26)(25,"select",27),eC(26,Me,2,2,"option",17,V),ml(),VI(),ml(),Qw(28,Pe,2,2,"ds-form-field",28),Qw(29,we,2,2,"ds-form-field",29),ml(),Is(30,"div",30)(31,"label",31),hg(32,"input",32),VI(),UC(33," Enabled "),ml(),Is(34,"p",33),UC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),ml()(),Is(36,"ds-form-field",34),hg(37,"textarea",35),VI(),ml(),Qw(38,Fe,2,1,"ds-notice"),Is(39,"ds-form-actions")(40,"button",36),UC(41),ml(),Is(42,"button",37),Eg("click",function(){mf(e);let f=fC();return yf(f.cancel())}),UC(43,"Cancel"),ml()()();}if(n&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),KE(3),pg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),KE(),pg("formControl",e.promptContentControl),UI(),KE(3),pg("formControl",e.unitControl),UI(),KE(),tC(e.schedulerUnits),KE(2),Kw(e.showDayFilter()?15:-1),KE(),pg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),KE(2),pg("formControl",e.timeUtcControl),UI(),KE(4),pg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),KE(),pg("formControl",e.startDateControl),UI(),KE(2),pg("formControl",e.endTypeControl),UI(),KE(),tC(e.endTypes),KE(2),Kw(e.showEndDate()?28:-1),KE(),Kw(e.showOccurrenceCount()?29:-1),KE(3),pg("formControl",e.enabledControl),UI(),KE(4),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(),Kw(e.errorMessage()?38:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(ke$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(De$1.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);errorMessage=zi(null);SchedulerUnit=ke$1;SchedulerEndType=De$1;schedulerUnits=[{value:ke$1.WEEK,label:"Week(s)"},{value:ke$1.MONTH,label:"Month(s)"}];endTypes=[{value:De$1.NEVER,label:"Never"},{value:De$1.ON_DATE,label:"On date"},{value:De$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(We).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Dd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Dd(this.endTypeControl.value)));showDayFilter=yT(()=>this.unitSignal()===ke$1.WEEK);showEndDate=yT(()=>this.endTypeSignal()===De$1.ON_DATE);showOccurrenceCount=yT(()=>this.endTypeSignal()===De$1.OCCURRENCES);agentConfigs=zi([]);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),Ny({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(ga(()=>_r([])))}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===De$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===De$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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return l.cancel()}),UC(3),ml()(),Qw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),ml()),e&2&&(KE(),pg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),KE(2),Il(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),KE(),Kw(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===De$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===De$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 {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-
|
|
1
|
+
import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-Dn4zozYE.js';import {g,W,aP as Y,z as zi,ab as le,p as Ff,x as xw,aQ as Ob,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,ak as Dd,a1 as ma,a3 as rn,ac as Ny,a2 as ga,U as UC,s as aC,S as Eg,aR as $g,T as VI,r as fC,aS as Ug,X as UI,l as eC,t as tC,aT as oT,aU as rT,L as Lg,j as fg,av as uT,aw as dT,as as jg,q as Il,aV as fT,u as mf,w as yf,aW as ZC}from'./main-5H45CWBF.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&&(Is(0,"p",2),UC(1,"Loading usage settings\u2026"),ml());}function fe(e,a){if(e&1){let t=aC();Is(0,"ds-notice"),UC(1,"Could not load usage settings. Please try again."),ml(),Is(2,"div")(3,"button",3),Eg("click",function(){mf(t);let s=fC();return yf(s.configuration.retry())}),UC(4,"Retry usage settings"),ml()();}}function ye(e,a){e&1&&(Is(0,"p",2),UC(1,"Usage tracking is disabled."),ml());}function be(e,a){e&1&&(Is(0,"ds-notice"),UC(1),ml()),e&2&&(KE(),Lg(a));}function xe(e,a){e&1&&(Is(0,"p",2),UC(1,"Loading usage\u2026"),ml());}function he(e,a){e&1&&(Is(0,"p",12),UC(1,"No recorded usage for this period."),ml());}function Se(e,a){if(e&1&&(Is(0,"p",10),UC(1),ml()),e&2){let t=fC().$implicit;KE(),Il("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Is(0,"tr",16)(1,"td",18),UC(2),ml(),Is(3,"td",19),UC(4),uT(5,"number"),ml(),Is(6,"td",20),UC(7),uT(8,"number"),uT(9,"number"),ml(),Is(10,"td",21),UC(11),uT(12,"number"),uT(13,"number"),ml(),Is(14,"td",22),UC(15),uT(16,"agentosCost"),Qw(17,Se,2,1,"p",10),ml()()),e&2){let t=a.$implicit;KE(2),Lg(t.key),KE(2),Lg(dT(5,8,t.aggregate.totalTokens)),KE(3),jg(" ",dT(8,10,t.aggregate.inputTokens)," / ",dT(9,12,t.aggregate.outputTokens)," "),KE(4),jg(" ",dT(12,14,t.aggregate.cacheReadTokens)," / ",dT(13,16,t.aggregate.cacheWriteTokens)," "),KE(4),Il(" ",fT(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),KE(2),Kw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),UC(5,"Name"),ml(),Is(6,"th",17),UC(7,"Tokens"),ml(),Is(8,"th",17),UC(9,"Input / output"),ml(),Is(10,"th",17),UC(11,"Cache read / write"),ml(),Is(12,"th",17),UC(13,"Estimated cost"),ml()()(),Is(14,"tbody",15),eC(15,we,18,21,"tr",16,_e),ml()()()),e&2){let t=fC().$implicit;KE(),fg("aria-label","Usage "+t.title.toLowerCase()),KE(14),tC(t.rows);}}function Ne(e,a){if(e&1&&(Is(0,"h3",11),UC(1),ml(),Qw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;KE(),Lg(t.title),KE(),Kw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(eC(0,Ne,4,2,null,null,ue),Is(2,"p",10),UC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),ml()),e&2){let t=fC(2);tC(oT(4,ge,rT(0,ce,t.agents()),rT(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let s=fC();return yf(s.load())}),Is(1,"ds-form-field",5)(2,"input",6),$g("ngModelChange",function(s){mf(t);let m=fC();return ZC(m.from,s)||(m.from=s),yf(s)}),ml(),VI(),ml(),Is(3,"ds-form-field",7)(4,"input",8),$g("ngModelChange",function(s){mf(t);let m=fC();return ZC(m.to,s)||(m.to=s),yf(s)}),ml(),VI(),ml(),Is(5,"button",9),UC(6,"Refresh"),ml()(),Qw(7,be,2,1,"ds-notice"),Qw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=fC();KE(2),Ug("ngModel",r.from),UI(),KE(2),Ug("ngModel",r.to),UI(),KE(3),Kw((t=r.error())?7:-1,t),KE(),Kw(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=zi([]);models=zi([]);error=zi(null);loading=zi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Ff(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Dd(void 0),ma(()=>{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),Ny({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ga(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=xw({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&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Qw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),ml()),t&2&&(KE(2),Kw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Ob,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-CLcM8cT9.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Dn4zozYE.js';import {g,F,H as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-5H45CWBF.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(Is(0,"p",3),UC(1),ml()),i&2){let t=fC();KE(),Lg(t.deletion.error());}}function A(i,e){i&1&&(Is(0,"p",4),UC(1,"Loading skills\u2026"),ml());}function H(i,e){i&1&&(Is(0,"p",5),UC(1,"No platform skills defined yet."),ml());}function U(i,e){i&1&&(Is(0,"p",4),UC(1,"No skills match the current filter."),ml());}function z(i,e){i&1&&(Is(0,"ds-tag",15),UC(1,"SKILL.md"),ml());}function G(i,e){if(i&1){let t=aC();Is(0,"button",21),Eg("click",function(){mf(t);let d=fC(2).$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(i&2){let t=fC(2).$implicit;fg("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=aC();Is(0,"button",21),Eg("click",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.inspect(d))}),UC(1,"View"),ml(),Qw(2,G,2,1,"button",22);}if(i&2){let t=fC().$implicit;fg("aria-label","View "+t.name),KE(2),Kw(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=aC();Is(0,"agentos-row-delete-action",23),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(i&2){let t=fC().$implicit,l=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),UC(4),ml(),Qw(5,z,2,0,"ds-tag",15),ml()(),Is(6,"td",16),UC(7),ml(),Is(8,"td",17),UC(9),ml(),Is(10,"td",18)(11,"div",19),Qw(12,J,3,2),Qw(13,Q,1,3,"agentos-row-delete-action",20),ml()()()),i&2){let t=e.$implicit,l=fC(2);KE(4),Lg(t.name),KE(),Kw(t.readOnly?5:-1),KE(2),Il(" ",t.description||"\u2014"," "),KE(2),Lg(l.resourceCount(t)),KE(3),Kw(l.deletion.confirmingId()!==t.id?12:-1),KE(),Kw(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Resources"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,W,14,6,"tr",9,K),ml()()()),i&2){let t=fC();KE(14),tC(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();skills=zi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return l.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return l.openCreateForm()}),UC(3,"New skill"),ml()(),Qw(4,O,2,1,"p",3),Qw(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&&(KE(),pg("query",l.rowFilter.query()),KE(3),Kw(l.deletion.error()?4:-1),KE(),Kw(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {S}from'./chunk-
|
|
1
|
+
import {S}from'./chunk-Dn4zozYE.js';import {x as xw,Y as br,I as Is,U as UC,m as ml,a as hg,R as pg}from'./main-5H45CWBF.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=xw({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&&(Is(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),UC(3,"Platform"),ml(),Is(4,"span",2),UC(5,"/"),ml(),Is(6,"span"),UC(7,"Administration"),ml()(),hg(8,"router-outlet"),ml()),e&2&&pg("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 {s}from'./chunk-
|
|
1
|
+
import {s}from'./chunk-Dn4zozYE.js';import {g,W,E as ry,G as y,x as xw,y as yl,U as UC,v as vl,K as KE,L as Lg}from'./main-5H45CWBF.js';var A=class r{route=g(W);http=g(ry);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(s,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(s,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(yl(0,"p",0),UC(1),vl()),t&2&&(KE(),Lg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-Fi6x3Mr0.js';import {y}from'./chunk-Dn4zozYE.js';import {g as g$1,ap as k,$ as Sr,at as _y,a1 as ma,a2 as ga,aa as _r,ad as ne,aF as Jy,a5 as Ed,O as w,a6 as A}from'./main-5H45CWBF.js';var g="none",N="me",O=class p{nsController=g$1(k);userState=g$1(y);refresh$=new Sr(void 0);namespaceId$=new Sr(null);vm$=_y([this.namespaceId$,this.refresh$]).pipe(ma(([e])=>{let r=this.loadPlatformProviders().pipe(ga(()=>_r([])));return e?_y([r,this.loadNamespaceProviders(e).pipe(ga(()=>_r([]))),this.loadUserProviders(e).pipe(ga(()=>_r([]))),this.loadUserProviders("global").pipe(ga(()=>_r([])))]).pipe(ne(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):_y([r,this.loadNamespaceProviders("").pipe(ga(()=>_r([]))),this.loadUserProviders("global").pipe(ga(()=>_r([])))]).pipe(ne(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Jy({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):_r([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Ed(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Ed(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Ed(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Ed(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=A({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-Dn4zozYE.js';import {g,F,H as we,ag as U$1,$ as Sr,z as zi,a1 as ma,M as U$2,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,u as mf,w as yf,j as fg}from'./main-5H45CWBF.js';var B=(n,e)=>e.id??e.name;function j(n,e){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let t=fC();KE(),Lg(t.deletion.error());}}function K(n,e){n&1&&(Is(0,"p",4),UC(1,"Loading agent configs\u2026"),ml());}function H(n,e){n&1&&(Is(0,"p",5),UC(1,"No platform agent configs defined yet."),ml());}function U(n,e){n&1&&(Is(0,"p",4),UC(1,"No agent configs match the current filter."),ml());}function z(n,e){if(n&1){let t=aC();Is(0,"button",19),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.inspect(d))}),UC(1," Inspect "),ml(),Is(2,"button",19),Eg("click",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.edit(d))}),UC(3,"Edit"),ml();}if(n&2){let t=fC().$implicit;fg("aria-label","Inspect "+t.name),KE(2),fg("aria-label","Edit "+t.name);}}function G(n,e){if(n&1){let t=aC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.deletion.request(d.id))})("deleteConfirmed",function(){mf(t);let d=fC().$implicit,c=fC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=fC().$implicit,a=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",a.deletion);}}function J(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14),UC(6),ml(),Is(7,"td",15),UC(8),ml(),Is(9,"td",16)(10,"div",17),Qw(11,z,4,2),Qw(12,G,1,3,"agentos-row-delete-action",18),ml()()()),n&2){let t=e.$implicit,a=fC(2);KE(2),Lg(t.name),KE(2),Il(" ",t.description||"\u2014"," "),KE(2),Lg(t.modelName||"\u2014"),KE(2),Lg(a.mode(t)),KE(3),Kw(a.deletion.confirmingId()!==t.id?11:-1),KE(),Kw(t.id?12:-1);}}function O(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10),UC(9,"Model"),ml(),Is(10,"th",10),UC(11,"Execution mode"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,J,13,6,"tr",9,B),ml()()()),n&2){let t=fC();KE(16),tC(t.rowFilter.filteredRows());}}var I=class n{router=g(F);destroyRef=g(we);agentConfigController=g(U$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$1(this.configs,e=>[e.name,e.description,e.modelName,this.mode(e)].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.agentConfigController.listPlatformAgentsAgentConfig(true))),U$2(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}mode(e){return e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE")}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","agent-configs",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.agentConfigController.deleteAgentConfig(e.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:9,vars:3,consts:[["title","Platform agents","description","Agent configurations shared across every namespace."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform agents"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Model"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),UC(3,"New agent config"),ml()(),Qw(4,j,2,1,"p",3),Qw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,18,0,"div",6)),t&2&&(KE(),pg("query",a.rowFilter.query()),KE(3),Kw(a.deletion.error()?4:-1),KE(),Kw(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{I as PlatformAgentConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-DNXokVBg.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-Dn4zozYE.js';import {g,F,H as we,z as zi,M as U$1,ai as ke,al as Ge,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-5H45CWBF.js';var M=(n,t)=>t.id??t.name;function U(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function B(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function j(n,t){n&1&&(Is(0,"p",5),UC(1,"No platform scheduled prompts defined yet."),ml());}function W(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function H(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.description);}}function O(n,t){if(n&1){let e=aC();Is(0,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.toggle(s))}),UC(1),ml(),Is(2,"button",21),Eg("click",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.edit(s))}),UC(3,"Edit"),ml();}if(n&2){let e=fC().$implicit;KE(),Lg(e.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.name);}}function Y(n,t){if(n&1){let e=aC();Is(0,"agentos-row-delete-action",22),Eg("deleteRequested",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.deletion.request(s.id))})("deleteConfirmed",function(){mf(e);let s=fC().$implicit,c=fC(2);return yf(c.confirmDelete(s))})("deleteCancelled",function(){mf(e);let s=fC(3);return yf(s.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);pg("rowKey",e.id)("rowLabel",e.name)("state",i.deletion);}}function z(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,H,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19),Qw(12,O,4,2),Qw(13,Y,1,3,"agentos-row-delete-action",20),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.name),KE(),Kw(e.description?4:-1),KE(2),Lg(i.scheduleLabel(e)),KE(2),pg("variant",e.enabled?"accent":"outline"),KE(),Lg(e.enabled?"Enabled":"Disabled"),KE(3),Kw(i.deletion.confirmingId()!==e.id?12:-1),KE(),Kw(e.id?13:-1);}}function G(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,z,14,7,"tr",9,M),ml()()()),n&2){let e=fC();KE(14),tC(e.rowFilter.filteredRows());}}var A=class n{router=g(F);destroyRef=g(we);state=g(c);prompts=zi([]);isLoading=zi(true);deletion=k();rowFilter=O$1(this.prompts,t=>[t.name,t.description,this.scheduleLabel(t),t.enabled?"Enabled":"Disabled"].filter(Boolean).join(" "));constructor(){this.state.listPlatform().pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.prompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}scheduleLabel(t){let{recurrence:e}=t,i=e.unit===ke.WEEK?"week":"month",s=e.unit===ke.WEEK&&e.days?.length?` (${e.days.map(c=>Ge[c]??c).join(", ")})`:"";return `Every ${i}${s} at ${e.timeUtc} UTC`}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}edit(t){t.id&&this.router.navigate(["/agentos","admin","scheduled-prompts",t.id,"edit"]);}toggle(t){(t.enabled?this.state.disable(t.id??""):this.state.enable(t.id??"")).pipe(U$1(this.destroyRef)).subscribe(i=>this.patchPrompt(i));}confirmDelete(t){if(!t.id)return;let e=t.id;this.deletion.execute(e,{request$:this.state.delete(e).pipe(U$1(this.destroyRef)),onSuccess:()=>this.prompts.update(i=>i.filter(s=>s.id!==e)),errorMessage:`Deleting "${t.name}" failed. Try again.`});}patchPrompt(t){this.prompts.update(e=>e.map(i=>i.id===t.id?t:i));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-platform-scheduled-prompts"]],decls:9,vars:3,consts:[["title","Platform scheduled prompts","description","Scheduled prompts shared across every namespace."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,i){e&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return i.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,U,2,1,"p",3),Qw(5,B,2,0,"p",4)(6,j,2,0,"p",5)(7,W,2,0,"p",4)(8,G,16,0,"div",6)),e&2&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(i.isLoading()?5:i.prompts().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{A as PlatformScheduledPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,aN as ue,a6 as A}from'./main-
|
|
1
|
+
import {g,aN as ue,a6 as A}from'./main-5H45CWBF.js';var o=class r{skillController=g(ue);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
|