@whoz-oss/coday-client 0.0.0-workstream-forge.266 → 0.0.0-workstream-messaging.9
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-B2OdW-y7.js +1 -0
- package/browser/chunk-B4aagjFN.js +1 -0
- package/browser/chunk-BDBFLLoa.js +2 -0
- package/browser/chunk-BS4UgHRO.js +1 -0
- package/browser/chunk-BZ4F5_xt.js +1 -0
- package/browser/chunk-BZ8SegKy.js +1 -0
- package/browser/chunk-BatABxZT.js +1 -0
- package/browser/chunk-Bb1dx-Ci.js +1 -0
- package/browser/chunk-Bh7y7EIZ.js +1 -0
- package/browser/chunk-BjTEffSr.js +1 -0
- package/browser/{chunk-MzRAkbwR.js → chunk-BnIh2Agv.js} +1 -1
- package/browser/chunk-BsPrQGCO.js +1 -0
- package/browser/chunk-BtzGwr18.js +1 -0
- package/browser/chunk-Bv223hQn.js +1 -0
- package/browser/chunk-BxNPtuPg.js +1 -0
- package/browser/{chunk-BzTXrMsf.js → chunk-C4mkvgOW.js} +1 -1
- package/browser/{chunk-IMqSwtoo.js → chunk-C6aXXb6M.js} +1 -1
- package/browser/chunk-C86Xogns.js +1 -0
- package/browser/chunk-CEHHoMbA.js +2 -0
- package/browser/chunk-CHRZly0o.js +1 -0
- package/browser/chunk-CKcknwaO.js +1 -0
- package/browser/chunk-CZkST2Zn.js +1 -0
- package/browser/{chunk-DA_ON43Y.js → chunk-CdzB1hlk.js} +1 -1
- package/browser/chunk-CkbrWR16.js +1 -0
- package/browser/chunk-Cng5sc1A.js +1 -0
- package/browser/chunk-CpLFr6wl.js +1 -0
- package/browser/chunk-CwbSc94v.js +1 -0
- package/browser/chunk-DCYS0PGC.js +1 -0
- package/browser/chunk-DGU69dIe.js +1 -0
- package/browser/chunk-D_dIjWIZ.js +1 -0
- package/browser/chunk-DcX96pJb.js +1 -0
- package/browser/chunk-Ddc_ENU1.js +1 -0
- package/browser/chunk-DmkvfivC.js +1 -0
- package/browser/{chunk-D15w64SG.js → chunk-DnJZx-N1.js} +1 -1
- package/browser/{chunk-DxjesQXu.js → chunk-Do3ec7CW.js} +1 -1
- package/browser/{chunk-C3fz6Nhs.js → chunk-DoVW4Qid.js} +1 -1
- package/browser/chunk-DvtbHzPu.js +671 -0
- package/browser/chunk-DymDoxBo.js +1 -0
- package/browser/chunk-DzQphzTy.js +1 -0
- package/browser/chunk-KYe8W5ss.js +1 -0
- package/browser/chunk-MdjBSjZT.js +1 -0
- package/browser/chunk-RltTZwlz.js +1 -0
- package/browser/{chunk-CXhczMHJ.js → chunk-_ojJ8Ms-.js} +1 -1
- package/browser/chunk-bst4n40I.js +1 -0
- package/browser/chunk-iZXu2H1x.js +1 -0
- package/browser/chunk-lCKocljz.js +1 -0
- package/browser/chunk-t-Kfnaoc.js +1 -0
- package/browser/chunk-tEeX_Ukz.js +1 -0
- package/browser/chunk-yULRQNfZ.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-OQ262YIZ.js +1254 -0
- package/package.json +1 -1
- package/browser/chunk-5l4dJKzj.js +0 -1
- package/browser/chunk-6G_HDlLt.js +0 -1
- package/browser/chunk-8ZA-dXSc.js +0 -2
- package/browser/chunk-B1-Po7IP.js +0 -1
- package/browser/chunk-B1ETqMnn.js +0 -1
- package/browser/chunk-B6ucC9JA.js +0 -1
- package/browser/chunk-B8yw58sL.js +0 -1
- package/browser/chunk-B9m_Pv-N.js +0 -1
- package/browser/chunk-BAFDJC7n.js +0 -1
- package/browser/chunk-BCtLUKA1.js +0 -1
- package/browser/chunk-BEGiDML0.js +0 -1
- package/browser/chunk-BItNUZzz.js +0 -1
- package/browser/chunk-BMgJXfSE.js +0 -1
- package/browser/chunk-BUdZ5OqC.js +0 -1
- package/browser/chunk-BVY2wOIp.js +0 -1
- package/browser/chunk-BeAWBIRs.js +0 -671
- package/browser/chunk-BeGVJrPy.js +0 -1
- package/browser/chunk-BfJl60vA.js +0 -1
- package/browser/chunk-BkRwWFjx.js +0 -2
- package/browser/chunk-BoLw7dqx.js +0 -1
- package/browser/chunk-C1mIsJc9.js +0 -1
- package/browser/chunk-CfLZEoOb.js +0 -1
- package/browser/chunk-ChYykPZM.js +0 -1
- package/browser/chunk-CkDaEVkZ.js +0 -1
- package/browser/chunk-CmjEguYB.js +0 -1
- package/browser/chunk-Cq9rgtVx.js +0 -1
- package/browser/chunk-CvFTKrrN.js +0 -1
- package/browser/chunk-D8O-XquS.js +0 -1
- package/browser/chunk-D9cyFDnZ.js +0 -1
- package/browser/chunk-DAC1_8mf.js +0 -1
- package/browser/chunk-DSe6H4u5.js +0 -1
- package/browser/chunk-DYGNedc1.js +0 -1
- package/browser/chunk-Db_G9wnV.js +0 -1
- package/browser/chunk-Tz-PZzVS.js +0 -1
- package/browser/chunk-Vn-xaj9q.js +0 -1
- package/browser/chunk-fbDk9ppW.js +0 -1
- package/browser/chunk-jfM6q-6w.js +0 -1
- package/browser/chunk-t3EN_XZw.js +0 -1
- package/browser/main-P6EOYPYG.js +0 -1253
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-BnIh2Agv.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,W,F,v as we,M as Mi,ag as Gm,a6 as Zs,ae as Dr,x as U,E as x,C as w,am as De,ap as _e,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,h as Bh}from'./main-OQ262YIZ.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let e=Lw();IE(),lg(e.deletion.error());}}function Y(n,t){n&1&&(os(0,"p",4),pC(1,"Loading scheduled prompts\u2026"),zu());}function z(n,t){n&1&&(os(0,"p",5),pC(1,"No scheduled prompts available."),zu());}function G(n,t){n&1&&(os(0,"p",4),pC(1,"No scheduled prompts match the current filter."),zu());}function Q(n,t){if(n&1&&(os(0,"span",14),pC(1),zu()),n&2){let e=Lw().$implicit;IE(),lg(e.prompt.description);}}function X(n,t){n&1&&(os(0,"ds-tag",20),pC(1,"Read-only"),zu());}function Z(n,t){if(n&1){let e=Rw();os(0,"button",25),qh("click",function(){Pd(e);let l=Lw(2).$implicit,p=Lw(2);return Ld(p.toggle(l))}),pC(1),zu(),os(2,"button",25),qh("click",function(){Pd(e);let l=Lw(2).$implicit,p=Lw(2);return Ld(p.edit(l))}),pC(3," Edit "),zu();}if(n&2){let e=Lw(2).$implicit;IE(),lg(e.prompt.enabled?"Disable":"Enable"),IE(),Bh("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=Rw();Iw(0,Z,4,2),os(1,"agentos-row-delete-action",24),qh("deleteRequested",function(){Pd(e);let l=Lw().$implicit,p=Lw(2);return Ld(p.deletion.request(l.key))})("deleteConfirmed",function(){Pd(e);let l=Lw().$implicit,p=Lw(2);return Ld(p.confirmDelete(l))})("deleteCancelled",function(){Pd(e);let l=Lw(3);return Ld(l.deletion.cancel())}),zu();}if(n&2){let e=Lw().$implicit,i=Lw(2);ww(i.deletion.confirmingId()!==e.key?0:-1),IE(),Vh("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(os(0,"button",23),pC(1,"Inherited"),zu());}function ne(n,t){if(n&1&&(os(0,"tr",9)(1,"td",12)(2,"span",13),pC(3),zu(),Iw(4,Q,2,1,"span",14),zu(),os(5,"td",15),pC(6),zu(),os(7,"td",16)(8,"ds-tag",17),pC(9),zu()(),os(10,"td",18)(11,"div",19)(12,"ds-tag",17),pC(13),zu(),Iw(14,X,2,0,"ds-tag",20),zu()(),os(15,"td",21)(16,"div",22),Iw(17,ee,2,4)(18,te,2,0,"button",23),zu()()()),n&2){let e=t.$implicit,i=Lw(2);IE(3),lg(e.prompt.name),IE(),ww(e.prompt.description?4:-1),IE(2),lg(i.scheduleLabel(e.prompt)),IE(2),Vh("variant",e.prompt.enabled?"accent":"outline"),IE(),lg(e.prompt.enabled?"Enabled":"Disabled"),IE(3),Vh("variant",e.scope==="platform"?"neutral":"accent"),IE(),lg(e.scope==="platform"?"Platform":"Namespace"),IE(),ww(e.scope==="platform"?14:-1),IE(3),ww(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&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,"Schedule"),zu(),os(8,"th",10),pC(9,"Status"),zu(),os(10,"th",10),pC(11,"Scope"),zu(),os(12,"th",10)(13,"span",11),pC(14,"Actions"),zu()()()(),os(15,"tbody",8),Tw(16,ne,19,9,"tr",9,J),zu()()()),n&2){let e=Lw();IE(16),_w(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Mi([]);isLoading=Mi(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Gm({platform:this.state.listPlatform().pipe(Zs(()=>Dr([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===De.WEEK?"week":"month",l=e.unit===De.WEEK&&e.days?.length?` (${e.days.map(p=>_e[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(p){return i.rowFilter.query.set(p)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),pC(3,"New scheduled prompt"),zu()(),Iw(4,O,2,1,"p",3),Iw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(IE(),Vh("query",i.rowFilter.query()),IE(3),ww(i.deletion.error()?4:-1),IE(),ww(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {O as O$1}from'./chunk-BjTEffSr.js';import {I}from'./chunk-DGU69dIe.js';import {O}from'./chunk-RltTZwlz.js';import {g,v as we,M as Mi,i as VC,ad as F,aw as $m,ah as te,x as U,a as ew,o as os,H as Hh,I as Iw,z as zu,c as IE,w as ww,aF as Qs,E as x,C as w,X as Kb,b as pC,R as Rw,K as qh,L as Lw,J as Vh,G as Gu,d as Wu,T as Tw,_ as _w,N as lI,l as lg,Q as fI,Y as Yu,f as Gh,$ as dg,Z as Zh,P as Pd,n as Ld,ai as Dw,a0 as RC,a1 as FC,O as Op}from'./main-OQ262YIZ.js';import {y,$ as k,a0 as B,a1 as a,p as pt,T as Te,a2 as v,a3 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,a4 as gn,h as hn,i as at$1,u as un,m as mn,a5 as ji,G as Ni,L as M,j as e,a6 as m,a7 as S}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var Ve=(n,t)=>t.id;function Ne(n,t){if(n&1){let e=Rw();Gu(0,"span",10),pC(1,"Unlink?"),Wu(),Gu(2,"button",11),Zh("click",function(){Pd(e);let r=Lw(),c=Lw(3);return Ld(c.unlink(r))}),pC(3," Confirm "),Wu(),Gu(4,"button",12),Zh("click",function(){Pd(e);let r=Lw(4);return Ld(r.pendingUnlinkId.set(null))}),pC(5,"Cancel"),Wu();}}function Fe(n,t){if(n&1){let e=Rw();Gu(0,"button",12),Zh("click",function(){Pd(e);let r=Lw(),c=Lw(3);return Ld(c.pendingUnlinkId.set(r.id))}),pC(1," Unlink "),Wu();}}function Ae(n,t){if(n&1&&(Gu(0,"span",7),pC(1),Gu(2,"span",8),pC(3),RC(4,"date"),Wu()(),Iw(5,Ne,6,0)(6,Fe,2,0,"button",9)),n&2){let e=t,i=Lw(3);IE(),Yu(" ",e.displayName," "),IE(2),Yu("linked ",FC(4,3,e.linkedAt,"mediumDate")),IE(2),ww(i.pendingUnlinkId()===e.id?5:6);}}function Le(n,t){if(n&1){let e=Rw();Gu(0,"span",8),pC(1," Then send it this message: "),Gu(2,"code",14),pC(3),Wu(),Gu(4,"button",12),Zh("click",function(){let r=Pd(e),c=Lw(4);return Ld(c.copy(r))}),pC(5,"Copy"),Wu(),pC(6),RC(7,"date"),Wu();}if(n&2){let e=Lw();IE(3),lg(t),IE(3),Yu(" Valid until ",FC(7,2,e.expiresAt,"shortTime"),". ");}}function Ge(n,t){if(n&1&&(Gu(0,"span",8),pC(1),RC(2,"date"),Wu()),n&2){let e=Lw(),i=Lw().$implicit,r=Lw(2);IE(),dg(" Press Start in ",r.platformName(i.platform),", then come back here. Valid until ",FC(2,2,e.expiresAt,"shortTime"),". ");}}function Re(n,t){if(n&1&&(Gu(0,"a",13),pC(1),Wu(),Iw(2,Le,8,5,"span",8)(3,Ge,3,5,"span",8)),n&2){let e,i=t,r=Lw().$implicit;Gh("href",i.url,Op),IE(),Yu(" Open @",r.username," "),IE(),ww((e=i.code)?2:3,e);}}function $e(n,t){if(n&1){let e=Rw();Gu(0,"span",15),pC(1,"Not connected"),Wu(),Gu(2,"button",16),Zh("click",function(){Pd(e);let r=Lw().$implicit,c=Lw(2);return Ld(c.connect(r))}),pC(3," Connect "),Wu();}}function Be(n,t){if(n&1&&(Gu(0,"div",3)(1,"span",5),pC(2),Gu(3,"a",6),pC(4),Wu()(),Iw(5,Ae,7,6)(6,Re,4,3)(7,$e,4,0),Wu()),n&2){let e,i=t.$implicit,r=Lw(2);IE(2),Yu(" ",i.agentName," "),IE(),Gh("href",i.url,Op),IE(),dg(" @",i.username," on ",r.platformName(i.platform)," "),IE(),ww((e=r.identityOf(i))?5:(e=r.linkOf(i))?6:7,e);}}function Ke(n,t){if(n&1){let e=Rw();Gu(0,"div",3)(1,"span",5),pC(2),Gu(3,"span",8),pC(4),Wu()(),Gu(5,"span",7),pC(6),Wu(),Gu(7,"button",12),Zh("click",function(){let r=Pd(e).$implicit,c=Lw(2);return Ld(c.unlink(r))}),pC(8,"Unlink"),Wu()();}if(n&2){let e=t.$implicit,i=Lw(2);IE(2),Yu(" ",e.agentName??"A removed bot"," "),IE(2),lg(i.platformName(e.platform)),IE(2),lg(e.displayName);}}function ze(n,t){n&1&&(Gu(0,"p",4),pC(1),Wu()),n&2&&(IE(),lg(t));}function je(n,t){if(n&1&&(Gu(0,"div",0)(1,"h2",1),pC(2,"Messaging"),Wu(),Gu(3,"p",2),pC(4," Talk to your agents from a messaging application: each agent with a bot answers there, in your cases. "),Wu(),Tw(5,Be,8,5,"div",3,Ve),Tw(7,Ke,9,3,"div",3,Ve),Iw(9,ze,2,1,"p",4),Wu()),n&2){let e,i=Lw();IE(5),_w(i.bots()),IE(2),_w(i.orphanIdentities()),IE(2),ww((e=i.error())?9:-1,e);}}var R=class n{messagingState=g(M);destroyRef=g(we);bots=this.messagingState.bots;platformName=e;orphanIdentities=VC(()=>this.messagingState.identities().filter(t=>!this.bots().some(e=>e.id===t.botId)));visible=VC(()=>this.bots().length>0||this.messagingState.identities().length>0);links=Mi({});pendingUnlinkId=Mi(null);error=Mi(null);constructor(){this.refresh(),Qs(window,"focus").pipe(U()).subscribe(()=>{Object.keys(this.links()).length>0&&this.refresh();});}identityOf(t){return this.messagingState.identities().find(e=>e.botId===t.id)}linkOf(t){return this.links()[t.id]}connect(t){this.error.set(null),this.messagingState.createLink(t.id).pipe(U(this.destroyRef)).subscribe({next:e=>this.links.update(i=>x(w({},i),{[t.id]:e})),error:e=>{console.error(`[MessagingAccounts] Could not get a link to @${t.username}:`,e),this.error.set(`Could not get a link to @${t.username}. Please try again.`);}});}copy(t){navigator.clipboard?.writeText(t).catch(()=>{});}unlink(t){this.pendingUnlinkId.set(null),this.messagingState.unlink(t.id).pipe(U(this.destroyRef)).subscribe({error:e=>{console.error(`[MessagingAccounts] Unlink failed for ${t.id}:`,e),this.error.set("Could not unlink the account. Please try again.");}});}refresh(){this.messagingState.load().pipe(U(this.destroyRef)).subscribe({next:([,t])=>this.links.update(e=>Object.fromEntries(Object.entries(e).filter(([i])=>!t.some(r=>r.botId===i)))),error:t=>console.error("[MessagingAccounts] Could not load the messaging accounts:",t)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-messaging-accounts"]],decls:1,vars:1,consts:[[1,"messaging-accounts"],[1,"messaging-accounts__title"],[1,"messaging-accounts__hint"],[1,"messaging-accounts__row"],["role","alert",1,"messaging-accounts__error"],[1,"messaging-accounts__platform"],["target","_blank","rel","noopener",1,"messaging-accounts__since",3,"href"],[1,"messaging-accounts__account"],[1,"messaging-accounts__since"],["type","button",1,"messaging-accounts__btn"],[1,"messaging-accounts__confirm"],["type","button",1,"messaging-accounts__btn","messaging-accounts__btn--danger",3,"click"],["type","button",1,"messaging-accounts__btn",3,"click"],["target","_blank","rel","noopener",1,"messaging-accounts__btn","messaging-accounts__btn--primary",3,"href"],[1,"messaging-accounts__code"],[1,"messaging-accounts__account","messaging-accounts__account--none"],["type","button",1,"messaging-accounts__btn","messaging-accounts__btn--primary",3,"click"]],template:function(e,i){e&1&&Iw(0,je,10,1,"div",0),e&2&&ww(i.visible()?0:-1);},dependencies:[Kb],styles:[".messaging-accounts[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.messaging-accounts__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}.messaging-accounts__hint[_ngcontent-%COMP%], .messaging-accounts__since[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-text-secondary)}.messaging-accounts__row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.75rem}.messaging-accounts__platform[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;gap:.125rem;min-width:180px;font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.messaging-accounts__platform[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.messaging-accounts__platform[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.messaging-accounts__account[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;gap:.125rem;flex:1;font-size:.9375rem;color:var(--color-text)}.messaging-accounts__account--none[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.messaging-accounts__confirm[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text-secondary)}.messaging-accounts__btn[_ngcontent-%COMP%]{padding:.4rem .9rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;text-decoration:none;cursor:pointer}.messaging-accounts__btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.messaging-accounts__btn--primary[_ngcontent-%COMP%]{border-color:var(--color-accent);color:var(--color-accent)}.messaging-accounts__btn--danger[_ngcontent-%COMP%]{border-color:var(--color-error, #c62828);color:var(--color-error, #c62828)}.messaging-accounts__error[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-error, #c62828)}.messaging-accounts__code[_ngcontent-%COMP%]{padding:.1rem .4rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);font-family:var(--font-mono, monospace);word-break:break-all}"]})};var He=(n,t)=>t.value,Ye=(n,t)=>t.title;function Je(n,t){n&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function qe(n,t){if(n&1&&(os(0,"option",27),pC(1),zu()),n&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function Qe(n,t){if(n&1){let e=Rw();os(0,"form",15),qh("ngSubmit",function(){Pd(e);let r=Lw(2);return Ld(r.save())}),os(1,"ds-group",16)(2,"dl",17)(3,"dt"),pC(4,"Email"),zu(),os(5,"dd"),pC(6),zu(),os(7,"dt"),pC(8,"External ID"),zu(),os(9,"dd"),pC(10),zu()()(),os(11,"ds-group",18)(12,"ds-form-field",19),Hh(13,"input",20),lI(),zu(),os(14,"ds-form-field",21),Hh(15,"input",22),lI(),zu(),os(16,"ds-form-field",23),Hh(17,"textarea",24),lI(),zu(),os(18,"ds-form-field",25)(19,"select",26),Tw(20,qe,2,2,"option",27,He),zu(),lI(),zu()(),os(22,"ds-form-actions")(23,"button",28),pC(24),zu(),os(25,"button",29),qh("click",function(){Pd(e);let r=Lw(2);return Ld(r.cancelEditing())}),pC(26,"Cancel"),zu()()();}if(n&2){let e=Lw(),i=Lw();Vh("formGroup",i.form),IE(6),lg(e.email),IE(4),lg(e.externalId),IE(3),fI(),IE(2),fI(),IE(2),fI(),IE(2),fI(),IE(),_w(i.languageOptions),IE(3),Vh("disabled",i.isSaving()),IE(),Yu(" ",i.isSaving()?"Saving\u2026":"Save changes"," ");}}function We(n,t){n&1&&(os(0,"p",2),pC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),zu());}function Xe(n,t){if(n&1){let e=Rw();os(0,"span",38),pC(1,"Delete?"),zu(),os(2,"button",39),qh("click",function(){Pd(e);let r=Lw().$implicit,c=Lw(5);return Ld(c.confirmDelete(r))}),pC(3,"Confirm"),zu(),os(4,"button",40),qh("click",function(){Pd(e);let r=Lw(6);return Ld(r.cancelDelete())}),pC(5,"Cancel"),zu();}}function Ze(n,t){if(n&1){let e=Rw();os(0,"button",40),qh("click",function(){Pd(e);let r=Lw().$implicit,c=Lw(5);return Ld(c.armDelete(r))}),pC(1,"Delete"),zu();}}function et(n,t){if(n&1&&(os(0,"li",34)(1,"span",35),pC(2),zu(),os(3,"span",36),pC(4),zu(),Iw(5,Xe,6,0)(6,Ze,2,0,"button",37),zu()),n&2){let e=t.$implicit,i=Lw(5);IE(2),lg(e.name),IE(2),lg(e.subtitle),IE(),ww(i.isPendingDelete(e)?5:6);}}function tt(n,t){if(n&1&&(os(0,"span",32),pC(1),zu(),os(2,"ul",33),Tw(3,et,7,3,"li",34,Dw().trackEntry,true),zu()),n&2){let e=t.$implicit;IE(),lg(e.title),IE(2),_w(e.entries);}}function nt(n,t){if(n&1&&Tw(0,tt,5,1,null,null,Ye),n&2){let e=Lw(3);_w(e.recapSections());}}function it(n,t){if(n&1){let e=Rw();os(0,"ds-group",16)(1,"dl",17)(2,"dt"),pC(3,"Email"),zu(),os(4,"dd"),pC(5),zu(),os(6,"dt"),pC(7,"External ID"),zu(),os(8,"dd"),pC(9),zu()()(),os(10,"ds-group",18)(11,"dl",17)(12,"dt"),pC(13,"First name"),zu(),os(14,"dd"),pC(15),zu(),os(16,"dt"),pC(17,"Last name"),zu(),os(18,"dd"),pC(19),zu(),os(20,"dt"),pC(21,"Bio"),zu(),os(22,"dd"),pC(23),zu(),os(24,"dt"),pC(25,"Language"),zu(),os(26,"dd"),pC(27),zu()()(),os(28,"ds-form-actions")(29,"button",30),qh("click",function(){Pd(e);let r=Lw(2);return Ld(r.startEditing())}),pC(30,"Edit profile"),zu()(),os(31,"ds-disclosure",31),qh("toggled",function(){Pd(e);let r=Lw(2);return Ld(r.toggleOverrides())}),Iw(32,We,2,0,"p",2)(33,nt,2,0),zu();}if(n&2){let e=Lw(),i=Lw();IE(5),lg(e.email),IE(4),lg(e.externalId),IE(6),lg(e.firstname||"\u2014"),IE(4),lg(e.lastname||"\u2014"),IE(4),lg(e.bio||"\u2014"),IE(4),lg(e.preferredLanguage||"\u2014"),IE(4),Vh("heading","My global user configurations ("+i.recap().total+")")("open",i.isOverridesExpanded()),IE(),ww(i.recap().total===0?32:33);}}function ot(n,t){if(n&1){let e=Rw();os(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),qh("valueChange",function(r){Pd(e);let c=Lw();return Ld(c.setThemeVariant(r))}),zu()(),os(3,"ds-form-field",6)(4,"ds-segmented",7),qh("valueChange",function(r){Pd(e);let c=Lw();return Ld(c.setTheme(r))}),zu()()(),os(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),qh("valueChange",function(r){Pd(e);let c=Lw();return Ld(c.setEnterKeyBehavior(r))}),zu()()(),os(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),qh("valueChange",function(r){Pd(e);let c=Lw();return Ld(c.setShowTechnical(r))}),zu()()(),Hh(11,"agentos-messaging-accounts"),Iw(12,Qe,27,5,"form",14)(13,it,34,9);}if(n&2){let e=Lw();IE(),Vh("hint",e.activeVariantDescription()),IE(),Vh("options",e.themeVariantOptions)("value",e.themeVariant()),IE(),Vh("hint",e.modeOverridden()?e.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),IE(),Vh("options",e.modeOptions())("value",e.shownMode()),IE(3),Vh("options",e.enterKeyOptions)("value",e.enterKeyBehavior()),IE(3),Vh("options",e.showTechnicalOptions)("value",e.showTechnical()),IE(2),ww(e.isEditing()?12:13);}}function at(n,t){n&1&&(os(0,"p",2),pC(1,"Unable to load profile."),zu());}var Ie=class n{userState=g(y);destroyRef=g(we);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=Mi(false);isLoading=Mi(false);isSaving=Mi(false);isOverridesExpanded=Mi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=VC(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=VC(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:t,label:e,description:i})=>({value:t,label:e,description:i}));modeOverridden=VC(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=VC(()=>m(this.themeVariant()).label);activeVariantDescription=VC(()=>m(this.themeVariant()).description);modeOptions=VC(()=>this.themeOptions.map(t=>x(w({},t),{disabled:this.isModeDisabled(t.value)})));shownMode=VC(()=>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("",{nonNullable:true}),lastname:new Te("",{nonNullable:true}),bio:new Te("",{nonNullable:true}),preferredLanguage:new Te("",{nonNullable:true})});recap=F($m([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(te(([t,e,i])=>{let r=t.map(h=>({category:"integration",id:h.id??"",name:h.name,subtitle:h.integrationType})),c=e.map(h=>({category:"aiProvider",id:h.id??"",name:h.name,subtitle:h.apiType})),H=i.map(h=>({category:"authSetting",id:h.id??"",name:h.name,subtitle:h.authType}));return {integrations:r,aiProviders:c,authSettings:H,total:r.length+c.length+H.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=VC(()=>{let t=this.recap();return [{title:"Integrations",entries:t.integrations},{title:"AI Providers",entries:t.aiProviders},{title:"My global auth settings",entries:t.authSettings}].filter(e=>e.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(t){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:t});}setThemeVariant(t){v(t)&&this.themePort.setTheme({variant:t,mode:this.themePort.theme().mode});}isModeDisabled(t){return !V(this.themeVariant(),t)}setEnterKeyBehavior(t){this.preferencesPort.setEnterKeyBehavior(t);}setShowTechnical(t){this.preferencesPort.setShowTechnical(t);}save(){if(this.isSaving())return;this.isSaving.set(true);let t=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:t||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(t=>!t),this.pendingDeleteKey.set(null);}pendingDeleteKey=Mi(null);isPendingDelete(t){return this.pendingDeleteKey()===this.entryKey(t)}armDelete(t){t.id&&this.pendingDeleteKey.set(this.entryKey(t));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(t){if(!t.id)return;this.pendingDeleteKey.set(null),(t.category==="integration"?this.integrationState.delete(t.id,"userGlobal"):t.category==="authSetting"?this.authSettingState.delete(t.id,"userGlobal"):this.providerState.delete(t.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:i=>{console.error(`[UserProfile] Delete failed for ${t.category}:${t.id}:`,i);}});}entryKey(t){return `${t.category}:${t.id}`}trackEntry(t,e){return this.entryKey(e)}syncFormFromState(){let t=this.currentUser();t&&this.form.setValue({firstname:t.firstname??"",lastname:t.lastname??"",bio:t.bio??"",preferredLanguage:t.preferredLanguage??""});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ew({type:n,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(e,i){if(e&1&&(os(0,"ds-page",0),Hh(1,"ds-section-header",1),Iw(2,Je,2,0,"p",2)(3,ot,14,11)(4,at,2,0,"p",2),zu()),e&2){let r;IE(2),ww(i.isLoading()?2:(r=i.currentUser())?3:4,r);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,gn,hn,at$1,un,mn,ji,Ni,R],encapsulation:2})};export{Ie as UserProfileComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {x as m,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,W as W$1,F,v as we,a3 as vr,M as Mi,a5 as Ys,ag as Gm,a6 as Zs,ae as Dr,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 U=(n,e)=>e.key;function z(n,e){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let t=Lw();IE(),lg(t.deletion.error());}}function G(n,e){n&1&&(os(0,"p",4),pC(1,"Loading prompts\u2026"),zu());}function O(n,e){n&1&&(os(0,"p",5),pC(1,"No prompts available."),zu());}function Q(n,e){n&1&&(os(0,"p",4),pC(1,"No prompts match the current filter."),zu());}function W(n,e){n&1&&(os(0,"ds-tag",17),pC(1,"Read-only"),zu());}function X(n,e){if(n&1){let t=Rw();os(0,"button",23),qh("click",function(){Pd(t);let l=Lw(2).$implicit,m=Lw(2);return Ld(m.edit(l))}),pC(1," Edit "),zu();}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.prompt.name);}}function Y(n,e){if(n&1){let t=Rw();Iw(0,X,2,1,"button",21),os(1,"agentos-row-delete-action",22),qh("deleteRequested",function(){Pd(t);let l=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(l.key))})("deleteConfirmed",function(){Pd(t);let l=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(l))})("deleteCancelled",function(){Pd(t);let l=Lw(3);return Ld(l.deletion.cancel())}),zu();}if(n&2){let t=Lw().$implicit,i=Lw(2);ww(i.deletion.confirmingId()!==t.key?0:-1),IE(),Vh("rowKey",t.key)("rowLabel",t.prompt.name)("state",i.deletion);}}function Z(n,e){n&1&&(os(0,"button",20),pC(1,"Inherited"),zu());}function ee(n,e){if(n&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)(7,"ds-tag",16),pC(8),zu(),Iw(9,W,2,0,"ds-tag",17),zu()(),os(10,"td",18)(11,"div",19),Iw(12,Y,2,4)(13,Z,2,0,"button",20),zu()()()),n&2){let t=e.$implicit;IE(2),lg(t.prompt.name),IE(2),Yu(" ",t.prompt.description||"\u2014"," "),IE(3),Vh("variant",t.scope==="platform"?"neutral":"accent"),IE(),lg(t.scope==="platform"?"Platform":"Namespace"),IE(),ww(t.scope==="platform"?9:-1),IE(3),ww(t.scope==="namespace"?12:13);}}function te(n,e){if(n&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,"Scope"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,ee,14,6,"tr",9,U),zu()()()),n&2){let t=Lw();IE(14),_w(t.rowFilter.filteredRows());}}var J=class n{route=g(W$1);router=g(F);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();rows=Mi([]);rowFilter=O$1(this.rows,e=>[e.prompt.name,e.prompt.description,e.scope].filter(Boolean).join(" "));allPrompts$=this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),Gm({platform:this.promptState.listPlatform().pipe(Zs(()=>Dr([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.rows.set([...e.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...t.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(e){e.scope==="platform"||!e.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",e.prompt.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.prompt.id||this.deletion.execute(e.key,{request$:this.promptState.delete(e.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.prompt.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-namespace-prompts"]],decls:9,vars:3,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,i){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return i.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),pC(3,"New prompt"),zu()(),Iw(4,z,2,1,"p",3),Iw(5,G,2,0,"p",4)(6,O,2,0,"p",5)(7,Q,2,0,"p",4)(8,te,16,0,"div",6)),t&2&&(IE(),Vh("query",i.rowFilter.query()),IE(3),ww(i.deletion.error()?4:-1),IE(),ww(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{J as NamespacePromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-Do3ec7CW.js';import {p as pt,T as Te,b as bn,K as Kt,a as fd,U as Ut,c as fo,g as go,N as Nn,R as Rn,v as vn,d as yn,e as fn,h as hn,_ as _n,i as at,u as un,A as Ao}from'./chunk-DvtbHzPu.js';import {g,W,F,v as we,M as Mi,x as U,E as x,C as w,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,L as Lw,R as Rw,H as Hh,N as lI,T as Tw,aq as Cw,Q as fI,_ as _w,Y as Yu,P as Pd,n as Ld,l as lg}from'./main-OQ262YIZ.js';function ie(i,t){if(i&1&&(os(0,"a",2),pC(1,"View skill \u2192"),zu()),i&2){let e=Lw();Vh("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(os(0,"ds-tag",3),pC(1,"Platform level"),zu());}function ne(i,t){i&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function re(i,t){if(i&1){let e=Rw();os(0,"div",15)(1,"div",19),Hh(2,"input",20),lI(),os(3,"button",21),qh("click",function(){let l=Pd(e).$implicit,te=Lw(2);return Ld(te.removeResource(l))}),pC(4," \xD7 "),zu()(),Hh(5,"textarea",22),lI(),zu();}if(i&2){let e=t.$implicit;IE(2),Vh("formControl",e.path),fI(),IE(3),Vh("formControl",e.content),fI();}}function ae(i,t){if(i&1&&(os(0,"ds-notice"),pC(1),zu()),i&2){let e=Lw(2);IE(),lg(e.errorMessage());}}function se(i,t){if(i&1){let e=Rw();os(0,"form",6),qh("ngSubmit",function(){Pd(e);let l=Lw();return Ld(l.submit())}),os(1,"ds-form-field",7),Hh(2,"input",8),lI(),zu(),os(3,"ds-form-field",9),Hh(4,"textarea",10),lI(),zu(),os(5,"ds-form-field",11),Hh(6,"textarea",12),lI(),zu(),os(7,"ds-form-field",13)(8,"div",14),Tw(9,re,6,2,"div",15,Cw),os(11,"div")(12,"button",16),qh("click",function(){Pd(e);let l=Lw();return Ld(l.addResource())}),pC(13,"+ Add resource"),zu()()()(),Iw(14,ae,2,1,"ds-notice"),os(15,"ds-form-actions")(16,"button",17),pC(17),zu(),os(18,"button",18),qh("click",function(){Pd(e);let l=Lw();return Ld(l.cancel())}),pC(19,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(),Vh("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),IE(),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.bodyControl),fI(),IE(3),_w(e.resourceRows()),IE(5),ww(e.errorMessage()?14:-1),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save changes":"Create"," ");}}var ee=class i{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Mi(false);isLoading=Mi(false);isSubmitting=Mi(false);errorMessage=Mi(null);existingSkill=null;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(100),bn.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new Te("",{nonNullable:true,validators:[bn.required,bn.maxLength(500),bn.pattern(/\S/)]}),body:new Te("",{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})});resourceRows=Mi([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let t=this.route.snapshot.paramMap.get("skillId");t&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([o,l])=>({path:new Te(o,{nonNullable:true}),content:new Te(l,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(t=>[...t,{path:new Te("",{nonNullable:true}),content:new Te("",{nonNullable:true})}]);}removeResource(t){this.resourceRows.update(e=>e.filter(o=>o!==t));}buildResourcesPayload(){let t=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",t):this.skillState.create(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:o=>{this.isSubmitting.set(false),o.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):o.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let t=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",t,"inspect"]:["/agentos",this.namespaceId,"skills",t,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-skill-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","skill-name","hint","The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max.",3,"error"],["dsControl","","id","skill-name","type","text","autocomplete","off",3,"formControl"],["label","Description","controlId","skill-description","hint","This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max."],["dsControl","","id","skill-description","rows","2",3,"formControl"],["label","Body","controlId","skill-body","hint","Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill."],["dsControl","","mono","","id","skill-body","rows","16",3,"formControl"],["label","Resources","hint","Optional files the agent can read with readSkillResource, by relative path."],[1,"ds-stack"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],[1,"ds-inline"],["dsControl","","mono","","type","text","placeholder","e.g. references/checklist.md","aria-label","Resource path","autocomplete","off",3,"formControl"],["dsButton","","variant","icon-danger","type","button","title","Remove","aria-label","Remove resource",3,"click"],["dsControl","","mono","","rows","4","aria-label","Resource content",3,"formControl"]],template:function(e,o){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return o.cancel()}),pC(3,"\u2190 Skills"),zu(),Iw(4,ie,2,1,"a",2),Iw(5,oe,2,0,"ds-tag",3),zu(),Iw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),zu()),e&2&&(IE(),Vh("title",o.isEditMode()?"Edit skill":"New skill"),IE(3),ww(o.isEditMode()?4:-1),IE(),ww(o.isPlatformMode?5:-1),IE(),ww(o.isLoading()?6:7));},dependencies:[Kt,fd,Ut,fo,go,Nn,Rn,$t,vn,yn,fn,hn,_n,at,un,Ao],encapsulation:2})};export{ee as SkillFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {y,p as pt,T as Te,b as bn,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,h as hn,l as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-DvtbHzPu.js';import {g,v as we,W,u as L,M as Mi,x as U,a as ew,o as os,H as Hh,K as qh,I as Iw,z as zu,N as lI,b as pC,c as IE,J as Vh,w as ww,Q as fI,Y as Yu,a8 as Re,a9 as Hl,aa as k,L as Lw,R as Rw,l as lg,ab as Sn,P as Pd,n as Ld,T as Tw,_ as _w}from'./main-OQ262YIZ.js';var I=class e{api=g(Re);isLoading=Mi(false);result=Mi(null);errorMessage=Mi(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(Hl({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Sn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var de=(e,t)=>t.id;function me(e,t){e&1&&(os(0,"p",14),pC(1,"Loading namespaces\u2026"),zu());}function pe(e,t){if(e&1&&(os(0,"option",17),pC(1),zu()),e&2){let n=t.$implicit;Vh("value",n.id),IE(),lg(n.name);}}function ce(e,t){if(e&1&&(os(0,"select",15)(1,"option",16),pC(2,"Select a namespace"),zu(),Tw(3,pe,2,2,"option",17,de),zu(),lI()),e&2){let n=Lw(2);fI(),IE(3),_w(n.namespaces());}}function ue(e,t){if(e&1&&Iw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=Lw();ww(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&Hh(0,"input",3),e&2){let n=Lw();Vh("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=Rw();os(0,"button",18),qh("click",function(){Pd(n);let l=Lw();return Ld(l.reset())}),pC(1,"Clear result"),zu();}}function ve(e,t){e&1&&(os(0,"ds-card",12)(1,"pre",19),pC(2),zu()()),e&2&&(IE(2),lg(t));}function ye(e,t){e&1&&(os(0,"span",21),pC(1,"Metadata"),zu(),os(2,"pre",19),pC(3),zu()),e&2&&(IE(3),lg(t));}function Ce(e,t){if(e&1&&(os(0,"dt"),pC(1,"Type"),zu(),os(2,"dd",23),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.errorType);}}function _e(e,t){if(e&1&&(os(0,"dt"),pC(1,"Message"),zu(),os(2,"dd"),pC(3),zu()),e&2){let n=Lw(2);IE(3),lg(n.errorMessage);}}function be(e,t){if(e&1&&(os(0,"span",21),pC(1,"Tool error details"),zu(),os(2,"dl",22),Iw(3,Ce,4,1),Iw(4,_e,4,1),zu()),e&2){let n=Lw();IE(3),ww(n.errorType?3:-1),IE(),ww(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(os(0,"ds-card",13)(1,"div")(2,"ds-tag",20),pC(3),zu()(),os(4,"span",21),pC(5,"Output"),zu(),os(6,"pre",19),pC(7),zu(),Iw(8,ye,4,1),os(9,"span",21),pC(10,"Structured output"),zu(),os(11,"pre",19),pC(12),zu(),Iw(13,be,5,2),zu()),e&2){let n,o=t,l=Lw();Vh("heading","Result \u2014 "+o.toolName),IE(2),Vh("variant",o.success?"accent":"outline"),IE(),lg(o.success?"Success":"Tool error"),IE(4),lg(o.output),IE(),ww((n=l.formatMetadata(o.metadata))?8:-1,n),IE(4),lg(l.formatStructuredOutput(o.structuredOutput)??"null"),IE(),ww(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(we);route=g(W);namespaceController=g(L);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Mi([]);namespacesLoading=Mi(true);namespaceName=Mi(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[bn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[bn.required]}),payload:new Te("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ew({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(os(0,"ds-page"),Hh(1,"ds-section-header",0),os(2,"form",1),qh("ngSubmit",function(){return o.submit()}),os(3,"ds-form-field",2),Iw(4,ue,2,1)(5,fe,1,1,"input",3),zu(),os(6,"ds-form-field",4),Hh(7,"input",5),lI(),zu(),os(8,"ds-form-field",6),Hh(9,"input",7),lI(),zu(),os(10,"ds-form-field",8),Hh(11,"textarea",9),lI(),zu(),os(12,"ds-form-actions")(13,"button",10),pC(14),zu(),Iw(15,ge,2,0,"button",11),zu()(),Iw(16,ve,3,1,"ds-card",12),Iw(17,he,14,7,"ds-card",13),zu()),n&2){let l,v;IE(),Vh("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),IE(),Vh("formGroup",o.form),IE(2),ww(o.isPlatformMode?4:5),IE(3),fI(),IE(2),fI(),IE(2),fI(),IE(2),Vh("disabled",o.form.invalid||o.state.isLoading()),IE(),Yu(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),IE(),ww(o.state.result()||o.state.errorMessage()?15:-1),IE(),ww((l=o.state.errorMessage())?16:-1,l),IE(),ww((v=o.state.result())?17:-1,v);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,hn,dn,at,un,mn,Ao],encapsulation:2})};export{re as ToolInvokeComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {v}from'./chunk-t-Kfnaoc.js';import {I}from'./chunk-DGU69dIe.js';import {g,W,F,v as we,M as Mi,x as U,ah as te$1,a5 as Ys,ae as Dr,aS as qo,a6 as Zs,ag as Gm,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,q as nC,h as Bh,Y as Yu,T as Tw,_ as _w,R as Rw,P as Pd,n as Ld}from'./main-OQ262YIZ.js';import {r as k,O,a8 as w,i as at,d as yn,V as Vo,A as Ao,k as P,w as P$1}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var Q=(i,t)=>t.key;function X(i,t){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let e=Lw();IE(),lg(e.deletion.error());}}function Z(i,t){if(i&1&&(os(0,"p"),pC(1),zu()),i&2){let e=t;nC(e.kind==="error"?"settings-table__error":"settings-table__status"),Bh("role",e.kind==="error"?"alert":"status"),IE(),Yu(" ",e.text," ");}}function ee(i,t){i&1&&(os(0,"p",5),pC(1,"Loading auth settings\u2026"),zu());}function te(i,t){i&1&&(os(0,"p",6),pC(1,"No auth settings available."),zu());}function ne(i,t){i&1&&(os(0,"p",5),pC(1,"No auth settings match the current filter."),zu());}function ie(i,t){i&1&&(os(0,"ds-tag",18),pC(1,"Read-only"),zu());}function oe(i,t){i&1&&(os(0,"ds-tag",20),pC(1,"Connected"),zu());}function ae(i,t){i&1&&(os(0,"ds-tag",18),pC(1,"Not connected"),zu());}function se(i,t){i&1&&(os(0,"span",21),pC(1,"\u2014"),zu());}function re(i,t){if(i&1){let e=Rw();os(0,"span",26),pC(1,"Waiting for authorization\u2026"),zu(),os(2,"button",27),qh("click",function(){Pd(e);let r=Lw(4);return Ld(r.cancelConnect())}),pC(3," Cancel "),zu();}if(i&2){let e=Lw(2).$implicit;IE(2),Bh("aria-label","Stop waiting for the authorization of "+e.config.name);}}function le(i,t){if(i&1){let e=Rw();os(0,"span",28),pC(1,"Disconnect?"),zu(),os(2,"button",29),qh("click",function(){Pd(e);let r=Lw(2).$implicit,d=Lw(2);return Ld(d.confirmReset(r))}),pC(3),zu(),os(4,"button",29),qh("click",function(){Pd(e);let r=Lw(4);return Ld(r.cancelReset())}),pC(5," Cancel "),zu();}if(i&2){let e=Lw(2).$implicit,n=Lw(2);IE(2),Vh("disabled",n.resettingKey()===e.key),Bh("aria-label","Confirm disconnecting "+e.config.name),IE(),Yu(" ",n.resettingKey()===e.key?"Disconnecting\u2026":"Confirm"," "),IE(),Vh("disabled",n.resettingKey()===e.key),Bh("aria-label","Cancel disconnecting "+e.config.name);}}function ce(i,t){if(i&1){let e=Rw();os(0,"button",29),qh("click",function(){Pd(e);let r=Lw(3).$implicit,d=Lw(2);return Ld(d.requestReset(r))}),pC(1," Disconnect "),zu();}if(i&2){let e=Lw(3).$implicit,n=Lw(2);Vh("disabled",n.connectingKey()!==null),Bh("aria-label","Disconnect "+e.config.name);}}function de(i,t){if(i&1){let e=Rw();os(0,"button",29),qh("click",function(){Pd(e);let r=Lw(2).$implicit,d=Lw(2);return Ld(d.connect(r))}),pC(1),zu(),Iw(2,ce,2,2,"button",30);}if(i&2){let e=Lw(2).$implicit,n=Lw(2);Vh("disabled",n.connectingKey()!==null||n.resettingKey()!==null),Bh("aria-label",(n.connectionOf(e)==="connected"?"Reconnect ":"Connect ")+e.config.name),IE(),Yu(" ",n.connectionOf(e)==="connected"?"Reconnect":"Connect"," "),IE(),ww(n.connectionOf(e)==="connected"?2:-1);}}function pe(i,t){if(i&1&&Iw(0,re,4,1)(1,le,6,5)(2,de,3,4),i&2){let e=Lw().$implicit,n=Lw(2);ww(n.connectingKey()===e.key?0:n.resetConfirmingKey()===e.key?1:n.deletion.confirmingId()!==e.key?2:-1);}}function ue(i,t){if(i&1){let e=Rw();os(0,"button",27),qh("click",function(){Pd(e);let r=Lw().$implicit,d=Lw(2);return Ld(d.duplicate(r))}),pC(1," Duplicate "),zu();}if(i&2){let e=Lw().$implicit;Bh("aria-label","Duplicate "+e.config.name);}}function _e(i,t){if(i&1){let e=Rw();os(0,"button",27),qh("click",function(){Pd(e);let r=Lw(2).$implicit,d=Lw(2);return Ld(d.edit(r))}),pC(1," Edit "),zu();}if(i&2){let e=Lw(2).$implicit;Bh("aria-label","Edit "+e.config.name);}}function me(i,t){if(i&1){let e=Rw();Iw(0,_e,2,1,"button",24),os(1,"agentos-row-delete-action",31),qh("deleteRequested",function(){Pd(e);let r=Lw().$implicit,d=Lw(2);return Ld(d.deletion.request(r.key))})("deleteConfirmed",function(){Pd(e);let r=Lw().$implicit,d=Lw(2);return Ld(d.confirmDelete(r))})("deleteCancelled",function(){Pd(e);let r=Lw(3);return Ld(r.deletion.cancel())}),zu();}if(i&2){let e=Lw().$implicit,n=Lw(2);ww(n.deletion.confirmingId()!==e.key?0:-1),IE(),Vh("rowKey",e.key)("rowLabel",e.config.name)("state",n.deletion);}}function ge(i,t){i&1&&(os(0,"button",25),pC(1,"Inherited"),zu());}function he(i,t){if(i&1&&(os(0,"tr",10)(1,"td",13),pC(2),zu(),os(3,"td",14),pC(4),zu(),os(5,"td",15)(6,"div",16)(7,"ds-tag",17),pC(8),zu(),Iw(9,ie,2,0,"ds-tag",18),zu()(),os(10,"td",19),Iw(11,oe,2,0,"ds-tag",20)(12,ae,2,0,"ds-tag",18)(13,se,2,0,"span",21),zu(),os(14,"td",22)(15,"div",23),Iw(16,pe,3,1),Iw(17,ue,2,1,"button",24),Iw(18,me,2,4)(19,ge,2,0,"button",25),zu()()()),i&2){let e=t.$implicit,n=Lw(2);IE(2),lg(e.config.name),IE(2),Yu(" ",e.config.authType," "),IE(3),Vh("variant",e.scopeLabel==="Platform"?"neutral":e.scopeLabel==="Personal"?"outline":"accent"),IE(),lg(e.scopeLabel),IE(),ww(e.canMutate?-1:9),IE(2),ww(n.isOAuth(e)&&n.connectionOf(e)==="connected"?11:n.isOAuth(e)&&n.connectionOf(e)==="disconnected"?12:13),IE(5),ww(n.isOAuth(e)?16:-1),IE(),ww(n.deletion.confirmingId()!==e.key&&n.resetConfirmingKey()!==e.key&&n.connectingKey()!==e.key?17:-1),IE(),ww(e.canMutate?18:19);}}function Ce(i,t){if(i&1&&(os(0,"div",7)(1,"table",8)(2,"thead",9)(3,"tr",10)(4,"th",11),pC(5,"Name"),zu(),os(6,"th",11),pC(7,"Authentication type"),zu(),os(8,"th",11),pC(9,"Scope"),zu(),os(10,"th",11),pC(11,"Connection"),zu(),os(12,"th",11)(13,"span",12),pC(14,"Actions"),zu()()()(),os(15,"tbody",9),Tw(16,he,20,9,"tr",10,Q),zu()()()),i&2){let e=Lw();IE(16),_w(e.rowFilter.filteredRows());}}var fe=new Set(["OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"]),J=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Mi(false);isLoading=Mi(true);rows=Mi([]);deletion=k();connections=Mi({});connectingKey=Mi(null);resetConfirmingKey=Mi(null);resettingKey=Mi(null);actionMessage=Mi(null);connectAttempt=null;connectPopup=null;connectionsLoad=null;rowFilter=O(this.rows,t=>[t.config.name,t.config.authType,t.scopeLabel].join(" "));ngOnInit(){this.route.paramMap.pipe(U(this.destroyRef)).subscribe(t=>{let e=t.get("namespaceId")??"";e&&e!==this.namespaceId&&(this.namespaceId=e),this.state.setNamespace(e);}),this.route.paramMap.pipe(te$1(t=>t.get("namespaceId")??""),Ys(t=>t?this.namespaceRole.isAdminOfNamespace$(t):Dr(false)),U(this.destroyRef)).subscribe(t=>this.isAdmin.set(t)),this.state.vm$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.rows.set(this.toRows(t)),this.isLoading.set(false),this.loadConnections();},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(t){!t.canMutate||!t.config.id||this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t.config.id,"edit"],{queryParams:{scope:t.scope}});}confirmDelete(t){!t.canMutate||!t.config.id||this.deletion.execute(t.key,{request$:this.state.delete(t.config.id,t.scope).pipe(U(this.destroyRef)),errorMessage:`Deleting "${t.config.name}" failed. Try again.`});}isOAuth(t){return fe.has(t.config.authType)}connectionOf(t){return this.connections()[t.key]??"unknown"}connect(t){let e=t.config.id;if(!e||this.connectingKey()||this.resettingKey())return;let n=w();if(!n){this.actionMessage.set({kind:"error",text:"The browser blocked the authorization window. Allow pop-ups for this site and try again."});return}this.actionMessage.set(null),this.resetConfirmingKey.set(null),this.connectPopup=n,this.connectingKey.set(t.key),this.connectAttempt=this.state.connect(e,this.namespaceParam(),r=>n.location.href=r,()=>n.closed).pipe(qo(()=>{this.connectingKey.set(null),this.connectAttempt=null,this.connectPopup=null;}),U(this.destroyRef)).subscribe({next:r=>this.onConnectOutcome(t,r,n),error:()=>{n.close(),this.actionMessage.set({kind:"error",text:`Connecting "${t.config.name}" failed. Check that its OAuth settings are complete, then try again.`});}});}cancelConnect(){this.connectAttempt?.unsubscribe(),this.connectPopup?.close();}requestReset(t){this.resettingKey()||this.connectingKey()||(this.actionMessage.set(null),this.resetConfirmingKey.set(t.key));}cancelReset(){this.resettingKey()||this.resetConfirmingKey.set(null);}confirmReset(t){let e=t.config.id;!e||this.resettingKey()||this.resetConfirmingKey()!==t.key||(this.resettingKey.set(t.key),this.state.resetCredential(e,this.namespaceParam()).pipe(U(this.destroyRef)).subscribe({next:()=>{this.resettingKey.set(null),this.resetConfirmingKey.set(null),this.loadConnections();},error:()=>{this.resettingKey.set(null),this.actionMessage.set({kind:"error",text:`Disconnecting "${t.config.name}" failed. Try again.`});}}));}duplicate(t){if(!t.config.id)return;let e=t.scope==="platform"||t.scope==="namespace"&&!this.isAdmin()?"userOnNs":t.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:e,template:t.config.id,templateScope:t.scope}});}onConnectOutcome(t,e,n){n.close(),this.loadConnections(),e==="abandoned"?this.actionMessage.set({kind:"info",text:`The authorization window was closed before "${t.config.name}" got connected.`}):e==="timeout"&&this.actionMessage.set({kind:"info",text:`No authorization was received for "${t.config.name}" in time. Try again.`});}namespaceParam(){return this.namespaceId||void 0}loadConnections(){this.connectionsLoad?.unsubscribe();let t=this.rows().filter(e=>this.isOAuth(e)&&e.config.id).map(e=>this.state.getConnection(e.config.id,this.namespaceParam()).pipe(te$1(n=>[e.key,n.connected?"connected":"disconnected"]),Zs(()=>Dr([e.key,"unknown"]))));if(t.length===0){this.connections.set({});return}this.connectionsLoad=Gm(t).pipe(U(this.destroyRef)).subscribe(e=>this.connections.set(Object.fromEntries(e)));}toRows(t){return [...this.mapScope(t.platform,"platform","Platform",false),...this.mapScope(t.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(t.userOnNs,"userOnNs","Personal",true),...this.mapScope(t.userGlobal,"userGlobal","Personal",true)]}mapScope(t,e,n,r){return t.map((d,Y)=>({key:`${e}:${d.id??Y}`,config:d,scope:e,scopeLabel:n,canMutate:r}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-auth-settings-all-scopes"]],decls:10,vars:4,consts:[["title","Auth settings","description","Authentication settings available in this namespace, including inherited platform and personal entries."],["label","Filter auth settings","placeholder","Filter auth settings\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],[3,"class"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Auth settings"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Authentication type",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Connection"],["variant","accent"],[1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["type","button","disabled",""],["role","status",1,"settings-table__confirm-label"],["type","button",3,"click"],[1,"settings-table__confirm-label"],["type","button",3,"click","disabled"],["type","button",3,"disabled"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(e,n){if(e&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(d){return n.rowFilter.query.set(d)}),zu(),os(2,"button",2),qh("click",function(){return n.openCreateForm()}),pC(3,"New auth setting"),zu()(),Iw(4,X,2,1,"p",3),Iw(5,Z,2,4,"p",4),Iw(6,ee,2,0,"p",5)(7,te,2,0,"p",6)(8,ne,2,0,"p",5)(9,Ce,18,0,"div",7)),e&2){let r;IE(),Vh("query",n.rowFilter.query()),IE(3),ww(n.deletion.error()?4:-1),IE(),ww((r=n.actionMessage())?5:-1,r),IE(),ww(n.isLoading()?6:n.rows().length===0?7:n.rowFilter.filteredRows().length===0?8:9);}},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{J as AuthSettingsAllScopesComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {g as g$1}from'./chunk-Bv223hQn.js';import {v}from'./chunk-t-Kfnaoc.js';import {L as M,X as a,j as e}from'./chunk-DvtbHzPu.js';import {g,v as we,aD as aB,aE as ze,M as Mi,aF as Qs,x as U,aG as oy,E as x,C as w,a as ew,X as Kb,G as Gu,b as pC,d as Wu,T as Tw,as as bw,I as Iw,c as IE,_ as _w,w as ww,L as Lw,l as lg,Y as Yu,a0 as RC,f as Gh,a1 as FC,R as Rw,Z as Zh,P as Pd,n as Ld,O as Op,q as nC,U as Uh}from'./main-OQ262YIZ.js';function J(i,t){i&1&&(Gu(0,"span",6),pC(1,"created by AgentOS"),Wu());}function H(i,t){if(i&1){let e=Rw();Gu(0,"span",6),pC(1,"Remove the bot and its users' links?"),Wu(),Gu(2,"button",14),Zh("click",function(){Pd(e);let o=Lw(2),d=Lw(2);return Ld(d.remove(o))}),pC(3," Remove "),Wu(),Gu(4,"button",15),Zh("click",function(){Pd(e);let o=Lw(4);return Ld(o.confirmingRemoveId.set(null))}),pC(5,"Cancel"),Wu();}if(i&2){let e=Lw(4);IE(2),Gh("disabled",e.busy());}}function Y(i,t){if(i&1){let e=Rw();Gu(0,"button",15),Zh("click",function(){Pd(e);let o=Lw(2),d=Lw(2);return Ld(d.confirmingRemoveId.set(o.id))}),pC(1," Remove "),Wu();}}function Q(i,t){if(i&1){let e=Rw();Uh(0,"span",11),Gu(1,"button",12),Zh("click",function(){Pd(e);let o=Lw(),d=Lw(2);return Ld(d.toggle(o))}),pC(2),Wu(),Iw(3,H,6,1)(4,Y,2,0,"button",13);}if(i&2){let e=Lw(),n=Lw(2);IE(),Gh("disabled",n.busy()),IE(),Yu(" ",e.enabled?"Turn off":"Turn on"," "),IE(),ww(n.confirmingRemoveId()===e.id?3:4);}}function W(i,t){if(i&1&&(Gu(0,"p",10),pC(1),Wu()),i&2){let e=Lw(2).$implicit,n=Lw();IE(),Yu(" ",n.platformName(e)," refuses this bot's token: it was revoked or replaced. Remove the bot and give the agent a new one. ");}}function X(i,t){i&1&&(Gu(0,"p",10),pC(1," Another program receives this bot's messages, such as another AgentOS instance: give each instance its own bot. "),Wu());}function Z(i,t){if(i&1&&(Gu(0,"p",2),pC(1),Wu()),i&2){let e=Lw(2).$implicit,n=Lw();IE(),Yu("Your ",n.platformName(e)," account is connected to this bot.");}}function ee(i,t){if(i&1){let e=Rw();Gu(0,"span",6),pC(1,"then send it this message:"),Wu(),Gu(2,"code",17),pC(3),Wu(),Gu(4,"button",15),Zh("click",function(){let o=Pd(e),d=Lw(4);return Ld(d.copy(o))}),pC(5,"Copy"),Wu();}i&2&&(IE(3),lg(t));}function te(i,t){i&1&&(Gu(0,"span",6),pC(1,"Press Start, then come back here."),Wu());}function ne(i,t){if(i&1&&(Gu(0,"div",7)(1,"a",16),pC(2),Wu(),Iw(3,ee,6,1)(4,te,2,0,"span",6),Gu(5,"span",6),pC(6),RC(7,"date"),Wu()()),i&2){let e,n=t,o=Lw();IE(),Gh("href",n.url,Op),IE(),Yu(" Open @",o.username," "),IE(),ww((e=n.code)?3:4,e),IE(3),Yu("Valid until ",FC(7,4,n.expiresAt,"shortTime"),".");}}function ie(i,t){if(i&1){let e=Rw();Gu(0,"div",7)(1,"button",12),Zh("click",function(){Pd(e);let o=Lw(),d=Lw(2);return Ld(d.connect(o))}),pC(2," Connect my account "),Wu()();}if(i&2){let e=Lw(3);IE(),Gh("disabled",e.busy());}}function oe(i,t){if(i&1&&(Gu(0,"div",7)(1,"a",8),pC(2),Wu(),Gu(3,"span",9),pC(4),Wu(),Iw(5,J,2,0,"span",6),Iw(6,Q,5,3),Wu(),Iw(7,W,2,1,"p",10)(8,X,2,0,"p",10),Iw(9,Z,2,1,"p",2)(10,ne,8,7,"div",7)(11,ie,3,1,"div",7)),i&2){let e,n=t,o=Lw(2);IE(),Gh("href",n.url,Op),IE(),Yu("@",n.username),IE(),nC("agent-messaging__status--"+o.statusTone(n.status)),IE(),Yu(" ",o.statusLabel(n.status)," "),IE(),ww(n.managed?5:-1),IE(),ww(o.canAdminister()?6:-1),IE(),ww(n.status==="TOKEN_REJECTED"?7:n.status==="CONFLICT"?8:-1),IE(2),ww(n.linked?9:(e=o.connectLinkOf(n))?10:n.enabled?11:-1,e);}}function ae(i,t){if(i&1&&(Gu(0,"div",7)(1,"a",16),pC(2," Open Telegram "),Wu(),Gu(3,"span",6),pC(4),RC(5,"date"),Wu()()),i&2){let e=t;IE(),Gh("href",e.url,Op),IE(3),Yu(" Press Start, then Create, and confirm the bot's name: this page shows the bot as soon as it exists. Valid until ",FC(5,2,e.expiresAt,"shortTime"),". ");}}function re(i,t){if(i&1){let e=Rw();Gu(0,"button",20),Zh("click",function(){Pd(e);let o=Lw(3).$implicit,d=Lw();return Ld(d.createBot(o))}),pC(1),Wu();}if(i&2){let e=Lw(3).$implicit,n=Lw();Gh("disabled",n.busy()),IE(),Yu(" Create a ",n.platformName(e)," bot ");}}function se(i,t){i&1&&(Gu(0,"p",6),pC(1," Creating a bot without copying a token needs the instance's bot manager: a super-admin sets it in Settings, Messaging. "),Wu());}function le(i,t){if(i&1){let e=Rw();Gu(0,"div",7),Iw(1,re,2,2,"button",19),Gu(2,"button",15),Zh("click",function(){Pd(e);let o=Lw(2).$implicit,d=Lw();return Ld(d.openForm(o))}),pC(3),Wu()(),Iw(4,se,2,0,"p",6);}if(i&2){let e=Lw(2).$implicit,n=Lw();IE(),ww(n.canCreate(e)?1:-1),IE(2),Yu(" ",e===n.Platform.SLACK?"Connect a Slack app":"Use an existing bot"," "),IE(),ww(e===n.Platform.TELEGRAM&&!n.canCreate(e)?4:-1);}}function me(i,t){if(i&1){let e=Rw();Gu(0,"a",27),pC(1,"open Slack's apps"),Wu(),pC(2,", choose From a manifest, pick the workspace and paste it. "),Gu(3,"pre",28),pC(4),Wu(),Gu(5,"button",15),Zh("click",function(){let o=Pd(e),d=Lw(5);return Ld(d.copy(o.manifest))}),pC(6),Wu();}if(i&2){let e=t,n=Lw(5);Gh("href",e.createUrl,Op),IE(4),lg(e.manifest),IE(2),Yu(" ",n.copied()?"Copied":"Copy the manifest"," ");}}function de(i,t){if(i&1&&(Gu(0,"ol",22)(1,"li"),pC(2," Create a Slack app from this manifest: "),Iw(3,me,7,3),Wu(),Gu(4,"li"),pC(5,"Install the app in the workspace, then copy its Bot User OAuth Token (OAuth & Permissions)."),Wu(),Gu(6,"li"),pC(7," In Basic Information, App-Level Tokens, generate a token with the connections:write scope, and copy it. "),Wu()()),i&2){let e,n=Lw(4);IE(3),ww((e=n.manifest())?3:-1,e);}}function ge(i,t){if(i&1){let e=Rw();Gu(0,"label",29),pC(1,"App-level token"),Wu(),Gu(2,"input",30),Zh("input",function(o){Pd(e);let d=Lw(4);return Ld(d.appToken.set(o.target.value))}),Wu();}if(i&2){let e=Lw(4);IE(2),Gh("value",e.appToken());}}function ce(i,t){i&1&&pC(0," Create a bot with @BotFather in Telegram (/newbot) and paste its token. ");}function _e(i,t){if(i&1){let e=Rw();Gu(0,"form",21),Zh("submit",function(o){Pd(e);let d=Lw(2).$implicit,M=Lw();return o.preventDefault(),Ld(M.attach(d))}),Iw(1,de,8,1,"ol",22),Gu(2,"div",23)(3,"label",24),pC(4),Wu(),Gu(5,"input",25),Zh("input",function(o){Pd(e);let d=Lw(3);return Ld(d.token.set(o.target.value))}),Wu(),Iw(6,ge,3,1),Gu(7,"button",26),pC(8," Attach "),Wu()(),Gu(9,"p",6),Iw(10,ce,1,0),pC(11," The tokens are stored encrypted and never shown again. "),Wu()();}if(i&2){let e=Lw(2).$implicit,n=Lw();IE(),ww(e===n.Platform.SLACK?1:-1),IE(2),Gh("htmlFor","agent-messaging-token-"+e),IE(),Yu(" ",e===n.Platform.SLACK?"Bot User OAuth Token":"Bot token"," "),IE(),Gh("id","agent-messaging-token-"+e)("placeholder",e===n.Platform.SLACK?"xoxb-\u2026":"123456789:AA\u2026")("value",n.token()),IE(),ww(e===n.Platform.SLACK?6:-1),IE(),Gh("disabled",n.busy()||!n.token().trim()||e===n.Platform.SLACK&&!n.appToken().trim()),IE(3),ww(e===n.Platform.TELEGRAM?10:-1);}}function pe(i,t){if(i&1&&(Iw(0,ae,6,5,"div",7)(1,le,5,3),Iw(2,_e,12,9,"form",18)),i&2){let e,n=Lw().$implicit,o=Lw();ww((e=n===o.Platform.TELEGRAM&&o.creationLink())?0:1,e),IE(2),ww(o.formPlatform()===n?2:-1);}}function ue(i,t){if(i&1&&(Gu(0,"p",6),pC(1),Wu()),i&2){let e=Lw().$implicit,n=Lw();IE(),Yu(" No bot yet. An admin of the namespace can give this agent a ",n.platformName(e)," bot. ");}}function fe(i,t){if(i&1&&(Gu(0,"div",3)(1,"h3",5),pC(2),Wu(),Iw(3,oe,12,9)(4,pe,3,2)(5,ue,2,1,"p",6),Wu()),i&2){let e,n=t.$implicit,o=Lw();IE(2),lg(o.platformName(n)),IE(),ww((e=o.botOf(n))?3:o.canAdminister()?4:5,e);}}function Ce(i,t){i&1&&(Gu(0,"p",4),pC(1),Wu()),i&2&&(IE(),lg(t));}var q=class i{botConfig=g(g$1);messagingState=g(M);namespaceRole=g(v);destroyRef=g(we);namespaceId=aB.required();agentId=aB.required();platforms=a;platformName=e;Platform=ze;bots=Mi([]);canAdminister=Mi(false);creatable=Mi([]);creationLink=Mi(null);connectLinks=Mi({});formPlatform=Mi(null);token=Mi("");appToken=Mi("");manifest=Mi(null);copied=Mi(false);busy=Mi(false);confirmingRemoveId=Mi(null);error=Mi(null);constructor(){Qs(window,"focus").pipe(U()).subscribe(()=>{(this.creationLink()||Object.keys(this.connectLinks()).length>0)&&this.refresh();}),oy(be).pipe(U()).subscribe(()=>{let t=this.creationLink();t&&(Date.parse(t.expiresAt)<Date.now()?this.creationLink.set(null):this.refresh());});}ngOnInit(){this.namespaceRole.isAdminOfNamespace$(this.namespaceId()).pipe(U(this.destroyRef)).subscribe(t=>this.canAdminister.set(t)),this.messagingState.capabilities().pipe(U(this.destroyRef)).subscribe({next:t=>this.creatable.set(t.botCreation),error:t=>console.error("[AgentMessaging] Could not read the messaging capabilities:",t)}),this.refresh();}botOf(t){return this.bots().find(e=>e.platform===t)??null}canCreate(t){return this.creatable().includes(t)}connectLinkOf(t){return this.connectLinks()[t.id]}statusLabel(t){return xe[t]??t}statusTone(t){switch(t){case "RUNNING":return "ok";case "DISABLED":return "off";default:return "warn"}}openForm(t){if(this.formPlatform()===t){this.formPlatform.set(null);return}this.formPlatform.set(t),this.token.set(""),this.appToken.set(""),this.manifest.set(null),this.copied.set(false),t==="SLACK"&&this.run(this.botConfig.manifest(this.namespaceId(),this.agentId(),t),e=>this.manifest.set(e),"Could not get the manifest of the Slack app.");}copy(t){navigator.clipboard?.writeText(t).then(()=>this.copied.set(true),()=>this.copied.set(false));}createBot(t){this.run(this.botConfig.requestCreation(this.namespaceId(),this.agentId(),t),e=>this.creationLink.set(e),"Could not start the creation of the bot.");}attach(t){let e$1=this.token().trim(),n=this.appToken().trim();!e$1||t==="SLACK"&&!n||this.run(this.botConfig.attach(this.namespaceId(),this.agentId(),t,e$1,n||void 0),o=>{this.token.set(""),this.appToken.set(""),this.formPlatform.set(null),this.replace(o);},`${e(t)} refused these tokens, or the bot already serves another agent.`);}toggle(t){this.run(this.botConfig.setEnabled(t.id,!t.enabled),e=>this.replace(e),"Could not change the bot.");}remove(t){this.confirmingRemoveId.set(null),this.run(this.botConfig.remove(t.id),()=>{this.bots.update(e=>e.filter(n=>n.id!==t.id)),this.reloadMessagingState();},"Could not remove the bot.");}connect(t){this.run(this.messagingState.createLink(t.id),e=>this.connectLinks.update(n=>x(w({},n),{[t.id]:e})),"Could not get a link to the bot.");}refresh(){let t=this.creationLink()!==null||Object.keys(this.connectLinks()).length>0;this.botConfig.agentBots(this.namespaceId(),this.agentId()).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=e.some(o=>o.linked&&!this.bots().some(d=>d.id===o.id&&d.linked));this.bots.set(e),t&&n&&this.reloadMessagingState(),e.some(o=>o.platform==="TELEGRAM")&&this.creationLink.set(null),this.connectLinks.update(o=>Object.fromEntries(Object.entries(o).filter(([d])=>!e.some(M=>M.id===d&&M.linked))));},error:e=>console.error("[AgentMessaging] Could not load the bots of the agent:",e)});}reloadMessagingState(){this.messagingState.load().pipe(U(this.destroyRef)).subscribe({error:()=>{}});}replace(t){this.bots.update(e=>[...e.filter(n=>n.platform!==t.platform),t]);}run(t,e,n){this.error.set(null),this.busy.set(true),t.pipe(U(this.destroyRef)).subscribe({next:o=>{this.busy.set(false),e(o);},error:o=>{console.error("[AgentMessaging]",n,o),this.busy.set(false),this.error.set(o?.error?.message??n);}});}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-agent-messaging"]],inputs:{namespaceId:[1,"namespaceId"],agentId:[1,"agentId"]},decls:8,vars:1,consts:[[1,"agent-messaging"],[1,"agent-messaging__title"],[1,"agent-messaging__hint"],[1,"agent-messaging__platform"],["role","alert",1,"agent-messaging__error"],[1,"agent-messaging__platform-title"],[1,"agent-messaging__note"],[1,"agent-messaging__row"],["target","_blank","rel","noopener",1,"agent-messaging__bot",3,"href"],[1,"agent-messaging__status"],[1,"agent-messaging__warning"],[1,"agent-messaging__spacer"],["type","button",1,"agent-messaging__btn",3,"click","disabled"],["type","button",1,"agent-messaging__btn"],["type","button",1,"agent-messaging__btn","agent-messaging__btn--danger",3,"click","disabled"],["type","button",1,"agent-messaging__btn",3,"click"],["target","_blank","rel","noopener",1,"agent-messaging__btn","agent-messaging__btn--primary",3,"href"],[1,"agent-messaging__code"],[1,"agent-messaging__form"],["type","button",1,"agent-messaging__btn","agent-messaging__btn--primary",3,"disabled"],["type","button",1,"agent-messaging__btn","agent-messaging__btn--primary",3,"click","disabled"],[1,"agent-messaging__form",3,"submit"],[1,"agent-messaging__steps"],[1,"agent-messaging__fields"],[1,"agent-messaging__label",3,"for"],["type","password","name","token","autocomplete","off",1,"agent-messaging__input",3,"input","id","placeholder","value"],["type","submit",1,"agent-messaging__btn","agent-messaging__btn--primary",3,"disabled"],["target","_blank","rel","noopener",1,"agent-messaging__link",3,"href"],[1,"agent-messaging__manifest"],["for","agent-messaging-app-token",1,"agent-messaging__label"],["id","agent-messaging-app-token","type","password","name","appToken","autocomplete","off","placeholder","xapp-\u2026",1,"agent-messaging__input",3,"input","value"]],template:function(e,n){if(e&1&&(Gu(0,"section",0)(1,"h2",1),pC(2,"Messaging"),Wu(),Gu(3,"p",2),pC(4," Users talk to this agent from a messaging application through its bot: their messages go to their cases in this namespace, the answers come back in the application. "),Wu(),Tw(5,fe,6,2,"div",3,bw),Iw(7,Ce,2,1,"p",4),Wu()),e&2){let o;IE(5),_w(n.platforms),IE(2),ww((o=n.error())?7:-1,o);}},dependencies:[Kb],styles:[".agent-messaging[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;margin-top:1.5rem}.agent-messaging__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}.agent-messaging__hint[_ngcontent-%COMP%], .agent-messaging__note[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-text-secondary)}.agent-messaging__warning[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-warning, #b26a00)}.agent-messaging__error[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;color:var(--color-error, #c62828)}.agent-messaging__row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.agent-messaging__spacer[_ngcontent-%COMP%]{flex:1}.agent-messaging__bot[_ngcontent-%COMP%]{font-family:var(--font-mono, monospace);font-size:.9375rem;color:var(--color-accent);text-decoration:none}.agent-messaging__bot[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-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}.agent-messaging__status--ok[_ngcontent-%COMP%]{border-color:var(--color-success, #2e7d32);color:var(--color-success, #2e7d32)}.agent-messaging__status--off[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.agent-messaging__status--warn[_ngcontent-%COMP%]{border-color:var(--color-warning, #b26a00);color:var(--color-warning, #b26a00)}.agent-messaging__token[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.agent-messaging__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary)}.agent-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}.agent-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}.agent-messaging__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-messaging__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.agent-messaging__btn--primary[_ngcontent-%COMP%]{border-color:var(--color-accent);color:var(--color-accent)}.agent-messaging__btn--danger[_ngcontent-%COMP%]{border-color:var(--color-error, #c62828);color:var(--color-error, #c62828)}.agent-messaging__platform[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.agent-messaging__platform-title[_ngcontent-%COMP%]{margin:0;font-size:.875rem;font-weight:600;color:var(--color-text)}.agent-messaging__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.agent-messaging__fields[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.agent-messaging__steps[_ngcontent-%COMP%]{margin:0;padding-left:1.25rem;font-size:.875rem;color:var(--color-text);line-height:1.6}.agent-messaging__steps[_ngcontent-%COMP%] li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{margin-top:.25rem}.agent-messaging__manifest[_ngcontent-%COMP%]{max-height:14rem;overflow:auto;margin:.5rem 0;padding:.5rem .75rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);background:var(--color-bg-subtle, var(--color-bg));font-family:var(--font-mono, monospace);font-size:.75rem}.agent-messaging__code[_ngcontent-%COMP%]{padding:.1rem .4rem;border:1px solid var(--color-divider);border-radius:var(--radius-sm, 0);font-family:var(--font-mono, monospace);font-size:.8125rem;word-break:break-all}.agent-messaging__link[_ngcontent-%COMP%]{color:var(--color-accent)}"]})},be=3e3,xe={STARTING:"Starting",RUNNING:"Running",DISABLED:"Off",TOKEN_REJECTED:"Token rejected",CONFLICT:"Used elsewhere",UNREACHABLE:"Unreachable"};export{q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {p as pt,T as Te,b as bn,v as vn,d as yn,e as fn,n as pn,h as hn,i as at,u as un,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,q as Mn,Q as Qt,c as fo,g as go,t as ta,Z as Zr,N as Nn,R as Rn,E as Ea}from'./chunk-DvtbHzPu.js';import {g,W,F,v as we,au as k,at as F$1,ad as F$2,a6 as Zs,ae as Dr,av as Fe,i as VC,M as Mi,s as sf,x as U,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,w as ww,R as Rw,H as Hh,N as lI,T as Tw,as as bw,L as Lw,Q as fI,_ as _w,Y as Yu,ai as Dw,l as lg,$ as dg,P as Pd,n as Ld}from'./main-OQ262YIZ.js';function he(r,t){r&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function ve(r,t){if(r&1&&Hh(0,"input",6),r&2){let e=Lw(2);Vh("value",e.selectedProviderLabel());}}function ye(r,t){if(r&1&&(os(0,"option",44),pC(1),zu()),r&2){let e=t.$implicit;Vh("value",e.id),IE(),dg("",e.name," (",e.apiType,")");}}function be(r,t){if(r&1&&(os(0,"select",7)(1,"option",43),pC(2,"Select provider"),zu(),Tw(3,ye,2,3,"option",44,Dw().trackByProvider,true),zu(),lI()),r&2){let e=Lw(2);Vh("formControl",e.aiProviderIdControl),fI(),IE(3),_w(e.providers());}}function xe(r,t){if(r&1&&(os(0,"option",25),pC(1),zu()),r&2){let e=t.$implicit;Vh("ngValue",e),IE(),lg(e.toLowerCase());}}function _e(r,t){r&1&&(os(0,"p",2),pC(1,"Not supported yet for Anthropic and Gemini providers."),zu());}function Me(r,t){r&1&&(os(0,"p",2),pC(1," Sent as is to OpenAI-compatible providers, which reject levels the model does not support. Through Requesty, Claude models do not apply it faithfully. "),zu());}function Ee(r,t){r&1&&(os(0,"p",26),pC(1," OpenAI reasoning models (GPT-5.1 and later) reject a temperature other than 1 with an effort: leave Temperature empty or set it to 1. "),zu());}function Ae(r,t){if(r&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let u=Lw();return Ld(u.submit())}),os(1,"ds-form-field",5),Iw(2,ve,1,1,"input",6)(3,be,5,1,"select",7),zu(),os(4,"ds-form-field",8),Hh(5,"input",9),lI(),zu(),os(6,"ds-form-field",10),Hh(7,"input",11),lI(),zu(),os(8,"ds-form-field",12),Hh(9,"input",13),lI(),zu(),os(10,"ds-form-field",14),Hh(11,"input",15),lI(),zu(),os(12,"div",16)(13,"ds-form-field",17),Hh(14,"input",18),lI(),zu(),os(15,"ds-form-field",19),Hh(16,"input",20),lI(),zu()(),os(17,"ds-form-field",21),Hh(18,"input",22),lI(),zu(),os(19,"ds-form-field",23)(20,"select",24)(21,"option",25),pC(22,"Provider default"),zu(),Tw(23,xe,2,2,"option",25,bw),zu(),lI(),Iw(25,_e,2,0,"p",2)(26,Me,2,0,"p",2),Iw(27,Ee,2,0,"p",26),zu(),os(28,"div",27)(29,"label",28),Hh(30,"input",29),lI(),os(31,"span",30),pC(32,"Supports advanced execution"),zu()(),os(33,"p",31),pC(34," Agents configured in ADVANCED execution mode fail to run on a model that does not support it. SIMPLE agents are not concerned. "),zu()(),os(35,"ds-fieldset",32)(36,"div",16)(37,"ds-form-field",33),Hh(38,"input",34),lI(),zu(),os(39,"ds-form-field",35),Hh(40,"input",36),lI(),zu()(),os(41,"div",16)(42,"ds-form-field",37),Hh(43,"input",38),lI(),zu(),os(44,"ds-form-field",39),Hh(45,"input",40),lI(),zu()()(),os(46,"ds-form-actions")(47,"button",41),pC(48),zu(),os(49,"button",42),qh("click",function(){Pd(e);let u=Lw();return Ld(u.cancel())}),pC(50,"Cancel"),zu()()();}if(r&2){let e=Lw();Vh("formGroup",e.form),IE(2),ww(e.isEditMode()?2:3),IE(3),Vh("formControl",e.apiModelNameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.aliasControl),fI(),IE(2),Vh("formControl",e.priorityControl),fI(),IE(3),Vh("formControl",e.temperatureControl),fI(),IE(2),Vh("formControl",e.contextWindowControl),fI(),IE(2),Vh("formControl",e.maxCompletionTokensControl),fI(),IE(2),Vh("formControl",e.reasoningEffortControl),fI(),IE(),Vh("ngValue",null),IE(2),_w(e.reasoningEffortOptions),IE(2),ww(e.reasoningEffortUnsupported()?25:26),IE(2),ww(e.temperatureMayConflictWithEffort()?27:-1),IE(3),Vh("formControl",e.supportsAdvancedExecutionControl),fI(),IE(5),Vh("formGroup",e.pricingGroup),IE(3),fI(),IE(2),fI(),IE(3),fI(),IE(2),fI(),IE(2),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create"," ");}}var Ie=["Anthropic","Gemini"],ge=class r{route=g(W);router=g(F);destroyRef=g(we);aiModelController=g(k);aiProviderController=g(F$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F$2(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(Zs(()=>Dr([]))),{initialValue:[]});form=new pt({aiProviderId:new Te("",{nonNullable:true,validators:[bn.required]}),apiModelName:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),alias:new Te("",{nonNullable:true}),priority:new Te(0,{nonNullable:true}),temperature:new Te(null),contextWindow:new Te(null),maxCompletionTokens:new Te(null),reasoningEffort:new Te(null),supportsAdvancedExecution:new Te(false,{nonNullable:true}),pricing:new pt({inputMTokens:new Te(null),outputMTokens:new Te(null),cacheWrite:new Te(null),cacheRead:new Te(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get reasoningEffortControl(){return this.form.controls.reasoningEffort}get supportsAdvancedExecutionControl(){return this.form.controls.supportsAdvancedExecution}get pricingGroup(){return this.form.controls.pricing}reasoningEffortOptions=Object.values(Fe);selectedProviderId=F$2(this.form.controls.aiProviderId.valueChanges,{initialValue:this.form.controls.aiProviderId.value});reasoningEffortUnsupported=VC(()=>{let t=this.providers().find(e=>e.id===this.selectedProviderId())?.apiType;return t!==void 0&&Ie.includes(t)});temperatureValue=F$2(this.form.controls.temperature.valueChanges,{initialValue:this.form.controls.temperature.value});reasoningEffortValue=F$2(this.form.controls.reasoningEffort.valueChanges,{initialValue:this.form.controls.reasoningEffort.value});temperatureMayConflictWithEffort=VC(()=>{let t=this.temperatureValue();return this.reasoningEffortValue()!=null&&t!=null&&t!==1});isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);selectedProviderLabel=VC(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(c=>c.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;constructor(){sf(()=>{this.reasoningEffortUnsupported()?(this.reasoningEffortControl.setValue(null),this.reasoningEffortControl.disable()):this.reasoningEffortControl.enable();});}ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.reasoningEffortControl.setValue(e.reasoningEffort??null),this.supportsAdvancedExecutionControl.setValue(e.supportsAdvancedExecution??false),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,w$1=x(w({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,reasoningEffort:t.reasoningEffort??void 0,supportsAdvancedExecution:t.supportsAdvancedExecution,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",w$1):this.aiModelController.createAiModel(w$1)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=ew({type:r,selectors:[["agentos-ai-model-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to AI models",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Provider","controlId","model-provider","required",""],["dsControl","","id","model-provider","type","text","readonly","","tabindex","-1",3,"value"],["dsControl","","id","model-provider",3,"formControl"],["label","API name","controlId","model-api-name","required",""],["dsControl","","mono","","id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",3,"formControl"],["label","Description","controlId","model-description"],["dsControl","","id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",3,"formControl"],["label","Alias","controlId","model-alias"],["dsControl","","id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",3,"formControl"],["label","Priority","controlId","model-priority"],["dsControl","","id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",3,"formControl"],[1,"ds-grid-2"],["label","Temperature","controlId","model-temperature"],["dsControl","","id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",3,"formControl"],["label","Context window","controlId","model-context-window"],["dsControl","","id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",3,"formControl"],["label","Max completion tokens","controlId","model-max-completion-tokens"],["dsControl","","id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",3,"formControl"],["label","Reasoning effort","controlId","model-reasoning-effort"],["dsControl","","id","model-reasoning-effort",3,"formControl"],[3,"ngValue"],[1,"ds-hint","ds-hint--warning"],[1,"ai-model-form__field"],[1,"ai-model-form__toggle-label"],["type","checkbox",1,"ai-model-form__toggle-checkbox",3,"formControl"],[1,"ai-model-form__toggle-text"],[1,"ai-model-form__toggle-hint"],["legend","Pricing","legendHint","per million tokens \u2014 leave blank to skip cost monitoring",3,"formGroup"],["label","Input","controlId","pricing-input"],["dsControl","","id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens"],["label","Output","controlId","pricing-output"],["dsControl","","id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens"],["label","Cache write","controlId","pricing-cache-write"],["dsControl","","id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite"],["label","Cache read","controlId","pricing-cache-read"],["dsControl","","id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,c){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return c.cancel()}),pC(3," \u2190 AI models "),zu()(),Iw(4,he,2,0,"p",2)(5,Ae,51,17,"form",3),zu()),e&2&&(IE(),Vh("title",c.isEditMode()?"Edit AI model":"New AI model"),IE(3),ww(c.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,Ea],encapsulation:2})};export{ge as AiModelFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {r as k,O,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,W as W$1,F,v as we,ak as U$1,a3 as vr,M as Mi,a5 as Ys,ag as Gm,a6 as Zs,ae as Dr,x as U$2,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 J=(n,e)=>e.key;function U(n,e){if(n&1&&(os(0,"p",3),pC(1),zu()),n&2){let t=Lw();IE(),lg(t.deletion.error());}}function z(n,e){n&1&&(os(0,"p",4),pC(1,"Loading agent configs\u2026"),zu());}function G(n,e){n&1&&(os(0,"p",5),pC(1,"No agent configs available."),zu());}function Q(n,e){n&1&&(os(0,"p",4),pC(1,"No agent configs match the current filter."),zu());}function W(n,e){n&1&&(os(0,"ds-tag",18),pC(1,"Read-only"),zu());}function X(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw(2).$implicit,d=Lw(2);return Ld(d.launch(s))}),pC(1," Launch "),zu();}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Launch "+t.config.name);}}function Y(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw(2).$implicit,d=Lw(2);return Ld(d.edit(s))}),pC(1," Edit "),zu();}if(n&2){let t=Lw(2).$implicit;Bh("aria-label","Edit "+t.config.name);}}function Z(n,e){if(n&1){let t=Rw();os(0,"button",22),qh("click",function(){Pd(t);let s=Lw().$implicit,d=Lw(2);return Ld(d.inspect(s))}),pC(1," Inspect "),zu(),Iw(2,X,2,1,"button",23),Iw(3,Y,2,1,"button",23);}if(n&2){let t=Lw().$implicit,i=Lw(2);Bh("aria-label","Inspect "+t.config.name),IE(2),ww(i.canLaunch(t)?2:-1),IE(),ww(t.scope==="namespace"?3:-1);}}function ee(n,e){if(n&1){let t=Rw();os(0,"agentos-row-delete-action",24),qh("deleteRequested",function(){Pd(t);let s=Lw().$implicit,d=Lw(2);return Ld(d.deletion.request(s.key))})("deleteConfirmed",function(){Pd(t);let s=Lw().$implicit,d=Lw(2);return Ld(d.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Lw(3);return Ld(s.deletion.cancel())}),zu();}if(n&2){let t=Lw().$implicit,i=Lw(2);Vh("rowKey",t.key)("rowLabel",t.config.name)("state",i.deletion);}}function te(n,e){if(n&1&&(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)(8,"div",16)(9,"ds-tag",17),pC(10),zu(),Iw(11,W,2,0,"ds-tag",18),zu()(),os(12,"td",19)(13,"div",20),Iw(14,Z,4,3),Iw(15,ee,1,3,"agentos-row-delete-action",21),zu()()()),n&2){let t=e.$implicit,i=Lw(2);IE(2),lg(t.config.name),IE(2),Yu(" ",t.config.description||"\u2014"," "),IE(2),lg(i.mode(t)),IE(3),Vh("variant",t.scope==="platform"?"neutral":"accent"),IE(),lg(t.scope==="platform"?"Platform":"Namespace"),IE(),ww(t.scope==="platform"?11:-1),IE(3),ww(i.deletion.confirmingId()!==t.key?14:-1),IE(),ww(t.scope==="namespace"?15:-1);}}function ne(n,e){if(n&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,"Execution mode"),zu(),os(10,"th",10),pC(11,"Scope"),zu(),os(12,"th",10)(13,"span",11),pC(14,"Actions"),zu()()()(),os(15,"tbody",8),Tw(16,te,16,8,"tr",9,J),zu()()()),n&2){let t=Lw();IE(16),_w(t.rowFilter.filteredRows());}}var H=class n{route=g(W$1);router=g(F);destroyRef=g(we);controller=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new vr(void 0);isLoading=Mi(true);deletion=k();rows=Mi([]);rowFilter=O(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),Gm({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(Zs(()=>Dr([])))}))));constructor(){this.allConfigs$.pipe(U$2(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((i,s)=>({key:`platform:${i.id??s}`,config:i,scope:"platform"})),...e.map((i,s)=>({key:`namespace:${i.id??s}`,config:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}confirmDelete(e){e.scope==="platform"||!e.config.id||this.deletion.execute(e.key,{request$:this.controller.deleteAgentConfig(e.config.id).pipe(U$2(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.config.name}" failed. Try again.`});}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-namespace-agent-configs"]],decls:9,vars:3,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Agent configs"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Execution mode"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,i){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(d){return i.rowFilter.query.set(d)}),zu(),os(2,"button",2),qh("click",function(){return i.openCreateForm()}),pC(3,"New agent config"),zu()(),Iw(4,U,2,1,"p",3),Iw(5,z,2,0,"p",4)(6,G,2,0,"p",5)(7,Q,2,0,"p",4)(8,ne,18,0,"div",6)),t&2&&(IE(),Vh("query",i.rowFilter.query()),IE(3),ww(i.deletion.error()?4:-1),IE(),ww(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{H as NamespaceAgentConfigsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {i}from'./chunk-iZXu2H1x.js';import {y}from'./chunk-DvtbHzPu.js';import {g,aL as X,a3 as vr,aw as $m,a5 as Ys,a6 as Zs,ae as Dr,ah as te,aK as my,E as x,C as w$1,a9 as Hl,aM as st,aN as bt,aO as en,aa as k$1}from'./main-OQ262YIZ.js';var nt=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],it={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},R="none",w="me",b=2e3,M=15e4,P=3,L={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},k={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function B(i){let t=L[i.authType];return t?x(w$1({},i),{authType:t}):i}function m(i){return U(i)}function f(i){return i.map(U)}function U(i){let t=i;if(typeof t.authType=="string"){let e=k[t.authType];if(e)return x(w$1({},t),{authType:e})}return i}function H(i,t){return t===null?true:i!==void 0&&Date.parse(i)>Date.parse(t)}var I=class i$1{controller=g(X);userState=g(y);refresh$=new vr(void 0);namespaceId$=new vr(null);vm$=$m([this.namespaceId$,this.refresh$]).pipe(Ys(([t])=>{let e=this.loadPlatformSettings().pipe(Zs(()=>Dr([])));return t?$m([e,this.loadNamespaceSettings(t).pipe(Zs(()=>Dr([]))),this.loadUserSettings(t).pipe(Zs(()=>Dr([]))),this.loadUserSettings("global").pipe(Zs(()=>Dr([])))]).pipe(te(([n,o,r,h])=>({platform:n,namespace:o,userOnNs:r,userGlobal:h}))):$m([e,this.loadNamespaceSettings("").pipe(Zs(()=>Dr([]))),this.loadUserSettings("global").pipe(Zs(()=>Dr([])))]).pipe(te(([n,o,r])=>({platform:n,namespace:o,userOnNs:[],userGlobal:r})))}),my({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?R:t;return this.controller.listAuthSetting(e,w).pipe(te(n=>f(n)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(R).pipe(te(t=>f(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(te(e=>f(e))):Dr([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(te(n=>m(n)))}create(t,e,n){let r=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!r)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(n===void 0||n===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!n)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let h=B(x(w$1({},t),{namespaceId:e==="namespace"||e==="userOnNs"?n??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?r:void 0}));return this.controller.createAuthSetting(h).pipe(te(A=>m(A)),Hl(()=>this.refresh()))}update(t,e,n){let o=B(x(w$1({},e),{namespaceId:n.namespaceId,userId:n.userId,authType:n.authType}));return this.controller.updateAuthSetting(t,o).pipe(te(r=>m(r)),Hl(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Hl(()=>this.refresh()))}getConnection(t,e){return this.controller.getConnectionAuthSetting(t,e)}resetCredential(t,e){return this.controller.resetMyCredentialAuthSetting(t,e)}connect(t,e,n,o){return this.getConnection(t,e).pipe(Ys(r=>this.controller.connectAuthSetting(t,e).pipe(Hl(h=>n(h.authorizationUrl)),Ys(()=>this.awaitNewConnection(t,e,r.connected?r.connectedAt??null:null,o)))))}awaitNewConnection(t,e,n,o){let r=0,h=0;return st(b,b).pipe(Ys(()=>this.getConnection(t,e).pipe(Zs(()=>Dr(null)))),te(A=>(r++,A?.connected&&H(A.connectedAt,n)?"connected":r*b>=M?"timeout":o()&&++h>=P?"abandoned":null)),bt(A=>A!==null),en(1))}static \u0275fac=function(e){return new(e||i$1)};static \u0275prov=k$1({token:i$1,factory:i$1.\u0275fac,providedIn:"root"})};export{I,it as i,nt as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {S}from'./chunk-DvtbHzPu.js';import {a as ew,S as br,o as os,b as pC,z as zu,H as Hh,J as Vh}from'./main-OQ262YIZ.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:"Messaging",commands:["messaging"]}]},{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(t){return new(t||a)};static \u0275cmp=ew({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(t,g){t&1&&(os(0,"agentos-settings-layout",0)(1,"nav",1)(2,"span"),pC(3,"Platform"),zu(),os(4,"span",2),pC(5,"/"),zu(),os(6,"span"),pC(7,"Administration"),zu()(),Hh(8,"router-outlet"),zu()),t&2&&Vh("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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {o as o$1,r,i,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-Do3ec7CW.js';import {q}from'./chunk-CpLFr6wl.js';import'./chunk-Bv223hQn.js';import'./chunk-t-Kfnaoc.js';import {O}from'./chunk-RltTZwlz.js';import {g,W,F as F$1,v as we,ak as U,aA as N,M as Mi,aB as Q,ac as _,i as VC,ad as F$2,aC as $e$1,x as U$1,a6 as Zs,ae as Dr,ag as Gm,ah as te,E as x,C as w,a as ew,ax as $t$1,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,L as Lw,R as Rw,H as Hh,N as lI,Q as fI,h as Bh,Y as Yu,T as Tw,_ as _w,l as lg,P as Pd,n as Ld,$ as dg}from'./main-OQ262YIZ.js';import {I as A,p as pt$1,T as Te,b as bn,J as E,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,Z as Zr,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$1,u as un,o as cn,A as Ao}from'./chunk-DvtbHzPu.js';import'./chunk-iZXu2H1x.js';var F="*";function $e(n){return (n??[]).some(t=>t.trim()===F)}function Ge(n){let t=(n??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F).map(e=>e.toLowerCase());return new Set(t)}function j(n){return n.includes(F)}function Je(n){let t=n.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(n,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==F&&j(e)).some(e=>Je(e)?.test(n)??false)}var Ue="AGENTOS_CONFIG",Ye=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ke(n){return n.configEnabled&&(n.hasSubAgents||n.integrationTypes.some(t=>Ye.has(t)))}var We=(n,t)=>t.value,qe=(n,t)=>t.config.id,ze=(n,t)=>t.type,He=(n,t)=>t.selector;function Xe(n,t){if(n&1&&(os(0,"a",2),pC(1,"View resolved definition \u2192"),zu()),n&2){let e=Lw();Vh("routerLink",e.inspectRoute());}}function Qe(n,t){n&1&&(os(0,"ds-tag",3),pC(1,"Platform level"),zu());}function Ze(n,t){n&1&&(os(0,"p",4),pC(1,"Loading\u2026"),zu());}function et(n,t){if(n&1&&(Hh(0,"input",16),lI()),n&2){let e=Lw(2);Vh("formControl",e.modelNameControl),fI();}}function tt(n,t){if(n&1&&(os(0,"option",41),pC(1),zu()),n&2){let e=t;Vh("ngValue",e.value),IE(),lg(e.label);}}function nt(n,t){if(n&1&&(os(0,"option",41),pC(1),zu()),n&2){let e=t.$implicit;Vh("ngValue",e.value),IE(),lg(e.label);}}function it(n,t){if(n&1&&(os(0,"optgroup",42),Tw(1,nt,2,2,"option",41,We),zu()),n&2){let e=Lw(3);IE(),_w(e.modelOptions().aliases);}}function ot(n,t){if(n&1&&(os(0,"option",41),pC(1),zu()),n&2){let e=t.$implicit;Vh("ngValue",e.value),IE(),lg(e.label);}}function at(n,t){if(n&1&&(os(0,"optgroup",43),Tw(1,ot,2,2,"option",41,We),zu()),n&2){let e=Lw(3);IE(),_w(e.modelOptions().apiNames);}}function lt(n,t){if(n&1&&(os(0,"select",17)(1,"option",40),pC(2,"Select a model"),zu(),Iw(3,tt,2,2,"option",41),Iw(4,it,3,0,"optgroup",42),Iw(5,at,3,0,"optgroup",43),zu(),lI()),n&2){let e,i=Lw(2);Vh("formControl",i.modelNameControl),fI(),IE(),Vh("ngValue",null),IE(2),ww((e=i.modelOptions().current)?3:-1,e),IE(),ww(i.modelOptions().aliases.length>0?4:-1),IE(),ww(i.modelOptions().apiNames.length>0?5:-1);}}function rt(n,t){if(n&1&&(os(0,"span",44),pC(1),zu()),n&2){let e=Lw().$implicit;IE(),lg(e.config.integrationType);}}function st(n,t){if(n&1&&(Hh(0,"input",45),lI()),n&2){let e=Lw().$implicit;Vh("formControl",e.toolsControl),Bh("aria-label","Tools of "+e.config.name),fI();}}function dt(n,t){if(n&1){let e=Rw();os(0,"div",9)(1,"label",10)(2,"input",22),qh("change",function(){let s=Pd(e).$implicit,m=Lw(3);return Ld(m.toggleIntegration(s))}),zu(),os(3,"span",23),pC(4),zu(),Iw(5,rt,2,1,"span",44),zu(),Iw(6,st,1,2,"input",45),zu();}if(n&2){let e=t.$implicit;IE(2),Vh("checked",e.enabled()),IE(2),lg(e.config.name),IE(),ww(e.config.integrationType?5:-1),IE(),ww(e.enabled()?6:-1);}}function ct(n,t){if(n&1&&(os(0,"p",12),pC(1),zu()),n&2){let e=Lw().$implicit;IE(),Yu(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function mt(n,t){if(n&1){let e=Rw();os(0,"div",9)(1,"label",23),pC(2),os(3,"span",44),pC(4,"built-in"),zu()(),os(5,"select",47),qh("change",function(s){let m=Pd(e).$implicit,C=Lw(4);return Ld(C.setBuiltInState(m,s.target.value))}),os(6,"option",48),pC(7),zu(),os(8,"option",49),pC(9,"Enabled"),zu(),os(10,"option",50),pC(11,"Disabled"),zu()(),Iw(12,ct,2,1,"p",12),os(13,"p",12),pC(14),zu()();}if(n&2){let e=t.$implicit,i=Lw(4);IE(),Bh("for","built-in-"+e.type),IE(),Yu(" ",e.displayName," "),IE(3),Vh("id","built-in-"+e.type)("value",e.state()),IE(2),lg(i.builtInDefaultLabel(e)),IE(5),ww(e.state()==="on"&&e.restrictedTools?12:-1),IE(2),lg(e.description);}}function gt(n,t){if(n&1&&(os(0,"span",46),pC(1,"Built-in integrations"),zu(),Tw(2,mt,15,7,"div",9,ze)),n&2){let e=Lw(3);IE(2),_w(e.builtInRows());}}function ut(n,t){n&1&&(os(0,"ds-notice",25),pC(1," This agent can read the AgentOS configuration and also has a network integration or sub-agents: what it reads could be sent outside without any confirmation. Prefer a dedicated configuration agent without them. "),zu());}function pt(n,t){if(n&1&&(os(0,"ds-fieldset",20),Tw(1,dt,7,4,"div",9,qe),Iw(3,gt,4,0),Iw(4,ut,2,0,"ds-notice",25),zu()),n&2){let e=Lw(2);IE(),_w(e.integrationRows()),IE(2),ww(e.builtInRows().length>0?3:-1),IE(),ww(e.configAgentExposureWarning()?4:-1);}}function ft(n,t){n&1&&pC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function Ct(n,t){n&1&&(os(0,"ds-notice",25),pC(1," Saving with this on replaces the selection below with "),os(2,"code",24),pC(3,"*"),zu(),pC(4,". "),zu());}function _t(n,t){n&1&&(os(0,"ds-notice"),pC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),zu());}function bt(n,t){n&1&&(os(0,"p",4),pC(1,"No skill available in this scope yet."),zu());}function ht(n,t){n&1&&(os(0,"span",44),pC(1,"platform"),zu());}function yt(n,t){if(n&1&&(os(0,"span",44),pC(1),zu()),n&2){let e=Lw(4);IE(),Yu(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function xt(n,t){if(n&1&&(os(0,"p",12),pC(1),zu()),n&2){let e=Lw().$implicit;IE(),lg(e.description);}}function vt(n,t){if(n&1){let e=Rw();os(0,"div",9)(1,"label",10)(2,"input",51),qh("change",function(){let s=Pd(e).$implicit,m=Lw(3);return Ld(m.toggleSkill(s))}),zu(),os(3,"span",23),pC(4),zu(),Iw(5,ht,2,0,"span",44),Iw(6,yt,2,1,"span",44),zu(),Iw(7,xt,2,1,"p",12),zu();}if(n&2){let e=t.$implicit,i=Lw(3);IE(2),Vh("checked",e.selected())("disabled",i.allSkillsSelected()),IE(2),lg(e.name),IE(),ww(e.platform?5:-1),IE(),ww(e.unresolved?6:-1),IE(),ww(e.description?7:-1);}}function St(n,t){if(n&1&&Tw(0,vt,8,6,"div",9,He),n&2){let e=Lw(2);_w(e.skillRows());}}function At(n,t){if(n&1&&(os(0,"ds-form-field",29),Hh(1,"textarea",52),lI(),os(2,"p",4),pC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),os(4,"code"),pC(5,"AgentLoopPayload"),zu(),pC(6,". Leave empty if you always provide the payload at launch. "),zu()()),n&2){let e=Lw(2);Vh("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),IE(),Vh("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),fI();}}function wt(n,t){n&1&&pC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Et(n,t){if(n&1&&pC(0),n&2){let e=Lw(3);dg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Tt(n,t){if(n&1&&(os(0,"ds-notice",25),pC(1," Saving with this on replaces the selection below with "),os(2,"code",24),pC(3,"*"),zu(),pC(4,". "),Iw(5,Et,1,2),zu()),n&2){let e=Lw(2);IE(5),ww(e.droppedUnresolvedSubAgents()>0?5:-1);}}function It(n,t){n&1&&(os(0,"ds-notice"),pC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),zu());}function kt(n,t){n&1&&(os(0,"p",4),pC(1,"No other agent is available in this scope yet."),zu());}function Rt(n,t){n&1&&(os(0,"span",44),pC(1,"pattern"),zu());}function Mt(n,t){n&1&&(os(0,"span",44),pC(1,"via pattern"),zu());}function Ft(n,t){if(n&1&&(os(0,"span",44),pC(1),zu()),n&2){let e=Lw(4);IE(),Yu(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function Nt(n,t){if(n&1){let e=Rw();os(0,"button",55),qh("click",function(){Pd(e);let s=Lw().$implicit,m=Lw(3);return Ld(m.removeSubAgent(s))}),pC(1," \xD7 "),zu();}if(n&2){let e=Lw().$implicit;Bh("aria-label","Remove "+e.selector);}}function Dt(n,t){if(n&1){let e=Rw();os(0,"div",31)(1,"label",53)(2,"input",51),qh("change",function(){let s=Pd(e).$implicit,m=Lw(3);return Ld(m.toggleSubAgent(s))}),zu(),os(3,"span",23),pC(4),zu(),Iw(5,Rt,2,0,"span",44)(6,Mt,2,0,"span",44)(7,Ft,2,1,"span",44),zu(),Iw(8,Nt,2,1,"button",54),zu();}if(n&2){let e=t.$implicit,i=Lw(3);IE(2),Vh("checked",e.selected())("disabled",i.allSubAgentsSelected()),IE(2),lg(e.name),IE(),ww(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),IE(3),ww(e.unresolved?8:-1);}}function Lt(n,t){if(n&1&&Tw(0,Dt,9,5,"div",31,He),n&2){let e=Lw(2);_w(e.subAgentRows());}}function Vt(n,t){if(n&1){let e=Rw();os(0,"div")(1,"button",56),qh("click",function(){Pd(e);let s=Lw(2);return Ld(s.useDefaultDelegationTimeout())}),pC(2," Use server default "),zu()();}}function Pt(n,t){n&1&&(os(0,"ds-notice"),pC(1),zu()),n&2&&(IE(),lg(t));}function Ot(n,t){if(n&1){let e=Rw();os(0,"button",57),qh("click",function(){Pd(e);let s=Lw(2);return Ld(s.exportYaml())}),pC(1),zu();}if(n&2){let e=Lw(2);Vh("disabled",e.isExporting()),IE(),Yu(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Bt(n,t){if(n&1&&Hh(0,"agentos-agent-messaging",39),n&2){let e=Lw(2);Vh("namespaceId",e.namespaceId)("agentId",e.agentConfigId);}}function $t(n,t){if(n&1){let e=Rw();os(0,"form",5),qh("ngSubmit",function(){Pd(e);let s=Lw();return Ld(s.submit())}),os(1,"ds-fieldset",6)(2,"ds-form-field",7),Hh(3,"input",8),lI(),zu(),os(4,"div",9)(5,"label",10),Hh(6,"input",11),lI(),pC(7," Enabled "),zu(),os(8,"p",12),pC(9,"Disabled agents are excluded from namespace resolution."),zu()(),os(10,"ds-form-field",13),Hh(11,"input",14),lI(),zu(),os(12,"ds-form-field",15),Iw(13,et,1,1,"input",16)(14,lt,6,5,"select",17),zu(),os(15,"ds-form-field",18),Hh(16,"textarea",19),lI(),zu()(),Iw(17,pt,5,2,"ds-fieldset",20),os(18,"ds-fieldset",21)(19,"p",4),pC(20," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),os(21,"code"),pC(22,"readSkill"),zu(),pC(23," and "),os(24,"code"),pC(25,"readSkillResource"),zu(),pC(26," tools; selecting none grants neither. "),Iw(27,ft,1,0),zu(),os(28,"label",10)(29,"input",22),qh("change",function(){Pd(e);let s=Lw();return Ld(s.toggleAllSkills())}),zu(),os(30,"span",23),pC(31,"Every skill in the catalogue ("),os(32,"code",24),pC(33,"*"),zu(),pC(34,")"),zu()(),os(35,"p",12),pC(36," Resolved at run time, so skills added later are granted too, without editing this agent. "),zu(),Iw(37,Ct,5,0,"ds-notice",25),Iw(38,_t,2,0,"ds-notice"),Iw(39,bt,2,0,"p",4)(40,St,2,0),zu(),os(41,"ds-form-field",26)(42,"select",27)(43,"option",28),pC(44,"SIMPLE \u2014 Standard agent (single LLM call)"),zu(),os(45,"option",28),pC(46,"ADVANCED \u2014 Multi-step reasoning loop"),zu(),os(47,"option",28),pC(48,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),zu()(),lI(),zu(),Iw(49,At,7,3,"ds-form-field",29),os(50,"ds-fieldset",30)(51,"p",4),pC(52," The agents this one may delegate to. Selecting at least one grants it the "),os(53,"code"),pC(54,"DELEGATE__delegate"),zu(),pC(55," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Iw(56,wt,1,0),zu(),os(57,"label",10)(58,"input",22),qh("change",function(){Pd(e);let s=Lw();return Ld(s.toggleAllSubAgents())}),zu(),os(59,"span",23),pC(60,"Every agent it can reach ("),os(61,"code",24),pC(62,"*"),zu(),pC(63,")"),zu()(),os(64,"p",12),pC(65," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),zu(),Iw(66,Tt,6,1,"ds-notice",25),Iw(67,It,2,0,"ds-notice"),Iw(68,kt,2,0,"p",4)(69,Lt,2,0),os(70,"p",4),pC(71," Advanced \u2014 add a glob instead of picking a name, for example "),os(72,"code"),pC(73,"*Fixer"),zu(),pC(74," to cover BugFixer and StoryFixer. "),zu(),os(75,"div",31)(76,"input",32),qh("keydown.enter",function(){Pd(e);let s=Lw();return Ld(s.addSubAgent())}),zu(),lI(),os(77,"button",33),qh("click",function(){Pd(e);let s=Lw();return Ld(s.addSubAgent())}),pC(78," + "),zu()(),os(79,"ds-form-field",34),Hh(80,"input",35),lI(),Iw(81,Vt,3,0,"div"),zu()(),Iw(82,Pt,2,1,"ds-notice"),os(83,"ds-form-actions")(84,"button",36),pC(85),zu(),Iw(86,Ot,2,2,"button",37),os(87,"button",38),qh("click",function(){Pd(e);let s=Lw();return Ld(s.cancel())}),pC(88,"Cancel"),zu()()(),Iw(89,Bt,1,2,"agentos-agent-messaging",39);}if(n&2){let e,i=Lw();Vh("formGroup",i.form),IE(3),Vh("formControl",i.nameControl),fI(),IE(3),Vh("formControl",i.enabledControl),fI(),IE(5),Vh("formControl",i.descriptionControl),fI(),IE(2),ww(i.modelAsFreeText()?13:14),IE(3),Vh("formControl",i.instructionsControl),fI(),IE(),ww(i.integrationRows().length>0||i.builtInRows().length>0?17:-1),IE(10),ww(i.isPlatformMode?27:-1),IE(2),Vh("checked",i.allSkillsSelected()),IE(8),ww(i.namedSkillSelectionDropped()?37:-1),IE(),ww(i.skillCatalogueUnavailable()?38:-1),IE(),ww(i.skillRows().length===0?39:40),IE(3),Vh("formControl",i.executionModeControl),fI(),IE(),Vh("value",i.ExecutionMode.SIMPLE),IE(2),Vh("value",i.ExecutionMode.ADVANCED),IE(2),Vh("value",i.ExecutionMode.LOOP),IE(2),ww(i.isLoopMode()?49:-1),IE(7),ww(i.isPlatformMode?56:-1),IE(2),Vh("checked",i.allSubAgentsSelected()),IE(8),ww(i.namedSubAgentSelectionDropped()?66:-1),IE(),ww(i.subAgentCandidatesUnavailable()?67:-1),IE(),ww(i.subAgentRows().length===0?68:69),IE(8),Vh("formControl",i.newSubAgentControl),fI(),IE(),Vh("disabled",!i.newSubAgentControl.value.trim()),IE(2),Vh("hint",i.delegationTimeoutHint())("error",i.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),IE(),Vh("formControl",i.delegationTimeoutControl),Bh("aria-invalid",i.delegationTimeoutControl.invalid),fI(),IE(),ww(i.delegationTimeoutControl.value!==null?81:-1),IE(),ww((e=i.submitError())?82:-1,e),IE(2),Vh("disabled",i.form.invalid||i.isSubmitting()),IE(),Yu(" ",i.isEditMode()?"Save changes":"Create"," "),IE(),ww(i.isEditMode()?86:-1),IE(3),ww(i.isEditMode()&&i.namespaceId?89:-1);}}var je=class n{route=g(W);router=g(F$1);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=Mi(null);exportService=g(Q);integrationConfigState=g(O);integrationTypeController=g(_);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.paramMap.get("agentConfigId")??"";isPlatformMode=!this.namespaceId;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,n.notBlankValidator]}),instructions:new Te(null),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(false,{nonNullable:true}),loopConfig:new Te(null,{validators:[n.jsonValidator]})});static notBlankValidator(t){let e=t.value;return typeof e=="string"&&e.length>0&&e.trim().length===0?{required:true}:null}static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(i){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}delegationTimeoutHint=VC(()=>{let t=this.defaultDelegationTimeoutSeconds();return `How long each delegation launched by this agent waits without activity from the sub-agent, including its own delegations. When it runs out, the sub-agent and its active descendants are stopped and can be resumed. Leave empty to use the server default${t!==null?`: ${t} s (${t/60} min)`:""}.`});get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$2(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=VC(()=>this.executionModeValue()==="LOOP");subAgentRows=Mi([]);allSubAgentsSelected=Mi(false);subAgentCandidatesUnavailable=Mi(false);namedSubAgentSelectionDropped=VC(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=VC(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=VC(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);isExporting=Mi(false);submitError=Mi(null);ExecutionMode=$e$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Mi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}configAgentExposureWarning=VC(()=>Ke({configEnabled:this.builtInRows().some(t=>t.type===Ue&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=Mi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=Mi(false);modelAsFreeText=VC(()=>{let{aliases:t,apiNames:e}=this.modelOptions();return this.modelCatalogueLoaded()&&t.length+e.length===0});applyModelCatalogue(t,e){this.modelOptions.set(E(t,e)),this.modelCatalogueLoaded.set(true);}integrationRows=Mi([]);skillRows=Mi([]);allSkillsSelected=Mi(false);skillCatalogueUnavailable=Mi(false);namedSkillSelectionDropped=VC(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),Zs(()=>Dr(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),Gm({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Dr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:i,platformIntegrations:s,builtInTypes:m,skillCatalogue:C,delegationCandidates:E,models:I})=>{this.existingConfig=e,this.applyModelCatalogue(I,e.modelName??null),this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let f=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(f),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let N=[...s,...i];this.integrationRows.set(this.buildIntegrationRows(N,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(m,e.integrations??void 0)),this.allSubAgentsSelected.set($e(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(E,e.subAgents,e.name)),this.allSkillsSelected.set(o$1(e.skillSelectors)),this.skillRows.set(this.buildSkillRows(C,e.skillSelectors)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){Gm({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):Dr([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes(),skillCatalogue:this.loadSkillCatalogue(),delegationCandidates:this.loadDelegationCandidates(),models:this.aiModelState.listAvailable(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:i,builtInTypes:s,skillCatalogue:m,delegationCandidates:C,models:E})=>{this.applyModelCatalogue(E,null);let I=[...i,...e];this.integrationRows.set(this.buildIntegrationRows(I,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(s,t??void 0)),this.allSubAgentsSelected.set(false),this.subAgentRows.set(this.buildSubAgentRows(C,void 0,null)),this.allSkillsSelected.set(false),this.skillRows.set(this.buildSkillRows(m,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(te(e=>e.map(i=>({id:i.id??"",name:i.name,description:i.description,namespaceId:i.namespaceId??null,readOnly:i.readOnly===true}))))).pipe(Zs(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),Dr([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),m=i(s),C=new Set(t.map(f=>f.name.toLowerCase())),E=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:Mi(m.has(f.name.toLowerCase()))})),I=new Set;for(let f of s){let N=l(f).toLowerCase();C.has(N)||I.has(N)||(I.add(N),E.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:Mi(true)}));}return E}toggleSkill(t){t.selected.update(e=>!e);}toggleAllSkills(){this.allSkillsSelected.update(t=>!t);}buildSkillSelectorsPayload(){if(this.allSkillsSelected())return [r];let t=this.skillRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}loadDelegationCandidates(){let t=this.agentConfigController.listPlatformAgentsAgentConfig(false).pipe(this.orNoCandidates()),e=this.namespaceId?this.agentConfigController.listByParentAgentConfig(this.namespaceId,false).pipe(this.orNoCandidates()):Dr([]);return Gm({platform:t,namespace:e}).pipe(te(({platform:i,namespace:s})=>[...i,...s]),te(i=>i.map(s=>s.name).filter(s=>s.length>0)),te(i=>n.dedupeByKey(i)))}orNoCandidates(){return Zs(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),Dr([])))}static dedupeByKey(t){let e=new Set;return t.filter(i=>{let s=i.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,i){let s=Ge(e),m=i?.toLowerCase()??null,C=t.filter(_=>{let O=_.toLowerCase();return O!==m||s.has(O)}),E=new Set(C.map(_=>_.toLowerCase())),I=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:Mi(s.has(_.toLowerCase()))})),f=new Set,N=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==F);for(let _ of N){let O=_.toLowerCase();E.has(O)||f.has(O)||(f.add(O),I.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:Mi(true)}));}return I}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(te(t=>t.filter(e=>!e.configSchema)),Zs(t=>(console.error("[agent-config-form] failed to load integration types",t),Dr([]))))}buildIntegrationRows(t,e){return t.map(i=>{let s=i.name??"",m=e?.[s],C=e!=null&&s in e,E=Array.isArray(m)?m.join(", "):"";return {config:i,enabled:Mi(C),toolsControl:new Te(E,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(i=>{let s=e!=null&&i.type in e,m=e?.[i.type],C=s?Array.isArray(m)&&m.length===0?"off":"on":"default";return {type:i.type,displayName:i.displayName,description:i.description,enabledByDefault:i.enabledByDefault===true,state:Mi(C),restrictedTools:Array.isArray(m)&&m.length>0?m:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();if(!t)return;let e=this.subAgentRows().find(i=>i.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===F?this.allSubAgentsSelected.set(true):this.subAgentRows.update(i=>this.withPatternGrants([...i,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:Mi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(i=>this.withPatternGrants(i.filter(s=>s.selector.toLowerCase()!==e)));}toggleSubAgent(t){t.selected.update(e=>!e),t.pattern&&this.subAgentRows.update(e=>this.withPatternGrants(e));}withPatternGrants(t){let e=this.allSubAgentsSelected()?[]:t.filter(i=>i.selected()).map(i=>i.selector);return t.map(i=>i.unresolved?i:x(w({},i),{grantedByPattern:Y(i.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [F];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let i of this.integrationRows().filter(s=>s.enabled())){let s=i.config.name??"",m=i.toolsControl.value.trim();t[s]=m===""?null:m.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let i of this.builtInRows()){let s=i.state();s==="on"?t[i.type]=i.restrictedTools??null:s==="off"&&(t[i.type]=[]);}let e=new Set([...this.integrationRows().map(i=>i.config.name??""),...this.builtInRows().map(i=>i.type)]);for(let[i,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(i)||(t[i]=s);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.submitError.set(null),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),skillSelectors:this.buildSkillSelectorsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(false),this.submitError.set(n.serverMessage(i));}});}static serverMessage(t){let i=t?.error?.message;if(typeof i=="string"&&i.trim().length>0)return i;let s=t?.status;return s===0?"The server could not be reached. The agent was not saved.":typeof s=="number"&&s>=500?`The server failed to save the agent (HTTP ${s}). Nothing was changed.`:"The server refused the save and gave no reason. Check the values and try again."}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(i),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"agent"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=ew({type:n,selectors:[["agentos-agent-config-form"]],decls:8,vars:4,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required",""],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",3,"formControl"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","Description","controlId","agent-config-description"],["dsControl","","id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",3,"formControl"],["label","Model","controlId","agent-config-model-name","required","","hint","Aliases are matched first, then API model names. Resolved when the agent runs."],["dsControl","","id","agent-config-model-name","type","text","placeholder","Model alias or name to use, e.g. BIG","autocomplete","off",3,"formControl"],["dsControl","","id","agent-config-model-name",3,"formControl"],["label","Instructions","controlId","agent-config-instructions"],["dsControl","","id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",3,"formControl"],["legend","Integrations","hint","Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration."],["legend","Skills"],["type","checkbox",3,"change","checked"],[1,"ds-strong"],[1,"ds-code"],["tone","warning"],["label","Execution mode","controlId","agent-config-execution-mode","hint",'SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks and requires a model that supports advanced execution, otherwise the agent fails to run. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu.'],["dsControl","","id","agent-config-execution-mode",3,"formControl"],[3,"value"],["label","Loop configuration (JSON)","controlId","agent-config-loop-config",3,"error"],["legend","Sub-agents"],[1,"ds-inline"],["dsControl","","type","text","aria-label","New sub-agent pattern","placeholder","e.g. *Fixer","autocomplete","off",3,"keydown.enter","formControl"],["dsButton","","variant","icon","type","button","title","Add pattern","aria-label","Add pattern",3,"click","disabled"],["label","Delegation timeout (seconds)","controlId","delegation-timeout","hintId","delegation-timeout-hint","errorId","delegation-timeout-error",3,"hint","error"],["dsControl","","id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],[3,"namespaceId","agentId"],["disabled","",3,"ngValue"],[3,"ngValue"],["label","Aliases"],["label","API model names"],[1,"ds-meta"],["dsControl","","type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"ds-indent",3,"formControl"],[1,"ds-micro"],["dsControl","",1,"ds-indent","ds-control--auto",3,"change","id","value"],["value","default"],["value","on"],["value","off"],["type","checkbox",3,"change","checked","disabled"],["dsControl","","mono","","id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",3,"placeholder","formControl"],["dsCheck","",1,"ds-grow"],["dsButton","","variant","icon-danger","type","button","title","Remove"],["dsButton","","variant","icon-danger","type","button","title","Remove",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,i){e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return i.cancel()}),pC(3," \u2190 Agent configs "),zu(),Iw(4,Xe,2,1,"a",2),Iw(5,Qe,2,0,"ds-tag",3),zu(),Iw(6,Ze,2,0,"p",4)(7,$t,90,34),zu()),e&2&&(IE(),Vh("title",i.isEditMode()?"Edit agent config":"New agent config"),IE(3),ww(i.isEditMode()?4:-1),IE(),ww(i.isPlatformMode?5:-1),IE(),ww(i.isLoading()?6:7));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t$1,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao,q],encapsulation:2})};export{je as AgentConfigFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {r as k$1,O,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,at as F$1,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,R as Rw,h as Bh,P as Pd,n as Ld}from'./main-OQ262YIZ.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(os(0,"p",3),pC(1),zu()),i&2){let t=Lw();IE(),lg(t.deletion.error());}}function U(i,e){i&1&&(os(0,"p",4),pC(1,"Loading AI providers\u2026"),zu());}function j(i,e){i&1&&(os(0,"p",5),pC(1,"No platform AI providers defined yet."),zu());}function K(i,e){i&1&&(os(0,"p",4),pC(1,"No AI providers match the current filter."),zu());}function H(i,e){if(i&1){let t=Rw();os(0,"button",19),qh("click",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.edit(s))}),pC(1," Edit "),zu();}if(i&2){let t=Lw().$implicit;Bh("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=Rw();os(0,"agentos-row-delete-action",20),qh("deleteRequested",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.deletion.request(s.id))})("deleteConfirmed",function(){Pd(t);let s=Lw().$implicit,m=Lw(2);return Ld(m.confirmDelete(s))})("deleteCancelled",function(){Pd(t);let s=Lw(3);return Ld(s.deletion.cancel())}),zu();}if(i&2){let t=Lw().$implicit,r=Lw(2);Vh("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(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)(8,"div",16),Iw(9,H,2,1,"button",17),Iw(10,z,1,3,"agentos-row-delete-action",18),zu()()()),i&2){let t=e.$implicit,r=Lw(2);IE(2),lg(t.name),IE(2),lg(t.apiType),IE(2),lg(t.baseUrl||"\u2014"),IE(3),ww(r.deletion.confirmingId()!==t.id?9:-1),IE(),ww(t.id?10:-1);}}function J(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,"API type"),zu(),os(8,"th",10),pC(9,"Base URL"),zu(),os(10,"th",10)(11,"span",11),pC(12,"Actions"),zu()()()(),os(13,"tbody",8),Tw(14,G,11,5,"tr",9,B),zu()()()),i&2){let t=Lw();IE(14),_w(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(we);aiProviderController=g(F$1);refresh$=new vr(void 0);isLoading=Mi(true);deletion=k$1();providers=Mi([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ys(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))),U$1(this.destroyRef)).subscribe({next:e=>{this.providers.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-platform-ai-providers"]],decls:9,vars:3,consts:[["title","Platform AI providers","description","AI providers shared across every namespace."],["label","Filter AI providers","placeholder","Filter AI providers\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI providers"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","API type"],["role","cell","data-label","Base URL",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,r){t&1&&(os(0,"ds-section-header",0)(1,"agentos-table-filter",1),qh("queryChange",function(m){return r.rowFilter.query.set(m)}),zu(),os(2,"button",2),qh("click",function(){return r.openCreateForm()}),pC(3,"New AI provider"),zu()(),Iw(4,M,2,1,"p",3),Iw(5,U,2,0,"p",4)(6,j,2,0,"p",5)(7,K,2,0,"p",4)(8,J,16,0,"div",6)),t&2&&(IE(),Vh("query",r.rowFilter.query()),IE(3),ww(r.deletion.error()?4:-1),IE(),ww(r.isLoading()?5:r.providers().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{k as PlatformAiProvidersComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q as q$1}from'./chunk-CpLFr6wl.js';import'./chunk-Bv223hQn.js';import'./chunk-t-Kfnaoc.js';import {v as vn,d as yn,l as dn,_ as _n,i as at,m as mn,G as Ni,H as On}from'./chunk-DvtbHzPu.js';import {g,W as W$1,F,v as we,ak as U$1,M as Mi,i as VC,x as U$2,a as ew,ax as $t,o as os,K as qh,b as pC,z as zu,I as Iw,c as IE,J as Vh,w as ww,L as Lw,l as lg,r as rg,Y as Yu,T as Tw,_ as _w,H as Hh,R as Rw,a0 as RC,ay as kC,P as Pd,n as Ld,az as xD}from'./main-OQ262YIZ.js';var z=(t,n)=>n.id,q=(t,n)=>n.name;function Q(t,n){t&1&&(os(0,"p",3),pC(1,"Loading\u2026"),zu());}function W(t,n){t&1&&(os(0,"ds-notice"),pC(1,"Failed to load agent definition."),zu());}function X(t,n){if(t&1&&(os(0,"dt"),pC(1,"User context"),zu(),os(2,"dd",6),pC(3),zu()),t&2){let e=Lw();IE(3),lg(e.userId);}}function Y(t,n){if(t&1){let e=Rw();os(0,"ds-card")(1,"ds-disclosure",13),qh("toggled",function(){Pd(e);let m=Lw(2);return Ld(m.toggleSystemPrompt())}),os(2,"pre",14),pC(3),zu()()();}if(t&2){let e=Lw(),d=Lw();IE(),Vh("open",!d.systemPromptCollapsed()),IE(2),lg(e.systemPrompt);}}function Z(t,n){if(t&1){let e=Rw();os(0,"ds-card")(1,"ds-disclosure",15),qh("toggled",function(){Pd(e);let m=Lw(2);return Ld(m.toggleInstructions())}),os(2,"pre",14),pC(3),zu()()();}if(t&2){let e=Lw(),d=Lw();IE(),Vh("open",!d.instructionsCollapsed()),IE(2),lg(e.instructions);}}function ee(t,n){t&1&&(os(0,"p",3),pC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),zu());}function te(t,n){t&1&&(os(0,"span",18),pC(1,"platform"),zu());}function ne(t,n){t&1&&(os(0,"span",18),pC(1,"SKILL.md"),zu());}function ie(t,n){if(t&1&&(os(0,"li",16)(1,"span")(2,"span",17),pC(3),zu(),Iw(4,te,2,0,"span",18),Iw(5,ne,2,0,"span",18),zu(),os(6,"p",3),pC(7),zu()()),t&2){let e=n.$implicit;IE(3),lg(e.name),IE(),ww(e.namespaceId?-1:4),IE(),ww(e.readOnly?5:-1),IE(2),lg(e.description);}}function oe(t,n){if(t&1&&(os(0,"ul",11),Tw(1,ie,8,4,"li",16,z),zu()),t&2){let e=Lw(2);IE(),_w(e.resolvedSkills());}}function ae(t,n){t&1&&(os(0,"p",3),pC(1,"No tools available for this agent."),zu());}function de(t,n){if(t&1&&(Hh(0,"div",20),RC(1,"agentosMarkdown")),t&2){let e=Lw().$implicit;Vh("innerHTML",kC(1,1,e.description),xD);}}function re(t,n){if(t&1){let e=Rw();os(0,"li")(1,"ds-disclosure",19),qh("toggled",function(){let m=Pd(e).$implicit,j=Lw(3);return Ld(j.toggleTool(m))}),Iw(2,de,2,3,"div",20),os(3,"pre",21),pC(4),zu()()();}if(t&2){let e=n.$implicit,d=Lw(3);IE(),Vh("heading",e.name)("open",d.isToolExpanded(e)),IE(),ww(e.description?2:-1),IE(2),lg(d.formatSchema(e.inputSchema));}}function se(t,n){if(t&1&&(os(0,"ul",11),Tw(1,re,5,4,"li",null,q),zu()),t&2){let e=Lw();IE(),_w(e.tools);}}function le(t,n){if(t&1&&Hh(0,"agentos-agent-messaging",12),t&2){let e=Lw(2);Vh("namespaceId",e.namespaceId)("agentId",e.agentConfigId);}}function ce(t,n){if(t&1&&(os(0,"ds-card",4)(1,"dl",5)(2,"dt"),pC(3,"Name"),zu(),os(4,"dd"),pC(5),zu(),os(6,"dt"),pC(7,"Resolved model"),zu(),os(8,"dd",6),pC(9),zu(),os(10,"dt"),pC(11,"Provider"),zu(),os(12,"dd"),pC(13),zu(),os(14,"dt",7),pC(15,"Execution mode"),zu(),os(16,"dd",8)(17,"span",9),pC(18),zu()(),Iw(19,X,4,1),zu()(),Iw(20,Y,4,2,"ds-card"),Iw(21,Z,4,2,"ds-card"),os(22,"ds-card",10),Iw(23,ee,2,0,"p",3)(24,oe,3,0,"ul",11),zu(),os(25,"ds-card",10),Iw(26,ae,2,0,"p",3)(27,se,3,0,"ul",11),zu(),Iw(28,le,1,2,"agentos-agent-messaging",12)),t&2){let e=n,d=Lw();IE(5),lg(e.name),IE(4),lg(e.resolvedModelApiName),IE(4),lg(e.resolvedProviderName),IE(4),rg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),IE(),Yu(" ",e.executionMode," "),IE(),ww(e.userId?19:-1),IE(),ww(e.systemPrompt?20:-1),IE(),ww(e.instructions?21:-1),IE(),Vh("heading","Skills ("+d.resolvedSkills().length+")"),IE(),ww(d.resolvedSkills().length===0?23:24),IE(2),Vh("heading","Tools ("+e.tools.length+")"),IE(),ww(e.tools.length===0?26:27),IE(2),ww(d.namespaceId?28:-1);}}var U=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Mi(true);hasError=Mi(false);definition=Mi(null);expandedTools=Mi(new Set);resolvedSkills=VC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Mi(true);instructionsCollapsed=Mi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$2(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let d=new Set(e);return d.has(n.name)?d.delete(n.name):d.add(n.name),d});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ew({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],[3,"namespaceId","agentId"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,d){if(e&1&&(os(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),qh("click",function(){return d.back()}),pC(3," \u2190 Agent configs "),zu(),os(4,"a",2),pC(5,"Edit config \u2192"),zu()(),Iw(6,Q,2,0,"p",3)(7,W,2,0,"ds-notice")(8,ce,29,14),zu()),e&2){let m;IE(4),Vh("routerLink",d.editRoute()),IE(2),ww(d.isLoading()?6:d.hasError()?7:(m=d.definition())?8:-1,m);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ni,q$1,On],encapsulation:2})};export{U as AgentConfigInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,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,h as hn,i as at,u as un}from'./chunk-BeAWBIRs.js';import {g,W,t as F,I as J,K as we,o as oT,$ as $i,O as Of,U,L as w,N as x,D as Dw,E as Es,f as fg,a as Bw,c as hl,P as dg,d as VE,i as Vw,b as AC,Q as Qw,R as vg,S as NI,q as $w,v as tC,T as AI,n as lg,z as zw,u as Dl,F as Fg,w as pf,x as hf}from'./main-P6EOYPYG.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),AC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),AC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),VE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Qw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=tC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),NI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),NI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),NI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),NI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),NI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),NI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),NI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=tC();return hf(se.onMaxToolRoundsInput(p))}),hl(),NI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),$w(19,he,2,2,"option",23,ce),hl(),NI(),hl(),Es(21,"ds-form-actions")(22,"button",24),AC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=tC();return hf(p.cancel())}),AC(25,"Cancel"),hl()()();}if(i&2){let e=tC();dg("formGroup",e.form),VE(2),dg("formControl",e.nameControl),AI(),VE(2),dg("formControl",e.descriptionControl),AI(),VE(2),dg("formControl",e.externalIdControl),AI(),VE(2),dg("formControl",e.defaultAgentNameControl),AI(),VE(2),dg("formControl",e.configPathControl),AI(),VE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),VE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),AI(),VE(),dg("hint",e.runCostThresholdHint()),VE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),AI(),VE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),VE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),AI(),VE(2),dg("formControl",e.adminCaseListingControl),AI(),VE(),zw(e.adminCaseListingOptions),VE(3),dg("disabled",e.form.invalid||e.isSubmitting()),VE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=oT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=oT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=oT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=oT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Dw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),Bw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),VE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),VE(),Vw(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
|
|
1
|
+
import {f,y,p as pt,T as Te,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,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,h as hn,i as at,u as un}from'./chunk-DvtbHzPu.js';import {g,W,F,u as L,v as we,i as VC,M as Mi,s as sf,x as U,C as w,E as x,a as ew,o as os,H as Hh,I as Iw,z as zu,J as Vh,c as IE,w as ww,b as pC,R as Rw,K as qh,N as lI,T as Tw,L as Lw,Q as fI,h as Bh,_ as _w,Y as Yu,l as lg,P as Pd,n as Ld}from'./main-OQ262YIZ.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(os(0,"p",2),pC(1,"Loading\u2026"),zu());}function he(i,t){if(i&1&&(os(0,"option",23),pC(1),zu()),i&2){let e=t.$implicit;Vh("value",e.value),IE(),lg(e.label);}}function pe(i,t){if(i&1){let e=Rw();os(0,"form",4),qh("ngSubmit",function(){Pd(e);let p=Lw();return Ld(p.submit())}),os(1,"ds-form-field",5),Hh(2,"input",6),lI(),zu(),os(3,"ds-form-field",7),Hh(4,"textarea",8),lI(),zu(),os(5,"ds-form-field",9),Hh(6,"input",10),lI(),zu(),os(7,"ds-form-field",11),Hh(8,"input",12),lI(),zu(),os(9,"ds-form-field",13),Hh(10,"input",14),lI(),zu(),os(11,"ds-form-field",15),Hh(12,"input",16),lI(),zu(),os(13,"ds-form-field",17),Hh(14,"input",18),lI(),zu(),os(15,"ds-form-field",19)(16,"input",20),qh("input",function(p){Pd(e);let se=Lw();return Ld(se.onMaxToolRoundsInput(p))}),zu(),lI(),zu(),os(17,"ds-form-field",21)(18,"select",22),Tw(19,he,2,2,"option",23,ce),zu(),lI(),zu(),os(21,"ds-form-actions")(22,"button",24),pC(23),zu(),os(24,"button",25),qh("click",function(){Pd(e);let p=Lw();return Ld(p.cancel())}),pC(25,"Cancel"),zu()()();}if(i&2){let e=Lw();Vh("formGroup",e.form),IE(2),Vh("formControl",e.nameControl),fI(),IE(2),Vh("formControl",e.descriptionControl),fI(),IE(2),Vh("formControl",e.externalIdControl),fI(),IE(2),Vh("formControl",e.defaultAgentNameControl),fI(),IE(2),Vh("formControl",e.configPathControl),fI(),IE(),Vh("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),IE(),Vh("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),Bh("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),fI(),IE(),Vh("hint",e.runCostThresholdHint()),IE(),Vh("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),fI(),IE(),Vh("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),IE(),Vh("formControl",e.maxToolRoundsControl),Bh("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),fI(),IE(2),Vh("formControl",e.adminCaseListingControl),fI(),IE(),_w(e.adminCaseListingOptions),IE(3),Vh("disabled",e.form.invalid||e.isSubmitting()),IE(),Yu(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(L);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=VC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=VC(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=VC(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=VC(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[bn.min(fe),bn.max(ge),bn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=Mi(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Mi(false);isSubmitting=Mi(false);isLoading=Mi(false);existingNamespace=null;constructor(){sf(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ew({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(os(0,"ds-page",0),Hh(1,"ds-section-header",1),Iw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),zu()),e&2&&(Vh("framed",!u.isEditMode()),IE(),Vh("title",u.isEditMode()?"Edit namespace":"New namespace"),IE(),ww(u.isLoading()?2:3));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,hn,at,un],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,
|
|
1
|
+
import {g,aR as ge,aa as k}from'./main-OQ262YIZ.js';var o=class r{skillController=g(ge);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=k({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
|