@whoz-oss/coday-client 0.0.0-workstream-messaging.9 → 0.0.0-workstream-forge.269
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-5l4dJKzj.js +1 -0
- package/browser/chunk-6G_HDlLt.js +1 -0
- package/browser/chunk-8ZA-dXSc.js +2 -0
- package/browser/chunk-B1-Po7IP.js +1 -0
- package/browser/chunk-B1ETqMnn.js +1 -0
- package/browser/chunk-B6ucC9JA.js +1 -0
- package/browser/chunk-B8yw58sL.js +1 -0
- package/browser/chunk-B9m_Pv-N.js +1 -0
- package/browser/chunk-BAFDJC7n.js +1 -0
- package/browser/chunk-BCtLUKA1.js +1 -0
- package/browser/chunk-BEGiDML0.js +1 -0
- package/browser/chunk-BItNUZzz.js +1 -0
- package/browser/chunk-BMgJXfSE.js +1 -0
- package/browser/chunk-BUdZ5OqC.js +1 -0
- package/browser/chunk-BVY2wOIp.js +1 -0
- package/browser/chunk-BeAWBIRs.js +671 -0
- package/browser/chunk-BeGVJrPy.js +1 -0
- package/browser/chunk-BfJl60vA.js +1 -0
- package/browser/chunk-BkRwWFjx.js +2 -0
- package/browser/chunk-BoLw7dqx.js +1 -0
- package/browser/{chunk-C4mkvgOW.js → chunk-BzTXrMsf.js} +1 -1
- package/browser/chunk-C1mIsJc9.js +1 -0
- package/browser/{chunk-DoVW4Qid.js → chunk-C3fz6Nhs.js} +1 -1
- package/browser/{chunk-_ojJ8Ms-.js → chunk-CXhczMHJ.js} +1 -1
- package/browser/chunk-CfLZEoOb.js +1 -0
- package/browser/chunk-ChYykPZM.js +1 -0
- package/browser/chunk-CkDaEVkZ.js +1 -0
- package/browser/chunk-CmjEguYB.js +1 -0
- package/browser/chunk-Cq9rgtVx.js +1 -0
- package/browser/chunk-CvFTKrrN.js +1 -0
- package/browser/{chunk-DnJZx-N1.js → chunk-D15w64SG.js} +1 -1
- package/browser/chunk-D8O-XquS.js +1 -0
- package/browser/chunk-D9cyFDnZ.js +1 -0
- package/browser/chunk-DAC1_8mf.js +1 -0
- package/browser/{chunk-CdzB1hlk.js → chunk-DA_ON43Y.js} +1 -1
- package/browser/chunk-DSe6H4u5.js +1 -0
- package/browser/chunk-DYGNedc1.js +1 -0
- package/browser/chunk-Db_G9wnV.js +1 -0
- package/browser/{chunk-Do3ec7CW.js → chunk-DxjesQXu.js} +1 -1
- package/browser/{chunk-C6aXXb6M.js → chunk-IMqSwtoo.js} +1 -1
- package/browser/{chunk-BnIh2Agv.js → chunk-MzRAkbwR.js} +1 -1
- package/browser/chunk-Tz-PZzVS.js +1 -0
- package/browser/chunk-Vn-xaj9q.js +1 -0
- package/browser/chunk-fbDk9ppW.js +1 -0
- package/browser/chunk-jfM6q-6w.js +1 -0
- package/browser/chunk-t3EN_XZw.js +1 -0
- package/browser/index.html +2 -2
- package/browser/main-P6EOYPYG.js +1253 -0
- package/package.json +1 -1
- package/browser/chunk-B2OdW-y7.js +0 -1
- package/browser/chunk-B4aagjFN.js +0 -1
- package/browser/chunk-BDBFLLoa.js +0 -2
- package/browser/chunk-BS4UgHRO.js +0 -1
- package/browser/chunk-BZ4F5_xt.js +0 -1
- package/browser/chunk-BZ8SegKy.js +0 -1
- package/browser/chunk-BatABxZT.js +0 -1
- package/browser/chunk-Bb1dx-Ci.js +0 -1
- package/browser/chunk-Bh7y7EIZ.js +0 -1
- package/browser/chunk-BjTEffSr.js +0 -1
- package/browser/chunk-BsPrQGCO.js +0 -1
- package/browser/chunk-BtzGwr18.js +0 -1
- package/browser/chunk-Bv223hQn.js +0 -1
- package/browser/chunk-BxNPtuPg.js +0 -1
- package/browser/chunk-C86Xogns.js +0 -1
- package/browser/chunk-CEHHoMbA.js +0 -2
- package/browser/chunk-CHRZly0o.js +0 -1
- package/browser/chunk-CKcknwaO.js +0 -1
- package/browser/chunk-CZkST2Zn.js +0 -1
- package/browser/chunk-CkbrWR16.js +0 -1
- package/browser/chunk-Cng5sc1A.js +0 -1
- package/browser/chunk-CpLFr6wl.js +0 -1
- package/browser/chunk-CwbSc94v.js +0 -1
- package/browser/chunk-DCYS0PGC.js +0 -1
- package/browser/chunk-DGU69dIe.js +0 -1
- package/browser/chunk-D_dIjWIZ.js +0 -1
- package/browser/chunk-DcX96pJb.js +0 -1
- package/browser/chunk-Ddc_ENU1.js +0 -1
- package/browser/chunk-DmkvfivC.js +0 -1
- package/browser/chunk-DvtbHzPu.js +0 -671
- package/browser/chunk-DymDoxBo.js +0 -1
- package/browser/chunk-DzQphzTy.js +0 -1
- package/browser/chunk-KYe8W5ss.js +0 -1
- package/browser/chunk-MdjBSjZT.js +0 -1
- package/browser/chunk-RltTZwlz.js +0 -1
- package/browser/chunk-bst4n40I.js +0 -1
- package/browser/chunk-iZXu2H1x.js +0 -1
- package/browser/chunk-lCKocljz.js +0 -1
- package/browser/chunk-t-Kfnaoc.js +0 -1
- package/browser/chunk-tEeX_Ukz.js +0 -1
- package/browser/chunk-yULRQNfZ.js +0 -1
- package/browser/main-OQ262YIZ.js +0 -1254
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {ae as N,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un}from'./chunk-DvtbHzPu.js';import {g,W,F,a_ as D,ak as U,v as we,M as Mi,x as U$1,B,a$ as Fm,a as ew,o as os,K as qh,b as pC,z as zu,H as Hh,I as Iw,c as IE,J as Vh,w as ww,Y as Yu,L as Lw,l as lg}from'./main-OQ262YIZ.js';function P(l,t){if(l&1&&(os(0,"ds-notice"),pC(1),zu()),l&2){let n=Lw();IE(),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=Mi("");launchError=Mi(null);isLaunching=Mi(false);isLoading=Mi(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 Fm(this.agentConfigController.getByIdAgentConfig(this.agentConfigId))),n=yield Fm(this.caseController.createCase({namespaceId:this.namespaceId}));this.caseState.addCase(n);let e=n.id??"",d={content:`@${t.name} start`};yield Fm(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=ew({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&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return e.back()}),pC(3," \u2190 Edit agent config "),zu()(),os(4,"p",2),pC(5," The loop configuration below is read from "),os(6,"code"),pC(7,"AgentConfig.loopConfig"),zu(),pC(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. "),zu(),os(9,"ds-form-field",3),Hh(10,"textarea",4),zu(),Iw(11,P,2,1,"ds-notice"),os(12,"ds-form-actions")(13,"button",5),qh("click",function(){return e.launch()}),pC(14),zu(),os(15,"button",6),qh("click",function(){return e.back()}),pC(16,"Cancel"),zu()()()),n&2&&(IE(10),Vh("value",e.payloadJson())("disabled",e.isLaunching()||e.isLoading()),IE(),ww(e.launchError()?11:-1),IE(2),Vh("disabled",e.isLaunching()),IE(),Yu(" ",e.isLaunching()?"Launching\u2026":"Launch"," "),IE(),Vh("disabled",e.isLaunching()));},dependencies:[vn,yn,fn,hn,_n,at,un],encapsulation:2})};export{T as AgentConfigLaunchComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {o}from'./chunk-Do3ec7CW.js';import {r as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,F,v as we,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,P as Pd,n as Ld,h as Bh}from'./main-OQ262YIZ.js';var K=(i,e)=>e.id??e.name;function O(i,e){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let t=Lw();IE(),lg(t.deletion.error());}}function A(i,e){i&1&&(os(0,"p",4),pC(1,"Loading skills\u2026"),zu());}function H(i,e){i&1&&(os(0,"p",5),pC(1,"No platform skills defined yet."),zu());}function U(i,e){i&1&&(os(0,"p",4),pC(1,"No skills match the current filter."),zu());}function z(i,e){i&1&&(os(0,"ds-tag",15),pC(1,"SKILL.md"),zu());}function G(i,e){if(i&1){let t=Rw();os(0,"button",21),qh("click",function(){Pd(t);let d=Lw(2).$implicit,m=Lw(2);return Ld(m.edit(d))}),pC(1,"Edit"),zu();}if(i&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.name);}}function J(i,e){if(i&1){let t=Rw();os(0,"button",21),qh("click",function(){Pd(t);let d=Lw().$implicit,m=Lw(2);return Ld(m.inspect(d))}),pC(1,"View"),zu(),Iw(2,G,2,1,"button",22);}if(i&2){let t=Lw().$implicit;Bh("aria-label","View "+t.name),IE(2),ww(t.readOnly?-1:2);}}function Q(i,e){if(i&1){let t=Rw();os(0,"agentos-row-delete-action",23),qh("deleteRequested",function(){Pd(t);let d=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(d.id))})("deleteConfirmed",function(){Pd(t);let d=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(d))})("deleteCancelled",function(){Pd(t);let d=Lw(3);return Ld(d.deletion.cancel())}),zu();}if(i&2){let t=Lw().$implicit,l=Lw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",l.deletion);}}function W(i,e){if(i&1&&(os(0,"tr",9)(1,"td",12)(2,"div",13)(3,"span",14),pC(4),zu(),Iw(5,z,2,0,"ds-tag",15),zu()(),os(6,"td",16),pC(7),zu(),os(8,"td",17),pC(9),zu(),os(10,"td",18)(11,"div",19),Iw(12,J,3,2),Iw(13,Q,1,3,"agentos-row-delete-action",20),zu()()()),i&2){let t=e.$implicit,l=Lw(2);IE(4),lg(t.name),IE(),ww(t.readOnly?5:-1),IE(2),Yu(" ",t.description||"\u2014"," "),IE(2),lg(l.resourceCount(t)),IE(3),ww(l.deletion.confirmingId()!==t.id?12:-1),IE(),ww(!t.readOnly&&t.id?13:-1);}}function X(i,e){if(i&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Description"),zu(),os(8,"th",10),pC(9,"Resources"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,W,14,6,"tr",9,K),zu()()()),i&2){let t=Lw();IE(14),_w(t.rowFilter.filteredRows());}}var B=class i{router=g(F);destroyRef=g(we);skillState=g(o);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();skills=Mi([]);rowFilter=O$1(this.skills,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.skillState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.skills.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}inspect(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"inspect"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","skills",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.skillState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:t=>t.status===403?`Deleting "${e.name}" requires platform administrator rights.`:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-platform-skills"]],decls:9,vars:3,consts:[["title","Platform skills","description","Skills shared across every namespace."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__tags"],[1,"settings-table__name"],["variant","neutral"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,l){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return l.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return l.openCreateForm()}),pC(3,"New skill"),zu()(),Iw(4,O,2,1,"p",3),Iw(5,A,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,X,16,0,"div",6)),t&2&&(IE(),Vh("query",l.rowFilter.query()),IE(3),ww(l.deletion.error()?4:-1),IE(),ww(l.isLoading()?5:l.skills().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{B as PlatformSkillsComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {g as g$1}from'./chunk-Bv223hQn.js';import {j as e}from'./chunk-DvtbHzPu.js';import {g,v as we,M as Mi,i as VC,x as U,a as ew,X as Kb,G as Gu,b as pC,d as Wu,I as Iw,c as IE,Y as Yu,$ as dg,w as ww,R as Rw,a0 as RC,U as Uh,Z as Zh,P as Pd,L as Lw,n as Ld,l as lg,a1 as FC,f as Gh}from'./main-OQ262YIZ.js';function R(r,n){if(r&1){let e=Rw();Gu(0,"span",11),pC(1,"Remove it? The bots it created stay."),Wu(),Gu(2,"button",15),Zh("click",function(){Pd(e);let t=Lw(2);return Ld(t.remove())}),pC(3," Remove "),Wu(),Gu(4,"button",13),Zh("click",function(){Pd(e);let t=Lw(2);return Ld(t.confirmingRemove.set(false))}),pC(5,"Cancel"),Wu();}if(r&2){let e=Lw(2);IE(2),Gh("disabled",e.busy());}}function I(r,n){if(r&1){let e=Rw();Gu(0,"button",13),Zh("click",function(){Pd(e);let t=Lw(2);return Ld(t.confirmingRemove.set(true))}),pC(1,"Remove"),Wu();}}function V(r,n){if(r&1){let e=Rw();Gu(0,"div",5)(1,"span",9),pC(2),Wu(),Gu(3,"span",10),pC(4),Wu(),Gu(5,"span",11),pC(6),RC(7,"date"),Wu(),Uh(8,"span",12),Gu(9,"button",13),Zh("click",function(){Pd(e);let t=Lw();return Ld(t.replacing.set(!t.replacing()))}),pC(10,"Replace"),Wu(),Iw(11,R,6,1)(12,I,2,0,"button",14),Wu();}if(r&2){let e=n,o=Lw();IE(2),Yu("@",e.username),IE(2),lg(o.statusLabel(e.status)),IE(2),Yu("since ",FC(7,4,e.createdAt,"mediumDate")),IE(5),ww(o.confirmingRemove()?11:12);}}function z(r,n){if(r&1&&(Gu(0,"ol",6)(1,"li"),pC(2),Wu(),Gu(3,"li"),pC(4,"In BotFather's Mini App, open the bot's settings and turn Bot Management Mode on."),Wu(),Gu(5,"li"),pC(6,"Paste the bot's token below. It is stored encrypted and never shown again."),Wu()()),r&2){let e=Lw();IE(2),Yu("In ",e.platformName,', create a bot with @BotFather (/newbot), for example "AgentOS".');}}function B(r,n){if(r&1){let e=Rw();Gu(0,"form",16),Zh("submit",function(t){Pd(e);let p=Lw();return t.preventDefault(),Ld(p.save())}),Gu(1,"label",17),pC(2,"Bot manager token"),Wu(),Gu(3,"input",18),Zh("input",function(t){Pd(e);let p=Lw();return Ld(p.token.set(t.target.value))}),Wu(),Gu(4,"button",19),pC(5),Wu()();}if(r&2){let e=Lw();IE(3),Gh("value",e.token()),IE(),Gh("disabled",e.busy()||!e.token().trim()),IE(),Yu(" ",e.manager()?"Replace":"Set"," ");}}function L(r,n){r&1&&(Gu(0,"p",8),pC(1),Wu()),r&2&&(IE(),lg(n));}var D=class r{botConfig=g(g$1);destroyRef=g(we);platform="TELEGRAM";platformName=e("TELEGRAM");managers=Mi([]);manager=VC(()=>this.managers().find(n=>n.platform===this.platform)??null);replacing=Mi(false);confirmingRemove=Mi(false);token=Mi("");busy=Mi(false);error=Mi(null);ngOnInit(){this.run(this.botConfig.managers(),n=>this.managers.set(n),"Could not load the bot managers.");}statusLabel(n){return n==="RUNNING"?"Running":n.replace("_"," ").toLowerCase()}save(){let n=this.token().trim();n&&this.run(this.botConfig.setManager(this.platform,n),e=>{this.token.set(""),this.replacing.set(false),this.managers.update(o=>[...o.filter(t=>t.platform!==e.platform),e]);},`${this.platformName} refused this token, or the bot cannot manage other bots yet.`);}remove(){this.confirmingRemove.set(false),this.run(this.botConfig.removeManager(this.platform),()=>this.managers.update(n=>n.filter(e=>e.platform!==this.platform)),"Could not remove the bot manager.");}run(n,e,o){this.error.set(null),this.busy.set(true),n.pipe(U(this.destroyRef)).subscribe({next:t=>{this.busy.set(false),e(t);},error:t=>{console.error("[AdminMessaging]",o,t),this.busy.set(false),this.error.set(t?.error?.message??o);}});}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=ew({type:r,selectors:[["agentos-admin-messaging"]],decls:12,vars:6,consts:[[1,"admin-messaging"],[1,"admin-messaging__title"],[1,"admin-messaging__section"],[1,"admin-messaging__section-title"],[1,"admin-messaging__hint"],[1,"admin-messaging__row"],[1,"admin-messaging__steps"],[1,"admin-messaging__token"],["role","alert",1,"admin-messaging__error"],[1,"admin-messaging__bot"],[1,"admin-messaging__status"],[1,"admin-messaging__note"],[1,"admin-messaging__spacer"],["type","button",1,"admin-messaging__btn",3,"click"],["type","button",1,"admin-messaging__btn"],["type","button",1,"admin-messaging__btn","admin-messaging__btn--danger",3,"click","disabled"],[1,"admin-messaging__token",3,"submit"],["for","admin-messaging-token",1,"admin-messaging__label"],["id","admin-messaging-token","type","password","name","token","autocomplete","off","placeholder","123456789:AA\u2026",1,"admin-messaging__input",3,"input","value"],["type","submit",1,"admin-messaging__btn","admin-messaging__btn--primary",3,"disabled"]],template:function(e,o){if(e&1&&(Gu(0,"div",0)(1,"h1",1),pC(2,"Messaging"),Wu(),Gu(3,"section",2)(4,"h2",3),pC(5),Wu(),Gu(6,"p",4),pC(7),Wu(),Iw(8,V,13,7,"div",5)(9,z,7,1,"ol",6),Iw(10,B,6,3,"form",7),Iw(11,L,2,1,"p",8),Wu()()),e&2){let t,p;IE(5),Yu("",o.platformName," bot manager"),IE(2),dg(" The bot manager creates the ",o.platformName," bots of agents for the admins of their namespace: on an agent's page, Create a bot opens ",o.platformName,", the admin confirms, and the bot answers as the agent. Nobody copies a token. Without a bot manager, an agent can still get a bot created with @BotFather, from its token. "),IE(),ww((t=o.manager())?8:9,t),IE(2),ww(!o.manager()||o.replacing()?10:-1),IE(),ww((p=o.error())?11:-1,p);}},dependencies:[Kb],styles:[".admin-messaging[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.admin-messaging__title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:1.25rem;font-weight:600;color:var(--color-text)}.admin-messaging__hint[_ngcontent-%COMP%], .admin-messaging__note[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-text-secondary)}.admin-messaging__warning[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-warning, #b26a00)}.admin-messaging__error[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-error, #c62828)}.admin-messaging__row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.admin-messaging__spacer[_ngcontent-%COMP%]{flex:1}.admin-messaging__bot[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);font-size:.9375rem;color:var(--color-accent);text-decoration:none}.admin-messaging__bot[_ngcontent-%COMP%]:hover{text-decoration:underline}.admin-messaging__status[_ngcontent-%COMP%]{padding:.1rem .5rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);font-size:.75rem;font-weight:600}.admin-messaging__status--ok[_ngcontent-%COMP%]{border-color:var(--color-success, #2e7d32);color:var(--color-success, #2e7d32)}.admin-messaging__status--off[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.admin-messaging__status--warn[_ngcontent-%COMP%]{border-color:var(--color-warning, #b26a00);color:var(--color-warning, #b26a00)}.admin-messaging__token[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.admin-messaging__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.admin-messaging__input[_ngcontent-%COMP%]{flex:1;min-width:16rem;padding:.4rem .6rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);background:var(--color-bg);color:var(--color-text);font-family:var(--font-mono, monospace);font-size:.875rem}.admin-messaging__btn[_ngcontent-%COMP%]{padding:.4rem .9rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;text-decoration:none;cursor:pointer}.admin-messaging__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.admin-messaging__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.admin-messaging__btn--primary[_ngcontent-%COMP%]{border-color:var(--color-accent);color:var(--color-accent)}.admin-messaging__btn--danger[_ngcontent-%COMP%]{border-color:var(--color-error, #c62828);color:var(--color-error, #c62828)}.admin-messaging__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.admin-messaging__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.admin-messaging__steps[_ngcontent-%COMP%]{margin:0;padding-left:1.25rem;font-size:.875rem;color:var(--color-text);line-height:1.6}"]})};export{D as AdminMessagingComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-RltTZwlz.js';import {g,W,v as we,M as Mi,x as U,a as ew,o as os,H as Hh,I as Iw,z as zu,c as IE,w as ww,b as pC,L as Lw,l as lg}from'./main-OQ262YIZ.js';import {v as vn,d as yn,l as dn,_ as _n,m as mn,A as Ao}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';function O(r,e){r&1&&(os(0,"p",1),pC(1,"Loading integration\u2026"),zu());}function T(r,e){r&1&&(os(0,"ds-notice"),pC(1,"Failed to load this integration configuration."),zu());}function L(r,e){r&1&&(os(0,"div",3)(1,"ds-tag",9),pC(2,"YAML"),zu(),os(3,"ds-tag",10),pC(4,"Read-only"),zu()());}function k(r,e){if(r&1&&(os(0,"ds-card",2),Iw(1,L,5,0,"div",3),os(2,"dl",4)(3,"dt"),pC(4,"Name"),zu(),os(5,"dd"),pC(6),zu(),os(7,"dt"),pC(8,"Type"),zu(),os(9,"dd",5),pC(10),zu(),os(11,"dt"),pC(12,"Description"),zu(),os(13,"dd"),pC(14),zu(),os(15,"dt"),pC(16,"Scope"),zu(),os(17,"dd"),pC(18),zu(),os(19,"dt"),pC(20,"Source"),zu(),os(21,"dd"),pC(22),zu(),os(23,"dt"),pC(24,"Auto grant"),zu(),os(25,"dd"),pC(26),zu(),os(27,"dt"),pC(28,"Auth setting"),zu(),os(29,"dd"),pC(30),zu()()(),os(31,"ds-card",6)(32,"p",7),pC(33,"Sensitive values are always redacted."),zu(),os(34,"pre",8),pC(35),zu()()),r&2){let o=e,a=Lw();IE(),ww(a.source()==="FILESYSTEM"?1:-1),IE(5),lg(o.name),IE(4),lg(o.integrationType),IE(4),lg(o.description||"\u2014"),IE(4),lg(a.scopeOf(o)),IE(4),lg(a.source()),IE(4),lg(o.autoGrant?"Enabled":"Disabled"),IE(4),lg(o.authSettingName||"None"),IE(5),lg(a.parameters());}}var w="\u2022\u2022\u2022\u2022\u2022\u2022",A=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,V=class r{route=g(W);destroyRef=g(we);state=g(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=Mi(true);hasError=Mi(false);config=Mi(null);source=Mi("NEO4J");parameters=Mi("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return A.test(o)?w:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?w:e:Array.isArray(e)?e.map(a=>this.redact(a,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,m])=>[a,this.redact(m,a)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=ew({type:r,selectors:[["agentos-integration-config-view"]],decls:5,vars:1,consts:[["title","Integration configuration"],["role","status",1,"ds-hint"],["heading","General"],[1,"settings-table__tags"],["dsDefinitionList",""],[1,"ds-mono"],["heading","Parameters"],[1,"ds-hint"],[1,"ds-pre"],["variant","neutral"],["variant","outline"]],template:function(o,a){if(o&1&&(os(0,"ds-page"),Hh(1,"ds-section-header",0),Iw(2,O,2,0,"p",1)(3,T,2,0,"ds-notice")(4,k,36,9),zu()),o&2){let m;IE(2),ww(a.isLoading()?2:a.hasError()?3:(m=a.config())?4:-1,m);}},dependencies:[vn,yn,dn,_n,mn,Ao],encapsulation:2})};export{V as IntegrationConfigViewComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {i}from'./chunk-iZXu2H1x.js';import {y}from'./chunk-DvtbHzPu.js';import {g,aj as G,aP as we,a3 as vr,aw as $m,a5 as Ys,a6 as Zs,ae as Dr,ah as te,aK as my,a9 as Hl,aa as k}from'./main-OQ262YIZ.js';var u=s=>s,N="none",w="me",O=class s{nsController=g(G);exportService=g(we);userState=g(y);refresh$=new vr(void 0);namespaceId$=new vr(null);vm$=$m([this.namespaceId$,this.refresh$]).pipe(Ys(([e])=>{let n=this.loadPlatformConfigs().pipe(Zs(()=>Dr([]))),t=this.loadUserConfigs("global").pipe(Zs(()=>Dr([])));return e?$m([n,this.loadNamespaceConfigs(e).pipe(Zs(()=>Dr([]))),this.loadUserConfigs(e).pipe(Zs(()=>Dr([]))),t]).pipe(te(([i,r,c,g])=>({platform:i,namespace:r,userOnNs:c,userGlobal:g}))):$m([n,t]).pipe(te(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),my({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(N)}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,w)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):Dr([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let g={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Hl(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let g={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(g)).pipe(Hl(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u(c)).pipe(Hl(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,u(r)).pipe(Hl(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Hl(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=k({token:s,factory:s.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {O as O$1,i as at,d as yn,V as Vo,A as Ao,k as P}from'./chunk-DvtbHzPu.js';import {g,v as we,a2 as W,a3 as vr,M as Mi,i as VC,a4 as Ne,a5 as Ys,a6 as Zs,a7 as Kt,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,T as Tw,L as Lw,_ as _w,Y as Yu,l as lg}from'./main-OQ262YIZ.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&&(os(0,"p",10),pC(1,"Loading the configuration failed. Try refreshing."),zu());}function V(e,t){e&1&&(os(0,"p",11),pC(1,"Loading configuration\u2026"),zu());}function j(e,t){e&1&&(os(0,"p",12),pC(1,"The service reported no settings."),zu());}function O(e,t){e&1&&(os(0,"p",11),pC(1,"No settings match the current filters."),zu());}function Y(e,t){e&1&&(os(0,"ds-tag",22),pC(1,"on"),zu());}function z(e,t){e&1&&(os(0,"ds-tag",20),pC(1,"off"),zu());}function H(e,t){if(e&1&&(os(0,"ds-tag",20),pC(1),zu()),e&2){let i=Lw().$implicit;IE(),lg(i.display.text);}}function G(e,t){if(e&1&&(os(0,"ds-tag",23),pC(1),zu()),e&2){let i=Lw().$implicit;IE(),lg(i.display.text);}}function J(e,t){if(e&1&&(os(0,"span",24),pC(1),zu()),e&2){let i=Lw().$implicit;IE(),lg(i.display.text);}}function K(e,t){if(e&1&&(os(0,"tr",16)(1,"td",18),pC(2),zu(),os(3,"td",19)(4,"ds-tag",20),pC(5),zu()(),os(6,"td",21),Iw(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),zu(),os(12,"td",25),pC(13),zu()()),e&2){let i,a=t.$implicit,m=Lw(2);IE(2),Yu(" ",a.entry.key," "),IE(3),Yu(" ",a.entry.source===m.Source.ENVIRONMENT?"Environment":"Property"," "),IE(2),ww((i=a.display.status)==="on"?7:i==="off"?8:i==="hidden"?9:i==="unset"?10:11),IE(6),Yu(" ",a.entry.description||"\u2014"," ");}}function Q(e,t){if(e&1&&(os(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),pC(5,"Setting"),zu(),os(6,"th",17),pC(7,"Source"),zu(),os(8,"th",17),pC(9,"Value"),zu(),os(10,"th",17),pC(11,"Description"),zu()()(),os(12,"tbody",15),Tw(13,K,14,4,"tr",16,U),zu()()()),e&2){let i=Lw();IE(13),_w(i.visibleRows());}}var A=class e{destroyRef=g(we);configurationController=g(W);refresh$=new vr(void 0);isLoading=Mi(true);loadError=Mi(false);rows=Mi([]);source=Mi("ALL");status=Mi("ALL");rowFilter=O$1(this.rows,t=>[t.entry.key,t.entry.description,t.entry.value].filter(Boolean).join(" "));visibleRows=VC(()=>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=Ne;constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.loadError.set(false),this.configurationController.listEffectiveConfiguration().pipe(Zs(()=>(this.loadError.set(true),this.isLoading.set(false),Kt))))),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=ew({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&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(c){return a.rowFilter.query.set(c)}),zu(),os(2,"button",2),qh("click",function(){return a.reload()}),pC(3,"Refresh"),zu()(),os(4,"div",3)(5,"select",4),qh("change",function(c){return a.source.set(c.target.value)}),os(6,"option",5),pC(7,"All sources"),zu(),os(8,"option",6),pC(9,"Environment variables"),zu(),os(10,"option",6),pC(11,"Spring properties"),zu()(),os(12,"select",7),qh("change",function(c){return a.status.set(c.target.value)}),os(13,"option",5),pC(14,"Set and unset"),zu(),os(15,"option",8),pC(16,"Set only"),zu(),os(17,"option",9),pC(18,"Unset only"),zu()()(),Iw(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&&(IE(),Vh("query",a.rowFilter.query()),IE(4),Vh("value",a.source()),IE(3),Vh("value",a.Source.ENVIRONMENT),IE(2),Vh("value",a.Source.PROPERTY),IE(2),Vh("value",a.status()),IE(7),ww(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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a5 as Ys,a6 as Zs,ae as Dr,aK as my}from'./main-OQ262YIZ.js';function i(t,o,p){return t.pipe(Ys(()=>o().pipe(Zs(()=>Dr(p)))),my({bufferSize:1,refCount:true}))}export{i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {x as m,r as k,O as O$1,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,F,v as we,a3 as vr,M as Mi,a5 as Ys,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,Y as Yu,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(os(0,"p",3),pC(1),zu()),t&2){let n=Lw();IE(),lg(n.deletion.error());}}function K(t,e){t&1&&(os(0,"p",4),pC(1,"Loading prompts\u2026"),zu());}function H(t,e){t&1&&(os(0,"p",5),pC(1,"No platform prompts defined yet."),zu());}function U(t,e){t&1&&(os(0,"p",4),pC(1,"No prompts match the current filter."),zu());}function z(t,e){if(t&1){let n=Rw();os(0,"button",18),qh("click",function(){Pd(n);let m=Lw().$implicit,p=Lw(2);return Ld(p.edit(m))}),pC(1,"Edit"),zu();}if(t&2){let n=Lw().$implicit;Bh("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=Rw();os(0,"agentos-row-delete-action",19),qh("deleteRequested",function(){Pd(n);let m=Lw().$implicit,p=Lw(2);return Ld(p.deletion.request(m.id))})("deleteConfirmed",function(){Pd(n);let m=Lw().$implicit,p=Lw(2);return Ld(p.confirmDelete(m))})("deleteCancelled",function(){Pd(n);let m=Lw(3);return Ld(m.deletion.cancel())}),zu();}if(t&2){let n=Lw().$implicit,r=Lw(2);Vh("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14)(6,"div",15),Iw(7,z,2,1,"button",16),Iw(8,G,1,3,"agentos-row-delete-action",17),zu()()()),t&2){let n=e.$implicit,r=Lw(2);IE(2),lg(n.name),IE(2),Yu(" ",n.description||"\u2014"," "),IE(3),ww(r.deletion.confirmingId()!==n.id?7:-1),IE(),ww(n.id?8:-1);}}function O(t,e){if(t&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Description"),zu(),os(8,"th",10)(9,"span",11),pC(10,"Actions"),zu()()()(),os(11,"tbody",8),Tw(12,J,9,4,"tr",9,j),zu()()()),t&2){let n=Lw();IE(12),_w(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();prompts=Mi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ew({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(p){return r.rowFilter.query.set(p)}),zu(),os(2,"button",2),qh("click",function(){return r.openCreateForm()}),pC(3,"New prompt"),zu()(),Iw(4,A,2,1,"p",3),Iw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(IE(),Vh("query",r.rowFilter.query()),IE(3),ww(r.deletion.error()?4:-1),IE(),ww(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {y}from'./chunk-DvtbHzPu.js';import {g,aI as ce,aJ as T,ae as Dr,a5 as Ys,ah as te,a6 as Zs,aK as my,aa as k}from'./main-OQ262YIZ.js';var v=class i{userState=g(y);membership=g(ce);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return Dr(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(Ys(a=>a?a.isAdmin?Dr(true):this.membership.getMembersNamespaceMembership(e).pipe(te(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),Zs(()=>Dr(false))):Dr(false)),my({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {r as k$1,O as O$1,i as at,d as yn,V as Vo,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import {g,F,v as we,au as k,at as F$1,a3 as vr,M as Mi,a5 as Ys,aw as $m,x as U$1,a as ew,o as os,K as qh,z as zu,b as pC,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,T as Tw,_ as _w,R as Rw,P as Pd,n as Ld,Y as Yu,h as Bh}from'./main-OQ262YIZ.js';var K=(o,t)=>t.key;function H(o,t){if(o&1&&(os(0,"p",3),pC(1),zu()),o&2){let e=Lw();IE(),lg(e.deletion.error());}}function U(o,t){o&1&&(os(0,"p",4),pC(1,"Loading AI models\u2026"),zu());}function z(o,t){o&1&&(os(0,"p",5),pC(1,"No platform AI models defined yet."),zu());}function G(o,t){o&1&&(os(0,"p",4),pC(1,"No AI models match the current filter."),zu());}function J(o,t){if(o&1){let e=Rw();os(0,"button",21),qh("click",function(){Pd(e);let r=Lw().$implicit,m=Lw(2);return Ld(m.edit(r))}),pC(1,"Edit"),zu();}if(o&2){let e=Lw().$implicit;Bh("aria-label","Edit "+e.title);}}function O(o,t){if(o&1){let e=Rw();os(0,"tr",9)(1,"td",12),pC(2),zu(),os(3,"td",13),pC(4),zu(),os(5,"td",14),pC(6),zu(),os(7,"td",15),pC(8),zu(),os(9,"td",16),pC(10),zu(),os(11,"td",17)(12,"div",18),Iw(13,J,2,1,"button",19),os(14,"agentos-row-delete-action",20),qh("deleteRequested",function(){let r=Pd(e).$implicit,m=Lw(2);return Ld(m.deletion.request(r.key))})("deleteConfirmed",function(){let r=Pd(e).$implicit,m=Lw(2);return Ld(m.confirmDelete(r))})("deleteCancelled",function(){Pd(e);let r=Lw(2);return Ld(r.deletion.cancel())}),zu()()()();}if(o&2){let e=t.$implicit,a=Lw(2);IE(2),lg(e.title),IE(2),lg(e.providerName),IE(2),Yu(" ",e.model.apiModelName," "),IE(2),lg(e.model.priority),IE(2),Yu(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),IE(3),ww(a.deletion.confirmingId()!==e.key?13:-1),IE(),Vh("rowKey",e.key)("rowLabel",e.title)("state",a.deletion);}}function Q(o,t){if(o&1&&(os(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),pC(5,"Name"),zu(),os(6,"th",10),pC(7,"Provider"),zu(),os(8,"th",10),pC(9,"API model name"),zu(),os(10,"th",10),pC(11,"Priority"),zu(),os(12,"th",10),pC(13,"Reasoning effort"),zu(),os(14,"th",10)(15,"span",11),pC(16,"Actions"),zu()()()(),os(17,"tbody",8),Tw(18,O,15,9,"tr",9,K),zu()()()),o&2){let e=Lw();IE(18),_w(e.rowFilter.filteredRows());}}var j=class o{router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k$1();rows=Mi([]);rowFilter=O$1(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),$m([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=ew({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&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return a.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return a.openCreateForm()}),pC(3,"New AI model"),zu()(),Iw(4,H,2,1,"p",3),Iw(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&&(IE(),Vh("query",a.rowFilter.query()),IE(3),ww(a.deletion.error()?4:-1),IE(),ww(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 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-BnIh2Agv.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,q as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,n as pn,h as hn,_ as _n,i as at,u as un,o as cn}from'./chunk-DvtbHzPu.js';import {g,W,F,v as we$1,ak as U,al as We,am as De$1,M as Mi,an as Ge,ad as F$1,ao as Vl,i as VC,ag as Gm,x as U$1,a6 as Zs,ae as Dr,E as x,C as w,a as ew,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,Y as Yu,w as ww,R as Rw,H as Hh,N as lI,T as Tw,L as Lw,Q as fI,_ as _w,l as lg,P as Pd,n as Ld,O as Op}from'./main-OQ262YIZ.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function _e(n,t){if(n&1&&(os(0,"ds-form-field",9),Hh(1,"input",38),zu()),n&2){let e=Lw(2);IE(),Vh("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(os(0,"a",39),pC(1,"Add an agent config"),zu(),pC(2," first. ")),n&2){let e=Lw(3);Vh("href","/agentos/"+e.namespaceId+"/agent-configs/new",Op);}}function xe(n,t){if(n&1&&(os(0,"ds-form-field",10)(1,"p",2),pC(2," No agent configs available in this scope yet. "),Iw(3,Se,3,1),zu()()),n&2){let e=Lw(2);IE(3),ww(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(os(0,"option",17),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.id),IE(),lg(e.name);}}function De(n,t){if(n&1&&(os(0,"ds-form-field",11)(1,"select",40)(2,"option",41),pC(3,"Select an agent config\u2026"),zu(),Tw(4,Ee,2,2,"option",17,ve),zu(),lI(),zu()),n&2){let e=Lw(2);Vh("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),IE(),Vh("formControl",e.agentConfigIdControl),fI(),IE(3),_w(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(os(0,"option",17),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function Ne(n,t){if(n&1){let e=Rw();os(0,"label",31)(1,"input",43),qh("change",function(){let f=Pd(e).$implicit,h=Lw(3);return Ld(h.toggleDay(f.value))}),zu(),pC(2),zu();}if(n&2){let e=t.$implicit,l=Lw(3);IE(),Vh("checked",l.isDaySelected(e.value)),IE(),Yu(" ",e.label," ");}}function Ie(n,t){if(n&1&&(os(0,"ds-form-field",18)(1,"div",42),Tw(2,Ne,3,2,"label",31,V),zu()()),n&2){let e=Lw(2);IE(2),_w(e.dayOptions);}}function Me(n,t){if(n&1&&(os(0,"option",17),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function Pe(n,t){if(n&1&&(os(0,"ds-form-field",28),Hh(1,"input",44),lI(),zu()),n&2){let e=Lw(2);Vh("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),IE(),Vh("formControl",e.endDateControl),fI();}}function we(n,t){if(n&1&&(os(0,"ds-form-field",29),Hh(1,"input",45),lI(),zu()),n&2){let e=Lw(2);Vh("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),IE(),Vh("formControl",e.occurrenceCountControl),fI();}}function Fe(n,t){if(n&1&&(os(0,"ds-notice"),pC(1),zu()),n&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let f=Lw();return Ld(f.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"input",8),lI(),zu(),Iw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),os(8,"ds-form-field",12),Hh(9,"textarea",13),lI(),zu(),os(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),Tw(13,Te,2,2,"option",17,V),zu(),lI(),zu(),Iw(15,Ie,4,0,"ds-form-field",18),os(16,"ds-form-field",19)(17,"div",20),Hh(18,"input",21),lI(),os(19,"span",22),pC(20,"UTC"),zu()()()(),os(21,"ds-fieldset",23)(22,"ds-form-field",24),Hh(23,"input",25),lI(),zu(),os(24,"ds-form-field",26)(25,"select",27),Tw(26,Me,2,2,"option",17,V),zu(),lI(),zu(),Iw(28,Pe,2,2,"ds-form-field",28),Iw(29,we,2,2,"ds-form-field",29),zu(),os(30,"div",30)(31,"label",31),Hh(32,"input",32),lI(),pC(33," Enabled "),zu(),os(34,"p",33),pC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),zu()(),os(36,"ds-form-field",34),Hh(37,"textarea",35),lI(),zu(),Iw(38,Fe,2,1,"ds-notice"),os(39,"ds-form-actions")(40,"button",36),pC(41),zu(),os(42,"button",37),qh("click",function(){Pd(e);let f=Lw();return Ld(f.cancel())}),pC(43,"Cancel"),zu()()();}if(n&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(),ww(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),IE(3),Vh("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),IE(),Vh("formControl",e.promptContentControl),fI(),IE(3),Vh("formControl",e.unitControl),fI(),IE(),_w(e.schedulerUnits),IE(2),ww(e.showDayFilter()?15:-1),IE(),Vh("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),IE(2),Vh("formControl",e.timeUtcControl),fI(),IE(4),Vh("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),IE(),Vh("formControl",e.startDateControl),fI(),IE(2),Vh("formControl",e.endTypeControl),fI(),IE(),_w(e.endTypes),IE(2),ww(e.showEndDate()?28:-1),IE(),ww(e.showOccurrenceCount()?29:-1),IE(3),Vh("formControl",e.enabledControl),fI(),IE(4),Vh("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),IE(),Vh("formControl",e.externalMetadataJsonControl),fI(),IE(),ww(e.errorMessage()?38:-1),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(De$1.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(We.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);errorMessage=Mi(null);SchedulerUnit=De$1;SchedulerEndType=We;schedulerUnits=[{value:De$1.WEEK,label:"Week(s)"},{value:De$1.MONTH,label:"Month(s)"}];endTypes=[{value:We.NEVER,label:"Never"},{value:We.ON_DATE,label:"On date"},{value:We.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ge).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Vl(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Vl(this.endTypeControl.value)));showDayFilter=VC(()=>this.unitSignal()===De$1.WEEK);showEndDate=VC(()=>this.endTypeSignal()===We.ON_DATE);showOccurrenceCount=VC(()=>this.endTypeSignal()===We.OCCURRENCES);agentConfigs=Mi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),Gm({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(Zs(()=>Dr([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===We.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===We.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return l.cancel()}),pC(3),zu()(),Iw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),zu()),e&2&&(IE(),Vh("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),IE(2),Yu(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),IE(),ww(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===We.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===We.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{ye as ScheduledPromptFormComponent};
|