@whoz-oss/coday-client 0.0.0-workstream-forge.286 → 0.0.0-workstream-forge.289
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-CTnGJhEu.js → chunk--EgRVDa6.js} +1 -1
- package/browser/{chunk-5mGW4E0G.js → chunk--aDoLaiU.js} +1 -1
- package/browser/{chunk-hqzAiSeU.js → chunk-2fwazn83.js} +1 -1
- package/browser/chunk-8_uYpgj6.js +1 -0
- package/browser/{chunk-BYBCnWol.js → chunk-BBUlPLUG.js} +1 -1
- package/browser/{chunk-CBa63htl.js → chunk-BV8irEp_.js} +1 -1
- package/browser/chunk-BX_QKHxp.js +1 -0
- package/browser/chunk-BXqGIEzq.js +1 -0
- package/browser/chunk-Bd7sD3Ol.js +1 -0
- package/browser/chunk-BdKKFYbn.js +1 -0
- package/browser/{chunk-DZzoCiPa.js → chunk-Bf0b5HDZ.js} +1 -1
- package/browser/{chunk-C-TFPDAn.js → chunk-Bn5nlhfj.js} +1 -1
- package/browser/{chunk-DvgyKpON.js → chunk-BuZSOKHs.js} +1 -1
- package/browser/chunk-C0Ss4BeX.js +1 -0
- package/browser/chunk-C7O4iJjY.js +1 -0
- package/browser/chunk-CBl5v-PO.js +1 -0
- package/browser/{chunk-BecFkRj3.js → chunk-CUA9JUgm.js} +1 -1
- package/browser/{chunk-BWOdgPpL.js → chunk-Cwlrv6dM.js} +1 -1
- package/browser/{chunk-DtO-loh9.js → chunk-D-d0VY4i.js} +1 -1
- package/browser/{chunk-DUksmlzj.js → chunk-D9epIXs4.js} +1 -1
- package/browser/{chunk-BFMfi7bN.js → chunk-DExf2qo6.js} +1 -1
- package/browser/chunk-DKqOeN1s.js +1 -0
- package/browser/{chunk-cs0QcDnt.js → chunk-D_E1x42C.js} +1 -1
- package/browser/chunk-DgfZzSfC.js +1 -0
- package/browser/{chunk-C8kRHbPY.js → chunk-DhxI9Zc7.js} +1 -1
- package/browser/{chunk-BIv3GA0j.js → chunk-Dk8uBiJC.js} +1 -1
- package/browser/chunk-DpoDbcU5.js +2 -0
- package/browser/{chunk-wS9pwsFZ.js → chunk-DrKb6zuj.js} +1 -1
- package/browser/chunk-Dsm56SGw.js +1 -0
- package/browser/chunk-DtKMBlUc.js +690 -0
- package/browser/chunk-Due0zK_F.js +1 -0
- package/browser/chunk-Dzo5PcDy.js +1 -0
- package/browser/chunk-VoLo31KM.js +2 -0
- package/browser/{chunk-Cgng0NyG.js → chunk-ZMKZf_Bj.js} +1 -1
- package/browser/{chunk-spovbUSX.js → chunk-Zjkf7Pld.js} +1 -1
- package/browser/chunk-_nQOgN_q.js +1 -0
- package/browser/{chunk-BgspkyJn.js → chunk-b5iF5vg2.js} +1 -1
- package/browser/chunk-eF4CmPLQ.js +1 -0
- package/browser/{chunk-DEd4dYEy.js → chunk-i-R8PjND.js} +1 -1
- package/browser/{chunk-C9I0IDkC.js → chunk-kB6kdDOB.js} +1 -1
- package/browser/{chunk-DWnk-InR.js → chunk-nPi97z1Y.js} +1 -1
- package/browser/{chunk-C4AQsMm0.js → chunk-oVZlpc4y.js} +1 -1
- package/browser/{chunk-BRKEdS-H.js → chunk-qH-TyzVZ.js} +1 -1
- package/browser/{chunk-Cht3Sl44.js → chunk-voYW_oL9.js} +1 -1
- package/browser/{chunk-B6Jjbp7r.js → chunk-xCLwu5NW.js} +1 -1
- package/browser/{chunk-BSLGGdgS.js → chunk-y3Td34jo.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-2W2EKPFF.js → main-MOZ7U7VP.js} +15 -15
- package/package.json +1 -1
- package/browser/chunk-B4ZKQxLi.js +0 -1
- package/browser/chunk-BDdxWZSD.js +0 -2
- package/browser/chunk-BGKOG_jF.js +0 -1
- package/browser/chunk-BaZs2cqq.js +0 -1
- package/browser/chunk-BuupDt2w.js +0 -1
- package/browser/chunk-C9Im1XQZ.js +0 -1
- package/browser/chunk-CR2ZgYm1.js +0 -1
- package/browser/chunk-CV72_wbg.js +0 -690
- package/browser/chunk-CpXnuzhL.js +0 -1
- package/browser/chunk-Cw_G-BTP.js +0 -1
- package/browser/chunk-D48e7Jxo.js +0 -2
- package/browser/chunk-DII4lC8r.js +0 -1
- package/browser/chunk-Da_8VPJd.js +0 -1
- package/browser/chunk-DeS6UHdw.js +0 -1
- package/browser/chunk-O_4Rn5qq.js +0 -1
- package/browser/chunk-RNbGWl1w.js +0 -1
- package/browser/chunk-YSYGmtzS.js +0 -1
- package/browser/chunk-gOvITjLx.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-5mGW4E0G.js';import {B as s,q as k,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,W,F,K as we,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,ad as ne$1,U,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,as as jg,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Is(0,"p",3),HC(1),ml()),n&2){let t=dC();QE(),Lg(t.deletion.error());}}function ee(n,e){n&1&&(Is(0,"p",4),HC(1,"Loading skills\u2026"),ml());}function te(n,e){n&1&&(Is(0,"p",5),HC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),ml());}function ne(n,e){n&1&&(Is(0,"p",4),HC(1,"No skills match the current filter."),ml());}function ie(n,e){if(n&1&&(Is(0,"span",14),HC(1),ml()),n&2){let t=dC().$implicit;QE(),jg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Is(0,"ds-tag",20),HC(1,"Read-only"),ml());}function oe(n,e){n&1&&(Is(0,"ds-tag",21),HC(1,"SKILL.md"),ml());}function le(n,e){if(n&1){let t=sC();Is(0,"button",25),Eg("click",function(){mf(t);let d=dC(2).$implicit,c=dC(2);return yf(c.edit(d))}),HC(1,"Edit"),ml();}if(n&2){let t=dC(2).$implicit;fg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=sC();Is(0,"button",25),Eg("click",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.inspect(d))}),HC(1," View "),ml(),Yw(2,le,2,1,"button",26);}if(n&2){let t=dC().$implicit,a=dC(2);fg("aria-label","View "+t.skill.name),QE(2),Qw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=sC();Is(0,"agentos-row-delete-action",27),Eg("deleteRequested",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.requestDelete(d))})("deleteConfirmed",function(){mf(t);let d=dC().$implicit,c=dC(2);return yf(c.confirmDelete(d))})("deleteCancelled",function(){mf(t);let d=dC(3);return yf(d.deletion.cancel())}),ml();}if(n&2){let t=dC().$implicit,a=dC(2);pg("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Is(0,"tr",9)(1,"td",12)(2,"span",13),HC(3),ml(),Yw(4,ie,2,2,"span",14),ml(),Is(5,"td",15),HC(6),ml(),Is(7,"td",16),HC(8),ml(),Is(9,"td",17)(10,"div",18)(11,"ds-tag",19),HC(12),ml(),Yw(13,ae,2,0,"ds-tag",20),Yw(14,oe,2,0,"ds-tag",21),ml()(),Is(15,"td",22)(16,"div",23),Yw(17,re,3,2),Yw(18,se,1,3,"agentos-row-delete-action",24),ml()()()),n&2){let t=e.$implicit,a=dC(2);QE(3),Lg(t.skill.name),QE(),Qw(t.namedByAgents>0?4:-1),QE(2),Il(" ",t.skill.description||"\u2014"," "),QE(2),Lg(a.resourceCount(t.skill)),QE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),QE(),Lg(t.scope==="platform"?"Platform":"Namespace"),QE(),Qw(t.scope==="platform"?13:-1),QE(),Qw(t.skill.readOnly?14:-1),QE(3),Qw(a.deletion.confirmingId()!==t.key?17:-1),QE(),Qw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Description"),ml(),Is(8,"th",10),HC(9,"Resources"),ml(),Is(10,"th",10),HC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),HC(14,"Actions"),ml()()()(),Is(15,"tbody",8),Jw(16,ce,19,10,"tr",9,Y),ml()()()),n&2){let t=dC();QE(16),eC(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k();rows=zi([]);rowFilter=O(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({platform:this.skillState.listPlatform().pipe(ga(()=>_r([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),ga(()=>_r([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Nw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["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","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(c){return a.rowFilter.query.set(c)}),ml(),Is(2,"button",2),Eg("click",function(){return a.openCreateForm()}),HC(3,"New skill"),ml()(),Yw(4,Z,2,1,"p",3),Yw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(QE(),pg("query",a.rowFilter.query()),QE(3),Qw(a.deletion.error()?4:-1),QE(),Qw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,F as Ni,G as c}from'./chunk-CV72_wbg.js';import {g,W as W$1,F,K as we,ag as U,z as zi,j as mT,U as U$1,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,x as xg,o as Il,J as Jw,k as eC,s as sC,a as hg,av as cT,aw as lT,q as mf,r as yf,ax as iE}from'./main-2W2EKPFF.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Is(0,"p",3),HC(1,"Loading\u2026"),ml());}function Q(t,n){t&1&&(Is(0,"ds-notice"),HC(1,"Failed to load agent definition."),ml());}function W(t,n){if(t&1&&(Is(0,"dt"),HC(1,"User context"),ml(),Is(2,"dd",6),HC(3),ml()),t&2){let e=dC();QE(3),Lg(e.userId);}}function X(t,n){if(t&1){let e=sC();Is(0,"ds-card")(1,"ds-disclosure",12),Eg("toggled",function(){mf(e);let m=dC(2);return yf(m.toggleSystemPrompt())}),Is(2,"pre",13),HC(3),ml()()();}if(t&2){let e=dC(),r=dC();QE(),pg("open",!r.systemPromptCollapsed()),QE(2),Lg(e.systemPrompt);}}function Y(t,n){if(t&1){let e=sC();Is(0,"ds-card")(1,"ds-disclosure",14),Eg("toggled",function(){mf(e);let m=dC(2);return yf(m.toggleInstructions())}),Is(2,"pre",13),HC(3),ml()()();}if(t&2){let e=dC(),r=dC();QE(),pg("open",!r.instructionsCollapsed()),QE(2),Lg(e.instructions);}}function Z(t,n){t&1&&(Is(0,"p",3),HC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),ml());}function ee(t,n){t&1&&(Is(0,"span",17),HC(1,"platform"),ml());}function te(t,n){t&1&&(Is(0,"span",17),HC(1,"SKILL.md"),ml());}function ne(t,n){if(t&1&&(Is(0,"li",15)(1,"span")(2,"span",16),HC(3),ml(),Yw(4,ee,2,0,"span",17),Yw(5,te,2,0,"span",17),ml(),Is(6,"p",3),HC(7),ml()()),t&2){let e=n.$implicit;QE(3),Lg(e.name),QE(),Qw(e.namespaceId?-1:4),QE(),Qw(e.readOnly?5:-1),QE(2),Lg(e.description);}}function ie(t,n){if(t&1&&(Is(0,"ul",11),Jw(1,ne,8,4,"li",15,j),ml()),t&2){let e=dC(2);QE(),eC(e.resolvedSkills());}}function oe(t,n){t&1&&(Is(0,"p",3),HC(1,"No tools available for this agent."),ml());}function ae(t,n){if(t&1&&(hg(0,"div",19),cT(1,"agentosMarkdown")),t&2){let e=dC().$implicit;pg("innerHTML",lT(1,1,e.description),iE);}}function de(t,n){if(t&1){let e=sC();Is(0,"li")(1,"ds-disclosure",18),Eg("toggled",function(){let m=mf(e).$implicit,U=dC(3);return yf(U.toggleTool(m))}),Yw(2,ae,2,3,"div",19),Is(3,"pre",20),HC(4),ml()()();}if(t&2){let e=n.$implicit,r=dC(3);QE(),pg("heading",e.name)("open",r.isToolExpanded(e)),QE(),Qw(e.description?2:-1),QE(2),Lg(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Is(0,"ul",11),Jw(1,de,5,4,"li",null,z),ml()),t&2){let e=dC();QE(),eC(e.tools);}}function se(t,n){if(t&1&&(Is(0,"ds-card",4)(1,"dl",5)(2,"dt"),HC(3,"Name"),ml(),Is(4,"dd"),HC(5),ml(),Is(6,"dt"),HC(7,"Resolved model"),ml(),Is(8,"dd",6),HC(9),ml(),Is(10,"dt"),HC(11,"Provider"),ml(),Is(12,"dd"),HC(13),ml(),Is(14,"dt",7),HC(15,"Execution mode"),ml(),Is(16,"dd",8)(17,"span",9),HC(18),ml()(),Yw(19,W,4,1),ml()(),Yw(20,X,4,2,"ds-card"),Yw(21,Y,4,2,"ds-card"),Is(22,"ds-card",10),Yw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),ml(),Is(25,"ds-card",10),Yw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),ml()),t&2){let e=n,r=dC();QE(5),Lg(e.name),QE(4),Lg(e.resolvedModelApiName),QE(4),Lg(e.resolvedProviderName),QE(4),xg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),QE(),Il(" ",e.executionMode," "),QE(),Qw(e.userId?19:-1),QE(),Qw(e.systemPrompt?20:-1),QE(),Qw(e.instructions?21:-1),QE(),pg("heading","Skills ("+r.resolvedSkills().length+")"),QE(),Qw(r.resolvedSkills().length===0?23:24),QE(2),pg("heading","Tools ("+e.tools.length+")"),QE(),Qw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(we);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);definition=zi(null);expandedTools=zi(new Set);resolvedSkills=mT(()=>this.definition()?.skills??[]);systemPromptCollapsed=zi(true);instructionsCollapsed=zi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let r=new Set(e);return r.has(n.name)?r.delete(n.name):r.add(n.name),r});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Nw({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,r){if(e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return r.back()}),HC(3," \u2190 Agent configs "),ml(),Is(4,"a",2),HC(5,"Edit config \u2192"),ml()(),Yw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),ml()),e&2){let m;QE(4),pg("routerLink",r.editRoute()),QE(2),Qw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ni,c],encapsulation:2})};export{K as AgentConfigInspectComponent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {I,n as nt,i as it}from'./chunk-DEd4dYEy.js';import {v}from'./chunk-C-TFPDAn.js';import {g,W,F,K as we,z as zi,a9 as F$1,j as mT,n as Ff,U,O as x,M as w,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,s as sC,J as Jw,ao as Xw,S as BI,a as hg,p as dC,T as HI,k as eC,o as Il,ae as qw,L as Lg,i as fg,q as mf,r as yf}from'./main-2W2EKPFF.js';import {T as Te,b as bn,p as pt,v as vn,d as yn,e as fn,l as pn,h as hn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';function Ce(i,t){i&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function ye(i,t){if(i&1&&(Is(0,"label",16),hg(1,"input",17),BI(),HC(2),ml()),i&2){let e=t.$implicit,n=dC(3);QE(),pg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),HI(),QE(),Il(" ",e.label," ");}}function ge(i,t){if(i&1&&(Is(0,"ds-fieldset",5),Jw(1,ye,3,4,"label",16,qw().trackByScope,true),ml()),i&2){let e=dC(2);pg("disabled",e.isEditMode()),QE(),eC(e.scopeOptions);}}function fe(i,t){if(i&1&&(Is(0,"option",8),HC(1),ml()),i&2){let e=t.$implicit,n=dC(2);pg("value",e),QE(),Lg(n.authTypeLabel[e]);}}function Se(i,t){if(i&1&&(Is(0,"ds-form-field",18),hg(1,"input",19),BI(),ml()),i&2){let e=dC().$implicit;pg("label",e.label)("controlId","as-cred-"+e.key)("required",e.required)("hint",e.hint??null)("hintId","as-hint-"+e.key),QE(),pg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),fg("aria-describedby",e.hint?"as-hint-"+e.key:null),HI();}}function Ae(i,t){if(i&1&&Yw(0,Se,2,11,"ds-form-field",18),i&2){let e,n=t.$implicit,o=dC(3);Qw((e=o.controlForField(n.key))?0:-1,e);}}function ve(i,t){if(i&1&&(Is(0,"ds-fieldset",13),Jw(1,Ae,1,1,null,null,qw().trackByField,true),ml()),i&2){let e=dC(2);pg("hint","Values are stored encrypted and masked on read."+(e.isEditMode()?" Leave a field unchanged to keep the stored credential.":"")),QE(),eC(e.credentialFields());}}function be(i,t){if(i&1){let e=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let o=dC();return yf(o.submit())}),Yw(1,ge,3,1,"ds-fieldset",5),Is(2,"ds-form-field",6)(3,"select",7),Jw(4,fe,2,2,"option",8,Xw),ml(),BI(),ml(),Is(6,"ds-form-field",9),hg(7,"input",10),BI(),ml(),Is(8,"ds-form-field",11),hg(9,"input",12),BI(),ml(),Yw(10,ve,3,1,"ds-fieldset",13),Is(11,"ds-form-actions")(12,"button",14),HC(13),ml(),Is(14,"button",15),Eg("click",function(){mf(e);let o=dC();return yf(o.cancel())}),HC(15,"Cancel"),ml()()();}if(i&2){let e=dC();pg("formGroup",e.form),QE(),Qw(e.isPlatformMode?-1:1),QE(2),pg("formControl",e.authTypeControl),HI(),QE(),eC(e.authTypeOptions),QE(3),pg("formControl",e.nameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(),Qw(e.credentialFields().length>0?10:-1),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),Il(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ke=new Set(["namespace","userOnNs","userGlobal"]),D=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),_e={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},me=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?zi(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=nt;authTypeLabel=it;scopeOptions=[{value:"namespace",label:D.namespace},{value:"userOnNs",label:D.userOnNs},{value:"userGlobal",label:D.userGlobal}];nameControl=new Te("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]});descriptionControl=new Te(null);authTypeControl=new Te("ApiKeyAuthSetting",{nonNullable:true,validators:[bn.required]});scopeControl=new Te("namespace",{nonNullable:true});form=new pt({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new Te("",{nonNullable:true});usernameControl=new Te("",{nonNullable:true});passwordControl=new Te("",{nonNullable:true});tokenControl=new Te("",{nonNullable:true});discoveryUrlControl=new Te("",{nonNullable:true});authorizationUrlControl=new Te("",{nonNullable:true});tokenUrlControl=new Te("",{nonNullable:true});clientIdControl=new Te("",{nonNullable:true});clientSecretControl=new Te("",{nonNullable:true});scopesControl=new Te("",{nonNullable:true});resourceUrlControl=new Te("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>_e[this.selectedAuthType()]);isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Ff(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let o=this.parseScope(e.get("scope"));this.scopeControl.setValue(o);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&ke.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",o=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(o),this.initialCredentials.username=n,this.initialCredentials.password=o;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,o=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,o,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let o={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return x(w({},o),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},o),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},o),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},o),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},o),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},o),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-auth-setting-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to auth settings",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Configuration scope",3,"disabled"],["label","Auth type","controlId","as-auth-type","required",""],["dsControl","","id","as-auth-type",3,"formControl"],[3,"value"],["label","Name","controlId","as-name","required",""],["dsControl","","id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",3,"formControl"],["label","Description","controlId","as-description"],["dsControl","","id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",3,"formControl"],["legend","Credentials",3,"hint"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsCheck",""],["type","radio",3,"formControl","value","disabled"],[3,"label","controlId","required","hint","hintId"],["dsControl","",3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),HC(3," \u2190 Auth settings "),ml()(),Yw(4,Ce,2,0,"p",2)(5,be,16,8,"form",3),ml()),e&2&&(QE(),pg("title",n.isEditMode()?"Edit auth setting":"New auth setting"),QE(3),Qw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,at,un,cn,Kt,fd,Mo,Do,Ut,Qt,Ca,fo,go,Nn,Rn],encapsulation:2})};
|
|
2
|
-
export{me as AuthSettingFormComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {q as k$1,O,i as at,d as yn,V as Vo,A as Ao,j as P,r as P$1}from'./chunk-CV72_wbg.js';import {g,W as W$1,F,K as we,aq as F$1,ap as k,$ as Sr,z as zi,a1 as ma,ac as Ny,a2 as ga,aa as _r,U,N as Nw,I as Is,R as Eg,m as ml,H as HC,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,L as Lg,J as Jw,k as eC,o as Il,s as sC,q as mf,r as yf,i as fg}from'./main-2W2EKPFF.js';var G=(i,e)=>e.key;function Q(i,e){if(i&1&&(Is(0,"p",3),HC(1),ml()),i&2){let t=dC();QE(),Lg(t.deletion.error());}}function W(i,e){i&1&&(Is(0,"p",4),HC(1,"Loading AI models\u2026"),ml());}function X(i,e){i&1&&(Is(0,"p",5),HC(1,"No AI models configured."),ml());}function Y(i,e){i&1&&(Is(0,"p",4),HC(1,"No AI models match the current filter."),ml());}function Z(i,e){i&1&&(Is(0,"ds-tag",18),HC(1,"Read-only"),ml());}function ee(i,e){if(i&1){let t=sC();Is(0,"button",24),Eg("click",function(){mf(t);let s=dC(2).$implicit,m=dC(2);return yf(m.edit(s))}),HC(1,"Edit"),ml();}if(i&2){let t=dC(2).$implicit,n=dC(2);fg("aria-label","Edit "+n.title(t));}}function te(i,e){if(i&1){let t=sC();Yw(0,ee,2,1,"button",22),Is(1,"agentos-row-delete-action",23),Eg("deleteRequested",function(){mf(t);let s=dC().$implicit,m=dC(2);return yf(m.deletion.request(s.key))})("deleteConfirmed",function(){mf(t);let s=dC().$implicit,m=dC(2);return yf(m.confirmDelete(s))})("deleteCancelled",function(){mf(t);let s=dC(3);return yf(s.deletion.cancel())}),ml();}if(i&2){let t=dC().$implicit,n=dC(2);Qw(n.deletion.confirmingId()!==t.key?0:-1),QE(),pg("rowKey",t.key)("rowLabel",n.title(t))("state",n.deletion);}}function ie(i,e){i&1&&(Is(0,"button",21),HC(1,"Inherited"),ml());}function ne(i,e){if(i&1&&(Is(0,"tr",9)(1,"td",12),HC(2),ml(),Is(3,"td",13),HC(4),ml(),Is(5,"td",14),HC(6),ml(),Is(7,"td",15)(8,"div",16)(9,"ds-tag",17),HC(10),ml(),Yw(11,Z,2,0,"ds-tag",18),ml()(),Is(12,"td",19)(13,"div",20),Yw(14,te,2,4)(15,ie,2,0,"button",21),ml()()()),i&2){let t=e.$implicit,n=dC(2);QE(2),Lg(n.title(t)),QE(2),Lg(t.providerName),QE(2),Il(" ",t.model.apiModelName," "),QE(3),pg("variant",t.scope==="platform"?"neutral":"accent"),QE(),Lg(t.scope==="platform"?"Platform":"Namespace"),QE(),Qw(t.scope==="platform"?11:-1),QE(3),Qw(t.scope==="namespace"?14:15);}}function oe(i,e){if(i&1&&(Is(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),HC(5,"Name"),ml(),Is(6,"th",10),HC(7,"Provider"),ml(),Is(8,"th",10),HC(9,"API model name"),ml(),Is(10,"th",10),HC(11,"Scope"),ml(),Is(12,"th",10)(13,"span",11),HC(14,"Actions"),ml()()()(),Is(15,"tbody",8),Jw(16,ne,16,7,"tr",9,G),ml()()()),i&2){let t=dC();QE(16),eC(t.rowFilter.filteredRows());}}var z=class i{route=g(W$1);router=g(F);destroyRef=g(we);aiModelController=g(F$1);aiProviderController=g(k);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Sr(void 0);isLoading=zi(true);deletion=k$1();rows=zi([]);rowFilter=O(this.rows,e=>[e.model.alias,e.model.apiModelName,e.providerName,e.scope].filter(Boolean).join(" "));data$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ny({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ga(()=>_r([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}).pipe(ma(({namespace:e,platform:t,providers:n})=>{let s=[...new Set([...t,...e].map(m=>m.aiProviderId))];return Ny({namespace:_r(e),platform:_r(t),providers:_r(n),referencedProviders:this.aiProviderController.getByIdsAiProvider({ids:s,withRemoved:false}).pipe(ga(()=>_r([])))})})))));constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:({namespace:e,platform:t,providers:n,referencedProviders:s})=>{let m=new Map([...s,...n].map(c=>[c.id??"",c.name]));this.rows.set([...t.map((c,g)=>({key:`platform:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"platform"})),...e.map((c,g)=>({key:`namespace:${c.id??g}`,model:c,providerName:m.get(c.aiProviderId)??c.aiProviderId,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}edit(e){e.scope==="platform"||!e.model.id||this.router.navigate(["/agentos",this.namespaceId,"ai-models",e.model.id,"edit"]);}title(e){return e.model.alias??e.model.apiModelName}confirmDelete(e){e.scope==="platform"||!e.model.id||this.deletion.execute(e.key,{request$:this.aiModelController.deleteAiModel(e.model.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${this.title(e)}" failed. Try again.`});}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-namespace-ai-models"]],decls:9,vars:3,consts:[["title","AI models","description","AI models configured for this namespace, including models inherited from the platform."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(t,n){t&1&&(Is(0,"ds-section-header",0)(1,"agentos-table-filter",1),Eg("queryChange",function(m){return n.rowFilter.query.set(m)}),ml(),Is(2,"button",2),Eg("click",function(){return n.openCreateForm()}),HC(3,"New AI model"),ml()(),Yw(4,Q,2,1,"p",3),Yw(5,W,2,0,"p",4)(6,X,2,0,"p",5)(7,Y,2,0,"p",4)(8,oe,18,0,"div",6)),t&2&&(QE(),pg("query",n.rowFilter.query()),QE(3),Qw(n.deletion.error()?4:-1),QE(),Qw(n.isLoading()?5:n.rows().length===0?6:n.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,yn,Vo,Ao,P,P$1],encapsulation:2})};export{z as NamespaceAiModelsComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-5mGW4E0G.js';import {B as s,v as vn,d as yn,k as dn,_ as _n,i as at,m as mn,A as Ao,F as Ni,G as c}from'./chunk-CV72_wbg.js';import {g,W,F,K as we,z as zi,j as mT,U,ac as Ny,a2 as ga,aa as _r,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,b as Qw,p as dC,P as pg,s as sC,a as hg,av as cT,L as Lg,o as Il,aw as lT,J as Jw,k as eC,ao as Xw,q as mf,r as yf,ax as iE}from'./main-2W2EKPFF.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Is(0,"a",2),HC(1,"Edit skill \u2192"),ml()),e&2){let n=dC();pg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Is(0,"ds-tag",3),HC(1,"Platform level"),ml());}function te(e,t){e&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function ne(e,t){e&1&&(Is(0,"ds-notice"),HC(1,"Failed to load skill."),ml());}function ie(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Created by"),ml(),Is(2,"dd"),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.createdBy);}}function oe(e,t){if(e&1&&(Is(0,"dt"),HC(1,"Last updated"),ml(),Is(2,"dd"),HC(3),ml()),e&2){let n=dC(2);QE(3),Lg(n.updatedOn);}}function ae(e,t){if(e&1&&(Yw(0,ie,4,1),Yw(1,oe,4,1)),e&2){let n=dC();Qw(n.createdBy?0:-1),QE(),Qw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Is(0,"p",4),HC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),ml());}function se(e,t){e&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function re(e,t){e&1&&(Is(0,"ds-notice"),HC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),ml());}function de(e,t){e&1&&(Is(0,"p",4),HC(1,"No agent references this skill."),ml());}function ce(e,t){e&1&&(Is(0,"ds-tag",15),HC(1,"platform agent"),ml());}function me(e,t){e&1&&(Is(0,"ds-tag",15),HC(1,"via *"),ml());}function pe(e,t){if(e&1&&(Is(0,"li",13)(1,"span",14),HC(2),ml(),Yw(3,ce,2,0,"ds-tag",15),Yw(4,me,2,0,"ds-tag",15),ml()),e&2){let n=t.$implicit;QE(2),Lg(n.name),QE(),Qw(n.platform?3:-1),QE(),Qw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Is(0,"ul",12),Jw(1,pe,5,3,"li",13,Y),ml(),Is(3,"p",4),HC(4," An agent listed "),Is(5,"code"),HC(6,"via *"),ml(),HC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),ml()),e&2){let n=dC(2);QE(),eC(n.consumers());}}function _e(e,t){e&1&&(Is(0,"p",4),HC(1,"No resources bundled with this skill."),ml());}function ge(e,t){if(e&1){let n=sC();Is(0,"li")(1,"ds-disclosure",16),Eg("toggled",function(){let r=mf(n).$implicit,g=dC(3);return yf(g.toggleResource(r))}),Is(2,"pre",17),HC(3),ml()()();}if(e&2){let n=t.$implicit,o=dC(3);QE(),pg("heading",n)("open",o.isResourceExpanded(n)),QE(2),Lg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Is(0,"ul",12),Jw(1,ge,4,3,"li",null,Xw),ml()),e&2){let n=dC(2);QE(),eC(n.resourcePaths());}}function fe(e,t){if(e&1){let n=sC();Is(0,"ds-card",5)(1,"dl",6)(2,"dt"),HC(3,"Name"),ml(),Is(4,"dd",7),HC(5),ml(),Is(6,"dt"),HC(7,"Description"),ml(),Is(8,"dd"),HC(9),ml(),Is(10,"dt"),HC(11,"Scope"),ml(),Is(12,"dd"),HC(13),ml(),Is(14,"dt"),HC(15,"Storage"),ml(),Is(16,"dd")(17,"ds-tag",8),HC(18),ml()(),Yw(19,ae,2,2),ml()(),Is(20,"ds-card",9),Yw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),ml(),Is(26,"ds-card")(27,"ds-disclosure",10),Eg("toggled",function(){mf(n);let r=dC();return yf(r.toggleBody())}),hg(28,"div",11),cT(29,"agentosMarkdown"),ml()(),Is(30,"ds-card",9),Yw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),ml();}if(e&2){let n=t,o=dC();QE(5),Lg(n.name),QE(4),Lg(n.description),QE(4),Lg(n.namespaceId?"Namespace":"Platform"),QE(4),pg("variant",o.isFilesystemBacked()?"outline":"neutral"),QE(),Il(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),QE(),Qw(o.isFilesystemBacked()?-1:19),QE(),pg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),QE(),Qw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),QE(6),pg("open",!o.bodyCollapsed()),QE(),pg("innerHTML",lT(29,12,n.body),iE),QE(2),pg("heading","Resources ("+o.resourcePaths().length+")"),QE(),Qw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);skill=zi(null);bodyCollapsed=zi(false);expandedResources=zi(new Set);resourcePaths=mT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=mT(()=>this.skill()?.readOnly===true);consumers=zi([]);consumersUnavailable=zi(false);consumersLoading=zi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Ny({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ga(()=>_r([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Nw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return o.back()}),HC(3,"\u2190 Skills"),ml(),Yw(4,Z,2,1,"a",2),Yw(5,ee,2,0,"ds-tag",3),ml(),Yw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),ml()),n&2){let r;QE(4),Qw(o.skill()&&!o.isFilesystemBacked()?4:-1),QE(),Qw(o.isPlatformMode?5:-1),QE(),Qw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,vn,yn,dn,_n,at,mn,Ao,Ni,c],encapsulation:2})};export{X as SkillInspectComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {f,a6 as gd,a as fd,U as Ut,c as fo,g as go,a7 as uo,a8 as _a,a9 as pa,v as vn,d as yn,e as fn,_ as _n,i as at,u as un,V as Vo,aa as f$1}from'./chunk-CV72_wbg.js';import {g,W,aN as Y,z as zi,ab as le,n as Ff,N as Nw,aO as Rb,I as Is,a as hg,Y as Yw,m as ml,Q as QE,b as Qw,ak as Dd,a1 as ma,a3 as rn,ac as Ny,a2 as ga,H as HC,s as sC,R as Eg,aP as $g,S as BI,p as dC,aQ as Ug,T as HI,J as Jw,k as eC,aR as rT,aS as nT,L as Lg,i as fg,av as cT,aw as lT,as as jg,o as Il,aT as dT,q as mf,r as yf,aU as qC}from'./main-2W2EKPFF.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Is(0,"p",2),HC(1,"Loading usage settings\u2026"),ml());}function fe(e,a){if(e&1){let t=sC();Is(0,"ds-notice"),HC(1,"Could not load usage settings. Please try again."),ml(),Is(2,"div")(3,"button",3),Eg("click",function(){mf(t);let s=dC();return yf(s.configuration.retry())}),HC(4,"Retry usage settings"),ml()();}}function ye(e,a){e&1&&(Is(0,"p",2),HC(1,"Usage tracking is disabled."),ml());}function be(e,a){e&1&&(Is(0,"ds-notice"),HC(1),ml()),e&2&&(QE(),Lg(a));}function xe(e,a){e&1&&(Is(0,"p",2),HC(1,"Loading usage\u2026"),ml());}function he(e,a){e&1&&(Is(0,"p",12),HC(1,"No recorded usage for this period."),ml());}function Se(e,a){if(e&1&&(Is(0,"p",10),HC(1),ml()),e&2){let t=dC().$implicit;QE(),Il("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Is(0,"tr",16)(1,"td",18),HC(2),ml(),Is(3,"td",19),HC(4),cT(5,"number"),ml(),Is(6,"td",20),HC(7),cT(8,"number"),cT(9,"number"),ml(),Is(10,"td",21),HC(11),cT(12,"number"),cT(13,"number"),ml(),Is(14,"td",22),HC(15),cT(16,"agentosCost"),Yw(17,Se,2,1,"p",10),ml()()),e&2){let t=a.$implicit;QE(2),Lg(t.key),QE(2),Lg(lT(5,8,t.aggregate.totalTokens)),QE(3),jg(" ",lT(8,10,t.aggregate.inputTokens)," / ",lT(9,12,t.aggregate.outputTokens)," "),QE(4),jg(" ",lT(12,14,t.aggregate.cacheReadTokens)," / ",lT(13,16,t.aggregate.cacheWriteTokens)," "),QE(4),Il(" ",dT(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),QE(2),Qw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Is(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),HC(5,"Name"),ml(),Is(6,"th",17),HC(7,"Tokens"),ml(),Is(8,"th",17),HC(9,"Input / output"),ml(),Is(10,"th",17),HC(11,"Cache read / write"),ml(),Is(12,"th",17),HC(13,"Estimated cost"),ml()()(),Is(14,"tbody",15),Jw(15,we,18,21,"tr",16,_e),ml()()()),e&2){let t=dC().$implicit;QE(),fg("aria-label","Usage "+t.title.toLowerCase()),QE(14),eC(t.rows);}}function Ne(e,a){if(e&1&&(Is(0,"h3",11),HC(1),ml(),Yw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;QE(),Lg(t.title),QE(),Qw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Jw(0,Ne,4,2,null,null,ue),Is(2,"p",10),HC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),ml()),e&2){let t=dC(2);eC(rT(4,ge,nT(0,ce,t.agents()),nT(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let s=dC();return yf(s.load())}),Is(1,"ds-form-field",5)(2,"input",6),$g("ngModelChange",function(s){mf(t);let m=dC();return qC(m.from,s)||(m.from=s),yf(s)}),ml(),BI(),ml(),Is(3,"ds-form-field",7)(4,"input",8),$g("ngModelChange",function(s){mf(t);let m=dC();return qC(m.to,s)||(m.to=s),yf(s)}),ml(),BI(),ml(),Is(5,"button",9),HC(6,"Refresh"),ml()(),Yw(7,be,2,1,"ds-notice"),Yw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=dC();QE(2),Ug("ngModel",r.from),HI(),QE(2),Ug("ngModel",r.to),HI(),QE(3),Qw((t=r.error())?7:-1,t),QE(),Qw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Y);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=zi([]);models=zi([]);error=zi(null);loading=zi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Ff(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Dd(void 0),ma(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),rn):(this.loading.set(true),Ny({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ga(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),rn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Nw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Is(0,"ds-page",0),hg(1,"ds-section-header",1),Yw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),ml()),t&2&&(QE(2),Qw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[gd,fd,Ut,fo,go,uo,_a,pa,vn,yn,fn,_n,at,un,Vo,Rb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {O}from'./chunk-DtO-loh9.js';import {I}from'./chunk-DEd4dYEy.js';import {v}from'./chunk-C-TFPDAn.js';import {g,W,F,K as we,a8 as _,a9 as F$1,aa as _r,z as zi,ab as le,j as mT,a1 as ma,U,n as Ff,ac as Ny,N as Nw,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,a2 as ga,ad as ne,s as sC,J as Jw,ae as qw,S as BI,a as hg,p as dC,k as eC,T as HI,o as Il,L as Lg,q as mf,r as yf}from'./main-2W2EKPFF.js';import {p as pt,T as Te$1,b as bn,v as vn,d as yn,e as fn,l as pn,h as hn,k as dn,i as at,u as un,n as cn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,o as Mn,Q as Qt,C as Ca,c as fo,g as go,N as Nn,R as Rn,Y as Yt}from'./chunk-CV72_wbg.js';import'./chunk-gOvITjLx.js';var be=(i,e)=>e.value;function _e(i,e){i&1&&(Is(0,"p",2),HC(1,"Loading\u2026"),ml());}function xe(i,e){if(i&1&&(Is(0,"label",6),hg(1,"input",22),BI(),HC(2),ml()),i&2){let t=e.$implicit,n=dC(2);QE(),pg("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),HI(),QE(),Il(" ",t.label," ");}}function Ie(i,e){if(i&1&&(Is(0,"option",10),HC(1),ml()),i&2){let t=e.$implicit;pg("value",t.type),QE(),Lg(t.displayName);}}function Ne(i,e){if(i&1&&(Is(0,"option",10),HC(1),ml()),i&2){let t=e.$implicit;pg("value",t.value),QE(),Lg(t.label);}}function Ae(i,e){if(i&1&&(Is(0,"div",18)(1,"label",6),hg(2,"input",23),BI(),HC(3," Grant automatically "),ml(),Is(4,"p",2),HC(5),ml()()),i&2){let t=dC(2);QE(2),pg("formControl",t.autoGrantControl),HI(),QE(3),Il(" Give this integration to ",t.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Ee(i,e){if(i&1){let t=sC();Is(0,"ds-card")(1,"ds-json-schema-form",24),Eg("valueChange",function(a){mf(t);let p=dC(2);return yf(p.onParamsChange(a))}),ml()();}if(i&2){let t=dC(2);QE(),pg("schema",e)("value",t.initialParams());}}function Fe(i,e){if(i&1){let t=sC();Is(0,"button",25),Eg("click",function(){mf(t);let a=dC(2);return yf(a.exportYaml())}),HC(1),ml();}if(i&2){let t=dC(2);pg("disabled",t.isExporting()),QE(),Il(" ",t.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Te(i,e){if(i&1){let t=sC();Is(0,"form",4),Eg("ngSubmit",function(){mf(t);let a=dC();return yf(a.submit())}),Is(1,"ds-fieldset",5),Jw(2,xe,3,4,"label",6,qw().trackByScope,true),ml(),Is(4,"ds-form-field",7)(5,"select",8)(6,"option",9),HC(7,"Select type"),ml(),Jw(8,Ie,2,2,"option",10,qw().trackByType,true),ml(),BI(),ml(),Is(10,"ds-form-field",11),hg(11,"input",12),BI(),ml(),Is(12,"ds-form-field",13),hg(13,"textarea",14),BI(),ml(),Is(14,"ds-form-field",15)(15,"select",16)(16,"option",17),HC(17,"None"),ml(),Jw(18,Ne,2,2,"option",10,be),ml(),BI(),ml(),Yw(20,Ae,6,2,"div",18),Yw(21,Ee,2,2,"ds-card"),Is(22,"ds-form-actions")(23,"button",19),HC(24),ml(),Yw(25,Fe,2,2,"button",20),Is(26,"button",21),Eg("click",function(){mf(t);let a=dC();return yf(a.cancel())}),HC(27,"Cancel"),ml()()();}if(i&2){let t,n=dC();pg("formGroup",n.form),QE(),pg("disabled",n.isEditMode()),QE(),eC(n.scopeOptions),QE(3),pg("formControl",n.typeControl),HI(),QE(3),eC(n.integrationTypes()),QE(3),pg("formControl",n.nameControl),HI(),QE(2),pg("formControl",n.descriptionControl),HI(),QE(2),pg("formControl",n.authSettingNameControl),HI(),QE(),pg("ngValue",null),QE(2),eC(n.authSettingOptions()),QE(2),Qw(n.isAutoGrantable()?20:-1),QE(),Qw((t=n.schema())?21:-1,t),QE(2),pg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),QE(),Il(" ",n.isEditMode()?"Save changes":"Create"," "),QE(),Qw(n.isEditMode()?25:-1);}}var Ve=new Set(["platform","namespace","userOnNs","userGlobal"]),w=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ve=class i{route=g(W);router=g(F);destroyRef=g(we);state=g(O);integrationTypeController=g(_);authSettingState=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?_r(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required,bn.minLength(1)]}),description:new Te$1(null),type:new Te$1("",{nonNullable:true,validators:[bn.required]}),scope:new Te$1("namespace",{nonNullable:true}),autoGrant:new Te$1(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);scopeOptions=[{value:"platform",label:w.platform},{value:"namespace",label:w.namespace},{value:"userOnNs",label:w.userOnNs},{value:"userGlobal",label:w.userGlobal}];authSettingNameControl=new Te$1(null);loadedAuthSettings=zi([]);authSettingsLoaded=zi(false);savedAuthSettingName=zi(null);authSettingsScope$=new le;authSettingOptions=mT(()=>{let e=this.loadedAuthSettings(),t=this.savedAuthSettingName();return !t||!this.authSettingsLoaded()||e.some(n=>n.value===t)?e:[...e,{value:t,label:`${t} (not found)`}]});paramsValue=zi(null);initialParams=zi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});isAutoGrantable=mT(()=>{let e=this.selectedType();return e?this.integrationTypes().find(t=>t.type===e)?.autoGrantable??false:false});autoGrantReach=mT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){this.authSettingsScope$.pipe(ma(e=>this.loadAuthSettingLayers(e)),U(this.destroyRef)).subscribe(e=>{this.loadedAuthSettings.set(this.toAuthSettingOptions(e)),this.authSettingsLoaded.set(true);}),Ff(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let a=this.parseScope(t.get("scope"));this.scopeControl.setValue(a),this.loadAuthSettingsForScope(a),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(D=>{this.loadAuthSettingsForScope(D);});let p=t.get("template");p&&this.hydrateFromTemplate(p);}parseScope(e){return e&&Ve.has(e)?e:"namespace"}deriveScopeFromConfig(e){return !e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t;let n=this.deriveScopeFromConfig(t);this.scopeControl.setValue(n),this.applyConfigToForm(t),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters),this.authSettingNameControl.setValue(e.authSettingName??null),this.savedAuthSettingName.set(e.authSettingName??null),this.autoGrantControl.setValue(e.autoGrant??false);}loadAuthSettingsForScope(e){this.authSettingsLoaded.set(false),this.authSettingsScope$.next(e);}loadAuthSettingLayers(e){let t=(p,D)=>D.pipe(ga(()=>_r([])),ne(Se=>({label:p,settings:Se}))),n=t("platform",this.authSettingState.loadPlatformSettings()),a=t("mine",this.authSettingState.loadUserSettings("global"));return e==="platform"||e==="userGlobal"?Ny([a,n]):Ny([t("mine",this.authSettingState.loadUserSettings(this.namespaceId)),t("namespace",this.authSettingState.loadNamespaceSettings(this.namespaceId)),a,n])}toAuthSettingOptions(e){let t=new Map;for(let{label:n,settings:a}of e)for(let{name:p}of a)p&&t.set(p,(t.get(p)??new Set).add(n));return [...t.entries()].sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>({value:n,label:`${n} (${[...a].join(", ")})`}))}onParamsChange(e){this.paramsValue.set(e);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let e=this.existingConfig?.id;!e||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(e).pipe(U(this.destroyRef)).subscribe({next:t=>{let n=new Blob([t],{type:"application/yaml"}),a=URL.createObjectURL(n),p=document.createElement("a");p.href=a,p.download=`${this.existingConfig?.name??"integration"}.yaml`,p.click(),URL.revokeObjectURL(a),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Nw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to integrations",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Scope",3,"disabled"],["dsCheck",""],["label","Type","controlId","integration-type","required",""],["dsControl","","id","integration-type",3,"formControl"],["value","","disabled",""],[3,"value"],["label","Name","controlId","integration-name","required",""],["dsControl","","id","integration-name","type","text","placeholder","Integration name","autocomplete","off",3,"formControl"],["label","Description","controlId","integration-description"],["dsControl","","id","integration-description","placeholder","Optional description","rows","3",3,"formControl"],["label","Auth Setting","controlId","integration-auth-setting","hint","Only the name is saved. It is resolved at run time for the user running the case, the most specific layer winning (user on this namespace > namespace > user > platform), so a shared integration can rely on each user's own auth setting of that name."],["dsControl","","id","integration-auth-setting",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["type","radio",3,"value","formControl","disabled"],["type","checkbox",3,"formControl"],[3,"valueChange","schema","value"],["dsButton","","type","button",3,"click","disabled"]],template:function(t,n){t&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return n.cancel()}),HC(3," \u2190 Integrations "),ml()(),Yw(4,_e,2,0,"p",2)(5,Te,28,12,"form",3),ml()),t&2&&(QE(),pg("title",n.isEditMode()?"Edit integration":"New integration"),QE(3),Qw(n.isLoading()?4:5));},dependencies:[vn,yn,fn,pn,hn,dn,at,un,cn,Kt,fd,Mo,Do,Ut,Mn,Qt,Ca,fo,go,Nn,Rn,Yt],encapsulation:2})};export{ve as IntegrationFormComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-C8kRHbPY.js';import {O}from'./chunk-DtO-loh9.js';import {I}from'./chunk-DEd4dYEy.js';import {g,K as we$1,z as zi,j as mT,a9 as F,at as _y,ad as ne,U,N as Nw,I as Is,a as hg,Y as Yw,m as ml,Q as QE,b as Qw,H as HC,s as sC,R as Eg,p as dC,P as pg,S as BI,J as Jw,L as Lg,T as HI,k as eC,o as Il,ae as qw,q as mf,r as yf,aL as DC,O as x,M as w}from'./main-2W2EKPFF.js';import {y,J as k,L as R,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-CV72_wbg.js';import'./chunk-gOvITjLx.js';var ye=(o,e)=>e.value,be=(o,e)=>e.title;function xe(o,e){o&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function Se(o,e){if(o&1&&(Is(0,"option",34),HC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),QE(),Lg(t.label);}}function Ee(o,e){if(o&1&&(Is(0,"option",34),HC(1),ml()),o&2){let t=e.$implicit;pg("value",t.value),QE(),Lg(t.label);}}function Te(o,e){if(o&1){let t=sC();Is(0,"form",22),Eg("ngSubmit",function(){mf(t);let s=dC(2);return yf(s.save())}),Is(1,"ds-group",23)(2,"dl",24)(3,"dt"),HC(4,"Email"),ml(),Is(5,"dd"),HC(6),ml(),Is(7,"dt"),HC(8,"External ID"),ml(),Is(9,"dd"),HC(10),ml()()(),Is(11,"ds-group",25)(12,"ds-form-field",26),hg(13,"input",27),BI(),ml(),Is(14,"ds-form-field",28),hg(15,"input",29),BI(),ml(),Is(16,"ds-form-field",30),hg(17,"textarea",31),BI(),ml(),Is(18,"ds-form-field",32)(19,"select",33),Jw(20,Se,2,2,"option",34,ye),ml(),BI(),ml(),Is(22,"ds-form-field",35)(23,"select",36),Jw(24,Ee,2,2,"option",34,ye),ml(),BI(),ml()(),Is(26,"ds-form-actions")(27,"button",37),HC(28),ml(),Is(29,"button",38),Eg("click",function(){mf(t);let s=dC(2);return yf(s.cancelEditing())}),HC(30,"Cancel"),ml()()();}if(o&2){let t=dC(),a=dC();pg("formGroup",a.form),QE(6),Lg(t.email),QE(4),Lg(t.externalId),QE(3),HI(),QE(2),HI(),QE(2),HI(),QE(2),HI(),QE(),eC(a.languageOptions),QE(3),HI(),QE(),eC(a.promptCacheTtlOptions),QE(3),pg("disabled",a.isSaving()),QE(),Il(" ",a.isSaving()?"Saving\u2026":"Save changes"," ");}}function Pe(o,e){o&1&&(Is(0,"p",4),HC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),ml());}function Ue(o,e){if(o&1){let t=sC();Is(0,"span",47),HC(1,"Delete?"),ml(),Is(2,"button",48),Eg("click",function(){mf(t);let s=dC().$implicit,m=dC(5);return yf(m.confirmDelete(s))}),HC(3,"Confirm"),ml(),Is(4,"button",49),Eg("click",function(){mf(t);let s=dC(6);return yf(s.cancelDelete())}),HC(5,"Cancel"),ml();}}function Ie(o,e){if(o&1){let t=sC();Is(0,"button",49),Eg("click",function(){mf(t);let s=dC().$implicit,m=dC(5);return yf(m.armDelete(s))}),HC(1,"Delete"),ml();}}function De(o,e){if(o&1&&(Is(0,"li",43)(1,"span",44),HC(2),ml(),Is(3,"span",45),HC(4),ml(),Yw(5,Ue,6,0)(6,Ie,2,0,"button",46),ml()),o&2){let t=e.$implicit,a=dC(5);QE(2),Lg(t.name),QE(2),Lg(t.subtitle),QE(),Qw(a.isPendingDelete(t)?5:6);}}function Ve(o,e){if(o&1&&(Is(0,"span",41),HC(1),ml(),Is(2,"ul",42),Jw(3,De,7,3,"li",43,qw().trackEntry,true),ml()),o&2){let t=e.$implicit;QE(),Lg(t.title),QE(2),eC(t.entries);}}function we(o,e){if(o&1&&Jw(0,Ve,5,1,null,null,be),o&2){let t=dC(3);eC(t.recapSections());}}function Me(o,e){if(o&1){let t=sC();Is(0,"ds-group",23)(1,"dl",24)(2,"dt"),HC(3,"Email"),ml(),Is(4,"dd"),HC(5),ml(),Is(6,"dt"),HC(7,"External ID"),ml(),Is(8,"dd"),HC(9),ml()()(),Is(10,"ds-group",25)(11,"dl",24)(12,"dt"),HC(13,"First name"),ml(),Is(14,"dd"),HC(15),ml(),Is(16,"dt"),HC(17,"Last name"),ml(),Is(18,"dd"),HC(19),ml(),Is(20,"dt"),HC(21,"Bio"),ml(),Is(22,"dd"),HC(23),ml(),Is(24,"dt"),HC(25,"Language"),ml(),Is(26,"dd"),HC(27),ml(),Is(28,"dt"),HC(29,"Prompt cache duration (Claude models via Requesty)"),ml(),Is(30,"dd"),HC(31),ml()()(),Is(32,"ds-form-actions")(33,"button",39),Eg("click",function(){mf(t);let s=dC(2);return yf(s.startEditing())}),HC(34,"Edit profile"),ml()(),Is(35,"ds-disclosure",40),Eg("toggled",function(){mf(t);let s=dC(2);return yf(s.toggleOverrides())}),Yw(36,Pe,2,0,"p",4)(37,we,2,0),ml();}if(o&2){let t=dC(),a=dC();QE(5),Lg(t.email),QE(4),Lg(t.externalId),QE(6),Lg(t.firstname||"\u2014"),QE(4),Lg(t.lastname||"\u2014"),QE(4),Lg(t.bio||"\u2014"),QE(4),Lg(t.preferredLanguage||"\u2014"),QE(4),Lg(a.promptCacheTtlLabel()),QE(4),pg("heading","My global user configurations ("+a.recap().total+")")("open",a.isOverridesExpanded()),QE(),Qw(a.recap().total===0?36:37);}}function Ne(o,e){if(o&1){let t=sC();Is(0,"ds-group",5)(1,"ds-form-field",6)(2,"ds-segmented",7),Eg("valueChange",function(s){mf(t);let m=dC();return yf(m.setThemeVariant(s))}),ml()(),Is(3,"ds-form-field",8)(4,"ds-segmented",9),Eg("valueChange",function(s){mf(t);let m=dC();return yf(m.setTheme(s))}),ml()()(),Is(5,"ds-group",10)(6,"ds-form-field",11)(7,"ds-segmented",12),Eg("valueChange",function(s){mf(t);let m=dC();return yf(m.setEnterKeyBehavior(s))}),ml()()(),Is(8,"ds-group",13)(9,"ds-form-field",14)(10,"ds-segmented",15),Eg("valueChange",function(s){mf(t);let m=dC();return yf(m.setShowTechnical(s))}),ml()()(),Is(11,"ds-group",16)(12,"ds-form-field",17)(13,"input",18,0),Eg("change",function(){mf(t);let s=DC(14),m=dC();return yf(m.setIdeProjectRoot(s.value))}),ml()(),Is(15,"ds-form-field",19)(16,"input",20,1),Eg("change",function(){mf(t);let s=DC(17),m=dC();return yf(m.setIdeUrlTemplate(s.value))}),ml()()(),Yw(18,Te,31,5,"form",21)(19,Me,38,10);}if(o&2){let t=dC();QE(),pg("hint",t.activeVariantDescription()),QE(),pg("options",t.themeVariantOptions)("value",t.themeVariant()),QE(),pg("hint",t.modeOverridden()?t.activeVariantLabel()+" does not support this mode; your choice is kept for other skins.":null),QE(),pg("options",t.modeOptions())("value",t.shownMode()),QE(3),pg("options",t.enterKeyOptions)("value",t.enterKeyBehavior()),QE(3),pg("options",t.showTechnicalOptions)("value",t.showTechnical()),QE(3),pg("value",t.ideProjectRoot()),QE(3),pg("value",t.ideUrlTemplate()),QE(2),Qw(t.isEditing()?18:19);}}function Fe(o,e){o&1&&(Is(0,"p",4),HC(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(R);isEditing=zi(false);isLoading=zi(false);isSaving=zi(false);isOverridesExpanded=zi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=mT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=mT(()=>this.themePort.theme().variant);themeVariantOptions=a.map(({id:e,label:t,description:a})=>({value:e,label:t,description:a}));modeOverridden=mT(()=>!V(this.themeVariant(),this.themeMode()));activeVariantLabel=mT(()=>m(this.themeVariant()).label);activeVariantDescription=mT(()=>m(this.themeVariant()).description);modeOptions=mT(()=>this.themeOptions.map(e=>x(w({},e),{disabled:this.isModeDisabled(e.value)})));shownMode=mT(()=>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"}];ideProjectRoot=this.preferencesPort.ideProjectRoot;ideUrlTemplate=this.preferencesPort.ideUrlTemplate;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:"FIVE_MINUTES",label:"5 minutes (Requesty default)"},{value:"ONE_HOUR",label:"1 hour"}];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("FIVE_MINUTES",{nonNullable:true})});promptCacheTtlLabel=mT(()=>{let e=this.currentUser()?.promptCacheTtl??"FIVE_MINUTES";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,a])=>{let s=e.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),m=t.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),N=a.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:s,aiProviders:m,authSettings:N,total:s.length+m.length+N.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});recapSections=mT(()=>{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);}setIdeProjectRoot(e){this.preferencesPort.setIdeProjectRoot(e);}setIdeUrlTemplate(e){this.preferencesPort.setIdeUrlTemplate(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:a=>{console.error(`[UserProfile] Delete failed for ${e.category}:${e.id}:`,a);}});}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??"FIVE_MINUTES"});}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Nw({type:o,selectors:[["agentos-user-profile"]],decls:5,vars:1,consts:[["projectRootInput",""],["urlTemplateInput",""],["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"],["heading","IDE links"],["label","IDE project root (absolute path)","controlId","ide-project-root","hint","Folder of the project on this machine. Relative file references in agent replies open from it."],["dsControl","","id","ide-project-root","type","text","placeholder","/Users/you/Workspace/project",3,"change","value"],["label","IDE URL template","controlId","ide-url-template","hint","Opens a file in IntelliJ IDEA. {file} is the URL-encoded absolute path, {line} and {column} the position."],["dsControl","","id","ide-url-template","type","text",3,"change","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 duration (Claude models via Requesty)","controlId","up-promptCacheTtl","hintId","up-promptCacheTtl-hint","hint","1 hour sends explicit 1-hour cache markers for Claude models: each cache write costs more, but the conversation stays cached during longer pauses. 5 minutes leaves the request as is (Requesty automatic caching)."],["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,a){if(t&1&&(Is(0,"ds-page",2),hg(1,"ds-section-header",3),Yw(2,xe,2,0,"p",4)(3,Ne,20,13)(4,Fe,2,0,"p",4),ml()),t&2){let s;QE(2),Qw(a.isLoading()?2:(s=a.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 +0,0 @@
|
|
|
1
|
-
import {o}from'./chunk-5mGW4E0G.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-CV72_wbg.js';import {g,W,F,K as we,z as zi,U,O as x,M as w,N as Nw,au as $t,I as Is,R as Eg,H as HC,m as ml,Y as Yw,Q as QE,P as pg,b as Qw,p as dC,s as sC,a as hg,S as BI,J as Jw,am as Kw,T as HI,k as eC,o as Il,q as mf,r as yf,L as Lg}from'./main-2W2EKPFF.js';function ie(i,t){if(i&1&&(Is(0,"a",2),HC(1,"View skill \u2192"),ml()),i&2){let e=dC();pg("routerLink",e.inspectRoute());}}function oe(i,t){i&1&&(Is(0,"ds-tag",3),HC(1,"Platform level"),ml());}function ne(i,t){i&1&&(Is(0,"p",4),HC(1,"Loading\u2026"),ml());}function re(i,t){if(i&1){let e=sC();Is(0,"div",15)(1,"div",19),hg(2,"input",20),BI(),Is(3,"button",21),Eg("click",function(){let l=mf(e).$implicit,te=dC(2);return yf(te.removeResource(l))}),HC(4," \xD7 "),ml()(),hg(5,"textarea",22),BI(),ml();}if(i&2){let e=t.$implicit;QE(2),pg("formControl",e.path),HI(),QE(3),pg("formControl",e.content),HI();}}function ae(i,t){if(i&1&&(Is(0,"ds-notice"),HC(1),ml()),i&2){let e=dC(2);QE(),Lg(e.errorMessage());}}function se(i,t){if(i&1){let e=sC();Is(0,"form",6),Eg("ngSubmit",function(){mf(e);let l=dC();return yf(l.submit())}),Is(1,"ds-form-field",7),hg(2,"input",8),BI(),ml(),Is(3,"ds-form-field",9),hg(4,"textarea",10),BI(),ml(),Is(5,"ds-form-field",11),hg(6,"textarea",12),BI(),ml(),Is(7,"ds-form-field",13)(8,"div",14),Jw(9,re,6,2,"div",15,Kw),Is(11,"div")(12,"button",16),Eg("click",function(){mf(e);let l=dC();return yf(l.addResource())}),HC(13,"+ Add resource"),ml()()()(),Yw(14,ae,2,1,"ds-notice"),Is(15,"ds-form-actions")(16,"button",17),HC(17),ml(),Is(18,"button",18),Eg("click",function(){mf(e);let l=dC();return yf(l.cancel())}),HC(19,"Cancel"),ml()()();}if(i&2){let e=dC();pg("formGroup",e.form),QE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"A valid, non-empty name is required.":null),QE(),pg("formControl",e.nameControl),HI(),QE(2),pg("formControl",e.descriptionControl),HI(),QE(2),pg("formControl",e.bodyControl),HI(),QE(3),eC(e.resourceRows()),QE(5),Qw(e.errorMessage()?14:-1),QE(2),pg("disabled",e.form.invalid||e.isSubmitting()),QE(),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=Nw({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()}),HC(3,"\u2190 Skills"),ml(),Yw(4,ie,2,1,"a",2),Yw(5,oe,2,0,"ds-tag",3),ml(),Yw(6,ne,2,0,"p",4)(7,se,20,8,"form",5),ml()),e&2&&(QE(),pg("title",o.isEditMode()?"Edit skill":"New skill"),QE(3),Qw(o.isEditMode()?4:-1),QE(),Qw(o.isPlatformMode?5:-1),QE(),Qw(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 +0,0 @@
|
|
|
1
|
-
import {a1 as ma,a2 as ga,aa as _r,aC as Jy}from'./main-2W2EKPFF.js';function i(t,o,p){return t.pipe(ma(()=>o().pipe(ga(()=>_r(p)))),Jy({bufferSize:1,refCount:true}))}export{i};
|