@whoz-oss/coday-client 0.0.0-workstream-forge.331 → 0.0.0-workstream-forge.333
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-DWek3Vvq.js → chunk-6mUiLq7J.js} +1 -1
- package/browser/{chunk-DkyYa4dP.js → chunk-B-OAcK88.js} +1 -1
- package/browser/{chunk-BKhg9cS8.js → chunk-B4TFcXLM.js} +1 -1
- package/browser/{chunk-BavZR8IQ.js → chunk-BHOnk9dZ.js} +1 -1
- package/browser/{chunk-C1_rbGUZ.js → chunk-BJmE-e06.js} +1 -1
- package/browser/{chunk-CIvkifuI.js → chunk-BNlIgcoJ.js} +1 -1
- package/browser/{chunk-e7Cu5bcW.js → chunk-BbV-6v9m.js} +1 -1
- package/browser/{chunk-DYliL6RV.js → chunk-Bcce-bFp.js} +1 -1
- package/browser/{chunk-BlUH8PiL.js → chunk-Beo5PU-L.js} +1 -1
- package/browser/{chunk-COjy9LwT.js → chunk-Bg57XyTu.js} +1 -1
- package/browser/{chunk-B6jlYkdc.js → chunk-BrHnLuhR.js} +1 -1
- package/browser/{chunk-BqhXRTE9.js → chunk-BwLbh1qu.js} +1 -1
- package/browser/{chunk-qDmjJRtz.js → chunk-C0YXwJjR.js} +1 -1
- package/browser/{chunk-CpG1Ps_f.js → chunk-C9tPnPS4.js} +1 -1
- package/browser/{chunk-D3RGHIPo.js → chunk-CCh_OPVX.js} +1 -1
- package/browser/{chunk-CQ2iuB3y.js → chunk-CDBtestp.js} +1 -1
- package/browser/chunk-CDHKd9K7.js +1 -0
- package/browser/{chunk-B1OueUuF.js → chunk-COOSrT79.js} +1 -1
- package/browser/{chunk-D_M6An-F.js → chunk-CQHpkwQM.js} +1 -1
- package/browser/{chunk-Ckqsw6_o.js → chunk-CSx6JB9H.js} +1 -1
- package/browser/{chunk-Dcb_-BFl.js → chunk-Ccyz6wFl.js} +1 -1
- package/browser/chunk-CfOL-lBl.js +1 -0
- package/browser/{chunk-AhABNqjK.js → chunk-CgeaInf7.js} +1 -1
- package/browser/chunk-CgqBKCnj.js +1 -0
- package/browser/{chunk-CDX2y9HT.js → chunk-Ch2iBggu.js} +1 -1
- package/browser/{chunk-BMIorvab.js → chunk-Cm318Wo9.js} +1 -1
- package/browser/{chunk-B5p0JRDM.js → chunk-CpI8ncwF.js} +3 -3
- package/browser/{chunk-5OWiGx2T.js → chunk-Cuqd2uDM.js} +1 -1
- package/browser/{chunk-iK8_dXTN.js → chunk-DB2bxpGQ.js} +1 -1
- package/browser/{chunk-YF5daR1e.js → chunk-DMs5vJQk.js} +1 -1
- package/browser/{chunk-BlzRRx1g.js → chunk-DeqenSfb.js} +1 -1
- package/browser/{chunk-UAQkvwE0.js → chunk-Dkj7Qoc6.js} +1 -1
- package/browser/{chunk-DLcXOMHn.js → chunk-DpVoIhsX.js} +1 -1
- package/browser/chunk-DtU71v04.js +1 -0
- package/browser/{chunk-j4fMa8e9.js → chunk-FlY1WFmu.js} +1 -1
- package/browser/chunk-HF1eX5Ac.js +1 -0
- package/browser/{chunk-Cyw_OgWI.js → chunk-Q2UK3YgL.js} +1 -1
- package/browser/{chunk-BBuC4eJi.js → chunk-Y2mmZKGJ.js} +1 -1
- package/browser/{chunk-DWmkj7eC.js → chunk-a2QnJZlG.js} +1 -1
- package/browser/{chunk-B7gZ0xoB.js → chunk-dtQD_YKT.js} +1 -1
- package/browser/{chunk-DFVMmbfW.js → chunk-iMU-ddhD.js} +1 -1
- package/browser/{chunk-BmUmjEM2.js → chunk-kV38ck51.js} +1 -1
- package/browser/{chunk-CHST_8Lf.js → chunk-ksmj50i0.js} +1 -1
- package/browser/{chunk-CA7j6SPL.js → chunk-kz1EiKNu.js} +1 -1
- package/browser/{chunk-B_4KQf9A.js → chunk-qXoQpHGN.js} +1 -1
- package/browser/chunk-sndqhEYj.js +2 -0
- package/browser/{chunk-DDr6qrWp.js → chunk-t8DlZ_sM.js} +1 -1
- package/browser/{chunk-_l0MlYG9.js → chunk-tB22Lge-.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-TMKGPCQB.js → main-GL65UOL7.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-CNX2FHwM.js +0 -2
- package/browser/chunk-CcQh1J7A.js +0 -1
- package/browser/chunk-DrR3Ei-n.js +0 -1
- package/browser/chunk-GHoS5IMW.js +0 -1
- package/browser/chunk-aP6s6v6i.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,aP as Ce,a8 as A}from'./main-
|
|
1
|
+
import {g,aP as Ce,a8 as A}from'./main-GL65UOL7.js';var o=class r{skillController=g(Ce);getById(l){return this.skillController.getByIdSkill(l)}listPlatform(){return this.skillController.listPlatformSkill()}listByNamespace(l){return this.skillController.listByParentSkill(l)}listEffective(l){return this.skillController.listEffectiveSkill(l)}create(l){return this.skillController.createSkill(l)}update(l,e){return this.skillController.updateSkill(l,e)}delete(l){return this.skillController.deleteSkill(l)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})};export{o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-DtU71v04.js';import {y}from'./chunk-CpI8ncwF.js';import {g as g$1,as as k,$ as Sr,av as _y,a1 as ma,a2 as ga,ac as _r,af as ne,aH as Jy,a7 as Ed,O as w,a8 as A}from'./main-GL65UOL7.js';var g="none",N="me",O=class p{nsController=g$1(k);userState=g$1(y);refresh$=new Sr(void 0);namespaceId$=new Sr(null);vm$=_y([this.namespaceId$,this.refresh$]).pipe(ma(([e])=>{let r=this.loadPlatformProviders().pipe(ga(()=>_r([])));return e?_y([r,this.loadNamespaceProviders(e).pipe(ga(()=>_r([]))),this.loadUserProviders(e).pipe(ga(()=>_r([]))),this.loadUserProviders("global").pipe(ga(()=>_r([])))]).pipe(ne(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):_y([r,this.loadNamespaceProviders("").pipe(ga(()=>_r([]))),this.loadUserProviders("global").pipe(ga(()=>_r([])))]).pipe(ne(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Jy({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):_r([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Ed(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Ed(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Ed(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Ed(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=A({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i as at,d as yn}from'./chunk-
|
|
1
|
+
import {i as at,d as yn}from'./chunk-CpI8ncwF.js';import {g,J as we,a4 as G,z as zi,M as U,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,r as fC,a5 as jg}from'./main-GL65UOL7.js';function P(e,n){e&1&&(Is(0,"p",2),UC(1,"Clearing the caches failed. Try again."),ml());}function S(e,n){if(e&1&&UC(0),e&2){let t=fC();jg(" ",t.clearedCount()," ",t.clearedCount()===1?"directory":"directories"," cleared. Files will be read again on next access. ");}}var x=class e{destroyRef=g(we);cacheController=g(G);isClearing=zi(false);clearedCount=zi(null);error=zi(false);clear(){this.isClearing()||(this.isClearing.set(true),this.error.set(false),this.clearedCount.set(null),this.cacheController.clearFilesystemCache().pipe(U(this.destroyRef)).subscribe({next:n=>{this.clearedCount.set(n.clearedDirectories),this.isClearing.set(false);},error:()=>{this.error.set(true),this.isClearing.set(false);}}));}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-platform-caches"]],decls:8,vars:4,consts:[["title","Caches","description","Agents, integrations, prompts, skills and AI models read from a namespace configPath are cached for 5 minutes. Clear the cache to read the files again now."],["dsButton","","variant","primary","type","button",3,"click","disabled"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"button",1),Eg("click",function(){return a.clear()}),UC(2),ml()(),Qw(3,P,2,0,"p",2),Is(4,"p",3),Qw(5,S,1,2),ml(),Is(6,"p",4),UC(7,"Only the AgentOS instance that receives the request is concerned."),ml()),t&2&&(KE(),pg("disabled",a.isClearing()),KE(),Il(" ",a.isClearing()?"Reloading\u2026":"Reload configuration files"," "),KE(),Kw(a.error()?3:-1),KE(2),Kw(a.clearedCount()!==null?5:-1));},dependencies:[at,yn],encapsulation:2})};export{x as PlatformCachesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-
|
|
1
|
+
import {O as O$1}from'./chunk-BHOnk9dZ.js';import {g,F,J as we,ah as _,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,j as fg,u as mf,w as yf}from'./main-GL65UOL7.js';import {q as k,O as O$2,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CpI8ncwF.js';import'./chunk-DtU71v04.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading integrations\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform integrations defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No integrations match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.edit(d))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.deletion.request(d.id))})("deleteConfirmed",function(){mf(n);let d=fC().$implicit,m=fC(2);return yf(m.confirmDelete(d))})("deleteCancelled",function(){mf(n);let d=fC(3);return yf(d.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Lg(n.integrationType),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Type"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);state=g(O$1);integrationConfigController=g(_);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();configs=zi([]);rowFilter=O$2(this.configs,e=>[e.name,e.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:e=>{this.configs.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.integrationConfigController.deleteIntegrationConfig(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=xw({type:t,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return r.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New integration"),ml()(),Qw(4,A,2,1,"p",3),Qw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.configs().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformIntegrationConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {q as k$2,O,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {q as k$2,O,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CpI8ncwF.js';import {g,F,J as we,as as k$1,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,j as fg,u as mf,w as yf}from'./main-GL65UOL7.js';var B=(i,e)=>e.id??e.name;function M(i,e){if(i&1&&(Is(0,"p",3),UC(1),ml()),i&2){let t=fC();KE(),Lg(t.deletion.error());}}function U(i,e){i&1&&(Is(0,"p",4),UC(1,"Loading AI providers\u2026"),ml());}function j(i,e){i&1&&(Is(0,"p",5),UC(1,"No platform AI providers defined yet."),ml());}function K(i,e){i&1&&(Is(0,"p",4),UC(1,"No AI providers match the current filter."),ml());}function H(i,e){if(i&1){let t=aC();Is(0,"button",19),Eg("click",function(){mf(t);let s=fC().$implicit,m=fC(2);return yf(m.edit(s))}),UC(1," Edit "),ml();}if(i&2){let t=fC().$implicit;fg("aria-label","Edit "+t.name);}}function z(i,e){if(i&1){let t=aC();Is(0,"agentos-row-delete-action",20),Eg("deleteRequested",function(){mf(t);let s=fC().$implicit,m=fC(2);return yf(m.deletion.request(s.id))})("deleteConfirmed",function(){mf(t);let s=fC().$implicit,m=fC(2);return yf(m.confirmDelete(s))})("deleteCancelled",function(){mf(t);let s=fC(3);return yf(s.deletion.cancel())}),ml();}if(i&2){let t=fC().$implicit,r=fC(2);pg("rowKey",t.id)("rowLabel",t.name)("state",r.deletion);}}function G(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14),UC(6),ml(),Is(7,"td",15)(8,"div",16),Qw(9,H,2,1,"button",17),Qw(10,z,1,3,"agentos-row-delete-action",18),ml()()()),i&2){let t=e.$implicit,r=fC(2);KE(2),Lg(t.name),KE(2),Lg(t.apiType),KE(2),Lg(t.baseUrl||"\u2014"),KE(3),Kw(r.deletion.confirmingId()!==t.id?9:-1),KE(),Kw(t.id?10:-1);}}function J(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"API type"),ml(),Is(8,"th",10),UC(9,"Base URL"),ml(),Is(10,"th",10)(11,"span",11),UC(12,"Actions"),ml()()()(),Is(13,"tbody",8),eC(14,G,11,5,"tr",9,B),ml()()()),i&2){let t=fC();KE(14),tC(t.rowFilter.filteredRows());}}var k=class i{router=g(F);destroyRef=g(we);aiProviderController=g(k$1);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k$2();providers=zi([]);rowFilter=O(this.providers,e=>[e.name,e.apiType,e.baseUrl].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(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=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return r.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New AI provider"),ml()(),Qw(4,M,2,1,"p",3),Qw(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&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {I}from'./chunk-AhABNqjK.js';import {O}from'./chunk-BavZR8IQ.js';import {O as O$1}from'./chunk-iK8_dXTN.js';import {g,J as we$1,z as zi,k as yT,ab as F,av as _y,af as ne,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,s as aC,S as Eg,r as fC,R as pg,T as VI,l as eC,L as Lg,X as UI,t as tC,q as Il,ag as Zw,u as mf,w as yf,P as x,O as w}from'./main-TMKGPCQB.js';import {y,J as k,L as B,X as a,p as pt,T as Te$1,$ as v,a0 as V,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,a1 as gn,h as hn,i as at,u as un,m as mn,a2 as ji,F as Ni,a3 as m,a4 as S}from'./chunk-B5p0JRDM.js';import'./chunk-aP6s6v6i.js';var ve=(o,e)=>e.value,ye=(o,e)=>e.title;function be(o,e){o&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function xe(o,e){if(o&1&&(Is(0,"option",27),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Se(o,e){if(o&1&&(Is(0,"option",27),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Ee(o,e){if(o&1){let t=aC();Is(0,"form",15),Eg("ngSubmit",function(){mf(t);let s=fC(2);return yf(s.save())}),Is(1,"ds-group",16)(2,"dl",17)(3,"dt"),UC(4,"Email"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"External ID"),ml(),Is(9,"dd"),UC(10),ml()()(),Is(11,"ds-group",18)(12,"ds-form-field",19),hg(13,"input",20),VI(),ml(),Is(14,"ds-form-field",21),hg(15,"input",22),VI(),ml(),Is(16,"ds-form-field",23),hg(17,"textarea",24),VI(),ml(),Is(18,"ds-form-field",25)(19,"select",26),eC(20,xe,2,2,"option",27,ve),ml(),VI(),ml(),Is(22,"ds-form-field",28)(23,"select",29),eC(24,Se,2,2,"option",27,ve),ml(),VI(),ml()(),Is(26,"ds-form-actions")(27,"button",30),UC(28),ml(),Is(29,"button",31),Eg("click",function(){mf(t);let s=fC(2);return yf(s.cancelEditing())}),UC(30,"Cancel"),ml()()();}if(o&2){let t=fC(),l=fC();pg("formGroup",l.form),KE(6),Lg(t.email),KE(4),Lg(t.externalId),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),UI(),KE(),tC(l.languageOptions),KE(3),UI(),KE(),tC(l.promptCacheTtlOptions),KE(3),pg("disabled",l.isSaving()),KE(),Il(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Te(o,e){o&1&&(Is(0,"p",2),UC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),ml());}function De(o,e){if(o&1){let t=aC();Is(0,"span",40),UC(1,"Delete?"),ml(),Is(2,"button",41),Eg("click",function(){mf(t);let s=fC().$implicit,c=fC(5);return yf(c.confirmDelete(s))}),UC(3,"Confirm"),ml(),Is(4,"button",42),Eg("click",function(){mf(t);let s=fC(6);return yf(s.cancelDelete())}),UC(5,"Cancel"),ml();}}function Pe(o,e){if(o&1){let t=aC();Is(0,"button",42),Eg("click",function(){mf(t);let s=fC().$implicit,c=fC(5);return yf(c.armDelete(s))}),UC(1,"Delete"),ml();}}function we(o,e){if(o&1&&(Is(0,"li",36)(1,"span",37),UC(2),ml(),Is(3,"span",38),UC(4),ml(),Qw(5,De,6,0)(6,Pe,2,0,"button",39),ml()),o&2){let t=e.$implicit,l=fC(5);KE(2),Lg(t.name),KE(2),Lg(t.subtitle),KE(),Kw(l.isPendingDelete(t)?5:6);}}function Ue(o,e){if(o&1&&(Is(0,"span",34),UC(1),ml(),Is(2,"ul",35),eC(3,we,7,3,"li",36,Zw().trackEntry,true),ml()),o&2){let t=e.$implicit;KE(),Lg(t.title),KE(2),tC(t.entries);}}function Ve(o,e){if(o&1&&eC(0,Ue,5,1,null,null,ye),o&2){let t=fC(3);tC(t.recapSections());}}function Ne(o,e){if(o&1){let t=aC();Is(0,"ds-group",16)(1,"dl",17)(2,"dt"),UC(3,"Email"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"External ID"),ml(),Is(8,"dd"),UC(9),ml()()(),Is(10,"ds-group",18)(11,"dl",17)(12,"dt"),UC(13,"First name"),ml(),Is(14,"dd"),UC(15),ml(),Is(16,"dt"),UC(17,"Last name"),ml(),Is(18,"dd"),UC(19),ml(),Is(20,"dt"),UC(21,"Bio"),ml(),Is(22,"dd"),UC(23),ml(),Is(24,"dt"),UC(25,"Language"),ml(),Is(26,"dd"),UC(27),ml(),Is(28,"dt"),UC(29,"Prompt cache"),ml(),Is(30,"dd"),UC(31),ml()()(),Is(32,"ds-form-actions")(33,"button",32),Eg("click",function(){mf(t);let s=fC(2);return yf(s.startEditing())}),UC(34,"Edit profile"),ml()(),Is(35,"ds-disclosure",33),Eg("toggled",function(){mf(t);let s=fC(2);return yf(s.toggleOverrides())}),Qw(36,Te,2,0,"p",2)(37,Ve,2,0),ml();}if(o&2){let t=fC(),l=fC();KE(5),Lg(t.email),KE(4),Lg(t.externalId),KE(6),Lg(t.firstname||"\u2014"),KE(4),Lg(t.lastname||"\u2014"),KE(4),Lg(t.bio||"\u2014"),KE(4),Lg(t.preferredLanguage||"\u2014"),KE(4),Lg(l.promptCacheTtlLabel()),KE(4),pg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),KE(),Kw(l.recap().total===0?36:37);}}function Ie(o,e){if(o&1){let t=aC();Is(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setThemeVariant(s))}),ml()(),Is(3,"ds-form-field",6)(4,"ds-segmented",7),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setTheme(s))}),ml()()(),Is(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setEnterKeyBehavior(s))}),ml()()(),Is(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setShowTechnical(s))}),ml()()(),Qw(11,Ee,31,5,"form",14)(12,Ne,38,10);}if(o&2){let t=fC();KE(),pg("hint",t.activeVariantDescription()),KE(),pg("options",t.themeVariantOptions)("value",t.themeVariant()),KE(),pg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),KE(),pg("options",t.modeOptions())("value",t.shownMode()),KE(3),pg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),KE(3),pg("options",t.showTechnicalOptions)("value",t.showTechnical()),KE(),Kw(t.isEditing()?11:12);}}function Me(o,e){o&1&&(Is(0,"p",2),UC(1,"Unable to load profile."),ml());}var Ce=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=zi(false);isLoading=zi(false);isSaving=zi(false);isOverridesExpanded=zi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=yT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=yT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=yT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=yT(()=>m(this.themeVariant()).label);activeVariantDescription=yT(()=>m(this.themeVariant()).description);modeOptions=yT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=yT(()=>this.modeOverridden()?S(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];promptCacheTtlOptions=[{value:"STANDARD",label:"Standard"},{value:"EXTENDED",label:"Extended"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true}),promptCacheTtl:new Te$1("STANDARD",{nonNullable:true})});promptCacheTtlLabel=yT(()=>{let e=this.currentUser()?.promptCacheTtl??"STANDARD";return this.promptCacheTtlOptions.find(t=>t.value===e)?.label??e});recap=F(_y([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),c=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:c,authSettings:I,total:s.length+c.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=yT(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){v(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !V(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0,promptCacheTtl:this.form.controls.promptCacheTtl.value}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=zi(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??"",promptCacheTtl:e.promptCacheTtl??"STANDARD"});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["label","Prompt cache","controlId","up-promptCacheTtl","hintId","up-promptCacheTtl-hint","hint","Extended keeps the conversation cached through longer pauses (Claude models via Requesty: 1 hour instead of 5 minutes; each cache write costs more). Other models keep their provider's default."],["dsControl","","id","up-promptCacheTtl","aria-describedby","up-promptCacheTtl-hint","formControlName","promptCacheTtl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Qw(2,be,2,0,"p",2)(3,Ie,13,11)(4,Me,2,0,"p",2),ml()),t&2){let s;KE(2),Kw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,gn,hn,at,un,mn,ji,Ni],encapsulation:2})};export{Ce as UserProfileComponent};
|
|
1
|
+
import {I}from'./chunk-CgeaInf7.js';import {O}from'./chunk-BHOnk9dZ.js';import {O as O$1}from'./chunk-DB2bxpGQ.js';import {g,J as we$1,z as zi,k as yT,ab as F,av as _y,af as ne,M as U,x as xw,I as Is,a as hg,Q as Qw,m as ml,K as KE,b as Kw,U as UC,s as aC,S as Eg,r as fC,R as pg,T as VI,l as eC,L as Lg,X as UI,t as tC,q as Il,ag as Zw,u as mf,w as yf,P as x,O as w}from'./main-GL65UOL7.js';import {y,J as k,L as B,X as a,p as pt,T as Te$1,$ as v,a0 as V,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,c as fo,g as go,R as Rn,E as Ea,v as vn,d as yn,e as fn,a1 as gn,h as hn,i as at,u as un,m as mn,a2 as ji,F as Ni,a3 as m,a4 as S}from'./chunk-CpI8ncwF.js';import'./chunk-DtU71v04.js';var ve=(o,e)=>e.value,ye=(o,e)=>e.title;function be(o,e){o&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function xe(o,e){if(o&1&&(Is(0,"option",27),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Se(o,e){if(o&1&&(Is(0,"option",27),UC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),KE(),Lg(t.label);}}function Ee(o,e){if(o&1){let t=aC();Is(0,"form",15),Eg("ngSubmit",function(){mf(t);let s=fC(2);return yf(s.save())}),Is(1,"ds-group",16)(2,"dl",17)(3,"dt"),UC(4,"Email"),ml(),Is(5,"dd"),UC(6),ml(),Is(7,"dt"),UC(8,"External ID"),ml(),Is(9,"dd"),UC(10),ml()()(),Is(11,"ds-group",18)(12,"ds-form-field",19),hg(13,"input",20),VI(),ml(),Is(14,"ds-form-field",21),hg(15,"input",22),VI(),ml(),Is(16,"ds-form-field",23),hg(17,"textarea",24),VI(),ml(),Is(18,"ds-form-field",25)(19,"select",26),eC(20,xe,2,2,"option",27,ve),ml(),VI(),ml(),Is(22,"ds-form-field",28)(23,"select",29),eC(24,Se,2,2,"option",27,ve),ml(),VI(),ml()(),Is(26,"ds-form-actions")(27,"button",30),UC(28),ml(),Is(29,"button",31),Eg("click",function(){mf(t);let s=fC(2);return yf(s.cancelEditing())}),UC(30,"Cancel"),ml()()();}if(o&2){let t=fC(),l=fC();pg("formGroup",l.form),KE(6),Lg(t.email),KE(4),Lg(t.externalId),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),UI(),KE(),tC(l.languageOptions),KE(3),UI(),KE(),tC(l.promptCacheTtlOptions),KE(3),pg("disabled",l.isSaving()),KE(),Il(" ",l.isSaving()?"Saving\u2026":"Save changes"," ");}}function Te(o,e){o&1&&(Is(0,"p",2),UC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),ml());}function De(o,e){if(o&1){let t=aC();Is(0,"span",40),UC(1,"Delete?"),ml(),Is(2,"button",41),Eg("click",function(){mf(t);let s=fC().$implicit,c=fC(5);return yf(c.confirmDelete(s))}),UC(3,"Confirm"),ml(),Is(4,"button",42),Eg("click",function(){mf(t);let s=fC(6);return yf(s.cancelDelete())}),UC(5,"Cancel"),ml();}}function Pe(o,e){if(o&1){let t=aC();Is(0,"button",42),Eg("click",function(){mf(t);let s=fC().$implicit,c=fC(5);return yf(c.armDelete(s))}),UC(1,"Delete"),ml();}}function we(o,e){if(o&1&&(Is(0,"li",36)(1,"span",37),UC(2),ml(),Is(3,"span",38),UC(4),ml(),Qw(5,De,6,0)(6,Pe,2,0,"button",39),ml()),o&2){let t=e.$implicit,l=fC(5);KE(2),Lg(t.name),KE(2),Lg(t.subtitle),KE(),Kw(l.isPendingDelete(t)?5:6);}}function Ue(o,e){if(o&1&&(Is(0,"span",34),UC(1),ml(),Is(2,"ul",35),eC(3,we,7,3,"li",36,Zw().trackEntry,true),ml()),o&2){let t=e.$implicit;KE(),Lg(t.title),KE(2),tC(t.entries);}}function Ve(o,e){if(o&1&&eC(0,Ue,5,1,null,null,ye),o&2){let t=fC(3);tC(t.recapSections());}}function Ne(o,e){if(o&1){let t=aC();Is(0,"ds-group",16)(1,"dl",17)(2,"dt"),UC(3,"Email"),ml(),Is(4,"dd"),UC(5),ml(),Is(6,"dt"),UC(7,"External ID"),ml(),Is(8,"dd"),UC(9),ml()()(),Is(10,"ds-group",18)(11,"dl",17)(12,"dt"),UC(13,"First name"),ml(),Is(14,"dd"),UC(15),ml(),Is(16,"dt"),UC(17,"Last name"),ml(),Is(18,"dd"),UC(19),ml(),Is(20,"dt"),UC(21,"Bio"),ml(),Is(22,"dd"),UC(23),ml(),Is(24,"dt"),UC(25,"Language"),ml(),Is(26,"dd"),UC(27),ml(),Is(28,"dt"),UC(29,"Prompt cache"),ml(),Is(30,"dd"),UC(31),ml()()(),Is(32,"ds-form-actions")(33,"button",32),Eg("click",function(){mf(t);let s=fC(2);return yf(s.startEditing())}),UC(34,"Edit profile"),ml()(),Is(35,"ds-disclosure",33),Eg("toggled",function(){mf(t);let s=fC(2);return yf(s.toggleOverrides())}),Qw(36,Te,2,0,"p",2)(37,Ve,2,0),ml();}if(o&2){let t=fC(),l=fC();KE(5),Lg(t.email),KE(4),Lg(t.externalId),KE(6),Lg(t.firstname||"\u2014"),KE(4),Lg(t.lastname||"\u2014"),KE(4),Lg(t.bio||"\u2014"),KE(4),Lg(t.preferredLanguage||"\u2014"),KE(4),Lg(l.promptCacheTtlLabel()),KE(4),pg("heading","My global user configurations ("+l.recap().total+")")("open",l.isOverridesExpanded()),KE(),Kw(l.recap().total===0?36:37);}}function Ie(o,e){if(o&1){let t=aC();Is(0,"ds-group",3)(1,"ds-form-field",4)(2,"ds-segmented",5),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setThemeVariant(s))}),ml()(),Is(3,"ds-form-field",6)(4,"ds-segmented",7),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setTheme(s))}),ml()()(),Is(5,"ds-group",8)(6,"ds-form-field",9)(7,"ds-segmented",10),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setEnterKeyBehavior(s))}),ml()()(),Is(8,"ds-group",11)(9,"ds-form-field",12)(10,"ds-segmented",13),Eg("valueChange",function(s){mf(t);let c=fC();return yf(c.setShowTechnical(s))}),ml()()(),Qw(11,Ee,31,5,"form",14)(12,Ne,38,10);}if(o&2){let t=fC();KE(),pg("hint",t.activeVariantDescription()),KE(),pg("options",t.themeVariantOptions)("value",t.themeVariant()),KE(),pg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),KE(),pg("options",t.modeOptions())("value",t.shownMode()),KE(3),pg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),KE(3),pg("options",t.showTechnicalOptions)("value",t.showTechnical()),KE(),Kw(t.isEditing()?11:12);}}function Me(o,e){o&1&&(Is(0,"p",2),UC(1,"Unable to load profile."),ml());}var Ce=class o{userState=g(y);destroyRef=g(we$1);integrationState=g(O);providerState=g(O$1);authSettingState=g(I);themePort=g(k);preferencesPort=g(B);isEditing=zi(false);isLoading=zi(false);isSaving=zi(false);isOverridesExpanded=zi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=yT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=yT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:l})=>({value:e,label:t,description:l}));modeOverridden=yT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=yT(()=>m(this.themeVariant()).label);activeVariantDescription=yT(()=>m(this.themeVariant()).description);modeOptions=yT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=yT(()=>this.modeOverridden()?S(this.themeVariant(),this.themeMode(),false):this.themeMode());enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];promptCacheTtlOptions=[{value:"STANDARD",label:"Standard"},{value:"EXTENDED",label:"Extended"}];form=new pt({firstname:new Te$1("",{nonNullable:true}),lastname:new Te$1("",{nonNullable:true}),bio:new Te$1("",{nonNullable:true}),preferredLanguage:new Te$1("",{nonNullable:true}),promptCacheTtl:new Te$1("STANDARD",{nonNullable:true})});promptCacheTtlLabel=yT(()=>{let e=this.currentUser()?.promptCacheTtl??"STANDARD";return this.promptCacheTtlOptions.find(t=>t.value===e)?.label??e});recap=F(_y([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ne(([e,t,l])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),c=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=l.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:c,authSettings:I,total:s.length+c.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=yT(()=>{let e=this.recap();return [{title:"Integrations",entries:e.integrations},{title:"AI Providers",entries:e.aiProviders},{title:"My global auth settings",entries:e.authSettings}].filter(t=>t.entries.length>0)});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(e){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e});}setThemeVariant(e){v(e)&&this.themePort.setTheme({variant:e,mode:this.themePort.theme().mode});}isModeDisabled(e){return !V(this.themeVariant(),e)}setEnterKeyBehavior(e){this.preferencesPort.setEnterKeyBehavior(e);}setShowTechnical(e){this.preferencesPort.setShowTechnical(e);}save(){if(this.isSaving())return;this.isSaving.set(true);let e=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:e||void 0,promptCacheTtl:this.form.controls.promptCacheTtl.value}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(e=>!e),this.pendingDeleteKey.set(null);}pendingDeleteKey=zi(null);isPendingDelete(e){return this.pendingDeleteKey()===this.entryKey(e)}armDelete(e){e.id&&this.pendingDeleteKey.set(this.entryKey(e));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(e){if(!e.id)return;this.pendingDeleteKey.set(null),(e.category==="integration"?this.integrationState.delete(e.id,"userGlobal"):e.category==="authSetting"?this.authSettingState.delete(e.id,"userGlobal"):this.providerState.delete(e.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,l);}});}entryKey(e){return `${e.category}:${e.id}`}trackEntry(e,t){return this.entryKey(t)}syncFormFromState(){let e=this.currentUser();e&&this.form.setValue({firstname:e.firstname??"",lastname:e.lastname??"",bio:e.bio??"",preferredLanguage:e.preferredLanguage??"",promptCacheTtl:e.promptCacheTtl??"STANDARD"});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["framed",""],["title","My profile"],[1,"ds-hint"],["heading","Appearance"],["label","Skin",3,"hint"],["label","Skin",3,"valueChange","options","value"],["label","Mode",3,"hint"],["label","Color mode",3,"valueChange","options","value"],["heading","Composer"],["label","Enter key","hint",'In "New line" mode, press Ctrl or Cmd + Enter to send.'],["label","Enter key behavior",3,"valueChange","options","value"],["heading","Case chat"],["label","Technical logs","hint","Show system log lines (agent status, tool selection...) in the case chat."],["label","Technical logs",3,"valueChange","options","value"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["heading","Identity"],["dsDefinitionList",""],["heading","Profile"],["label","First name","controlId","up-firstname"],["dsControl","","id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name"],["label","Last name","controlId","up-lastname"],["dsControl","","id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name"],["label","Bio","controlId","up-bio"],["dsControl","","id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4"],["label","Language","controlId","up-preferredLanguage"],["dsControl","","id","up-preferredLanguage","formControlName","preferredLanguage"],[3,"value"],["label","Prompt cache","controlId","up-promptCacheTtl","hintId","up-promptCacheTtl-hint","hint","Extended keeps the conversation cached through longer pauses (Claude models via Requesty: 1 hour instead of 5 minutes; each cache write costs more). Other models keep their provider's default."],["dsControl","","id","up-promptCacheTtl","aria-describedby","up-promptCacheTtl-hint","formControlName","promptCacheTtl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsButton","","variant","primary","type","button",3,"click"],[3,"toggled","heading","open"],[1,"ds-micro"],[1,"ds-list"],[1,"ds-row"],[1,"ds-strong","ds-row__grow"],[1,"ds-meta"],["dsButton","","variant","ghost","type","button"],[1,"ds-error"],["dsButton","","variant","danger","type","button",3,"click"],["dsButton","","variant","ghost","type","button",3,"click"]],template:function(t,l){if(t&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Qw(2,be,2,0,"p",2)(3,Ie,13,11)(4,Me,2,0,"p",2),ml()),t&2){let s;KE(2),Kw(l.isLoading()?2:(s=l.currentUser())?3:4,s);}},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Rn,Ea,vn,yn,fn,gn,hn,at,un,mn,ji,Ni],encapsulation:2})};export{Ce as UserProfileComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a1 as ma,a2 as ga,ac as _r,aH as Jy}from'./main-GL65UOL7.js';function i(t,o,p){return t.pipe(ma(()=>o().pipe(ga(()=>_r(p)))),Jy({bufferSize:1,refCount:true}))}export{i};
|
|
@@ -1 +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,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-
|
|
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,k as dn,i as at,u as un,m as mn,A as Ao}from'./chunk-CpI8ncwF.js';import {g,J as we,W,H as L,z as zi,M as U,x as xw,I as Is,a as hg,S as Eg,Q as Qw,m as ml,T as VI,U as UC,K as KE,R as pg,b as Kw,X as UI,q as Il,a6 as Ee,a7 as Ed,a8 as A,r as fC,s as aC,L as Lg,a9 as Ln,u as mf,w as yf,l as eC,t as tC}from'./main-GL65UOL7.js';var I=class e{api=g(Ee);isLoading=zi(false);result=zi(null);errorMessage=zi(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(Ed({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=A({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof Ln){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&&(Is(0,"p",14),UC(1,"Loading namespaces\u2026"),ml());}function pe(e,t){if(e&1&&(Is(0,"option",17),UC(1),ml()),e&2){let n=t.$implicit;pg("value",n.id),KE(),Lg(n.name);}}function ce(e,t){if(e&1&&(Is(0,"select",15)(1,"option",16),UC(2,"Select a namespace"),ml(),eC(3,pe,2,2,"option",17,de),ml(),VI()),e&2){let n=fC(2);UI(),KE(3),tC(n.namespaces());}}function ue(e,t){if(e&1&&Qw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=fC();Kw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&hg(0,"input",3),e&2){let n=fC();pg("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let l=fC();return yf(l.reset())}),UC(1,"Clear result"),ml();}}function ve(e,t){e&1&&(Is(0,"ds-card",12)(1,"pre",19),UC(2),ml()()),e&2&&(KE(2),Lg(t));}function ye(e,t){e&1&&(Is(0,"span",21),UC(1,"Metadata"),ml(),Is(2,"pre",19),UC(3),ml()),e&2&&(KE(3),Lg(t));}function Ce(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Type"),ml(),Is(2,"dd",23),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorType);}}function _e(e,t){if(e&1&&(Is(0,"dt"),UC(1,"Message"),ml(),Is(2,"dd"),UC(3),ml()),e&2){let n=fC(2);KE(3),Lg(n.errorMessage);}}function be(e,t){if(e&1&&(Is(0,"span",21),UC(1,"Tool error details"),ml(),Is(2,"dl",22),Qw(3,Ce,4,1),Qw(4,_e,4,1),ml()),e&2){let n=fC();KE(3),Kw(n.errorType?3:-1),KE(),Kw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Is(0,"ds-card",13)(1,"div")(2,"ds-tag",20),UC(3),ml()(),Is(4,"span",21),UC(5,"Output"),ml(),Is(6,"pre",19),UC(7),ml(),Qw(8,ye,4,1),Is(9,"span",21),UC(10,"Structured output"),ml(),Is(11,"pre",19),UC(12),ml(),Qw(13,be,5,2),ml()),e&2){let n,o=t,l=fC();pg("heading","Result \u2014 "+o.toolName),KE(2),pg("variant",o.success?"accent":"outline"),KE(),Lg(o.success?"Success":"Tool error"),KE(4),Lg(o.output),KE(),Kw((n=l.formatMetadata(o.metadata))?8:-1,n),KE(4),Lg(l.formatStructuredOutput(o.structuredOutput)??"null"),KE(),Kw(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=zi([]);namespacesLoading=zi(true);namespaceName=zi(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=xw({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&&(Is(0,"ds-page"),hg(1,"ds-section-header",0),Is(2,"form",1),Eg("ngSubmit",function(){return o.submit()}),Is(3,"ds-form-field",2),Qw(4,ue,2,1)(5,fe,1,1,"input",3),ml(),Is(6,"ds-form-field",4),hg(7,"input",5),VI(),ml(),Is(8,"ds-form-field",6),hg(9,"input",7),VI(),ml(),Is(10,"ds-form-field",8),hg(11,"textarea",9),VI(),ml(),Is(12,"ds-form-actions")(13,"button",10),UC(14),ml(),Qw(15,ge,2,0,"button",11),ml()(),Qw(16,ve,3,1,"ds-card",12),Qw(17,he,14,7,"ds-card",13),ml()),n&2){let l,v;KE(),pg("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."),KE(),pg("formGroup",o.form),KE(2),Kw(o.isPlatformMode?4:5),KE(3),UI(),KE(2),UI(),KE(2),UI(),KE(2),pg("disabled",o.form.invalid||o.state.isLoading()),KE(),Il(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),KE(),Kw(o.state.result()||o.state.errorMessage()?15:-1),KE(),Kw((l=o.state.errorMessage())?16:-1,l),KE(),Kw((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 {o as o$1,r,i as i$1,l}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-Cuqd2uDM.js';import {i,A as A$1}from'./chunk-CfOL-lBl.js';import {O}from'./chunk-BHOnk9dZ.js';import {g,W,F,J as we,ai as U,aA as N,z as zi,aB as K,aa as J,k as yT,ab as F$1,aC as QB,aD as Ne,M as U$1,a2 as ga,ac as _r,ae as Ny,af as ne,P as x,O as w,x as xw,aw as $t$1,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,aE as Sg,aF as DC,r as fC,s as aC,a as hg,T as VI,u as mf,w as yf,X as UI,c as xg,j as fg,q as Il,l as eC,t as tC,L as Lg,a5 as jg}from'./main-GL65UOL7.js';import {H as A,p as pt$1,T as Te,b as bn,I as E,K as Kt$1,a as fd,M as Mo,D as Do,U as Ut$1,P as Pn,o 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,l as pn,h as hn,_ as _n,i as at$1,u as un,n as cn,A as Ao}from'./chunk-CpI8ncwF.js';import'./chunk-DtU71v04.js';var D="*";function We(i){return (i??[]).some(t=>t.trim()===D)}function Je(i){let t=(i??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D).map(e=>e.toLowerCase());return new Set(t)}function j(i){return i.includes(D)}function Ze(i){let t=i.replace(/[\\.[\]{}()^$|]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${t}$`,"i")}catch(e){return null}}function Y(i,t){return (t??[]).map(e=>e.trim()).filter(e=>e.length>0&&e!==D&&j(e)).some(e=>Ze(e)?.test(i)??false)}var qe="AGENTOS_CONFIG",et=new Set(["HTTP_API","MCP_HTTP","MCP_STDIO","BASH","TMUX","GIT"]);function Ye(i){return i.configEnabled&&(i.hasSubAgents||i.integrationTypes.some(t=>et.has(t)))}var tt=["instructionsTextarea"],Qe=(i,t)=>t.value,nt=(i,t)=>t.config.id,it=(i,t)=>t.type,Xe=(i,t)=>t.selector;function ot(i,t){if(i&1&&(Is(0,"a",3),UC(1,"View resolved definition \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function at(i,t){i&1&&(Is(0,"ds-tag",4),UC(1,"Platform level"),ml());}function lt(i,t){i&1&&(Is(0,"p",5),UC(1,"Loading\u2026"),ml());}function rt(i,t){if(i&1&&(hg(0,"input",18),VI()),i&2){let e=fC(2);pg("formControl",e.modelNameControl),UI();}}function st(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t;pg("ngValue",e.value),KE(),Lg(e.label);}}function dt(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function ct(i,t){if(i&1&&(Is(0,"optgroup",46),eC(1,dt,2,2,"option",45,Qe),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().aliases);}}function ut(i,t){if(i&1&&(Is(0,"option",45),UC(1),ml()),i&2){let e=t.$implicit;pg("ngValue",e.value),KE(),Lg(e.label);}}function mt(i,t){if(i&1&&(Is(0,"optgroup",47),eC(1,ut,2,2,"option",45,Qe),ml()),i&2){let e=fC(3);KE(),tC(e.modelOptions().apiNames);}}function gt(i,t){if(i&1&&(Is(0,"select",19)(1,"option",44),UC(2,"Select a model"),ml(),Qw(3,st,2,2,"option",45),Qw(4,ct,3,0,"optgroup",46),Qw(5,mt,3,0,"optgroup",47),ml(),VI()),i&2){let e,n=fC(2);pg("formControl",n.modelNameControl),UI(),KE(),pg("ngValue",null),KE(2),Kw((e=n.modelOptions().current)?3:-1,e),KE(),Kw(n.modelOptions().aliases.length>0?4:-1),KE(),Kw(n.modelOptions().apiNames.length>0?5:-1);}}function pt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.config.integrationType);}}function ft(i,t){if(i&1&&(hg(0,"input",49),VI()),i&2){let e=fC().$implicit;pg("formControl",e.toolsControl),fg("aria-label","Tools of "+e.config.name),UI();}}function Ct(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",27),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleIntegration(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,pt,2,1,"span",48),ml(),Qw(6,ft,1,2,"input",49),ml();}if(i&2){let e=t.$implicit;KE(2),pg("checked",e.enabled()),KE(2),Lg(e.config.name),KE(),Kw(e.config.integrationType?5:-1),KE(),Kw(e.enabled()?6:-1);}}function _t(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Il(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ht(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",28),UC(2),Is(3,"span",48),UC(4,"built-in"),ml()(),Is(5,"select",51),Eg("change",function(s){let u=mf(e).$implicit,C=fC(4);return yf(C.setBuiltInState(u,s.target.value))}),Is(6,"option",52),UC(7),ml(),Is(8,"option",53),UC(9,"Enabled"),ml(),Is(10,"option",54),UC(11,"Disabled"),ml()(),Qw(12,_t,2,1,"p",14),Is(13,"p",14),UC(14),ml()();}if(i&2){let e=t.$implicit,n=fC(4);KE(),fg("for","built-in-"+e.type),KE(),Il(" ",e.displayName," "),KE(3),pg("id","built-in-"+e.type)("value",e.state()),KE(2),Lg(n.builtInDefaultLabel(e)),KE(5),Kw(e.state()==="on"&&e.restrictedTools?12:-1),KE(2),Lg(e.description);}}function bt(i,t){if(i&1&&(Is(0,"span",50),UC(1,"Built-in integrations"),ml(),eC(2,ht,15,7,"div",11,it)),i&2){let e=fC(3);KE(2),tC(e.builtInRows());}}function yt(i,t){i&1&&(Is(0,"ds-notice",30),UC(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. "),ml());}function xt(i,t){if(i&1&&(Is(0,"ds-fieldset",25),eC(1,Ct,7,4,"div",11,nt),Qw(3,bt,4,0),Qw(4,yt,2,0,"ds-notice",30),ml()),i&2){let e=fC(2);KE(),tC(e.integrationRows()),KE(2),Kw(e.builtInRows().length>0?3:-1),KE(),Kw(e.configAgentExposureWarning()?4:-1);}}function vt(i,t){i&1&&UC(0," A platform config can only list platform skills here: namespace skills are resolved per namespace when the agent runs. ");}function St(i,t){i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),ml());}function At(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The skill catalogue could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function wt(i,t){i&1&&(Is(0,"p",5),UC(1,"No skill available in this scope yet."),ml());}function Et(i,t){i&1&&(Is(0,"span",48),UC(1,"platform"),ml());}function Tt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.skillCatalogueUnavailable()?"not verified":"no matching skill"," ");}}function kt(i,t){if(i&1&&(Is(0,"p",14),UC(1),ml()),i&2){let e=fC().$implicit;KE(),Lg(e.description);}}function It(i,t){if(i&1){let e=aC();Is(0,"div",11)(1,"label",12)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSkill(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,Et,2,0,"span",48),Qw(6,Tt,2,1,"span",48),ml(),Qw(7,kt,2,1,"p",14),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSkillsSelected()),KE(2),Lg(e.name),KE(),Kw(e.platform?5:-1),KE(),Kw(e.unresolved?6:-1),KE(),Kw(e.description?7:-1);}}function Mt(i,t){if(i&1&&eC(0,It,8,6,"div",11,Xe),i&2){let e=fC(2);tC(e.skillRows());}}function Ft(i,t){if(i&1&&(Is(0,"ds-form-field",34),hg(1,"textarea",56),VI(),Is(2,"p",5),UC(3," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),Is(4,"code"),UC(5,"AgentLoopPayload"),ml(),UC(6,". Leave empty if you always provide the payload at launch. "),ml()()),i&2){let e=fC(2);pg("error",e.loopConfigControl.invalid&&e.loopConfigControl.touched?"Invalid JSON \u2014 please fix the syntax.":null),KE(),pg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI();}}function Rt(i,t){i&1&&UC(0," A platform config can only list platform agents here: a namespace's agents are resolved per namespace when the agent runs. ");}function Nt(i,t){if(i&1&&UC(0),i&2){let e=fC(3);jg(" That deletes ",e.droppedUnresolvedSubAgents()," flagged ",e.droppedUnresolvedSubAgents()===1?"selector":"selectors"," nothing matched, which this form cannot restore. ");}}function Dt(i,t){if(i&1&&(Is(0,"ds-notice",30),UC(1," Saving with this on replaces the selection below with "),Is(2,"code",29),UC(3,"*"),ml(),UC(4,". "),Qw(5,Nt,1,2),ml()),i&2){let e=fC(2);KE(5),Kw(e.droppedUnresolvedSubAgents()>0?5:-1);}}function Lt(i,t){i&1&&(Is(0,"ds-notice"),UC(1," The list of agents could not be loaded. What this agent already declares is listed below and preserved on save. "),ml());}function Vt(i,t){i&1&&(Is(0,"p",5),UC(1,"No other agent is available in this scope yet."),ml());}function Pt(i,t){i&1&&(Is(0,"span",48),UC(1,"pattern"),ml());}function Ot(i,t){i&1&&(Is(0,"span",48),UC(1,"via pattern"),ml());}function Bt(i,t){if(i&1&&(Is(0,"span",48),UC(1),ml()),i&2){let e=fC(4);KE(),Il(" ",e.subAgentCandidatesUnavailable()?"not verified":"no matching agent"," ");}}function $t(i,t){if(i&1){let e=aC();Is(0,"button",59),Eg("click",function(){mf(e);let s=fC().$implicit,u=fC(3);return yf(u.removeSubAgent(s))}),UC(1," \xD7 "),ml();}if(i&2){let e=fC().$implicit;fg("aria-label","Remove "+e.selector);}}function Ut(i,t){if(i&1){let e=aC();Is(0,"div",36)(1,"label",57)(2,"input",55),Eg("change",function(){let s=mf(e).$implicit,u=fC(3);return yf(u.toggleSubAgent(s))}),ml(),Is(3,"span",28),UC(4),ml(),Qw(5,Pt,2,0,"span",48)(6,Ot,2,0,"span",48)(7,Bt,2,1,"span",48),ml(),Qw(8,$t,2,1,"button",58),ml();}if(i&2){let e=t.$implicit,n=fC(3);KE(2),pg("checked",e.selected())("disabled",n.allSubAgentsSelected()),KE(2),Lg(e.name),KE(),Kw(e.pattern?5:e.grantedByPattern?6:e.unresolved?7:-1),KE(3),Kw(e.unresolved?8:-1);}}function Gt(i,t){if(i&1&&eC(0,Ut,9,5,"div",36,Xe),i&2){let e=fC(2);tC(e.subAgentRows());}}function Ht(i,t){if(i&1){let e=aC();Is(0,"div")(1,"button",60),Eg("click",function(){mf(e);let s=fC(2);return yf(s.useDefaultDelegationTimeout())}),UC(2," Use server default "),ml()();}}function jt(i,t){i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2&&(KE(),Lg(t));}function Kt(i,t){if(i&1){let e=aC();Is(0,"button",61),Eg("click",function(){mf(e);let s=fC(2);return yf(s.exportYaml())}),UC(1),ml();}if(i&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Wt(i,t){if(i&1){let e=aC();Is(0,"form",7),Eg("ngSubmit",function(){mf(e);let s=fC();return yf(s.submit())}),Is(1,"ds-fieldset",8)(2,"ds-form-field",9),hg(3,"input",10),VI(),ml(),Is(4,"div",11)(5,"label",12),hg(6,"input",13),VI(),UC(7," Enabled "),ml(),Is(8,"p",14),UC(9,"Disabled agents are excluded from namespace resolution."),ml()(),Is(10,"ds-form-field",15),hg(11,"input",16),VI(),ml(),Is(12,"ds-form-field",17),Qw(13,rt,1,1,"input",18)(14,gt,6,5,"select",19),ml(),Is(15,"div",20)(16,"div",21)(17,"button",22),Eg("click",function(){mf(e);let s=fC();return yf(s.toggleInstructionsFullscreen())})("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),UC(18),ml()(),Is(19,"ds-form-field",23)(20,"textarea",24,0),Eg("keydown.escape",function(){mf(e);let s=fC();return yf(s.closeInstructionsFullscreen())}),ml(),VI(),ml()()(),Qw(22,xt,5,2,"ds-fieldset",25),Is(23,"ds-fieldset",26)(24,"p",5),UC(25," Instruction bundles this agent can read on demand. Selecting at least one grants it the "),Is(26,"code"),UC(27,"readSkill"),ml(),UC(28," and "),Is(29,"code"),UC(30,"readSkillResource"),ml(),UC(31," tools; selecting none grants neither. "),Qw(32,vt,1,0),ml(),Is(33,"label",12)(34,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSkills())}),ml(),Is(35,"span",28),UC(36,"Every skill in the catalogue ("),Is(37,"code",29),UC(38,"*"),ml(),UC(39,")"),ml()(),Is(40,"p",14),UC(41," Resolved at run time, so skills added later are granted too, without editing this agent. "),ml(),Qw(42,St,5,0,"ds-notice",30),Qw(43,At,2,0,"ds-notice"),Qw(44,wt,2,0,"p",5)(45,Mt,2,0),ml(),Is(46,"ds-form-field",31)(47,"select",32)(48,"option",33),UC(49,"SIMPLE \u2014 Standard agent (single LLM call)"),ml(),Is(50,"option",33),UC(51,"ADVANCED \u2014 Multi-step reasoning loop"),ml(),Is(52,"option",33),UC(53,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),ml()(),VI(),ml(),Qw(54,Ft,7,3,"ds-form-field",34),Is(55,"ds-fieldset",35)(56,"p",5),UC(57," The agents this one may delegate to. Selecting at least one grants it the "),Is(58,"code"),UC(59,"DELEGATE__delegate"),ml(),UC(60," tool; selecting none grants it no way to delegate. Entries are matched against agent names, never ids. "),Qw(61,Rt,1,0),ml(),Is(62,"label",12)(63,"input",27),Eg("change",function(){mf(e);let s=fC();return yf(s.toggleAllSubAgents())}),ml(),Is(64,"span",28),UC(65,"Every agent it can reach ("),Is(66,"code",29),UC(67,"*"),ml(),UC(68,")"),ml()(),Is(69,"p",14),UC(70," Resolved at run time, so agents added later can be delegated to as well, without editing this agent. "),ml(),Qw(71,Dt,6,1,"ds-notice",30),Qw(72,Lt,2,0,"ds-notice"),Qw(73,Vt,2,0,"p",5)(74,Gt,2,0),Is(75,"p",5),UC(76," Advanced \u2014 add a glob instead of picking a name, for example "),Is(77,"code"),UC(78,"*Fixer"),ml(),UC(79," to cover BugFixer and StoryFixer. "),ml(),Is(80,"div",36)(81,"input",37),Eg("keydown.enter",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),ml(),VI(),Is(82,"button",38),Eg("click",function(){mf(e);let s=fC();return yf(s.addSubAgent())}),UC(83," + "),ml()(),Is(84,"ds-form-field",39),hg(85,"input",40),VI(),Qw(86,Ht,3,0,"div"),ml()(),Qw(87,jt,2,1,"ds-notice"),Is(88,"ds-form-actions")(89,"button",41),UC(90),ml(),Qw(91,Kt,2,2,"button",42),Is(92,"button",43),Eg("click",function(){mf(e);let s=fC();return yf(s.cancel())}),UC(93,"Cancel"),ml()()();}if(i&2){let e,n=fC();pg("formGroup",n.form),KE(2),pg("hint",n.nameHint)("error",n.nameControl.hasError("camelCaseName")&&(n.nameControl.dirty||n.nameControl.touched)?"The name must be CamelCase (e.g. SupportAgent).":null),KE(),pg("formControl",n.nameControl),UI(),KE(3),pg("formControl",n.enabledControl),UI(),KE(5),pg("formControl",n.descriptionControl),UI(),KE(2),Kw(n.modelAsFreeText()?13:14),KE(2),xg("agent-config-instructions--fullscreen",n.instructionsFullscreen()),KE(2),fg("aria-pressed",n.instructionsFullscreen()),KE(),Il(" ",n.instructionsFullscreen()?"Exit full screen":"Full screen"," "),KE(),pg("hint",n.instructionsCounter())("error",n.instructionsError()),KE(),pg("formControl",n.instructionsControl),fg("aria-invalid",n.instructionsControl.invalid),UI(),KE(2),Kw(n.integrationRows().length>0||n.builtInRows().length>0?22:-1),KE(10),Kw(n.isPlatformMode?32:-1),KE(2),pg("checked",n.allSkillsSelected()),KE(8),Kw(n.namedSkillSelectionDropped()?42:-1),KE(),Kw(n.skillCatalogueUnavailable()?43:-1),KE(),Kw(n.skillRows().length===0?44:45),KE(3),pg("formControl",n.executionModeControl),UI(),KE(),pg("value",n.ExecutionMode.SIMPLE),KE(2),pg("value",n.ExecutionMode.ADVANCED),KE(2),pg("value",n.ExecutionMode.LOOP),KE(2),Kw(n.isLoopMode()?54:-1),KE(7),Kw(n.isPlatformMode?61:-1),KE(2),pg("checked",n.allSubAgentsSelected()),KE(8),Kw(n.namedSubAgentSelectionDropped()?71:-1),KE(),Kw(n.subAgentCandidatesUnavailable()?72:-1),KE(),Kw(n.subAgentRows().length===0?73:74),KE(8),pg("formControl",n.newSubAgentControl),UI(),KE(),pg("disabled",!n.newSubAgentControl.value.trim()),KE(2),pg("hint",n.delegationTimeoutHint())("error",n.delegationTimeoutControl.invalid?"Enter a valid positive whole number of seconds, or leave empty to inherit the server default.":null),KE(),pg("formControl",n.delegationTimeoutControl),fg("aria-invalid",n.delegationTimeoutControl.invalid),UI(),KE(),Kw(n.delegationTimeoutControl.value!==null?86:-1),KE(),Kw((e=n.submitError())?87:-1,e),KE(2),pg("disabled",n.form.invalid||n.isSubmitting()),KE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),KE(),Kw(n.isEditMode()?91:-1);}}var z=2e4,ze=class i$2{route=g(W);router=g(F);destroyRef=g(we);agentConfigController=g(U);defaultsController=g(N);defaultDelegationTimeoutSeconds=zi(null);exportService=g(K);integrationConfigState=g(O);integrationTypeController=g(J);skillState=g(o);aiModelState=g(A);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;grandfatheredName=null;nameHint=i;form=new pt$1({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1),A$1(()=>this.grandfatheredName)]}),description:new Te(null),modelName:new Te(null,{validators:[bn.required,i$2.notBlankValidator]}),instructions:new Te(null,{validators:[bn.maxLength(z)]}),executionMode:new Te("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new Te(null,{validators:[bn.min(1),bn.max(2147483647),bn.pattern(/^\d+$/)]}),enabled:new Te(true,{nonNullable:true}),loopConfig:new Te(null,{validators:[i$2.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(n){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=yT(()=>{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$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=yT(()=>this.executionModeValue()==="LOOP");static maxInstructionsLabel=z.toLocaleString("en-US");instructionsValue=F$1(this.form.controls.instructions.valueChanges,{initialValue:this.form.controls.instructions.value});instructionsLength=yT(()=>(this.instructionsValue()??"").length);instructionsCounter=yT(()=>`${this.instructionsLength().toLocaleString("en-US")} / ${i$2.maxInstructionsLabel} characters`);instructionsError=yT(()=>{let t=this.instructionsLength();return t<=z?null:`Instructions must not exceed ${i$2.maxInstructionsLabel} characters (currently ${t.toLocaleString("en-US")}).`});instructionsFullscreen=zi(false);instructionsTextarea=QB("instructionsTextarea");toggleInstructionsFullscreen(){this.instructionsFullscreen.update(t=>!t),this.instructionsTextarea()?.nativeElement.focus();}closeInstructionsFullscreen(){this.instructionsFullscreen()&&(this.instructionsFullscreen.set(false),this.instructionsTextarea()?.nativeElement.focus());}subAgentRows=zi([]);allSubAgentsSelected=zi(false);subAgentCandidatesUnavailable=zi(false);namedSubAgentSelectionDropped=yT(()=>this.allSubAgentsSelected()&&this.subAgentRows().some(t=>t.selected()));droppedUnresolvedSubAgents=yT(()=>this.allSubAgentsSelected()?this.subAgentRows().filter(t=>t.unresolved&&t.selected()).length:0);hasAnySubAgent=yT(()=>this.allSubAgentsSelected()||this.subAgentRows().some(t=>t.selected()));newSubAgentControl=new Te("",{nonNullable:true});isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);submitError=zi(null);ExecutionMode=Ne;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=zi([]);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=yT(()=>Ye({configEnabled:this.builtInRows().some(t=>t.type===qe&&t.state()==="on"),integrationTypes:this.integrationRows().filter(t=>t.enabled()).map(t=>t.config.integrationType),hasSubAgents:this.hasAnySubAgent()}));modelOptions=zi({aliases:[],apiNames:[],current:null});modelCatalogueLoaded=zi(false);modelAsFreeText=yT(()=>{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=zi([]);skillRows=zi([]);allSkillsSelected=zi(false);skillCatalogueUnavailable=zi(false);namedSkillSelectionDropped=yT(()=>this.allSkillsSelected()&&this.skillRows().some(t=>t.selected()));existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U$1(this.destroyRef),ga(()=>_r(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),Ny({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),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:n,platformIntegrations:s,builtInTypes:u,skillCatalogue:C,delegationCandidates:T,models:k})=>{this.existingConfig=e,this.applyModelCatalogue(k,e.modelName??null),this.grandfatheredName=e.name,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 L=[...s,...n];this.integrationRows.set(this.buildIntegrationRows(L,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(u,e.integrations??void 0)),this.allSubAgentsSelected.set(We(e.subAgents)),this.subAgentRows.set(this.buildSubAgentRows(T,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){Ny({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):_r([]),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:n,builtInTypes:s,skillCatalogue:u,delegationCandidates:C,models:T})=>{this.applyModelCatalogue(T,null);let k=[...n,...e];this.integrationRows.set(this.buildIntegrationRows(k,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(u,void 0));}});}loadSkillCatalogue(){return (this.namespaceId?this.skillState.listEffective(this.namespaceId):this.skillState.listPlatform().pipe(ne(e=>e.map(n=>({id:n.id??"",name:n.name,description:n.description,namespaceId:n.namespaceId??null,readOnly:n.readOnly===true}))))).pipe(ga(e=>(console.error("[agent-config-form] failed to load the skill catalogue",e),this.skillCatalogueUnavailable.set(true),_r([]))))}buildSkillRows(t,e){let s=(e??[]).map(f=>f.trim()).filter(f=>f.length>0).filter(f=>f!==r),u=i$1(s),C=new Set(t.map(f=>f.name.toLowerCase())),T=t.map(f=>({selector:f.name,name:f.name,description:f.description,platform:f.namespaceId==null,unresolved:false,selected:zi(u.has(f.name.toLowerCase()))})),k=new Set;for(let f of s){let L=l(f).toLowerCase();C.has(L)||k.has(L)||(k.add(L),T.push({selector:f,name:f,description:"",platform:false,unresolved:true,selected:zi(true)}));}return T}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()):_r([]);return Ny({platform:t,namespace:e}).pipe(ne(({platform:n,namespace:s})=>[...n,...s]),ne(n=>n.map(s=>s.name).filter(s=>s.length>0)),ne(n=>i$2.dedupeByKey(n)))}orNoCandidates(){return ga(t=>(console.error("[agent-config-form] failed to load the delegation candidates",t),this.subAgentCandidatesUnavailable.set(true),_r([])))}static dedupeByKey(t){let e=new Set;return t.filter(n=>{let s=n.toLowerCase();return e.has(s)?false:(e.add(s),true)})}buildSubAgentRows(t,e,n){let s=Je(e),u=n?.toLowerCase()??null,C=t.filter(_=>{let B=_.toLowerCase();return B!==u||s.has(B)}),T=new Set(C.map(_=>_.toLowerCase())),k=C.map(_=>({selector:_,name:_,unresolved:false,pattern:false,grantedByPattern:Y(_,e),selected:zi(s.has(_.toLowerCase()))})),f=new Set,L=(e??[]).map(_=>_.trim()).filter(_=>_.length>0&&_!==D);for(let _ of L){let B=_.toLowerCase();T.has(B)||f.has(B)||(f.add(B),k.push({selector:_,name:_,unresolved:true,pattern:j(_),grantedByPattern:false,selected:zi(true)}));}return k}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ne(t=>t.filter(e=>!e.configSchema)),ga(t=>(console.error("[agent-config-form] failed to load integration types",t),_r([]))))}buildIntegrationRows(t,e){return t.map(n=>{let s=n.name??"",u=e?.[s],C=e!=null&&s in e,T=Array.isArray(u)?u.join(", "):"";return {config:n,enabled:zi(C),toolsControl:new Te(T,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(n=>{let s=e!=null&&n.type in e,u=e?.[n.type],C=s?Array.isArray(u)&&u.length===0?"off":"on":"default";return {type:n.type,displayName:n.displayName,description:n.description,enabledByDefault:n.enabledByDefault===true,state:zi(C),restrictedTools:Array.isArray(u)&&u.length>0?u: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(n=>n.selector.toLowerCase()===t.toLowerCase());e?e.selected.set(true):t===D?this.allSubAgentsSelected.set(true):this.subAgentRows.update(n=>this.withPatternGrants([...n,{selector:t,name:t,unresolved:true,pattern:j(t),grantedByPattern:false,selected:zi(true)}])),this.newSubAgentControl.reset("");}removeSubAgent(t){let e=t.selector.toLowerCase();this.subAgentRows.update(n=>this.withPatternGrants(n.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(n=>n.selected()).map(n=>n.selector);return t.map(n=>n.unresolved?n:x(w({},n),{grantedByPattern:Y(n.name,e)}))}toggleAllSubAgents(){this.allSubAgentsSelected.update(t=>!t),this.subAgentRows.update(t=>this.withPatternGrants(t));}buildSubAgentsPayload(){if(this.allSubAgentsSelected())return [D];let t=this.subAgentRows().filter(e=>e.selected()).map(e=>e.selector);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let n of this.integrationRows().filter(s=>s.enabled())){let s=n.config.name??"",u=n.toolsControl.value.trim();t[s]=u===""?null:u.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let n of this.builtInRows()){let s=n.state();s==="on"?t[n.type]=n.restrictedTools??null:s==="off"&&(t[n.type]=[]);}let e=new Set([...this.integrationRows().map(n=>n.config.name??""),...this.builtInRows().map(n=>n.type)]);for(let[n,s]of Object.entries(this.existingConfig?.integrations??{}))e.has(n)||(t[n]=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:n=>{this.isSubmitting.set(false),this.submitError.set(i$2.serverMessage(n));}});}static serverMessage(t){let n=t?.error?.message;if(typeof n=="string"&&n.trim().length>0)return n;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 n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),u=document.createElement("a");u.href=s,u.download=`${this.existingConfig?.name??"agent"}.yaml`,u.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||i$2)};static \u0275cmp=xw({type:i$2,selectors:[["agentos-agent-config-form"]],viewQuery:function(e,n){e&1&&Sg(n.instructionsTextarea,tt,5),e&2&&DC();},decls:8,vars:4,consts:[["instructionsTextarea",""],[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,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Agent"],["label","Name","controlId","agent-config-name","required","",3,"hint","error"],["dsControl","","id","agent-config-name","type","text","placeholder","e.g. SupportAgent","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"],[1,"agent-config-instructions"],[1,"agent-config-instructions__toolbar"],["dsButton","","variant","ghost","type","button",3,"click","keydown.escape"],["label","Instructions","controlId","agent-config-instructions","hintId","agent-config-instructions-hint","errorId","agent-config-instructions-error",3,"hint","error"],["dsControl","","id","agent-config-instructions","rows","20","placeholder","Optional \u2014 system instructions for this agent","aria-describedby","agent-config-instructions-hint agent-config-instructions-error",3,"keydown.escape","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"],["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,n){e&1&&(Is(0,"ds-page")(1,"ds-section-header",1)(2,"button",2),Eg("click",function(){return n.cancel()}),UC(3," \u2190 Agent configs "),ml(),Qw(4,ot,2,1,"a",3),Qw(5,at,2,0,"ds-tag",4),ml(),Qw(6,lt,2,0,"p",5)(7,Wt,94,42,"form",6),ml()),e&2&&(KE(),pg("title",n.isEditMode()?"Edit agent config":"New agent config"),KE(3),Kw(n.isEditMode()?4:-1),KE(),Kw(n.isPlatformMode?5:-1),KE(),Kw(n.isLoading()?6:7));},dependencies:[Kt$1,fd,Mo,Do,Ut$1,Pn,Mn,Qt,fo,go,ta,Zr,Nn,Rn,$t$1,vn,yn,fn,pn,hn,_n,at$1,un,cn,Ao],styles:[".agent-config-instructions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.agent-config-instructions[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{min-height:24rem}.agent-config-instructions__toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;box-sizing:border-box;padding:1.5rem;background:var(--color-bg, #fff)}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] ds-form-field[_ngcontent-%COMP%]{flex:1;min-height:0}.agent-config-instructions--fullscreen[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{flex:1;min-height:0;resize:none}@media(max-width:760px){.agent-config-instructions--fullscreen[_ngcontent-%COMP%]{padding:.75rem}}"]})};export{ze as AgentConfigFormComponent,z as MAX_INSTRUCTIONS_LENGTH};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w as m,p as pt,W as Wt,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,N as Nn,R as Rn,E as Ea,x as yo,z as bo,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un}from'./chunk-B5p0JRDM.js';import {g,W,F,J as we,ai as U,z as zi,M as U$1,a2 as ga,ac as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,ap as Xw,r as fC,X as UI,L as Lg,t as tC,j as fg,u as mf,w as yf}from'./main-TMKGPCQB.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function fe(o,t){if(o&1&&(Is(0,"ds-form-field",20),hg(1,"input",22),ml()),o&2){let e=fC(3);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Is(0,"option",24),UC(1),ml()),o&2){let e=t.$implicit;pg("ngValue",e.id),KE(),Lg(e.name);}}function Ce(o,t){if(o&1&&(Is(0,"ds-form-field",21)(1,"select",23)(2,"option",24),UC(3,"\u2014 None \u2014"),ml(),eC(4,ge,2,2,"option",24,ce),ml(),VI(),ml()),o&2){let e=fC(3);KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Qw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=fC(2);Kw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Is(0,"p",2),UC(1,"No parameters defined."),ml());}function he(o,t){if(o&1){let e=aC();Is(0,"div",11)(1,"div",25)(2,"ds-form-field",26),hg(3,"input",27),VI(),ml(),Is(4,"ds-form-field",28),hg(5,"input",29),VI(),ml(),Is(6,"ds-form-field",30),hg(7,"input",31),VI(),ml()(),Is(8,"button",32),Eg("click",function(){let d=mf(e).$index,m=fC(2);return yf(m.removeParameter(d))}),UC(9," \xD7 "),ml()();}if(o&2){let e=t.$implicit,r=t.$index;pg("formGroupName",r),KE(2),pg("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),KE(),pg("id","param-name-"+r),UI(),KE(),pg("controlId","param-desc-"+r),KE(),pg("id","param-desc-"+r),UI(),KE(),pg("controlId","param-default-"+r)("error",e.controls.defaultValue.invalid&&e.controls.defaultValue.touched?"Default value is required.":null),KE(),pg("id","param-default-"+r),UI();}}function _e(o,t){if(o&1){let e=aC();Is(0,"div",14)(1,"span",33),UC(2),ml(),Is(3,"ds-form-field",34),hg(4,"textarea",35),VI(),ml(),Is(5,"button",36),Eg("click",function(){let d=mf(e).$index,m=fC(2);return yf(m.removeContentEntry(d))}),UC(6," \xD7 "),ml()();}if(o&2){let e=t.$implicit,r=t.$index,d=fC(2);KE(2),Lg(r+1),KE(),pg("error",e.invalid&&e.touched?"Content entry must not be blank.":null),KE(),pg("formControlName",r),fg("aria-label","Content entry "+(r+1)),UI(),KE(),pg("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Is(0,"ds-notice"),UC(1),ml()),o&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function be(o,t){if(o&1){let e=aC();Is(0,"button",37),Eg("click",function(){mf(e);let d=fC(2);return yf(d.exportYaml())}),UC(1),ml();}if(o&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let d=fC();return yf(d.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,ye,2,1),Is(6,"ds-fieldset",9)(7,"p",2),UC(8," Each parameter must have a name and a default value. Use "),Is(9,"code"),UC(10),ml(),UC(11," in content entries to reference them. "),ml(),Is(12,"div",10),Qw(13,ve,2,0,"p",2),eC(14,he,10,9,"div",11,Xw),Is(16,"div")(17,"button",12),Eg("click",function(){mf(e);let d=fC();return yf(d.addParameter())}),UC(18,"+ Add parameter"),ml()()()(),Is(19,"ds-fieldset",13)(20,"p",2),UC(21," Each content entry is a command. Use "),Is(22,"code"),UC(23,"@AgentName"),ml(),UC(24," to target an agent, "),Is(25,"code"),UC(26,"/promptName param1 param2"),ml(),UC(27," to call another prompt, and "),Is(28,"code"),UC(29),ml(),UC(30," for parameter placeholders. "),ml(),Is(31,"div",10),eC(32,_e,7,5,"div",14,Xw),Is(34,"div")(35,"button",12),Eg("click",function(){mf(e);let d=fC();return yf(d.addContentEntry())}),UC(36,"+ Add content entry"),ml()()()(),Qw(37,xe,2,1,"ds-notice"),Is(38,"ds-form-field",15),hg(39,"textarea",16),VI(),ml(),Is(40,"ds-form-actions")(41,"button",17),UC(42),ml(),Qw(43,be,2,2,"button",18),Is(44,"button",19),Eg("click",function(){mf(e);let d=fC();return yf(d.cancel())}),UC(45,"Cancel"),ml()()();}if(o&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.availableAgentConfigs().length>0?5:-1),KE(5),Lg(e.paramPlaceholderSyntax),KE(2),pg("formArrayName","parameters"),KE(),Kw(e.parametersArray.length===0?13:-1),KE(),tC(e.parametersArray.controls),KE(15),Lg(e.paramPlaceholderSyntax),KE(2),pg("formArrayName","content"),KE(),tC(e.contentArray.controls),KE(5),Kw(e.errorMessage()?37:-1),KE(),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," "),KE(),Kw(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(we);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Wt([this.createContentControl()],{validators:[bn.required]}),parameters:new Wt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);errorMessage=zi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=zi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),ga(()=>_r([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),ga(()=>_r([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[bn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return r.cancel()}),UC(3),ml()(),Qw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),ml()),e&2&&(KE(),pg("title",r.isEditMode()?"Edit prompt":"New prompt"),KE(2),Il(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),KE(),Kw(r.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Nn,Rn,Ea,yo,bo,vn,yn,fn,pn,hn,_n,at,un],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
|
|
1
|
+
import {w as m,p as pt,W as Wt,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,N as Nn,R as Rn,E as Ea,x as yo,z as bo,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un}from'./chunk-CpI8ncwF.js';import {g,W,F,J as we,ai as U,z as zi,M as U$1,a2 as ga,ac as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,ap as Xw,r as fC,X as UI,L as Lg,t as tC,j as fg,u as mf,w as yf}from'./main-GL65UOL7.js';var ce=(o,t)=>t.id;function ue(o,t){o&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function fe(o,t){if(o&1&&(Is(0,"ds-form-field",20),hg(1,"input",22),ml()),o&2){let e=fC(3);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function ge(o,t){if(o&1&&(Is(0,"option",24),UC(1),ml()),o&2){let e=t.$implicit;pg("ngValue",e.id),KE(),Lg(e.name);}}function Ce(o,t){if(o&1&&(Is(0,"ds-form-field",21)(1,"select",23)(2,"option",24),UC(3,"\u2014 None \u2014"),ml(),eC(4,ge,2,2,"option",24,ce),ml(),VI(),ml()),o&2){let e=fC(3);KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(),pg("ngValue",null),KE(2),tC(e.availableAgentConfigs());}}function ye(o,t){if(o&1&&Qw(0,fe,2,1,"ds-form-field",20)(1,Ce,6,2,"ds-form-field",21),o&2){let e=fC(2);Kw(e.isEditMode()&&e.agentConfigIdControl.value?0:e.isEditMode()?-1:1);}}function ve(o,t){o&1&&(Is(0,"p",2),UC(1,"No parameters defined."),ml());}function he(o,t){if(o&1){let e=aC();Is(0,"div",11)(1,"div",25)(2,"ds-form-field",26),hg(3,"input",27),VI(),ml(),Is(4,"ds-form-field",28),hg(5,"input",29),VI(),ml(),Is(6,"ds-form-field",30),hg(7,"input",31),VI(),ml()(),Is(8,"button",32),Eg("click",function(){let d=mf(e).$index,m=fC(2);return yf(m.removeParameter(d))}),UC(9," \xD7 "),ml()();}if(o&2){let e=t.$implicit,r=t.$index;pg("formGroupName",r),KE(2),pg("controlId","param-name-"+r)("error",e.controls.name.invalid&&e.controls.name.touched?"Parameter name is required.":null),KE(),pg("id","param-name-"+r),UI(),KE(),pg("controlId","param-desc-"+r),KE(),pg("id","param-desc-"+r),UI(),KE(),pg("controlId","param-default-"+r)("error",e.controls.defaultValue.invalid&&e.controls.defaultValue.touched?"Default value is required.":null),KE(),pg("id","param-default-"+r),UI();}}function _e(o,t){if(o&1){let e=aC();Is(0,"div",14)(1,"span",33),UC(2),ml(),Is(3,"ds-form-field",34),hg(4,"textarea",35),VI(),ml(),Is(5,"button",36),Eg("click",function(){let d=mf(e).$index,m=fC(2);return yf(m.removeContentEntry(d))}),UC(6," \xD7 "),ml()();}if(o&2){let e=t.$implicit,r=t.$index,d=fC(2);KE(2),Lg(r+1),KE(),pg("error",e.invalid&&e.touched?"Content entry must not be blank.":null),KE(),pg("formControlName",r),fg("aria-label","Content entry "+(r+1)),UI(),KE(),pg("disabled",d.contentArray.length===1);}}function xe(o,t){if(o&1&&(Is(0,"ds-notice"),UC(1),ml()),o&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function be(o,t){if(o&1){let e=aC();Is(0,"button",37),Eg("click",function(){mf(e);let d=fC(2);return yf(d.exportYaml())}),UC(1),ml();}if(o&2){let e=fC(2);pg("disabled",e.isExporting()),KE(),Il(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Ee(o,t){if(o&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let d=fC();return yf(d.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,ye,2,1),Is(6,"ds-fieldset",9)(7,"p",2),UC(8," Each parameter must have a name and a default value. Use "),Is(9,"code"),UC(10),ml(),UC(11," in content entries to reference them. "),ml(),Is(12,"div",10),Qw(13,ve,2,0,"p",2),eC(14,he,10,9,"div",11,Xw),Is(16,"div")(17,"button",12),Eg("click",function(){mf(e);let d=fC();return yf(d.addParameter())}),UC(18,"+ Add parameter"),ml()()()(),Is(19,"ds-fieldset",13)(20,"p",2),UC(21," Each content entry is a command. Use "),Is(22,"code"),UC(23,"@AgentName"),ml(),UC(24," to target an agent, "),Is(25,"code"),UC(26,"/promptName param1 param2"),ml(),UC(27," to call another prompt, and "),Is(28,"code"),UC(29),ml(),UC(30," for parameter placeholders. "),ml(),Is(31,"div",10),eC(32,_e,7,5,"div",14,Xw),Is(34,"div")(35,"button",12),Eg("click",function(){mf(e);let d=fC();return yf(d.addContentEntry())}),UC(36,"+ Add content entry"),ml()()()(),Qw(37,xe,2,1,"ds-notice"),Is(38,"ds-form-field",15),hg(39,"textarea",16),VI(),ml(),Is(40,"ds-form-actions")(41,"button",17),UC(42),ml(),Qw(43,be,2,2,"button",18),Is(44,"button",19),Eg("click",function(){mf(e);let d=fC();return yf(d.cancel())}),UC(45,"Cancel"),ml()()();}if(o&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.availableAgentConfigs().length>0?5:-1),KE(5),Lg(e.paramPlaceholderSyntax),KE(2),pg("formArrayName","parameters"),KE(),Kw(e.parametersArray.length===0?13:-1),KE(),tC(e.parametersArray.controls),KE(15),Lg(e.paramPlaceholderSyntax),KE(2),pg("formArrayName","content"),KE(),tC(e.contentArray.controls),KE(5),Kw(e.errorMessage()?37:-1),KE(),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create"," "),KE(),Kw(e.isEditMode()?43:-1);}}var pe=class o{route=g(W);router=g(F);destroyRef=g(we);promptState=g(m);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(null),agentConfigId:new Te(null),externalMetadataJson:new Te("",{nonNullable:true,validators:[Pe]}),content:new Wt([this.createContentControl()],{validators:[bn.required]}),parameters:new Wt([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);errorMessage=zi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=zi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U$1(this.destroyRef),ga(()=>_r([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U$1(this.destroyRef),ga(()=>_r([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(r=>this.contentArray.push(this.createContentControl(r))),this.parametersArray.clear(),(t.parameters??[]).forEach(r=>this.parametersArray.push(this.createParameterGroup(r))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new Te(t,{nonNullable:true,validators:[bn.required,bn.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new pt({name:new Te(t?.name??"",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te(t?.description??null),defaultValue:new Te(t?.defaultValue??"",{nonNullable:true,validators:[bn.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(m=>m.value.trim()),parameters:this.parametersArray.controls.map(m=>({name:m.controls.name.value.trim(),description:m.controls.description.value?.trim()||void 0,defaultValue:m.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let r=this.externalMetadataJsonControl.value.trim();e.externalMetadata=r?JSON.parse(r):null;let d=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),d.pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:m=>{this.isSubmitting.set(false),m.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):m.status===400?this.errorMessage.set(m.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let r=new Blob([e],{type:"application/yaml"}),d=URL.createObjectURL(r),m=document.createElement("a");m.href=d,m.download=`${this.existingPrompt?.name??"prompt"}.yaml`,m.click(),URL.revokeObjectURL(d),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","prompt-name","required","",3,"error"],["dsControl","","id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",3,"formControl"],["label","Description","controlId","prompt-description"],["dsControl","","id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",3,"formControl"],["legend","Parameters","legendHint","Named placeholders used in content"],[1,"ds-stack",3,"formArrayName"],[1,"ds-panel","ds-inline","ds-inline--start",3,"formGroupName"],["dsButton","","variant","ghost","type","button",3,"click"],["legend","Content","legendHint","Ordered list of text commands"],[1,"ds-inline","ds-inline--start"],["label","External Metadata","controlId","prompt-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["label","Agent Config","hint","Agent Config cannot be changed after creation."],["label","Agent Config","controlId","prompt-agent-config","hint","Optional. Links this prompt to an agent as a starter. Immutable after creation."],["dsControl","","type","text","readonly","",3,"value"],["dsControl","","id","prompt-agent-config",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-grow"],["label","Name","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",3,"id"],["label","Description",3,"controlId"],["dsControl","","type","text","placeholder","Optional","formControlName","description","autocomplete","off",3,"id"],["label","Default value","required","",3,"controlId","error"],["dsControl","","type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",3,"id"],["dsButton","","variant","icon-danger","type","button","title","Remove this parameter","aria-label","Remove this parameter",3,"click"],[1,"ds-index"],["grow","",3,"error"],["dsControl","","rows","4","placeholder","Enter a command\u2026",3,"formControlName"],["dsButton","","variant","icon-danger","type","button","title","Remove this entry","aria-label","Remove this entry",3,"click","disabled"],["dsButton","","type","button",3,"click","disabled"]],template:function(e,r){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return r.cancel()}),UC(3),ml()(),Qw(4,ue,2,0,"p",2)(5,Ee,46,16,"form",3),ml()),e&2&&(KE(),pg("title",r.isEditMode()?"Edit prompt":"New prompt"),KE(2),Il(" \u2190 ",r.isPlatformMode?"Platform prompts":"Prompts"," "),KE(),Kw(r.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Qt,fo,go,Nn,Rn,Ea,yo,bo,vn,yn,fn,pn,hn,_n,at,un],encapsulation:2})};function Pe(o){let t=o.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{pe as PromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {o}from'./chunk-
|
|
1
|
+
import {o}from'./chunk-Cuqd2uDM.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-CpI8ncwF.js';import {g,W,F,J as we,z as zi,M as U,P as x,O as w,x as xw,aw as $t,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,b as Kw,r as fC,s as aC,a as hg,T as VI,l as eC,ap as Xw,X as UI,t as tC,q as Il,u as mf,w as yf,L as Lg}from'./main-GL65UOL7.js';function ie(i,t){if(i&1&&(Is(0,"a",2),UC(1,"View skill \u2192"),ml()),i&2){let e=fC();pg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Is(0,"ds-tag",3),UC(1,"Platform level"),ml());}function ne(i,t){i&1&&(Is(0,"p",4),UC(1,"Loading\u2026"),ml());}function re(i,t){if(i&1){let e=aC();Is(0,"div",15)(1,"div",19),hg(2,"input",20),VI(),Is(3,"button",21),Eg("click",function(){let l=mf(e).$implicit,te=fC(2);return yf(te.removeResource(l))}),UC(4," \xD7 "),ml()(),hg(5,"textarea",22),VI(),ml();}if(i&2){let e=t.$implicit;KE(2),pg("formControl",e.path),UI(),KE(3),pg("formControl",e.content),UI();}}function ae(i,t){if(i&1&&(Is(0,"ds-notice"),UC(1),ml()),i&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function se(i,t){if(i&1){let e=aC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let l=fC();return yf(l.submit())}),Is(1,"ds-form-field",7),hg(2,"input",8),VI(),ml(),Is(3,"ds-form-field",9),hg(4,"textarea",10),VI(),ml(),Is(5,"ds-form-field",11),hg(6,"textarea",12),VI(),ml(),Is(7,"ds-form-field",13)(8,"div",14),eC(9,re,6,2,"div",15,Xw),Is(11,"div")(12,"button",16),Eg("click",function(){mf(e);let l=fC();return yf(l.addResource())}),UC(13,"+ Add resource"),ml()()()(),Qw(14,ae,2,1,"ds-notice"),Is(15,"ds-form-actions")(16,"button",17),UC(17),ml(),Is(18,"button",18),Eg("click",function(){mf(e);let l=fC();return yf(l.cancel())}),UC(19,"Cancel"),ml()()();}if(i&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(2),pg("formControl",e.bodyControl),UI(),KE(3),tC(e.resourceRows()),KE(5),Kw(e.errorMessage()?14:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",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=zi(false);isLoading=zi(false);isSubmitting=zi(false);errorMessage=zi(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=zi([]);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=xw({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&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.cancel()}),UC(3,"\u2190 Skills"),ml(),Qw(4,ie,2,1,"a",2),Qw(5,oe,2,0,"ds-tag",3),ml(),Qw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),ml()),e&2&&(KE(),pg("title",o.isEditMode()?"Edit skill":"New skill"),KE(3),Kw(o.isEditMode()?4:-1),KE(),Kw(o.isPlatformMode?5:-1),KE(),Kw(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-
|
|
1
|
+
import {w as m,q as k,O as O$1,i as at,d as yn,V as Vo,j as P,r as P$1}from'./chunk-CpI8ncwF.js';import {g,F,J as we,$ as Sr,z as zi,a1 as ma,M as U$1,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,q as Il,s as aC,j as fg,u as mf,w as yf}from'./main-GL65UOL7.js';var j=(t,e)=>e.id??e.name;function A(t,e){if(t&1&&(Is(0,"p",3),UC(1),ml()),t&2){let n=fC();KE(),Lg(n.deletion.error());}}function K(t,e){t&1&&(Is(0,"p",4),UC(1,"Loading prompts\u2026"),ml());}function H(t,e){t&1&&(Is(0,"p",5),UC(1,"No platform prompts defined yet."),ml());}function U(t,e){t&1&&(Is(0,"p",4),UC(1,"No prompts match the current filter."),ml());}function z(t,e){if(t&1){let n=aC();Is(0,"button",18),Eg("click",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.edit(m))}),UC(1,"Edit"),ml();}if(t&2){let n=fC().$implicit;fg("aria-label","Edit "+n.name);}}function G(t,e){if(t&1){let n=aC();Is(0,"agentos-row-delete-action",19),Eg("deleteRequested",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.deletion.request(m.id))})("deleteConfirmed",function(){mf(n);let m=fC().$implicit,p=fC(2);return yf(p.confirmDelete(m))})("deleteCancelled",function(){mf(n);let m=fC(3);return yf(m.deletion.cancel())}),ml();}if(t&2){let n=fC().$implicit,r=fC(2);pg("rowKey",n.id)("rowLabel",n.name)("state",r.deletion);}}function J(t,e){if(t&1&&(Is(0,"tr",9)(1,"td",12),UC(2),ml(),Is(3,"td",13),UC(4),ml(),Is(5,"td",14)(6,"div",15),Qw(7,z,2,1,"button",16),Qw(8,G,1,3,"agentos-row-delete-action",17),ml()()()),t&2){let n=e.$implicit,r=fC(2);KE(2),Lg(n.name),KE(2),Il(" ",n.description||"\u2014"," "),KE(3),Kw(r.deletion.confirmingId()!==n.id?7:-1),KE(),Kw(n.id?8:-1);}}function O(t,e){if(t&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Description"),ml(),Is(8,"th",10)(9,"span",11),UC(10,"Actions"),ml()()()(),Is(11,"tbody",8),eC(12,J,9,4,"tr",9,j),ml()()()),t&2){let n=fC();KE(12),tC(n.rowFilter.filteredRows());}}var B=class t{router=g(F);destroyRef=g(we);promptState=g(m);refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();prompts=zi([]);rowFilter=O$1(this.prompts,e=>[e.name,e.description].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.promptState.listPlatform())),U$1(this.destroyRef)).subscribe({next:e=>{this.prompts.set(e),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}edit(e){e.id&&this.router.navigate(["/agentos","admin","prompts",e.id,"edit"]);}confirmDelete(e){e.id&&this.deletion.execute(e.id,{request$:this.promptState.delete(e.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${e.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=xw({type:t,selectors:[["agentos-platform-prompts"]],decls:9,vars:3,consts:[["title","Platform prompts","description","Prompts shared across every namespace."],["label","Filter prompts","placeholder","Filter prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,r){n&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return r.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return r.openCreateForm()}),UC(3,"New prompt"),ml()(),Qw(4,A,2,1,"p",3),Qw(5,K,2,0,"p",4)(6,H,2,0,"p",5)(7,U,2,0,"p",4)(8,O,14,0,"div",6)),n&2&&(KE(),pg("query",r.rowFilter.query()),KE(3),Kw(r.deletion.error()?4:-1),KE(),Kw(r.isLoading()?5:r.prompts().length===0?6:r.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,P,P$1],encapsulation:2})};export{B as PlatformPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-BNlIgcoJ.js';import {q as k,O as O$1,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CpI8ncwF.js';import {g,W,F,J as we,z as zi,ae as Ny,a2 as ga,ac as _r,M as U,P as x,O as w,ak as Ge,ao as Ye,x as xw,I as Is,S as Eg,m as ml,U as UC,Q as Qw,K as KE,R as pg,b as Kw,r as fC,L as Lg,l as eC,t as tC,s as aC,u as mf,w as yf,j as fg}from'./main-GL65UOL7.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Is(0,"p",3),UC(1),ml()),n&2){let e=fC();KE(),Lg(e.deletion.error());}}function Y(n,t){n&1&&(Is(0,"p",4),UC(1,"Loading scheduled prompts\u2026"),ml());}function z(n,t){n&1&&(Is(0,"p",5),UC(1,"No scheduled prompts available."),ml());}function G(n,t){n&1&&(Is(0,"p",4),UC(1,"No scheduled prompts match the current filter."),ml());}function Q(n,t){if(n&1&&(Is(0,"span",14),UC(1),ml()),n&2){let e=fC().$implicit;KE(),Lg(e.prompt.description);}}function X(n,t){n&1&&(Is(0,"ds-tag",20),UC(1,"Read-only"),ml());}function Z(n,t){if(n&1){let e=aC();Is(0,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.toggle(l))}),UC(1),ml(),Is(2,"button",25),Eg("click",function(){mf(e);let l=fC(2).$implicit,p=fC(2);return yf(p.edit(l))}),UC(3," Edit "),ml();}if(n&2){let e=fC(2).$implicit;KE(),Lg(e.prompt.enabled?"Disable":"Enable"),KE(),fg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=aC();Qw(0,Z,4,2),Is(1,"agentos-row-delete-action",24),Eg("deleteRequested",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.deletion.request(l.key))})("deleteConfirmed",function(){mf(e);let l=fC().$implicit,p=fC(2);return yf(p.confirmDelete(l))})("deleteCancelled",function(){mf(e);let l=fC(3);return yf(l.deletion.cancel())}),ml();}if(n&2){let e=fC().$implicit,i=fC(2);Kw(i.deletion.confirmingId()!==e.key?0:-1),KE(),pg("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Is(0,"button",23),UC(1,"Inherited"),ml());}function ne(n,t){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),UC(3),ml(),Qw(4,Q,2,1,"span",14),ml(),Is(5,"td",15),UC(6),ml(),Is(7,"td",16)(8,"ds-tag",17),UC(9),ml()(),Is(10,"td",18)(11,"div",19)(12,"ds-tag",17),UC(13),ml(),Qw(14,X,2,0,"ds-tag",20),ml()(),Is(15,"td",21)(16,"div",22),Qw(17,ee,2,4)(18,te,2,0,"button",23),ml()()()),n&2){let e=t.$implicit,i=fC(2);KE(3),Lg(e.prompt.name),KE(),Kw(e.prompt.description?4:-1),KE(2),Lg(i.scheduleLabel(e.prompt)),KE(2),pg("variant",e.prompt.enabled?"accent":"outline"),KE(),Lg(e.prompt.enabled?"Enabled":"Disabled"),KE(3),pg("variant",e.scope==="platform"?"neutral":"accent"),KE(),Lg(e.scope==="platform"?"Platform":"Namespace"),KE(),Kw(e.scope==="platform"?14:-1),KE(3),Kw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),UC(5,"Name"),ml(),Is(6,"th",10),UC(7,"Schedule"),ml(),Is(8,"th",10),UC(9,"Status"),ml(),Is(10,"th",10),UC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),UC(14,"Actions"),ml()()()(),Is(15,"tbody",8),eC(16,ne,19,9,"tr",9,J),ml()()()),n&2){let e=fC();KE(16),tC(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=zi([]);isLoading=zi(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(){Ny({platform:this.state.listPlatform().pipe(ga(()=>_r([]))),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===Ge.WEEK?"week":"month",l=e.unit===Ge.WEEK&&e.days?.length?` (${e.days.map(p=>Ye[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({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&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(p){return i.rowFilter.query.set(p)}),ml(),Is(2,"button",2),Eg("click",function(){return i.openCreateForm()}),UC(3,"New scheduled prompt"),ml()(),Qw(4,O,2,1,"p",3),Qw(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&&(KE(),pg("query",i.rowFilter.query()),KE(3),Kw(i.deletion.error()?4:-1),KE(),Kw(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};
|