@whoz-oss/coday-client 0.125.0 → 0.125.2
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-CRBPOP52.js → chunk-2GTCISR4.js} +1 -1
- package/browser/{chunk-TLXAJ2J2.js → chunk-7QZZJ3DG.js} +1 -1
- package/browser/{chunk-HTG2SANG.js → chunk-AVSWQR2Q.js} +1 -1
- package/browser/{chunk-FOWPCPU3.js → chunk-CP2BIFCA.js} +1 -1
- package/browser/{chunk-H5JE6Y2U.js → chunk-E6KB6VWH.js} +1 -1
- package/browser/{chunk-SHHNG775.js → chunk-EAGBL5PQ.js} +1 -1
- package/browser/{chunk-4VZIFCB6.js → chunk-EUTBCAQW.js} +1 -1
- package/browser/{chunk-UDGUWWGZ.js → chunk-I7DZEVJV.js} +1 -1
- package/browser/{chunk-Q3YY3NFM.js → chunk-J37E3F3X.js} +1 -1
- package/browser/{chunk-XQ4PJULE.js → chunk-J76ELV3B.js} +1 -1
- package/browser/{chunk-SZNIOJIK.js → chunk-LI36MCDZ.js} +1 -1
- package/browser/{chunk-TNUQQNZR.js → chunk-MFKNL6GY.js} +1 -1
- package/browser/{chunk-VOCIDXAB.js → chunk-MSXCVNKO.js} +1 -1
- package/browser/{chunk-J44N4WCW.js → chunk-NUTSPDGN.js} +1 -1
- package/browser/{chunk-JFRMX4TL.js → chunk-OHZKVDVY.js} +1 -1
- package/browser/{chunk-H6OBD3IB.js → chunk-OWYVTOTW.js} +1 -1
- package/browser/{chunk-ZL64I3EB.js → chunk-PKW64TFV.js} +1 -1
- package/browser/{chunk-OPGZ37VP.js → chunk-S66NFQG3.js} +1 -1
- package/browser/chunk-SDPOEKGB.js +1 -0
- package/browser/{chunk-SPIWOGE3.js → chunk-VELN6XU5.js} +1 -1
- package/browser/{chunk-KKEITF3S.js → chunk-VXZ7ZIMM.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-PMTICERL.js → main-PC4NDE3G.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BRHVMM4O.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $}from"./chunk-GAZJZBKP.js";import{b as q,d as y}from"./chunk-QWMDAFBN.js";import{b as h,g as F,m as z}from"./chunk-
|
|
1
|
+
import{c as $}from"./chunk-GAZJZBKP.js";import{b as q,d as y}from"./chunk-QWMDAFBN.js";import{b as h,g as F,m as z}from"./chunk-PKW64TFV.js";import"./chunk-ZAM3WGZM.js";import{a as I}from"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import"./chunk-AK6F2DC7.js";import"./chunk-IXD43YQI.js";import"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import"./chunk-B2QA6UZX.js";import{Bb as u,Db as d,Fb as s,Gc as V,Ka as l,Pb as R,S as M,Tb as g,Ub as b,Wa as C,ab as E,ac as S,ca as c,dc as N,ec as O,ga as p,ha as m,hc as B,i as w,lb as _,ma as D,mb as v,oa as k,rb as f,sb as r,t as A,ta as T,tb as a}from"./chunk-3JGMGRXW.js";function U(i,t){if(i&1&&(r(0,"span",4),g(1),a()),i&2){let e=s();l(),b(e.config.baseUrl)}}function W(i,t){if(i&1){let e=u();r(0,"span",7),g(1,"Delete?"),a(),r(2,"ds-icon-button",8),d("action",function(){p(e);let o=s();return m(o.onDeleteConfirmed())}),a(),r(3,"ds-icon-button",9),d("action",function(){p(e);let o=s();return m(o.onDeleteCancelled())}),a()}}function G(i,t){if(i&1){let e=u();r(0,"ds-kebab-menu",10),d("itemSelected",function(o){p(e);let P=s();return m(P.onMenuAction(o))}),a()}if(i&2){let e=s();f("items",e.menuItems)}}var x=class i{router=c(y);config;namespaceId;deleteRequested=new k;pendingDelete=T(!1);menuItems=[{key:"edit",label:"Edit provider",icon:"edit"},{key:"delete",label:"Delete provider",icon:"delete",variant:"danger"}];onMenuAction(t){switch(t){case"edit":this.router.navigate(["/agentos",this.namespaceId,"ai-providers",this.config.id,"edit"]);break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.config)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=C({type:i,selectors:[["agentos-ai-provider-item"]],inputs:{config:"config",namespaceId:"namespaceId"},outputs:{deleteRequested:"deleteRequested"},decls:10,vars:4,consts:[["role","listitem",1,"ai-provider-item"],[1,"ai-provider-item__body"],[1,"ai-provider-item__name"],[1,"ai-provider-item__type"],[1,"ai-provider-item__url"],[1,"ai-provider-item__actions"],[3,"items"],[1,"ai-provider-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"span",2),g(3),a(),r(4,"span",3),g(5),a(),_(6,U,2,1,"span",4),a(),r(7,"div",5),_(8,W,4,0)(9,G,1,1,"ds-kebab-menu",6),a()()),e&2&&(l(3),b(n.config.name),l(2),b(n.config.apiType),l(),v(n.config.baseUrl?6:-1),l(2),v(n.pendingDelete()?8:9))},dependencies:[z,h],styles:[".ai-provider-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.ai-provider-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-provider-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__type[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__url[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover .ai-provider-item__actions[_ngcontent-%COMP%], .ai-provider-item[_ngcontent-%COMP%]:focus-within .ai-provider-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-provider-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};var H=()=>[];function J(i,t){if(i&1){let e=u();r(0,"agentos-ai-provider-item",4),d("deleteRequested",function(o){p(e);let P=s(2);return m(P.deleteConfig(o))}),a()}if(i&2){let e=s(2);f("config",t)("namespaceId",e.namespaceId)}}function Q(i,t){if(i&1&&_(0,J,1,2,"agentos-ai-provider-item",3),i&2){let e,n=t.$implicit,o=s();v((e=o.resolveConfig(n.id))?0:-1,e)}}var j=class i{route=c(q);router=c(y);destroyRef=c(D);aiProviderController=c($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new w(void 0);configs$=this.refresh$.pipe(M(()=>this.aiProviderController.listByParentAiProvider(this.namespaceId)));configItems$=this.configs$.pipe(A(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.apiType}))));configsById=new Map;constructor(){this.configs$.pipe(I(this.destroyRef)).subscribe(t=>{this.configsById=new Map(t.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"])}deleteConfig(t){this.aiProviderController.deleteAiProvider(t.id??"").pipe(I(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=C({type:i,selectors:[["agentos-namespace-ai-providers"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"config","namespaceId"],[3,"deleteRequested","config","namespaceId"]],template:function(e,n){if(e&1&&(r(0,"ds-entity-list",1),N(1,"async"),d("createRequested",function(){return n.openCreateForm()}),r(2,"ds-icon-button",2),d("action",function(){return n.goBack()}),a()(),E(3,Q,1,1,"ng-template",null,0,B)),e&2){let o=R(4);f("items",O(1,3,n.configItems$)??S(5,H))("showCreate",!0)("itemTemplate",o)}},dependencies:[F,x,h,V],encapsulation:2,changeDetection:0})};export{j as NamespaceAiProvidersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-IFXDK4GQ.js";import{d as T}from"./chunk-QWMDAFBN.js";import{b as q,g as E,m as D}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-IFXDK4GQ.js";import{d as T}from"./chunk-QWMDAFBN.js";import{b as q,g as E,m as D}from"./chunk-PKW64TFV.js";import{a as U}from"./chunk-AJOXSD6I.js";import{Bb as w,Db as a,Fb as m,Ka as d,Pb as R,Tb as C,Ub as h,Wa as c,ab as I,ca as p,ga as y,ha as b,hc as M,kc as S,lb as _,ma as x,mb as f,oa as v,rb as u,sb as r,tb as o}from"./chunk-3JGMGRXW.js";function O(i,e){if(i&1&&(r(0,"span",3),C(1),o()),i&2){let t=m();d(),h(t.subtitle)}}var g=class i{user;editRequested=new v;deleteRequested=new v;menuItems=[{key:"edit",label:"Edit user",icon:"edit"},{key:"delete",label:"Delete user",icon:"delete",variant:"danger"}];get displayName(){let{firstname:e,lastname:t,email:n}=this.user;return[e,t].filter(Boolean).join(" ")||n||"\u2014"}get subtitle(){return this.user.email??this.user.externalId??""}onMenuAction(e){switch(e){case"edit":this.editRequested.emit(this.user);break;case"delete":confirm(`Delete user "${this.displayName}"?`)&&this.deleteRequested.emit(this.user);break}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=c({type:i,selectors:[["agentos-user-item"]],inputs:{user:"user"},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"user-item"],[1,"user-item__body"],[1,"user-item__name"],[1,"user-item__subtitle"],[1,"user-item__actions"],[3,"itemSelected","items"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"div",1)(2,"span",2),C(3),o(),_(4,O,2,1,"span",3),o(),r(5,"div",4)(6,"ds-kebab-menu",5),a("itemSelected",function(l){return n.onMenuAction(l)}),o()()()),t&2&&(d(3),h(n.displayName),d(),f(n.subtitle?4:-1),d(2),u("items",n.menuItems))},dependencies:[D],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:1rem 1.25rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-sizing:border-box;overflow:hidden;position:relative}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}"],changeDetection:0})};function B(i,e){if(i&1){let t=w();r(0,"agentos-user-item",4),a("editRequested",function(s){y(t);let l=m(2);return b(l.navigateToEdit(s))})("deleteRequested",function(s){y(t);let l=m(2);return b(l.deleteUser(s))}),o()}i&2&&u("user",e)}function P(i,e){if(i&1&&_(0,B,1,1,"agentos-user-item",3),i&2){let t,n=e.$implicit,s=m();f((t=s.resolveUser(n.id))?0:-1,t)}}var k=class i{router=p(T);destroyRef=p(x);userAdminState=p(L);isLoading=this.userAdminState.isLoading;userItems=S(()=>this.userAdminState.users().map(e=>({id:e.id??"",name:[e.firstname,e.lastname].filter(Boolean).join(" ")||e.email||"\u2014",description:e.email})));get usersById(){return new Map(this.userAdminState.users().map(e=>[e.id??"",e]))}ngOnInit(){this.userAdminState.loadAll().pipe(U(this.destroyRef)).subscribe()}goBack(){this.router.navigate(["/agentos"])}navigateToCreate(){this.router.navigate(["/agentos/admin/users/new"])}navigateToEdit(e){this.router.navigate(["/agentos/admin/users",e.id??"","edit"])}deleteUser(e){this.userAdminState.deleteUser(e.id??"").pipe(U(this.destroyRef)).subscribe()}resolveUser(e){return this.usersById.get(e)??null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=c({type:i,selectors:[["agentos-user-list"]],decls:4,vars:3,consts:[["userItemTpl",""],["title","Users","emptyMessage","No users found.","cardMinWidth","320px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"user"],[3,"editRequested","deleteRequested","user"]],template:function(t,n){if(t&1&&(r(0,"ds-entity-list",1),a("createRequested",function(){return n.navigateToCreate()}),r(1,"ds-icon-button",2),a("action",function(){return n.goBack()}),o()(),I(2,P,1,1,"ng-template",null,0,M)),t&2){let s=R(3);u("items",n.userItems())("showCreate",!0)("itemTemplate",s)}},dependencies:[E,g,q],encapsulation:2,changeDetection:0})};export{g as a,k as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as me,c as le}from"./chunk-WNNKQ2DH.js";import{a as R}from"./chunk-AQ3SEH2N.js";import{a as z,b as Se,c as Fe}from"./chunk-UKAN3Y3I.js";import{e as Pe,f as xe,g as ve,h as ye,i as we,j as Oe,k as ke,l as Ee}from"./chunk-ZL64I3EB.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import{c as de,d as pe,i as ge,j as ue,m as fe,n as Me}from"./chunk-AK6F2DC7.js";import{a as te,b as ne,d as oe,e as ie,f as re,g as ae,h as se}from"./chunk-DRBOHCTP.js";import"./chunk-IXD43YQI.js";import{a as L,b as A}from"./chunk-WPC6XC7P.js";import{A as Ce,C as B,b as _e,c as he,g as W,m as V,p as be}from"./chunk-XJUBZLY2.js";import"./chunk-XIQ3L6H6.js";import{O as D,Q as ce,S as I}from"./chunk-B2QA6UZX.js";import{Bb as f,Cc as $,Db as d,Fb as l,Jc as ee,Ka as c,Pb as N,Rb as T,Tb as a,Ub as M,Vb as O,Wa as F,Xb as x,Yb as v,Zb as y,ab as U,ac as J,bc as Q,ca as _,ga as g,ha as u,hc as X,kc as Z,lb as h,mb as b,nb as q,pb as H,qb as Y,rb as C,sb as n,ta as P,tb as o,yb as G,zb as K}from"./chunk-3JGMGRXW.js";function Re(s,i){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),o(),n(4,"textarea",19),y("ngModelChange",function(r){let m=g(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),u(r)}),o(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),o()(),n(7,"button",20),d("click",function(){let r=g(e).$index,m=l();return u(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),o()()()}if(s&2){let e=i.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function ze(s,i){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),o(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),o(),n(10,"span",27),a(11,"Local"),o()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),o()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),o(),n(20,"span",27),a(21,"Project"),o()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),o()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),o()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,i){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),o(),n(3,"div",31)(4,"span",26),a(5),o(),n(6,"span",27),a(7),o()(),n(8,"p",30),a(9,"Cannot be changed after creation"),o()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function Ne(s,i){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){g(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),u(r)}),o(),n(3,"span"),a(4,"Enable webhook"),o()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),o()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function je(s,i){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),o(),n(4,"h4"),a(5,"Webhook URL"),o()(),n(6,"div",36)(7,"p",37),a(8),o(),n(9,"button",38),d("click",function(){g(e);let r=l();return u(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),o(),n(12,"span"),a(13,"Copy URL"),o()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),o()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function qe(s,i){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),o(),n(3,"span"),a(4),o()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=_(R);dialogRef=_(te);configApi=_(z);snackBar=_(me);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=_(ne);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??!1},error:i=>{console.error("[PROMPT_FORM] Error loading user config:",i),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(i){this.commands.length>1&&this.commands.splice(i,1)}trackByIndex(i){return i}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let i=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let i=this.getWebhookUrl();navigator.clipboard.writeText(i).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),o(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),o(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),o(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),o()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),o(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),o(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),o()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),o(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),o()()(),n(23,"div",8),H(24,Re,10,3,"div",9,q),o()(),h(26,ze,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,Ne,7,1,"div",12),h(29,je,16,1,"div",13),h(30,qe,5,1,"div",14),o()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),o(),n(34,"button",17),d("click",function(){return t.save()}),a(35),o()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ee,B,he,_e,be,W,Ce,V,se,ie,ae,re,I,ce,D,Me,fe,ge,de,pe,ue,A,L,le],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var He=()=>[],Ye=s=>({id:s});function Ge(s,i){if(s&1&&(n(0,"div",6),a(1),o()),s&2){let e=l();c(),M(e.errorMessage())}}function Ke(s,i){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){g(e);let m=l();return u(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),o()(),K(),o()}if(s&2){let e=i.$implicit;l();let t=N(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,He)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ye,e.id))}}function Je(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){g(e);let r=l().id,m=l();return u(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),o(),a(3),o()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Qe(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=g(e).id,m=l();return u(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),o(),a(3," Edit "),o(),h(4,Je,4,2,"button",12),n(5,"button",13),d("click",function(){let r=g(e).id,m=l();return u(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),o(),a(8," Delete "),o()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var Te="system",De=class s{promptApi=_(R);configApi=_(z);location=_($);dialog=_(oe);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let i=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?i.filter(p=>this.isMyPrompt(p)):i,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===Te?1:w===Te?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Ie=>Ie.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin.set(i.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(i.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:i=>{this.prompts.set(i.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:i=>{this.errorMessage.set(i?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(i){this.promptApi.getPrompt(i).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(i){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(i).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(i){let e=this.prompts().find(r=>r.id===i);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(i):this.promptApi.enableWebhook(i)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(i){return this.prompts().find(e=>e.id===i)?.webhookEnabled??!1}isMyPrompt(i){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(i.createdBy)===e(this.currentUsername())}buildBadges(i){let e=[];return i.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),i.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),o()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),o()(),h(7,Ge,2,1,"div",6),o(),U(8,Ke,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),U(12,Qe,9,1,"ng-template",7),o()),e&2){let r=N(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[ve,xe,Pe,I,D,A,L,Fe,Se,Ee,Oe,ye,we,ke,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{De as PromptListComponent};
|
|
1
|
+
import{b as me,c as le}from"./chunk-WNNKQ2DH.js";import{a as R}from"./chunk-AQ3SEH2N.js";import{a as z,b as Se,c as Fe}from"./chunk-UKAN3Y3I.js";import{e as Pe,f as xe,g as ve,h as ye,i as we,j as Oe,k as ke,l as Ee}from"./chunk-PKW64TFV.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import{c as de,d as pe,i as ge,j as ue,m as fe,n as Me}from"./chunk-AK6F2DC7.js";import{a as te,b as ne,d as oe,e as ie,f as re,g as ae,h as se}from"./chunk-DRBOHCTP.js";import"./chunk-IXD43YQI.js";import{a as L,b as A}from"./chunk-WPC6XC7P.js";import{A as Ce,C as B,b as _e,c as he,g as W,m as V,p as be}from"./chunk-XJUBZLY2.js";import"./chunk-XIQ3L6H6.js";import{O as D,Q as ce,S as I}from"./chunk-B2QA6UZX.js";import{Bb as f,Cc as $,Db as d,Fb as l,Jc as ee,Ka as c,Pb as N,Rb as T,Tb as a,Ub as M,Vb as O,Wa as F,Xb as x,Yb as v,Zb as y,ab as U,ac as J,bc as Q,ca as _,ga as g,ha as u,hc as X,kc as Z,lb as h,mb as b,nb as q,pb as H,qb as Y,rb as C,sb as n,ta as P,tb as o,yb as G,zb as K}from"./chunk-3JGMGRXW.js";function Re(s,i){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),o(),n(4,"textarea",19),y("ngModelChange",function(r){let m=g(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),u(r)}),o(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),o()(),n(7,"button",20),d("click",function(){let r=g(e).$index,m=l();return u(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),o()()()}if(s&2){let e=i.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function ze(s,i){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),o(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),o(),n(10,"span",27),a(11,"Local"),o()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),o()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),o(),n(20,"span",27),a(21,"Project"),o()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),o()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),o()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,i){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),o(),n(3,"div",31)(4,"span",26),a(5),o(),n(6,"span",27),a(7),o()(),n(8,"p",30),a(9,"Cannot be changed after creation"),o()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function Ne(s,i){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){g(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),u(r)}),o(),n(3,"span"),a(4,"Enable webhook"),o()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),o()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function je(s,i){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),o(),n(4,"h4"),a(5,"Webhook URL"),o()(),n(6,"div",36)(7,"p",37),a(8),o(),n(9,"button",38),d("click",function(){g(e);let r=l();return u(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),o(),n(12,"span"),a(13,"Copy URL"),o()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),o()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function qe(s,i){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),o(),n(3,"span"),a(4),o()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=_(R);dialogRef=_(te);configApi=_(z);snackBar=_(me);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=_(ne);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??!1},error:i=>{console.error("[PROMPT_FORM] Error loading user config:",i),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(i){this.commands.length>1&&this.commands.splice(i,1)}trackByIndex(i){return i}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let i=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let i=this.getWebhookUrl();navigator.clipboard.writeText(i).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),o(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),o(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),o(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),o()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),o(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),o(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),o()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),o(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),o()()(),n(23,"div",8),H(24,Re,10,3,"div",9,q),o()(),h(26,ze,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,Ne,7,1,"div",12),h(29,je,16,1,"div",13),h(30,qe,5,1,"div",14),o()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),o(),n(34,"button",17),d("click",function(){return t.save()}),a(35),o()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ee,B,he,_e,be,W,Ce,V,se,ie,ae,re,I,ce,D,Me,fe,ge,de,pe,ue,A,L,le],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var He=()=>[],Ye=s=>({id:s});function Ge(s,i){if(s&1&&(n(0,"div",6),a(1),o()),s&2){let e=l();c(),M(e.errorMessage())}}function Ke(s,i){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){g(e);let m=l();return u(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),o()(),K(),o()}if(s&2){let e=i.$implicit;l();let t=N(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,He)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ye,e.id))}}function Je(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){g(e);let r=l().id,m=l();return u(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),o(),a(3),o()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Qe(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=g(e).id,m=l();return u(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),o(),a(3," Edit "),o(),h(4,Je,4,2,"button",12),n(5,"button",13),d("click",function(){let r=g(e).id,m=l();return u(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),o(),a(8," Delete "),o()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var Te="system",De=class s{promptApi=_(R);configApi=_(z);location=_($);dialog=_(oe);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let i=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?i.filter(p=>this.isMyPrompt(p)):i,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===Te?1:w===Te?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Ie=>Ie.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin.set(i.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(i.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:i=>{this.prompts.set(i.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:i=>{this.errorMessage.set(i?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(i){this.promptApi.getPrompt(i).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(i){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(i).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(i){let e=this.prompts().find(r=>r.id===i);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(i):this.promptApi.enableWebhook(i)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(i){return this.prompts().find(e=>e.id===i)?.webhookEnabled??!1}isMyPrompt(i){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(i.createdBy)===e(this.currentUsername())}buildBadges(i){let e=[];return i.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),i.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),o()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),o()(),h(7,Ge,2,1,"div",6),o(),U(8,Ke,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),U(12,Qe,9,1,"ng-template",7),o()),e&2){let r=N(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[ve,xe,Pe,I,D,A,L,Fe,Se,Ee,Oe,ye,we,ke,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{De as PromptListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-GAZJZBKP.js";import{b as w,d as M}from"./chunk-QWMDAFBN.js";import{b as k}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-GAZJZBKP.js";import{b as w,d as M}from"./chunk-QWMDAFBN.js";import{b as k}from"./chunk-PKW64TFV.js";import{a as I}from"./chunk-AJOXSD6I.js";import{Db as d,Jb as y,Ka as m,Kb as v,Lb as C,Ma as _,Rc as x,S as f,Tb as l,Wa as b,ca as n,ma as g,rb as p,sb as a,t as h,ta as c,tb as i}from"./chunk-3JGMGRXW.js";var H=["composerInput"],P=class u{http=n(x);router=n(M);route=n(w);config=n(E);destroyRef=n(g);composerInput;namespaceId=this.route.snapshot.params.namespaceId;inputValue=c("");isCreating=c(!1);constructor(){_(()=>{this.composerInput?.nativeElement.focus()})}get canSend(){return!!this.inputValue().trim()&&!this.isCreating()}onInput(t){this.inputValue.set(t.target.value)}onKeydown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.submit())}submit(){if(!this.canSend)return;let t=this.inputValue().trim();this.inputValue.set(""),this.isCreating.set(!0),this.http.post(`${this.config.basePath}/api/cases`,{namespaceId:this.namespaceId,metadata:{}}).pipe(f(e=>this.http.post(`${this.config.basePath}/api/cases/${e.id}/messages`,{content:t,userId:"default-user"}).pipe(h(()=>e))),I(this.destroyRef)).subscribe({next:e=>{this.router.navigate([e.id??""],{relativeTo:this.route})},error:e=>{console.error("[CaseHome] Failed to create case or send first message",e),this.isCreating.set(!1),this.inputValue.set(t)}})}static \u0275fac=function(e){return new(e||u)};static \u0275cmp=b({type:u,selectors:[["agentos-case-home"]],viewQuery:function(e,o){if(e&1&&y(H,5),e&2){let r;v(r=C())&&(o.composerInput=r.first)}},decls:11,vars:3,consts:[["composerInput",""],[1,"case-home"],[1,"case-home__hero"],[1,"case-home__headline"],[1,"case-home__composer"],["placeholder","Describe your task or ask a question\u2026","rows","4",1,"case-home__input",3,"input","keydown","value","disabled"],[1,"case-home__composer-footer"],[1,"case-home__hint"],["icon","send","variant","primary","title","Start case (Enter)",3,"action","disabled"]],template:function(e,o){e&1&&(a(0,"div",1)(1,"div",2)(2,"h1",3),l(3,"What can I help you with?"),i(),a(4,"div",4)(5,"textarea",5,0),d("input",function(s){return o.onInput(s)})("keydown",function(s){return o.onKeydown(s)}),i(),a(7,"div",6)(8,"span",7),l(9,"Enter to send\xA0\xA0\xB7\xA0\xA0Shift+Enter for new line"),i(),a(10,"ds-icon-button",8),d("action",function(){return o.submit()}),i()()()()()),e&2&&(m(5),p("value",o.inputValue())("disabled",o.isCreating()),m(5),p("disabled",!o.canSend))},dependencies:[k],styles:[".case-home[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;align-items:center;justify-content:center}.case-home__hero[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:2rem;padding:2rem 1.5rem 4rem;max-width:680px;width:100%}.case-home__headline[_ngcontent-%COMP%]{margin:0;font-size:clamp(1.5rem,4vw,2.25rem);font-weight:700;letter-spacing:-.03em;color:var(--color-text, #1d1d1f);text-align:center}.case-home__composer[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:16px;box-shadow:0 4px 24px #00000012;overflow:hidden;transition:box-shadow .2s ease,border-color .2s ease}.case-home__composer[_ngcontent-%COMP%]:focus-within{box-shadow:0 4px 32px #007aff26;border-color:var(--color-primary, #007aff)}.case-home__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:1rem 1.25rem .5rem;border:none;background:transparent;color:var(--color-text, #1d1d1f);font-size:1rem;font-family:inherit;line-height:1.6;outline:none;box-sizing:border-box}.case-home__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-home__input[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.case-home__composer-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.5rem .5rem .5rem 1.25rem}.case-home__hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};export{P as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-SDPOEKGB.js";import"./chunk-GAZJZBKP.js";import"./chunk-QWMDAFBN.js";import"./chunk-PKW64TFV.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import"./chunk-AK6F2DC7.js";import"./chunk-IXD43YQI.js";import"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import"./chunk-B2QA6UZX.js";import"./chunk-3JGMGRXW.js";export{a as CaseChatComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Y}from"./chunk-6LO3ANKL.js";import{d as K}from"./chunk-GAZJZBKP.js";import{a as A,b as H,c as G,d as J}from"./chunk-QWMDAFBN.js";import{a as U,b as g,g as X}from"./chunk-
|
|
1
|
+
import{b as Y}from"./chunk-6LO3ANKL.js";import{d as K}from"./chunk-GAZJZBKP.js";import{a as A,b as H,c as G,d as J}from"./chunk-QWMDAFBN.js";import{a as U,b as g,g as X}from"./chunk-PKW64TFV.js";import{b}from"./chunk-AJOXSD6I.js";import{A as D,B as O,Bb as h,Db as l,Fb as m,Jb as N,Ka as c,Kb as k,Lb as L,Pb as V,Rb as F,S as R,Tb as W,Ub as $,Wa as d,Xb as B,Yb as Q,Zb as j,ab as q,ca as p,ga as u,ha as C,hc as z,i as I,lb as P,m as x,mb as E,oa as f,rb as _,sb as o,t as y,ta as M,tb as s,ub as S,va as T}from"./chunk-3JGMGRXW.js";var v=class i{case;static toListItem(e){return{id:e.id??"",name:e.id??"\u2014",description:void 0}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=d({type:i,selectors:[["agentos-case-item"]],inputs:{case:"case"},decls:0,vars:0,template:function(t,n){},encapsulation:2,changeDetection:0})};var ne=["caseItemTpl"];function ae(i,e){if(i&1){let t=h();o(0,"button",3),l("click",function(){let a=u(t).$implicit,r=m();return C(r.onItemSelected(a.id))}),o(1,"span",4),W(2),s()()}if(i&2){let t=e.$implicit,n=m();F("case-drawer-item--active",t.id===n.activeCaseId),c(2),$(t.name)}}var w=class i{cases=[];activeCaseId=null;caseSelected=new f;createRequested=new f;closeRequested=new f;caseItemTpl;caseItems=[];ngOnChanges(e){e.cases&&(this.caseItems=this.cases.map(v.toListItem))}onItemSelected(e){this.caseSelected.emit(e)}onCreateRequested(){this.createRequested.emit()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=d({type:i,selectors:[["agentos-case-drawer"]],viewQuery:function(t,n){if(t&1&&N(ne,7),t&2){let a;k(a=L())&&(n.caseItemTpl=a.first)}},inputs:{cases:"cases",activeCaseId:"activeCaseId"},outputs:{caseSelected:"caseSelected",createRequested:"createRequested",closeRequested:"closeRequested"},features:[T],decls:4,vars:3,consts:[["caseItemTpl",""],["title","Cases","emptyMessage","No cases yet. Start one below.","searchPlaceholder","Filter cases\u2026","cardMinWidth","220px","contentMaxWidth","100%",3,"itemSelected","createRequested","items","itemTemplate","showCreate"],["toolbar-start","","icon","chevron_left","variant","default","title","Close drawer",3,"action"],["type","button",1,"case-drawer-item",3,"click"],[1,"case-drawer-item__name"]],template:function(t,n){if(t&1&&(o(0,"ds-entity-list",1),l("itemSelected",function(r){return n.onItemSelected(r)})("createRequested",function(){return n.onCreateRequested()}),o(1,"ds-icon-button",2),l("action",function(){return n.closeRequested.emit()}),s()(),q(2,ae,3,3,"ng-template",null,0,z)),t&2){let a=V(3);_("items",n.caseItems)("itemTemplate",a)("showCreate",!0)}},dependencies:[X,g],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}.case-drawer-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.5rem .75rem;border-radius:8px;border:none;background:transparent;cursor:pointer;text-align:left;font-family:inherit;font-size:.875rem;color:var(--color-text, #1d1d1f);transition:background .12s ease;gap:.5rem}.case-drawer-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .05))}.case-drawer-item--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-inverse, #fff)}.case-drawer-item--active[_ngcontent-%COMP%] .case-drawer-item__status[_ngcontent-%COMP%]{color:#ffffffb3}.case-drawer-item--active[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover, #0051d5)}.case-drawer-item__name[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);font-size:.8rem}'],changeDetection:0})};function ie(i,e){if(i&1){let t=h();o(0,"div",7)(1,"ds-icon-button",8),l("action",function(){u(t);let a=m();return C(a.toggleDrawer())}),s()()}}var te=class i{router=p(J);route=p(H);caseController=p(K);namespaceId=this.route.snapshot.params.namespaceId;drawerOpen=M(!0);refresh$=new I(void 0);cases$=this.refresh$.pipe(R(()=>this.caseController.listByParentCase(this.namespaceId)));cases=b(this.cases$,{initialValue:[]});activeCaseId=b(D(x(this.router.url),this.router.events.pipe(O(e=>e instanceof A),y(e=>e.urlAfterRedirects))).pipe(y(e=>this.extractCaseId(e))),{initialValue:null});extractCaseId(e){return e.match(/\/cases\/([^/?#]+)/)?.[1]??null}toggleDrawer(){this.drawerOpen.update(e=>!e)}onCaseSelected(e){this.router.navigate([e],{relativeTo:this.route})}onCreateRequested(){this.router.navigate(["."],{relativeTo:this.route})}refreshCases(){this.refresh$.next()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=d({type:i,selectors:[["agentos-case-shell"]],decls:9,vars:4,consts:[[1,"case-shell"],[1,"case-shell__header"],[1,"case-shell__body"],["drawerWidth","400px",3,"openChange","open"],["dsDrawerSide","",1,"case-shell__sidenav"],[3,"caseSelected","createRequested","closeRequested","cases","activeCaseId"],["dsDrawerContent","",1,"case-shell__content"],[1,"case-shell__toggle"],["icon","menu","variant","default","title","Open drawer",3,"action"]],template:function(t,n){t&1&&(o(0,"div",0),S(1,"agentos-header",1),o(2,"div",2)(3,"ds-drawer",3),j("openChange",function(r){return Q(n.drawerOpen,r)||(n.drawerOpen=r),r}),o(4,"div",4)(5,"agentos-case-drawer",5),l("caseSelected",function(r){return n.onCaseSelected(r)})("createRequested",function(){return n.onCreateRequested()})("closeRequested",function(){return n.toggleDrawer()}),s()(),o(6,"div",6),P(7,ie,2,0,"div",7),S(8,"router-outlet"),s()()()()),t&2&&(c(3),B("open",n.drawerOpen),c(2),_("cases",n.cases())("activeCaseId",n.activeCaseId()),c(2),E(n.drawerOpen()?-1:7))},dependencies:[G,U,w,Y,g],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100dvh}.case-shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.case-shell__header[_ngcontent-%COMP%]{flex-shrink:0}.case-shell__body[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.case-shell__sidenav[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.case-shell__content[_ngcontent-%COMP%]{position:relative;flex:1;display:flex;flex-direction:column;height:100%;overflow:hidden}.case-shell__toggle[_ngcontent-%COMP%]{position:absolute;top:.375rem;left:.5rem;z-index:10}"]})};export{v as a,w as b,te as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-2GTCISR4.js";import"./chunk-GAZJZBKP.js";import"./chunk-QWMDAFBN.js";import"./chunk-PKW64TFV.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import"./chunk-AK6F2DC7.js";import"./chunk-IXD43YQI.js";import"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import"./chunk-B2QA6UZX.js";import"./chunk-3JGMGRXW.js";export{a as NamespaceListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as L,c as z}from"./chunk-GAZJZBKP.js";import{b as F,d as y}from"./chunk-QWMDAFBN.js";import{b as v,g as K,m as j}from"./chunk-
|
|
1
|
+
import{b as L,c as z}from"./chunk-GAZJZBKP.js";import{b as F,d as y}from"./chunk-QWMDAFBN.js";import{b as v,g as K,m as j}from"./chunk-PKW64TFV.js";import"./chunk-ZAM3WGZM.js";import{a as x}from"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import"./chunk-AK6F2DC7.js";import"./chunk-IXD43YQI.js";import"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import"./chunk-B2QA6UZX.js";import{Bb as u,Db as s,Fb as l,Gc as $,Ka as p,Pb as T,S as P,Tb as f,Ub as I,Vb as E,Wa as g,ab as R,ac as O,ca as d,dc as B,ec as V,ga as m,ha as c,hc as q,i as w,lb as C,ma as k,mb as b,oa as N,rb as _,sb as a,t as A,ta as S,tb as r,u as D}from"./chunk-3JGMGRXW.js";function H(o,i){if(o&1){let e=u();a(0,"span",7),f(1,"Delete?"),r(),a(2,"ds-icon-button",8),s("action",function(){m(e);let t=l();return c(t.onDeleteConfirmed())}),r(),a(3,"ds-icon-button",9),s("action",function(){m(e);let t=l();return c(t.onDeleteCancelled())}),r()}}function J(o,i){if(o&1){let e=u();a(0,"ds-kebab-menu",10),s("itemSelected",function(t){m(e);let h=l();return c(h.onMenuAction(t))}),r()}if(o&2){let e=l();_("items",e.menuItems)}}var M=class o{router=d(y);model;namespaceId;deleteRequested=new N;pendingDelete=S(!1);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model.alias??this.model.apiModelName}onMenuAction(i){switch(i){case"edit":this.router.navigate(["/agentos",this.namespaceId,"ai-models",this.model.id,"edit"]);break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.model)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=g({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:"model",namespaceId:"namespaceId"},outputs:{deleteRequested:"deleteRequested"},decls:12,vars:4,consts:[["role","listitem",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"span",2),f(3),r(),a(4,"span",3),f(5),r(),a(6,"span",4)(7,"span"),f(8),r()()(),a(9,"div",5),C(10,H,4,0)(11,J,1,1,"ds-kebab-menu",6),r()()),e&2&&(p(3),I(n.displayTitle),p(2),I(n.model.apiModelName),p(3),E("priority: ",n.model.priority),p(2),b(n.pendingDelete()?10:11))},dependencies:[j,v],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:.75rem;color:var(--color-text-secondary, #6e6e73)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};var Q=()=>[];function X(o,i){if(o&1){let e=u();a(0,"agentos-ai-model-item",4),s("deleteRequested",function(t){m(e);let h=l(2);return c(h.deleteModel(t))}),r()}if(o&2){let e=l(2);_("model",i)("namespaceId",e.namespaceId)}}function Y(o,i){if(o&1&&C(0,X,1,2,"agentos-ai-model-item",3),o&2){let e,n=i.$implicit,t=l();b((e=t.resolveModel(n.id))?0:-1,e)}}var U=class o{route=d(F);router=d(y);destroyRef=d(k);aiModelController=d(L);aiProviderController=d(z);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new w(void 0);data$=this.refresh$.pipe(P(()=>D([this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),this.aiProviderController.listByParentAiProvider(this.namespaceId)])));modelItems$=this.data$.pipe(A(([i,e])=>{let n=new Map(e.map(t=>[t.id??"",t.name]));return i.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:t.aiProviderId,groupLabel:n.get(t.aiProviderId)??t.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(x(this.destroyRef)).subscribe(([i])=>{this.modelsById=new Map(i.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"])}deleteModel(i){this.aiModelController.deleteAiModel(i.id??"").pipe(x(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveModel(i){return this.modelsById.get(i)??null}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=g({type:o,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId"],[3,"deleteRequested","model","namespaceId"]],template:function(e,n){if(e&1&&(a(0,"ds-entity-list",1),B(1,"async"),s("createRequested",function(){return n.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return n.goBack()}),r()(),R(3,Y,1,1,"ng-template",null,0,q)),e&2){let t=T(4);_("items",V(1,3,n.modelItems$)??O(5,Q))("showCreate",!0)("itemTemplate",t)}},dependencies:[K,M,v,$],encapsulation:2,changeDetection:0})};export{U as NamespaceAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as $}from"./chunk-GAZJZBKP.js";import{b as q,d as I}from"./chunk-QWMDAFBN.js";import{b as y,g as A}from"./chunk-
|
|
1
|
+
import{e as $}from"./chunk-GAZJZBKP.js";import{b as q,d as I}from"./chunk-QWMDAFBN.js";import{b as y,g as A}from"./chunk-PKW64TFV.js";import"./chunk-ZAM3WGZM.js";import{a as x}from"./chunk-AJOXSD6I.js";import"./chunk-53STPEYQ.js";import"./chunk-AK6F2DC7.js";import"./chunk-IXD43YQI.js";import"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import"./chunk-B2QA6UZX.js";import{Bb as p,Db as s,Fb as c,Gc as B,Ka as d,Pb as P,S as M,Tb as C,Ub as h,Wa as f,ab as k,ac as N,ca as m,dc as S,ec as V,ga as l,ha as g,hc as O,i as w,lb as _,ma as E,mb as u,oa as T,rb as v,sb as r,t as D,ta as R,tb as a}from"./chunk-3JGMGRXW.js";function U(n,t){if(n&1){let e=p();r(0,"span",5),C(1,"Delete?"),a(),r(2,"ds-icon-button",6),s("action",function(){l(e);let i=c();return g(i.onDeleteConfirmed())}),a(),r(3,"ds-icon-button",7),s("action",function(){l(e);let i=c();return g(i.onDeleteCancelled())}),a()}}function W(n,t){if(n&1){let e=p();r(0,"ds-icon-button",8),s("action",function(){l(e);let i=c();return g(i.onEdit())}),a(),r(1,"ds-icon-button",9),s("action",function(){l(e);let i=c();return g(i.onDeleteArmed())}),a()}}var b=class n{router=m(I);config;namespaceId;deleteRequested=new T;pendingDelete=R(!1);onEdit(){this.router.navigate(["/agentos",this.namespaceId,"integrations",this.config.id,"edit"])}onDeleteArmed(){this.pendingDelete.set(!0)}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.config)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=f({type:n,selectors:[["agentos-integration-config-item"]],inputs:{config:"config",namespaceId:"namespaceId"},outputs:{deleteRequested:"deleteRequested"},decls:9,vars:3,consts:[["role","listitem",1,"integration-config-item"],[1,"integration-config-item__body"],[1,"integration-config-item__name"],[1,"integration-config-item__type"],[1,"integration-config-item__actions"],[1,"integration-config-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","edit","title","Edit integration",3,"action"],["icon","delete","variant","danger","title","Delete integration",3,"action"]],template:function(e,o){e&1&&(r(0,"div",0)(1,"div",1)(2,"span",2),C(3),a(),r(4,"span",3),C(5),a()(),r(6,"div",4),_(7,U,4,0)(8,W,2,0),a()()),e&2&&(d(3),h(o.config.name),d(2),h(o.config.integrationType),d(2),u(o.pendingDelete()?7:8))},dependencies:[y],styles:[".integration-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.integration-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.integration-config-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__type[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover .integration-config-item__actions[_ngcontent-%COMP%], .integration-config-item[_ngcontent-%COMP%]:focus-within .integration-config-item__actions[_ngcontent-%COMP%]{opacity:1}.integration-config-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};var G=()=>[];function H(n,t){if(n&1){let e=p();r(0,"agentos-integration-config-item",4),s("deleteRequested",function(i){l(e);let j=c(2);return g(j.deleteConfig(i))}),a()}if(n&2){let e=c(2);v("config",t)("namespaceId",e.namespaceId)}}function J(n,t){if(n&1&&_(0,H,1,2,"agentos-integration-config-item",3),n&2){let e,o=t.$implicit,i=c();u((e=i.resolveConfig(o.id))?0:-1,e)}}var F=class n{route=m(q);router=m(I);destroyRef=m(E);integrationConfigController=m($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new w(void 0);configs$=this.refresh$.pipe(M(()=>this.integrationConfigController.listByParentIntegrationConfig(this.namespaceId)));configItems$=this.configs$.pipe(D(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(x(this.destroyRef)).subscribe(t=>{this.configsById=new Map(t.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"])}deleteConfig(t){this.integrationConfigController.deleteIntegrationConfig(t.id??"").pipe(x(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=f({type:n,selectors:[["agentos-namespace-integrations"]],decls:5,vars:6,consts:[["integrationItemTpl",""],["title","Integrations","emptyMessage","No integrations configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"config","namespaceId"],[3,"deleteRequested","config","namespaceId"]],template:function(e,o){if(e&1&&(r(0,"ds-entity-list",1),S(1,"async"),s("createRequested",function(){return o.openCreateForm()}),r(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),a()(),k(3,J,1,1,"ng-template",null,0,O)),e&2){let i=P(4);v("items",V(1,3,o.configItems$)??N(5,G))("showCreate",!0)("itemTemplate",i)}},dependencies:[A,b,y,B],encapsulation:2})};export{F as NamespaceIntegrationsComponent};
|