@whoz-oss/coday-client 0.242.0 → 0.244.0
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-JCKKIKVU.js → chunk-4CNY7Z64.js} +1 -1
- package/browser/{chunk-NEVEN2BG.js → chunk-4FGWE3EW.js} +1 -1
- package/browser/{chunk-HN4TBO7J.js → chunk-5N6DUZII.js} +1 -1
- package/browser/{chunk-IN5SVY4U.js → chunk-5OGZHNUE.js} +1 -1
- package/browser/{chunk-SDHC7TR2.js → chunk-5WX43L4B.js} +1 -1
- package/browser/{chunk-36EOCF7B.js → chunk-5Y2Q6WKL.js} +1 -1
- package/browser/{chunk-DFXCCLVG.js → chunk-6BMCL5TR.js} +1 -1
- package/browser/{chunk-MZBZJFIH.js → chunk-76HYDFUL.js} +1 -1
- package/browser/{chunk-62AZ3TER.js → chunk-7H4TBVB7.js} +1 -1
- package/browser/{chunk-P3AFMA53.js → chunk-7O6TY5IW.js} +1 -1
- package/browser/{chunk-LU3ZSYWJ.js → chunk-ADEIEQGJ.js} +1 -1
- package/browser/{chunk-PXY6PLET.js → chunk-AK746XRX.js} +1 -1
- package/browser/{chunk-KKYAHLLD.js → chunk-BWBZLC7A.js} +1 -1
- package/browser/{chunk-ZCELWKMZ.js → chunk-CRXIMHRG.js} +3 -3
- package/browser/{chunk-GBTVBYVO.js → chunk-CSHG3PLJ.js} +1 -1
- package/browser/{chunk-AV3U5ZDG.js → chunk-CU7SABOQ.js} +1 -1
- package/browser/{chunk-N6D7DELC.js → chunk-DZ2M3NQD.js} +1 -1
- package/browser/{chunk-WH2T6TJR.js → chunk-ECISS7V2.js} +1 -1
- package/browser/{chunk-QCC2HSMN.js → chunk-ENRRDIUM.js} +1 -1
- package/browser/{chunk-ZS3GOED4.js → chunk-F4ZRQ6MH.js} +1 -1
- package/browser/chunk-FA2MVU23.js +1 -0
- package/browser/{chunk-GWUHK3IY.js → chunk-GLFQ37PU.js} +1 -1
- package/browser/{chunk-KH3XUBG3.js → chunk-GSUU7JSY.js} +1 -1
- package/browser/{chunk-6UXZYGDR.js → chunk-H6NBS4JE.js} +1 -1
- package/browser/{chunk-FV7MYI7I.js → chunk-I4RHXOIC.js} +1 -1
- package/browser/{chunk-KZ2MXYPS.js → chunk-KJJPVCIH.js} +1 -1
- package/browser/chunk-KWJJEVAI.js +1 -0
- package/browser/{chunk-QA4DQZOM.js → chunk-LHKOA7FX.js} +1 -1
- package/browser/{chunk-FOUZFGE6.js → chunk-LUB22VNT.js} +1 -1
- package/browser/{chunk-6QIZQ7GE.js → chunk-MFSY4HYK.js} +1 -1
- package/browser/{chunk-LYXZJWHW.js → chunk-MIAKSSSF.js} +1 -1
- package/browser/{chunk-XFS5RNFU.js → chunk-N2NJQ7DJ.js} +1 -1
- package/browser/chunk-NGMAQNX3.js +4 -0
- package/browser/{chunk-HY5SN7AG.js → chunk-NNUJIQ6R.js} +1 -1
- package/browser/{chunk-TMQGM3DO.js → chunk-NYUYHMIH.js} +1 -1
- package/browser/{chunk-JMRUD2BW.js → chunk-ONZVOEJQ.js} +1 -1
- package/browser/chunk-P6WNH2KJ.js +1 -0
- package/browser/{chunk-VNLBXJU6.js → chunk-QTXEWRHZ.js} +1 -1
- package/browser/{chunk-OY6A2XLL.js → chunk-QXBTTCPM.js} +1 -1
- package/browser/{chunk-OCX3RQ65.js → chunk-R2NWLPS6.js} +1 -1
- package/browser/{chunk-NIV7FMON.js → chunk-RQKLSUW5.js} +1 -1
- package/browser/{chunk-UU5QELSX.js → chunk-S5QSZK6N.js} +1 -1
- package/browser/{chunk-RGGNQESF.js → chunk-SZM3NJVZ.js} +1 -1
- package/browser/{chunk-UAHVURDD.js → chunk-TNSH3NBF.js} +1 -1
- package/browser/{chunk-IV7SJSBN.js → chunk-U3AHBQTX.js} +1 -1
- package/browser/{chunk-IYEDRCU5.js → chunk-U7ZJFIOR.js} +1 -1
- package/browser/{chunk-AFRMVXZZ.js → chunk-UEGZX4MW.js} +1 -1
- package/browser/{chunk-D5BPAYOR.js → chunk-UO7SKQEC.js} +1 -1
- package/browser/{chunk-BLRBIAYK.js → chunk-UQTA3ACH.js} +1 -1
- package/browser/{chunk-35S3IW2A.js → chunk-UWYJO2DN.js} +1 -1
- package/browser/{chunk-M5ZWYOBX.js → chunk-VLDPXI7G.js} +1 -1
- package/browser/{chunk-MQEDNZF7.js → chunk-VZOBZ3DD.js} +1 -1
- package/browser/chunk-W7A7CPWM.js +1 -0
- package/browser/{chunk-N2F3TQJA.js → chunk-WMHS3NSI.js} +1 -1
- package/browser/{chunk-4T6SALXS.js → chunk-X5ZRXGFA.js} +1 -1
- package/browser/{chunk-5IIN2VT5.js → chunk-X73LZ3QV.js} +1 -1
- package/browser/{chunk-3MTFWGAR.js → chunk-XAEUGARN.js} +1 -1
- package/browser/chunk-XJYEZL5J.js +1 -0
- package/browser/{chunk-Y37OZMXI.js → chunk-XZRVHU66.js} +1 -1
- package/browser/{chunk-WNYGQVYX.js → chunk-YGBFW4ZS.js} +1 -1
- package/browser/{chunk-FELLJOVH.js → chunk-ZQZHBROX.js} +1 -1
- package/browser/{chunk-3MREZSO7.js → chunk-ZXQEKBPA.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-44QZIU3R.js → main-VWHGBAF5.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-57XIXFX3.js +0 -1
- package/browser/chunk-HSEJNG7W.js +0 -3
- package/browser/chunk-LQOQ3VK5.js +0 -1
- package/browser/chunk-MH3KTYRA.js +0 -1
- package/browser/chunk-QBT6LKOQ.js +0 -1
- package/browser/chunk-TET2CIOZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-TCHHDPN6.js";import{h as $}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-TCHHDPN6.js";import{h as $}from"./chunk-UQTA3ACH.js";import{c as M}from"./chunk-6XX7GME4.js";import{s as k,z as E}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as d}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as R,Db as s,Fb as g,Lc as B,Pb as w,S as u,Wa as I,ab as h,ca as r,cc as P,fc as x,ga as m,gc as T,ha as p,i as _,jc as q,lb as v,ma as y,mb as b,rb as l,sb as a,t as C,tb as c}from"./chunk-CHEXA6RY.js";var V=()=>[];function F(i,e){if(i&1){let t=R();a(0,"agentos-integration-config-item",4),s("editRequested",function(n){m(t);let f=g(2);return p(f.onEdit(n))})("deleteRequested",function(n){m(t);let f=g(2);return p(f.deleteConfig(n))}),c()}i&2&&l("config",e)}function L(i,e){if(i&1&&v(0,F,1,1,"agentos-integration-config-item",3),i&2){let t,o=e.$implicit,n=g();b((t=n.resolveConfig(o.id))?0:-1,t)}}var S=class i{router=r(M);destroyRef=r(y);integrationConfigController=r($);refresh$=new _(void 0);configs$=this.refresh$.pipe(u(()=>this.integrationConfigController.listIntegrationConfig()));configItems$=this.configs$.pipe(C(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(d(this.destroyRef)).subscribe(e=>{this.configsById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"])}deleteConfig(e){this.integrationConfigController.deleteIntegrationConfig(e.id??"").pipe(d(this.destroyRef)).subscribe(()=>this.refresh$.next())}onEdit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"])}resolveConfig(e){return this.configsById.get(e)??null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:6,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),x(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),c()(),h(3,L,1,1,"ng-template",null,0,q)),t&2){let n=w(4);l("items",T(1,3,o.configItems$)??P(5,V))("showCreate",!0)("itemTemplate",n)}},dependencies:[E,D,k,B],styles:[".platform-integration-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-integration-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{S as PlatformIntegrationConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-NWFFZ2FW.js";import{a as v}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-NWFFZ2FW.js";import{a as v}from"./chunk-VZOBZ3DD.js";import{h,v as b}from"./chunk-UQTA3ACH.js";import{D as g,P as C,S as I,V as a,Z as d,ca as p,i as u,m as o,t as m,u as l}from"./chunk-CHEXA6RY.js";var N="none",O="me",y=class f{nsController=p(h);exportService=p(b);userState=p(v);refresh$=new u(void 0);namespaceId$=new u(null);vm$=l([this.namespaceId$,this.refresh$]).pipe(I(([e])=>{let n=this.loadPlatformConfigs().pipe(g(()=>o([]))),t=this.loadUserConfigs("global").pipe(g(()=>o([])));return e?l([n,this.loadNamespaceConfigs(e).pipe(g(()=>o([]))),this.loadUserConfigs(e).pipe(g(()=>o([]))),t]).pipe(m(([i,r,c,s])=>({platform:i,namespace:r,userOnNs:c,userGlobal:s}))):l([n,t]).pipe(m(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),C({bufferSize:1,refCount:!0}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e)}refresh(){this.refresh$.next()}loadPlatformConfigs(){return this.nsController.listIntegrationConfig()}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,O)}userGlobal$=S(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):o([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let s={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(a(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let s={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(a(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(c).pipe(a(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0};return this.nsController.updateIntegrationConfig(e,r).pipe(a(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(a(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||f)};static \u0275prov=d({token:f,factory:f.\u0275fac,providedIn:"root"})};export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-
|
|
1
|
+
import{a as G}from"./chunk-H6NBS4JE.js";import{a as T}from"./chunk-VZOBZ3DD.js";import{a as I,c as w}from"./chunk-6XX7GME4.js";import{a as _}from"./chunk-VMYKE4ZC.js";import{F as R,b as A,c as N,e as y,g as F,h as U,i as z,l as d,n as D,v as V,w as L}from"./chunk-7OGOI6WM.js";import{Bb as P,Db as f,Fb as u,Ka as l,Tb as n,Ub as C,Vb as k,Wa as O,ca as c,ga as p,ha as g,lb as v,ma as E,mb as x,rb as h,sb as r,ta as b,tb as e,ub as m}from"./chunk-CHEXA6RY.js";function q(a,i){a&1&&(r(0,"p",5),n(1,"Loading\u2026"),e())}function $(a,i){if(a&1&&(r(0,"span",13),n(1),e()),a&2){let t=u(2);l(),C(t.form.controls.email.value)}}function j(a,i){a&1&&m(0,"input",14)}function H(a,i){if(a&1){let t=P();r(0,"form",7),f("ngSubmit",function(){p(t);let s=u();return g(s.save())}),r(1,"div",8)(2,"h2",9),n(3,"Identity"),e(),r(4,"div",10)(5,"label",11),n(6,"Email "),r(7,"span",12),n(8,"*"),e()(),v(9,$,2,1,"span",13)(10,j,1,0,"input",14),e(),r(11,"div",10)(12,"label",15),n(13,"External ID"),e(),m(14,"input",16),e()(),r(15,"div",8)(16,"h2",9),n(17,"Profile"),e(),r(18,"div",10)(19,"label",17),n(20,"First name"),e(),m(21,"input",18),e(),r(22,"div",10)(23,"label",19),n(24,"Last name"),e(),m(25,"input",20),e(),r(26,"div",21)(27,"label",22),n(28,"Bio"),e(),m(29,"textarea",23),e()(),r(30,"div",8)(31,"h2",9),n(32,"Permissions"),e(),r(33,"div",24),m(34,"input",25),r(35,"label",26),n(36," Super admin (full access to AgentOS) "),e()()(),r(37,"div",27)(38,"button",28),n(39),e(),r(40,"button",29),f("click",function(){p(t);let s=u();return g(s.cancel())}),n(41,"Cancel"),e()()()}if(a&2){let t=u();h("formGroup",t.form),l(9),x(t.isEditMode?9:10),l(29),h("disabled",t.form.invalid||t.isSaving()),l(),k(" ",t.isSaving()?"Saving\u2026":t.isEditMode?"Save changes":"Create user"," ")}}var B=class a{route=c(I);router=c(w);destroyRef=c(E);userAdminState=c(G);userState=c(T);userId=this.route.snapshot.params.userId;isEditMode=!!this.userId;isSaving=b(!1);isLoading=b(!1);form=new z({email:new d("",{nonNullable:!0,validators:[y.required,y.email]}),externalId:new d("",{nonNullable:!0}),firstname:new d("",{nonNullable:!0}),lastname:new d("",{nonNullable:!0}),bio:new d("",{nonNullable:!0}),isAdmin:new d(!1,{nonNullable:!0})});ngOnInit(){if(!this.isEditMode)return;let i=()=>{this.userState.currentUser()?.id===this.userId&&this.form.controls.isAdmin.disable()};this.userState.currentUser()?i():this.userState.loadMe().pipe(_(this.destroyRef)).subscribe({next:()=>i(),error:()=>this.form.controls.isAdmin.disable()});let t=this.userAdminState.users().find(o=>o.id===this.userId);if(t){this.syncForm(t),this.form.controls.email.disable();return}this.isLoading.set(!0),this.userAdminState.loadAll().pipe(_(this.destroyRef)).subscribe({next:()=>{let o=this.userAdminState.users().find(s=>s.id===this.userId);o&&(this.syncForm(o),this.form.controls.email.disable()),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}get title(){return this.isEditMode?"Edit user":"New user"}save(){if(this.form.invalid||this.isSaving())return;this.isSaving.set(!0);let{email:i,externalId:t,firstname:o,lastname:s,bio:S,isAdmin:M}=this.form.getRawValue();(this.isEditMode?this.userAdminState.updateUser(this.userId,{externalId:t||void 0,firstname:o||void 0,lastname:s||void 0,bio:S||void 0,isAdmin:M}):this.userAdminState.createUser({email:i||void 0,externalId:t||void 0,firstname:o||void 0,lastname:s||void 0,bio:S||void 0,isAdmin:M})).pipe(_(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSaving.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/admin/users"])}syncForm(i){this.form.setValue({email:i.email??"",externalId:i.externalId??"",firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??"",isAdmin:i.isAdmin??!1})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=O({type:a,selectors:[["agentos-user-form"]],decls:10,vars:2,consts:[[1,"user-form"],[1,"user-form__header"],["type","button","title","Back to users",1,"user-form__back",3,"click"],[1,"user-form__back-icon"],[1,"user-form__title"],[1,"user-form__loading"],[1,"user-form__body",3,"formGroup"],[1,"user-form__body",3,"ngSubmit","formGroup"],[1,"user-form__section"],[1,"user-form__section-title"],[1,"user-form__field"],["for","uf-email",1,"user-form__label"],[1,"user-form__required"],[1,"user-form__value","user-form__value--readonly"],["id","uf-email","type","email","placeholder","user@example.com","formControlName","email","autocomplete","email",1,"user-form__input"],["for","uf-externalId",1,"user-form__label"],["id","uf-externalId","type","text","placeholder","External identifier","formControlName","externalId",1,"user-form__input"],["for","uf-firstname",1,"user-form__label"],["id","uf-firstname","type","text","placeholder","First name","formControlName","firstname","autocomplete","given-name",1,"user-form__input"],["for","uf-lastname",1,"user-form__label"],["id","uf-lastname","type","text","placeholder","Last name","formControlName","lastname","autocomplete","family-name",1,"user-form__input"],[1,"user-form__field","user-form__field--bio"],["for","uf-bio",1,"user-form__label"],["id","uf-bio","placeholder","A short description","formControlName","bio","rows","4",1,"user-form__input","user-form__input--textarea"],[1,"user-form__field","user-form__field--checkbox"],["id","uf-isAdmin","type","checkbox","formControlName","isAdmin",1,"user-form__checkbox"],["for","uf-isAdmin",1,"user-form__label","user-form__label--checkbox"],[1,"user-form__actions"],["type","submit",1,"user-form__btn","user-form__btn--primary",3,"disabled"],["type","button",1,"user-form__btn",3,"click"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return o.cancel()}),r(3,"span",3),n(4,"\u2190"),e(),n(5," Users "),e(),r(6,"h1",4),n(7),e()(),v(8,q,2,0,"p",5)(9,H,42,4,"form",6),e()),t&2&&(l(7),C(o.title),l(),x(o.isLoading()?8:9))},dependencies:[R,D,N,A,F,U,L,V],styles:[".user-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.user-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-form__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-form__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-form__section-title[_ngcontent-%COMP%]{margin:0;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem;font-family:var(--font-heading)}.user-form__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-form__field--bio[_ngcontent-%COMP%]{align-items:start}.user-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-form__required[_ngcontent-%COMP%]{color:var(--red)}.user-form__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text)}.user-form__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease;resize:none}.user-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-form__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.user-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{B as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as I}from"./chunk-
|
|
1
|
+
import{j as I}from"./chunk-UQTA3ACH.js";import{a as k,c as w}from"./chunk-6XX7GME4.js";import{a as C}from"./chunk-VMYKE4ZC.js";import{F as B,c as D,e as h,g as F,h as V,i as A,l as c,n as z,s as L,w as R}from"./chunk-7OGOI6WM.js";import{Bb as O,Db as u,Fb as g,Ka as r,Tb as o,Ub as S,Vb as E,Wa as N,a as v,b as x,ca as p,ga as _,ha as b,lb as M,ma as y,mb as P,rb as i,sb as n,ta as f,tb as t,ub as m}from"./chunk-CHEXA6RY.js";function T(l,a){l&1&&(n(0,"p",5),o(1,"Loading\u2026"),t())}function $(l,a){if(l&1){let e=O();n(0,"form",7),u("ngSubmit",function(){_(e);let d=g();return b(d.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),t()(),m(6,"input",11),t(),n(7,"div",8)(8,"label",12),o(9,"Description"),t(),m(10,"textarea",13),t(),n(11,"div",8)(12,"label",14),o(13,"External ID"),t(),m(14,"input",15),t(),n(15,"div",8)(16,"label",16),o(17,"Default agent"),t(),m(18,"input",17),t(),n(19,"div",8)(20,"label",18),o(21,"Config path"),t(),m(22,"input",19),t(),n(23,"div",20)(24,"button",21),o(25),t(),n(26,"button",22),u("click",function(){_(e);let d=g();return b(d.cancel())}),o(27,"Cancel"),t()()()}if(l&2){let e=g();i("formGroup",e.form),r(6),i("formControl",e.nameControl),r(4),i("formControl",e.descriptionControl),r(4),i("formControl",e.externalIdControl),r(4),i("formControl",e.defaultAgentNameControl),r(4),i("formControl",e.configPathControl),r(2),i("disabled",e.nameControl.invalid||e.isSubmitting()),r(),E(" ",e.isEditMode()?"Save changes":"Create"," ")}}var G=class l{route=p(k);router=p(w);namespaceController=p(I);destroyRef=p(y);form=new A({name:new c("",{nonNullable:!0,validators:[h.required,h.minLength(1)]}),description:new c("",{nonNullable:!0}),configPath:new c("",{nonNullable:!0}),externalId:new c("",{nonNullable:!0}),defaultAgentName:new c("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);existingNamespace=null;ngOnInit(){let a=this.route.snapshot.paramMap.get("namespaceId");a&&(this.isEditMode.set(!0),this.loadNamespace(a))}loadNamespace(a){this.isLoading.set(!0),this.namespaceController.getByIdNamespace(a).pipe(C(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let a=x(v({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",a):this.namespaceController.createNamespace(a)).pipe(C(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/namespaces"])}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=N({type:l,selectors:[["agentos-namespace-form"]],decls:10,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],["type","button","title","Back to namespaces",1,"namespace-form__back",3,"click"],[1,"namespace-form__back-icon"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","rows","4","placeholder","Optional description",1,"namespace-form__textarea",3,"formControl"],["for","ns-external-id",1,"namespace-form__label"],["id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-default-agent",1,"namespace-form__label"],["id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,s){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return s.cancel()}),n(3,"span",3),o(4,"\u2190"),t(),o(5," Namespaces "),t(),n(6,"h1",4),o(7),t()(),M(8,T,2,0,"p",5)(9,$,28,8,"form",6),t()),e&2&&(r(7),S(s.isEditMode()?"Edit namespace":"New namespace"),r(),P(s.isLoading()?8:9))},dependencies:[B,z,D,F,V,L,R],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.namespace-form__input[_ngcontent-%COMP%], .namespace-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus, .namespace-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.namespace-form__input[_ngcontent-%COMP%]::placeholder, .namespace-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.namespace-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:96px;line-height:1.5}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{G as NamespaceFormComponent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as de,b as w}from"./chunk-TASSC2XX.js";import{D as $,J as se,P as ce,R as re,S as ie,V as g,Xc as E,Z as c,a as T,b as C,ca as a,d,h as j,i as r,m as D,n as k,pa as le,t as te,u as ne}from"./chunk-CHEXA6RY.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(de);projectName$=this.projectStateService.selectedProject$.pipe(te(e=>e?.name),se());constructor(){ne([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(re(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),ie(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(te(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),D({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),D({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=ne([this.projectName$,this.selectedThreadIdSubject.pipe(se()),this.refreshSelectedThreadSubject.pipe(re(void 0))]).pipe(ie(([e,t])=>!e||!t?D(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(ce({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(T({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(T({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),k(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),k(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),k(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let _=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(_);let K=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(G);let Q=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(Q);let J=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(J);let Y=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(Y);let X=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(X);let Z=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(Z);let ee=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let _=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(_);let K=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(Q);let J=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(X);let Z=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(Z);let ee=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function oe(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},He="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=oe(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=oe(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${oe(this.summary,e)}`}},S=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name;let t=e.content;Array.isArray(t)?this.content=t.map(s=>typeof s=="string"?{type:"text",content:s}:s):typeof t=="string"?this.content=[{type:"text",content:t}]:t&&typeof t=="object"&&"type"in t?this.content=[t]:this.content=[],this.length=this.content.map(s=>{if(s.type==="text")return s.content.length;if(s.type==="image"){let i=(s.width||0)*(s.height||0)/750;return i?i*3.5:s.content.length}return s.type==="audio"?s.transcription?.length??100:0}).reduce((s,i)=>s+i,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
2
|
-
`)}},V=class n extends o{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,n.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},z=class n extends o{filename;operation;size;mimeType;static type="file";constructor(e){super(e,n.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},H=class n extends o{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,n.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},R=class n extends o{subThreadId;agentName;static type="delegation";constructor(e){super(e,n.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},W=class n extends o{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,n.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},
|
|
1
|
+
import{a as ue,b as w}from"./chunk-TASSC2XX.js";import{D as $,J as re,P as le,R as ie,S as oe,V as g,Xc as E,Z as c,a as S,b as C,ca as a,d,h as j,i as r,m as k,n as D,pa as de,t as ne,u as se}from"./chunk-CHEXA6RY.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(ue);projectName$=this.projectStateService.selectedProject$.pipe(ne(e=>e?.name),re());constructor(){se([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(ie(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),oe(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(ne(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),k({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),k({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=se([this.projectName$,this.selectedThreadIdSubject.pipe(re()),this.refreshSelectedThreadSubject.pipe(ie(void 0))]).pipe(oe(([e,t])=>!e||!t?k(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(le({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(S({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(S({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),D(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),D(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),D(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var he=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let K=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(G);let Q=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(Q);let J=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(J);let Y=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(Y);let X=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(X);let Z=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(Z);let ee=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(ee);let te=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(te),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let K=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(Q);let J=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(X);let Z=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(Z);let ee=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(ee);let te=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(te),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function ae(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},We="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=ae(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=ae(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${ae(this.summary,e)}`}},T=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name;let t=e.content;Array.isArray(t)?this.content=t.map(s=>typeof s=="string"?{type:"text",content:s}:s):typeof t=="string"?this.content=[{type:"text",content:t}]:t&&typeof t=="object"&&"type"in t?this.content=[t]:this.content=[],this.length=this.content.map(s=>{if(s.type==="text")return s.content.length;if(s.type==="image"){let i=(s.width||0)*(s.height||0)/750;return i?i*3.5:s.content.length}return s.type==="audio"?s.transcription?.length??100:0}).reduce((s,i)=>s+i,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
2
|
+
`)}},V=class n extends o{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,n.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},z=class n extends o{filename;operation;size;mimeType;static type="file";constructor(e){super(e,n.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},H=class n extends o{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,n.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},R=class n extends o{subThreadId;agentName;static type="delegation";constructor(e){super(e,n.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},W=class n extends o{static type="usage";inputTokens;outputTokens;contextWindow;price;iterations;cacheReadTokens;constructor(e){super(e,n.type),this.inputTokens=e.inputTokens??0,this.outputTokens=e.outputTokens??0,this.contextWindow=e.contextWindow??0,this.price=e.price??0,this.iterations=e.iterations??0,this.cacheReadTokens=e.cacheReadTokens??0}},_=class n extends o{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,n.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},be={[T.type]:T,[u.type]:u,[b.type]:b,[R.type]:R,[h.type]:h,[F.type]:F,[f.type]:f,[v.type]:v,[m.type]:m,[A.type]:A,[B.type]:B,[O.type]:O,[M.type]:M,[V.type]:V,[y.type]:y,[z.type]:z,[H.type]:H,[_.type]:_,[W.type]:W};function ce(n){let e=be[n.type];return e?new e(n):void 0}var Xe=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
|
|
3
3
|
|
|
4
4
|
<task>
|
|
5
5
|
{{PARAMETERS}}
|
|
@@ -267,4 +267,4 @@ Verify the memory system's overall health:
|
|
|
267
267
|
- List any remaining issues or concerns
|
|
268
268
|
- Provide recommendations for maintaining memory quality
|
|
269
269
|
|
|
270
|
-
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var
|
|
270
|
+
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var ht=[T.type,v.type,m.type,y.type,f.type,b.type,u.type,R.type];var pe={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},jt=Object.keys(pe).filter(n=>pe[n]?.length===0);var ge=class n{currentThemeSubject=new r({variant:"industry",mode:"light"});currentTheme$=this.currentThemeSubject.asObservable();preferences=a(L);subscription=null;constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}ngOnDestroy(){this.subscription?.unsubscribe()}initializeTheme(){this.subscription=this.preferences.theme$.subscribe(e=>{let t=this.preferences.getPreference("themeVariant")??"industry",s={variant:["industry","terminal"].includes(t)?t:"industry",mode:["light","dark","system"].includes(e)?e:"system"};console.log("[THEME] Theme preference changed to:",s),this.applyTheme(s)})}setTheme(e){this.preferences.setPreference("themeVariant",e.variant),this.preferences.setPreference("theme",e.mode),this.applyTheme(e)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(e){console.log("[THEME] Applying theme:",e),this.currentThemeSubject.next(e);let t=e.mode==="system"?typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":e.mode;this.setDocumentTheme(e.variant,t)}setDocumentTheme(e,t){if(typeof document>"u"||!document.documentElement)return;let s=e==="industry"&&t==="light"?null:`${e}-${t}`;s?document.documentElement.setAttribute("data-theme",s):document.documentElement.removeAttribute("data-theme")}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{let t=this.getCurrentTheme();t.mode==="system"&&this.setDocumentTheme(t.variant,e.matches?"dark":"light")})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var me=class n{eventSource=null;eventsSubject=new j;connectionStatusSubject=new r({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=a(de);connectToThread(e,t){console.log("[SSE] Connecting to thread event stream:",e,t),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let s=`/api/projects/${e}/threads/${t}/event-stream`;console.log("[SSE] EventSource URL:",s),this.eventSource=new EventSource(s),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=e=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",e.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let t=JSON.parse(e.data),s=ce(t);s?(console.log("[SSE] Event:",s.type),this.eventsSubject.next(s)):console.warn("[SSE] Failed to build event:",t.type)}catch(t){console.error("[SSE] Parse error:",t.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=e=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",e),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new h({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new h({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(e,t){this.connectionStatusSubject.next({connected:e,reconnectAttempts:t,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var fe=class n{http=a(E);projectState=a(w);threadState=a(U);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(e){return this.http.post(this.getBaseUrl(),e,{responseType:"text"})}sendFreeMessage(e){return this.http.post(this.getBaseUrl(),{message:e})}getMessage(e){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(e)}`)}deleteMessage(e){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(e)}`)}getFormattedMessage(e){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(e)}/formatted`,{responseType:"text"})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};export{N as a,U as b,he as c,L as d,ge as e,F as f,f as g,We as h,u as i,A as j,B as k,M as l,h as m,b as n,v as o,m as p,O as q,T as r,V as s,z as t,H as u,R as v,W as w,_ as x,ce as y,me as z,fe as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-6JMDCL65.js";import{a as D}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-6JMDCL65.js";import{a as D}from"./chunk-KWJJEVAI.js";import"./chunk-UQTA3ACH.js";import{a as E,c as $}from"./chunk-6XX7GME4.js";import{z as O}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as l}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as x,D as y,Db as m,Fb as a,Lc as T,Pb as N,S as P,Tb as w,Wa as b,ab as v,ca as p,cc as M,fc as B,ga as g,gc as S,ha as h,i as d,jc as k,lb as I,m as u,ma as C,mb as R,rb as s,sb as i,t as f,tb as c,z as _}from"./chunk-CHEXA6RY.js";var F=()=>[];function U(r,t){if(r&1){let o=x();i(0,"agentos-prompt-item",4),m("deleteRequested",function(n){g(o);let A=a(2);return h(A.deletePrompt(n))}),c()}if(r&2){let o=a().$implicit,e=a();s("prompt",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformPrompt(o.id))}}function V(r,t){if(r&1&&I(0,U,1,3,"agentos-prompt-item",3),r&2){let o,e=t.$implicit,n=a();R((o=n.resolvePrompt(e.id))?0:-1,o)}}var j="platform",G="namespace",q=class r{route=p(E);router=p($);destroyRef=p(C);promptState=p(D);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new d(void 0);allPrompts$=this.refresh$.pipe(P(()=>_({platform:this.promptState.listPlatform().pipe(y(()=>u([]))),namespace:this.promptState.listByNamespace(this.namespaceId)})));promptItems$=this.allPrompts$.pipe(f(({platform:t,namespace:o})=>[...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:j,groupLabel:"Platform (read-only)"})),...o.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Namespace"}))]));namespacePromptsById=new Map;platformPromptsById=new Map;constructor(){this.allPrompts$.pipe(l(this.destroyRef)).subscribe(({platform:t,namespace:o})=>{this.platformPromptsById=new Map(t.map(e=>[e.id??"",e])),this.namespacePromptsById=new Map(o.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"])}deletePrompt(t){this.promptState.delete(t.id??"").pipe(l(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolvePrompt(t){return this.platformPromptsById.get(t)??this.namespacePromptsById.get(t)??null}isPlatformPrompt(t){return this.platformPromptsById.has(t)}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=b({type:r,selectors:[["agentos-namespace-prompts"]],decls:6,vars:6,consts:[["promptItemTpl",""],["title","Prompts","emptyMessage","No prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-prompts__back",3,"click"],[3,"prompt","namespaceId","readOnly"],[3,"deleteRequested","prompt","namespaceId","readOnly"]],template:function(o,e){if(o&1&&(i(0,"ds-entity-list",1),B(1,"async"),m("createRequested",function(){return e.openCreateForm()}),i(2,"button",2),m("click",function(){return e.goBack()}),w(3,"\u2190 Namespaces"),c()(),v(4,V,1,1,"ng-template",null,0,k)),o&2){let n=N(5);s("items",S(1,3,e.promptItems$)??M(5,F))("showCreate",!0)("itemTemplate",n)}},dependencies:[O,L,T],styles:[".namespace-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as NamespacePromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-WAGXU26A.js";import{d as D}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-WAGXU26A.js";import{d as D}from"./chunk-UQTA3ACH.js";import{c as q}from"./chunk-6XX7GME4.js";import{s as M,z as $}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as _}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as b,Db as s,Fb as d,Lc as T,Pb as w,S as P,Wa as y,ab as C,ca as n,cc as R,fc as I,ga as m,gc as x,ha as l,i as f,jc as B,lb as h,ma as g,mb as A,rb as c,sb as a,t as u,tb as v}from"./chunk-CHEXA6RY.js";var S=()=>[];function V(r,e){if(r&1){let t=b();a(0,"agentos-ai-provider-item",4),s("editRequested",function(i){m(t);let p=d(2);return l(p.onEdit(i))})("deleteRequested",function(i){m(t);let p=d(2);return l(p.onDelete(i))}),v()}r&2&&c("config",e)("showBadge",!1)}function F(r,e){if(r&1&&h(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=d();A((t=i.resolveProvider(o.id))?0:-1,t)}}var E=class r{router=n(q);destroyRef=n(g);aiProviderController=n(D);refresh$=new f(void 0);providers$=this.refresh$.pipe(P(()=>this.aiProviderController.listAiProvider("none")));providerItems$=this.providers$.pipe(u(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(_(this.destroyRef)).subscribe(e=>{this.providersById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"])}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"])}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(_(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=y({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),v()(),C(3,F,1,1,"ng-template",null,0,B)),t&2){let i=w(4);c("items",x(1,3,o.providerItems$)??R(5,S))("showCreate",!0)("itemTemplate",i)}},dependencies:[$,k,M,T],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{E as PlatformAiProvidersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as m,x as l,z as A}from"./chunk-CRXIMHRG.js";import{a as u}from"./chunk-YJOXSEUO.js";import{B as v,Z as S,ca as h,i as g}from"./chunk-CHEXA6RY.js";var O=class c{eventStream=h(A);messageApi=h(m);pendingStates=new Map;popupCheckInterval=null;popupClosedAt=null;static POPUP_CLOSE_GRACE_MS=2e3;pendingRequest$=new g(null);messageHandler=e=>this.handlePopupMessage(e);storageHandler=e=>this.handleStorageEvent(e);constructor(){this.eventStream.events$.pipe(v(e=>e.type==="oauth_request")).subscribe(e=>this.handleOAuthRequest(e)),window.addEventListener("message",this.messageHandler),window.addEventListener("storage",this.storageHandler),this.drainLocalStorage()}ngOnDestroy(){window.removeEventListener("message",this.messageHandler),window.removeEventListener("storage",this.storageHandler),this.pendingRequest$.complete(),this.popupCheckInterval&&clearInterval(this.popupCheckInterval)}startPopupMonitoring(e,t){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(e.closed){if(this.popupClosedAt===null){this.popupClosedAt=Date.now(),console.log("[OAuth Service] Popup closed, waiting for postMessage grace period...");return}if(Date.now()-this.popupClosedAt<c.POPUP_CLOSE_GRACE_MS)return;if(console.log("[OAuth Service] Grace period elapsed, popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.popupClosedAt=null,this.pendingStates.has(t)){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let s=this.pendingStates.get(t);if(this.pendingStates.delete(t),s){let a=new l({state:t,integrationName:s,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(a).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:n=>console.error("[OAuth Service] Failed to send cancellation:",n)})}}}else this.popupClosedAt!==null&&(console.log("[OAuth Service] Popup reopened/navigating, resetting grace period"),this.popupClosedAt=null)},500)}openPopup(e){console.log("[OAuth Service] Opening popup from user gesture:",e.integrationName);let t=600,o=900,s=window.screenX+(window.outerWidth-t)/2,a=window.screenY+(window.outerHeight-o)/2,n=`width=${t},height=${o},left=${s},top=${a},popup=yes,resizable=yes,scrollbars=yes`,r=window.open(e.authUrl,"oauth_popup",n);console.log("[OAuth Service] Popup opened:",!!r),r?(r.focus(),this.startPopupMonitoring(r,e.state),this.pendingRequest$.next(null)):console.warn("[OAuth Service] Popup was blocked by the browser")}cancelRequest(e){console.log("[OAuth Service] OAuth cancelled by user via inline panel"),this.pendingStates.delete(e.state),this.pendingRequest$.next(null);let t=new l({state:e.state,integrationName:e.integrationName,error:"user_cancelled",errorDescription:"User dismissed the authorization panel"});this.messageApi.sendMessage(t).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:o=>console.error("[OAuth Service] Failed to send cancellation:",o)})}handleOAuthRequest(e){console.log("[OAuth Service] Received OAuthRequestEvent:",e.integrationName,e.state),this.pendingStates.set(e.state,e.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys())),this.pendingRequest$.next(e)}handlePopupMessage(e){if(console.log("[OAuth Service] Received postMessage:",e.origin,e.data),e.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",e.origin);return}this.processCallbackData(e.data)}handleStorageEvent(e){e.key!==u||!e.newValue||(console.log("[OAuth Service] Received localStorage callback fallback"),this.drainLocalStorage())}drainLocalStorage(){let e=localStorage.getItem(u);if(e){localStorage.removeItem(u),console.log("[OAuth Service] Processing localStorage OAuth callback fallback");try{let t=JSON.parse(e);this.processCallbackData(t)}catch(t){console.error("[OAuth Service] Failed to parse localStorage OAuth callback:",t)}}}processCallbackData(e){let{code:t,state:o,error:s,errorDescription:a}=e??{};if(s){console.log("[OAuth Service] OAuth error received:",s,a);let i=this.pendingStates.get(o);if(i){this.pendingStates.delete(o),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.popupClosedAt=null);let d=new l({state:o,integrationName:i,error:s,errorDescription:a});this.messageApi.sendMessage(d).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:p=>console.error("[OAuth Service] Failed to send error callback:",p)})}return}if(!t){console.warn("[OAuth Service] Message missing code:",e);return}console.log("[OAuth Service] Processing callback - code:",t,"state:",o);let n=o?this.pendingStates.get(o):void 0,r=o;if(!n&&this.pendingStates.size===1){let i=this.pendingStates.entries().next().value;if(i){let[d,p]=i;console.warn("[OAuth Service] State missing from callback, using sole pending flow:",p),n=p,r=d}}if(!n){console.warn("[OAuth Service] Unknown or ambiguous state:",o,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",n),this.pendingStates.delete(r),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.popupClosedAt=null);let f=new l({code:t,state:r,integrationName:n});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(f).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:i=>console.error("[OAuth Service] Failed to send callback:",i)})}static \u0275fac=function(t){return new(t||c)};static \u0275prov=S({token:c,factory:c.\u0275fac,providedIn:"root"})};export{O as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as z,d as B}from"./chunk-BLRBIAYK.js";import{a as D,c as L}from"./chunk-6XX7GME4.js";import{a as x,c as R}from"./chunk-VMYKE4ZC.js";import{A as Y,B as Z,F as ee,c as G,e as g,g as $,h as q,i as j,l as s,n as U,o as H,s as J,w as K,x as Q,y as W,z as X}from"./chunk-7OGOI6WM.js";import{Bb as w,D as k,Db as _,Fb as p,Ka as a,Tb as r,Ub as N,Vb as V,Wa as A,Wb as T,a as y,b as M,ca as c,ga as v,ha as b,kb as I,lb as C,m as P,ma as S,mb as h,mc as F,pb as E,qb as O,rb as l,sb as i,ta as f,tb as o,ub as m}from"./chunk-CHEXA6RY.js";function te(n,t){n&1&&(i(0,"p",5),r(1,"Loading\u2026"),o())}function ie(n,t){if(n&1&&m(0,"input",11),n&2){let e=p(2);l("value",e.selectedProviderLabel())}}function re(n,t){if(n&1&&(i(0,"option",30),r(1),o()),n&2){let e=t.$implicit;l("value",e.id),a(),T("",e.name," (",e.apiType,")")}}function ne(n,t){if(n&1&&(i(0,"select",12)(1,"option",29),r(2,"Select provider"),o(),E(3,re,2,3,"option",30,I().trackByProvider,!0),o()),n&2){let e=p(2);l("formControl",e.aiProviderIdControl),a(3),O(e.providers())}}function ae(n,t){if(n&1){let e=w();i(0,"form",7),_("ngSubmit",function(){v(e);let u=p();return b(u.submit())}),i(1,"div",8)(2,"label",9),r(3," Provider "),i(4,"span",10),r(5,"*"),o()(),C(6,ie,1,1,"input",11)(7,ne,5,1,"select",12),o(),i(8,"div",8)(9,"label",13),r(10," API name "),i(11,"span",10),r(12,"*"),o()(),m(13,"input",14),o(),i(14,"div",8)(15,"label",15),r(16,"Description"),o(),m(17,"input",16),o(),i(18,"div",8)(19,"label",17),r(20,"Alias"),o(),m(21,"input",18),o(),i(22,"div",8)(23,"label",19),r(24,"Priority"),o(),m(25,"input",20),o(),i(26,"div",21)(27,"div",8)(28,"label",22),r(29,"Temperature"),o(),m(30,"input",23),o(),i(31,"div",8)(32,"label",24),r(33,"Max tokens"),o(),m(34,"input",25),o()(),i(35,"div",26)(36,"button",27),r(37),o(),i(38,"button",28),_("click",function(){v(e);let u=p();return b(u.cancel())}),r(39,"Cancel"),o()()()}if(n&2){let e=p();l("formGroup",e.form),a(6),h(e.isEditMode()?6:7),a(7),l("formControl",e.apiModelNameControl),a(4),l("formControl",e.descriptionControl),a(4),l("formControl",e.aliasControl),a(4),l("formControl",e.priorityControl),a(5),l("formControl",e.temperatureControl),a(4),l("formControl",e.maxTokensControl),a(2),l("disabled",e.form.invalid||e.isSubmitting()),a(),V(" ",e.isEditMode()?"Save changes":"Create"," ")}}var oe=class n{route=c(D);router=c(L);destroyRef=c(S);aiModelController=c(z);aiProviderController=c(B);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=R(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(k(()=>P([]))),{initialValue:[]});form=new j({aiProviderId:new s("",{nonNullable:!0,validators:[g.required]}),apiModelName:new s("",{nonNullable:!0,validators:[g.required,g.minLength(1)]}),description:new s(null),alias:new s("",{nonNullable:!0}),priority:new s(0,{nonNullable:!0}),temperature:new s(null),maxTokens:new s(null)});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get maxTokensControl(){return this.form.controls.maxTokens}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);selectedProviderLabel=F(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(d=>d.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(!0),this.loadModel(t))}loadModel(t){this.isLoading.set(!0),this.aiModelController.getByIdAiModel(t).pipe(x(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.maxTokensControl.setValue(e.maxTokens??null),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=this.form.getRawValue(),e=M(y({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,maxTokens:t.maxTokens??void 0});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",e):this.aiModelController.createAiModel(e)).pipe(x(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"])}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["agentos-ai-model-form"]],decls:10,vars:2,consts:[[1,"ai-model-form"],[1,"ai-model-form__header"],["type","button","title","Back to AI models",1,"ai-model-form__back",3,"click"],[1,"ai-model-form__back-icon"],[1,"ai-model-form__title"],[1,"ai-model-form__loading"],[1,"ai-model-form__form",3,"formGroup"],[1,"ai-model-form__form",3,"ngSubmit","formGroup"],[1,"ai-model-form__field"],["for","model-provider",1,"ai-model-form__label"],["aria-hidden","true"],["id","model-provider","type","text","readonly","","tabindex","-1",1,"ai-model-form__input","ai-model-form__input--readonly",3,"value"],["id","model-provider",1,"ai-model-form__select",3,"formControl"],["for","model-api-name",1,"ai-model-form__label"],["id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",1,"ai-model-form__input","ai-model-form__input--mono",3,"formControl"],["for","model-description",1,"ai-model-form__label"],["id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-alias",1,"ai-model-form__label"],["id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-priority",1,"ai-model-form__label"],["id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__row"],["for","model-temperature",1,"ai-model-form__label"],["id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",1,"ai-model-form__input",3,"formControl"],["for","model-max-tokens",1,"ai-model-form__label"],["id","model-max-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__actions"],["type","submit",1,"ai-model-form__btn","ai-model-form__btn--primary",3,"disabled"],["type","button",1,"ai-model-form__btn",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,d){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),_("click",function(){return d.cancel()}),i(3,"span",3),r(4,"\u2190"),o(),r(5," AI models "),o(),i(6,"h1",4),r(7),o()(),C(8,te,2,0,"p",5)(9,ae,40,10,"form",6),o()),e&2&&(a(7),N(d.isEditMode()?"Edit AI model":"New AI model"),a(),h(d.isLoading()?8:9))},dependencies:[ee,U,W,X,G,H,Q,$,q,Z,Y,J,K],styles:[".ai-model-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-model-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-model-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-model-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-model-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-model-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-model-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-model-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-model-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.ai-model-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-model-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-model-form__input[_ngcontent-%COMP%], .ai-model-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-model-form__input[_ngcontent-%COMP%]:focus, .ai-model-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-model-form__input[_ngcontent-%COMP%]::placeholder, .ai-model-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-model-form__input--mono[_ngcontent-%COMP%]{font-family:monospace}.ai-model-form__input--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);cursor:default;background:var(--color-surface-muted, rgba(0, 0, 0, .03))}.ai-model-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-model-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-model-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-model-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-model-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-model-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{oe as AiModelFormComponent};
|
|
1
|
+
import{c as z,d as B}from"./chunk-UQTA3ACH.js";import{a as D,c as L}from"./chunk-6XX7GME4.js";import{a as x,c as R}from"./chunk-VMYKE4ZC.js";import{A as Y,B as Z,F as ee,c as G,e as g,g as $,h as q,i as j,l as s,n as U,o as H,s as J,w as K,x as Q,y as W,z as X}from"./chunk-7OGOI6WM.js";import{Bb as w,D as k,Db as _,Fb as p,Ka as a,Tb as r,Ub as N,Vb as V,Wa as A,Wb as T,a as y,b as M,ca as c,ga as v,ha as b,kb as I,lb as C,m as P,ma as S,mb as h,mc as F,pb as E,qb as O,rb as l,sb as i,ta as f,tb as o,ub as m}from"./chunk-CHEXA6RY.js";function te(n,t){n&1&&(i(0,"p",5),r(1,"Loading\u2026"),o())}function ie(n,t){if(n&1&&m(0,"input",11),n&2){let e=p(2);l("value",e.selectedProviderLabel())}}function re(n,t){if(n&1&&(i(0,"option",30),r(1),o()),n&2){let e=t.$implicit;l("value",e.id),a(),T("",e.name," (",e.apiType,")")}}function ne(n,t){if(n&1&&(i(0,"select",12)(1,"option",29),r(2,"Select provider"),o(),E(3,re,2,3,"option",30,I().trackByProvider,!0),o()),n&2){let e=p(2);l("formControl",e.aiProviderIdControl),a(3),O(e.providers())}}function ae(n,t){if(n&1){let e=w();i(0,"form",7),_("ngSubmit",function(){v(e);let u=p();return b(u.submit())}),i(1,"div",8)(2,"label",9),r(3," Provider "),i(4,"span",10),r(5,"*"),o()(),C(6,ie,1,1,"input",11)(7,ne,5,1,"select",12),o(),i(8,"div",8)(9,"label",13),r(10," API name "),i(11,"span",10),r(12,"*"),o()(),m(13,"input",14),o(),i(14,"div",8)(15,"label",15),r(16,"Description"),o(),m(17,"input",16),o(),i(18,"div",8)(19,"label",17),r(20,"Alias"),o(),m(21,"input",18),o(),i(22,"div",8)(23,"label",19),r(24,"Priority"),o(),m(25,"input",20),o(),i(26,"div",21)(27,"div",8)(28,"label",22),r(29,"Temperature"),o(),m(30,"input",23),o(),i(31,"div",8)(32,"label",24),r(33,"Max tokens"),o(),m(34,"input",25),o()(),i(35,"div",26)(36,"button",27),r(37),o(),i(38,"button",28),_("click",function(){v(e);let u=p();return b(u.cancel())}),r(39,"Cancel"),o()()()}if(n&2){let e=p();l("formGroup",e.form),a(6),h(e.isEditMode()?6:7),a(7),l("formControl",e.apiModelNameControl),a(4),l("formControl",e.descriptionControl),a(4),l("formControl",e.aliasControl),a(4),l("formControl",e.priorityControl),a(5),l("formControl",e.temperatureControl),a(4),l("formControl",e.maxTokensControl),a(2),l("disabled",e.form.invalid||e.isSubmitting()),a(),V(" ",e.isEditMode()?"Save changes":"Create"," ")}}var oe=class n{route=c(D);router=c(L);destroyRef=c(S);aiModelController=c(z);aiProviderController=c(B);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=R(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(k(()=>P([]))),{initialValue:[]});form=new j({aiProviderId:new s("",{nonNullable:!0,validators:[g.required]}),apiModelName:new s("",{nonNullable:!0,validators:[g.required,g.minLength(1)]}),description:new s(null),alias:new s("",{nonNullable:!0}),priority:new s(0,{nonNullable:!0}),temperature:new s(null),maxTokens:new s(null)});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get maxTokensControl(){return this.form.controls.maxTokens}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);selectedProviderLabel=F(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(d=>d.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(!0),this.loadModel(t))}loadModel(t){this.isLoading.set(!0),this.aiModelController.getByIdAiModel(t).pipe(x(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.maxTokensControl.setValue(e.maxTokens??null),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=this.form.getRawValue(),e=M(y({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,maxTokens:t.maxTokens??void 0});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",e):this.aiModelController.createAiModel(e)).pipe(x(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"])}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["agentos-ai-model-form"]],decls:10,vars:2,consts:[[1,"ai-model-form"],[1,"ai-model-form__header"],["type","button","title","Back to AI models",1,"ai-model-form__back",3,"click"],[1,"ai-model-form__back-icon"],[1,"ai-model-form__title"],[1,"ai-model-form__loading"],[1,"ai-model-form__form",3,"formGroup"],[1,"ai-model-form__form",3,"ngSubmit","formGroup"],[1,"ai-model-form__field"],["for","model-provider",1,"ai-model-form__label"],["aria-hidden","true"],["id","model-provider","type","text","readonly","","tabindex","-1",1,"ai-model-form__input","ai-model-form__input--readonly",3,"value"],["id","model-provider",1,"ai-model-form__select",3,"formControl"],["for","model-api-name",1,"ai-model-form__label"],["id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",1,"ai-model-form__input","ai-model-form__input--mono",3,"formControl"],["for","model-description",1,"ai-model-form__label"],["id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-alias",1,"ai-model-form__label"],["id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-priority",1,"ai-model-form__label"],["id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__row"],["for","model-temperature",1,"ai-model-form__label"],["id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",1,"ai-model-form__input",3,"formControl"],["for","model-max-tokens",1,"ai-model-form__label"],["id","model-max-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__actions"],["type","submit",1,"ai-model-form__btn","ai-model-form__btn--primary",3,"disabled"],["type","button",1,"ai-model-form__btn",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,d){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),_("click",function(){return d.cancel()}),i(3,"span",3),r(4,"\u2190"),o(),r(5," AI models "),o(),i(6,"h1",4),r(7),o()(),C(8,te,2,0,"p",5)(9,ae,40,10,"form",6),o()),e&2&&(a(7),N(d.isEditMode()?"Edit AI model":"New AI model"),a(),h(d.isLoading()?8:9))},dependencies:[ee,U,W,X,G,H,Q,$,q,Z,Y,J,K],styles:[".ai-model-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-model-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-model-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-model-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-model-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-model-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-model-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-model-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-model-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.ai-model-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-model-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-model-form__input[_ngcontent-%COMP%], .ai-model-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-model-form__input[_ngcontent-%COMP%]:focus, .ai-model-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-model-form__input[_ngcontent-%COMP%]::placeholder, .ai-model-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-model-form__input--mono[_ngcontent-%COMP%]{font-family:monospace}.ai-model-form__input--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);cursor:default;background:var(--color-surface-muted, rgba(0, 0, 0, .03))}.ai-model-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-model-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-model-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-model-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-model-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-model-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{oe as AiModelFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ne}from"./chunk-LYXZJWHW.js";import{a as ze}from"./chunk-36EOCF7B.js";import{a as Se,b as Ie}from"./chunk-Y37OZMXI.js";import{a as Pe,b as ye}from"./chunk-Y42FQQZC.js";import{a as Me}from"./chunk-PXY6PLET.js";import{a as Te,b as He,c as Ue}from"./chunk-62AZ3TER.js";import{a as we,b as Fe,c as Ee}from"./chunk-5IIN2VT5.js";import{a as Oe}from"./chunk-HN4TBO7J.js";import{a as ke}from"./chunk-6UXZYGDR.js";import{a as Q}from"./chunk-46V5PCBB.js";import{a as ee,b as te,c as ne,d as oe,e as ae,f as re,g as ie,h as me,i as pe,j as de,k as ce,l as le,m as ge,n as he,o as ue,p as fe,q as Ce,r as be,s as ve,t as _e,u as xe}from"./chunk-GWUHK3IY.js";import{a as se}from"./chunk-KHMEGI4Z.js";import{a as X,b as Z,c as $}from"./chunk-RB7N2NWN.js";import"./chunk-QBT6LKOQ.js";import"./chunk-KH3XUBG3.js";import{a as Ae}from"./chunk-TMQGM3DO.js";import"./chunk-35S3IW2A.js";import{a as H}from"./chunk-MQEDNZF7.js";import{a as Y,b as q,c as J,d as K}from"./chunk-YFCRBVWD.js";import{l as F}from"./chunk-BLRBIAYK.js";import"./chunk-TSYL5EEO.js";import{c as w}from"./chunk-6XX7GME4.js";import{s as T}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as E}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as k,Db as c,Fb as C,Ka as p,Rb as M,Tb as r,Ub as x,Wa as h,ca as g,ga as A,ha as P,lb as s,ma as y,mb as l,mc as O,rb as v,sb as n,ta as b,tb as o,ub as f,vb as S,wb as I,xb as _}from"./chunk-CHEXA6RY.js";var t=()=>!0;var Re=[{path:"oauth/callback",loadComponent:()=>import("./chunk-FOUZFGE6.js").then(e=>e.OAuthCallbackComponent)},{path:"",loadComponent:()=>import("./chunk-FAHNOZ4S.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-MH3KTYRA.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-LQOQ3VK5.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-KKYAHLLD.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-KKYAHLLD.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-RGGNQESF.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-WC55KAEC.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-HY5SN7AG.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-HY5SN7AG.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-VNLBXJU6.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-IN5SVY4U.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-IN5SVY4U.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-P3AFMA53.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-TET2CIOZ.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-TET2CIOZ.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-IV7SJSBN.js").then(e=>e.PlatformScheduledPromptsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-57XIXFX3.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-57XIXFX3.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-ZS3GOED4.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-3MTFWGAR.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-3MTFWGAR.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-AV3U5ZDG.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-JCKKIKVU.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-JCKKIKVU.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-M5ZWYOBX.js").then(e=>e.PlatformAuthSettingsComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-WH2T6TJR.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-WH2T6TJR.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-XFS5RNFU.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-FV7MYI7I.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FV7MYI7I.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-NEVEN2BG.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-NIV7FMON.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-JMRUD2BW.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-JMRUD2BW.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-JCKKIKVU.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-JCKKIKVU.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-UAHVURDD.js").then(e=>e.AuthSettingsAllScopesComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-IN5SVY4U.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-IN5SVY4U.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-FELLJOVH.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-3MTFWGAR.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-3MTFWGAR.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-3MREZSO7.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-WH2T6TJR.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-WH2T6TJR.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-QA4DQZOM.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-TET2CIOZ.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-TET2CIOZ.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-4T6SALXS.js").then(e=>e.ScheduledPromptListComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-57XIXFX3.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-57XIXFX3.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-GBTVBYVO.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-FV7MYI7I.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FV7MYI7I.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-NEVEN2BG.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-UU5QELSX.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-IYEDRCU5.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-IYEDRCU5.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-6QIZQ7GE.js").then(e=>e.NamespaceUserGroupsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&_(0,"span",1)}function R(e,i){e&1&&_(0,"span",2)}function j(e,i){e&1&&_(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(S(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),I()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=k();n(0,"button",9),c("click",function(){A(a);let d=C();return P(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(y);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=O(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),f(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),f(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),M("header__user-btn--active",m.isOnProfilePage),v("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom: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));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),f(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),v("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Re as AGENTOS_ROUTES,Pe as ActionCardChipsDirective,ye as ActionCardComponent,Ue as AdminUsersGroupsComponent,Q as AgentosShellComponent,J as AgentosThemeService,Z as AgentosUserPreferencesService,u as BackendStatusComponent,Ce as CaseChatComponent,_e as CaseDrawerComponent,be as CaseHomeComponent,ve as CaseItemComponent,xe as CaseShellComponent,X as ENTER_KEY_BEHAVIORS,le as ExchangeContentViewerComponent,ue as ExchangeDrawerComponent,he as ExchangeFileListComponent,ge as ExchangeItemComponent,fe as ExchangeShellComponent,ee as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,Ae as LayoutComponent,te as MAX_VIEWABLE_SIZE,se as MarkdownPipe,Se as NamespaceItemComponent,Ie as NamespaceListComponent,we as NamespaceSelectComponent,ze as NamespaceUserGroupsComponent,q as THEME_MODES,K as THEME_PORT,Y as THEME_VARIANTS,$ as USER_PREFERENCES_PORT,ke as UserAdminStateService,Me as UserFormComponent,Ne as UserGroupFormComponent,Fe as UserGroupItemComponent,Ee as UserGroupListComponent,Oe as UserGroupStateService,Te as UserItemComponent,He as UserListComponent,H as UserStateService,t as agentosReadyGuard,pe as canViewFile,re as detectFormat,ce as exchangeMutationScope,ae as formatDate,oe as formatSize,ne as getFileIcon,ie as isFormatViewable,me as isViewable,de as reindentJson};
|
|
1
|
+
import{a as Ne}from"./chunk-MIAKSSSF.js";import{a as ze}from"./chunk-5Y2Q6WKL.js";import{a as Se,b as Ie}from"./chunk-XZRVHU66.js";import{a as Pe,b as ye}from"./chunk-Y42FQQZC.js";import{a as Me}from"./chunk-AK746XRX.js";import{a as Te,b as He,c as Ue}from"./chunk-7H4TBVB7.js";import{a as we,b as Fe,c as Ee}from"./chunk-X73LZ3QV.js";import{a as Oe}from"./chunk-5N6DUZII.js";import{a as ke}from"./chunk-H6NBS4JE.js";import{a as Q}from"./chunk-46V5PCBB.js";import{a as ee,b as te,c as ne,d as oe,e as ae,f as re,g as ie,h as me,i as pe,j as de,k as ce,l as le,m as ge,n as he,o as ue,p as fe,q as Ce,r as be,s as ve,t as _e,u as xe}from"./chunk-GLFQ37PU.js";import{a as se}from"./chunk-KHMEGI4Z.js";import{a as X,b as Z,c as $}from"./chunk-RB7N2NWN.js";import"./chunk-KWJJEVAI.js";import"./chunk-GSUU7JSY.js";import{a as Ae}from"./chunk-NYUYHMIH.js";import"./chunk-UWYJO2DN.js";import{a as H}from"./chunk-VZOBZ3DD.js";import{a as Y,b as q,c as J,d as K}from"./chunk-YFCRBVWD.js";import{l as F}from"./chunk-UQTA3ACH.js";import"./chunk-TSYL5EEO.js";import{c as w}from"./chunk-6XX7GME4.js";import{s as T}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as E}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as k,Db as c,Fb as C,Ka as p,Rb as M,Tb as r,Ub as x,Wa as h,ca as g,ga as A,ha as P,lb as s,ma as y,mb as l,mc as O,rb as v,sb as n,ta as b,tb as o,ub as f,vb as S,wb as I,xb as _}from"./chunk-CHEXA6RY.js";var t=()=>!0;var Re=[{path:"oauth/callback",loadComponent:()=>import("./chunk-LUB22VNT.js").then(e=>e.OAuthCallbackComponent)},{path:"",loadComponent:()=>import("./chunk-FAHNOZ4S.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-XJYEZL5J.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-P6WNH2KJ.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-BWBZLC7A.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-BWBZLC7A.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-SZM3NJVZ.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-WC55KAEC.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-NNUJIQ6R.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-NNUJIQ6R.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-QTXEWRHZ.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-5OGZHNUE.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-5OGZHNUE.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-7O6TY5IW.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-W7A7CPWM.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-W7A7CPWM.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-U3AHBQTX.js").then(e=>e.PlatformScheduledPromptsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-FA2MVU23.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FA2MVU23.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-F4ZRQ6MH.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-XAEUGARN.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-XAEUGARN.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-CU7SABOQ.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-4CNY7Z64.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-4CNY7Z64.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-VLDPXI7G.js").then(e=>e.PlatformAuthSettingsComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-ECISS7V2.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-ECISS7V2.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-N2NJQ7DJ.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-I4RHXOIC.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-I4RHXOIC.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-4FGWE3EW.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-RQKLSUW5.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-ONZVOEJQ.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-ONZVOEJQ.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-4CNY7Z64.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-4CNY7Z64.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-TNSH3NBF.js").then(e=>e.AuthSettingsAllScopesComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-5OGZHNUE.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-5OGZHNUE.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-ZQZHBROX.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-XAEUGARN.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-XAEUGARN.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-ZXQEKBPA.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-ECISS7V2.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-ECISS7V2.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-LHKOA7FX.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-W7A7CPWM.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-W7A7CPWM.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-X5ZRXGFA.js").then(e=>e.ScheduledPromptListComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-FA2MVU23.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FA2MVU23.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-CSHG3PLJ.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-I4RHXOIC.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-I4RHXOIC.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-4FGWE3EW.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-S5QSZK6N.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-U7ZJFIOR.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-U7ZJFIOR.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-MFSY4HYK.js").then(e=>e.NamespaceUserGroupsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&_(0,"span",1)}function R(e,i){e&1&&_(0,"span",2)}function j(e,i){e&1&&_(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(S(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),I()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=k();n(0,"button",9),c("click",function(){A(a);let d=C();return P(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(y);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=O(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),f(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),f(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),M("header__user-btn--active",m.isOnProfilePage),v("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom: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));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),f(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),v("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Re as AGENTOS_ROUTES,Pe as ActionCardChipsDirective,ye as ActionCardComponent,Ue as AdminUsersGroupsComponent,Q as AgentosShellComponent,J as AgentosThemeService,Z as AgentosUserPreferencesService,u as BackendStatusComponent,Ce as CaseChatComponent,_e as CaseDrawerComponent,be as CaseHomeComponent,ve as CaseItemComponent,xe as CaseShellComponent,X as ENTER_KEY_BEHAVIORS,le as ExchangeContentViewerComponent,ue as ExchangeDrawerComponent,he as ExchangeFileListComponent,ge as ExchangeItemComponent,fe as ExchangeShellComponent,ee as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,Ae as LayoutComponent,te as MAX_VIEWABLE_SIZE,se as MarkdownPipe,Se as NamespaceItemComponent,Ie as NamespaceListComponent,we as NamespaceSelectComponent,ze as NamespaceUserGroupsComponent,q as THEME_MODES,K as THEME_PORT,Y as THEME_VARIANTS,$ as USER_PREFERENCES_PORT,ke as UserAdminStateService,Me as UserFormComponent,Ne as UserGroupFormComponent,Fe as UserGroupItemComponent,Ee as UserGroupListComponent,Oe as UserGroupStateService,Te as UserItemComponent,He as UserListComponent,H as UserStateService,t as agentosReadyGuard,pe as canViewFile,re as detectFormat,ce as exchangeMutationScope,ae as formatDate,oe as formatSize,ne as getFileIcon,ie as isFormatViewable,me as isViewable,de as reindentJson};
|