@whoz-oss/coday-client 0.0.0-workstream-forge.107 → 0.0.0-workstream-forge.108

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.
Files changed (76) hide show
  1. package/browser/{chunk-DIrez99x.js → chunk-1qxtpXum.js} +1 -1
  2. package/browser/{chunk-HRUxEFNV.js → chunk-3arSLCsL.js} +1 -1
  3. package/browser/{chunk-BoMAQeIx.js → chunk-8Fdi2AUg.js} +1 -1
  4. package/browser/{chunk-CjKuOoYl.js → chunk-9HQsVoR7.js} +1 -1
  5. package/browser/{chunk-BrWe3Tc0.js → chunk-AdPMVy2T.js} +1 -1
  6. package/browser/{chunk-m-t8eFzj.js → chunk-B0emNCN6.js} +1 -1
  7. package/browser/{chunk-D4POvHTC.js → chunk-B8kbBJuq.js} +1 -1
  8. package/browser/{chunk-CEizRT71.js → chunk-BAkBK7RM.js} +1 -1
  9. package/browser/{chunk-CHFfpyIc.js → chunk-BDm99Ksh.js} +1 -1
  10. package/browser/{chunk-DNUoJb9d.js → chunk-BGqgwB-o.js} +1 -1
  11. package/browser/{chunk-9t0dGUuC.js → chunk-BHaCDZtZ.js} +1 -1
  12. package/browser/{chunk-BOdSBH-Z.js → chunk-BKiEHvJE.js} +1 -1
  13. package/browser/{chunk-lkQw5eQ_.js → chunk-BKxShcbV.js} +1 -1
  14. package/browser/{chunk-DhCn0LVf.js → chunk-BOTun9xs.js} +1 -1
  15. package/browser/{chunk-Bp63FVq7.js → chunk-BXySg6jk.js} +1 -1
  16. package/browser/{chunk-FV8LaU7e.js → chunk-B_SBnFI8.js} +1 -1
  17. package/browser/{chunk-DqLrAE6M.js → chunk-Ba8pScsz.js} +1 -1
  18. package/browser/{chunk-B6OZW8wN.js → chunk-BbtVOMTU.js} +1 -1
  19. package/browser/{chunk-CIRByaMA.js → chunk-BeOtLXIa.js} +1 -1
  20. package/browser/{chunk-DUxFDQE0.js → chunk-BhQHLrzW.js} +1 -1
  21. package/browser/{chunk-C3o3QVhs.js → chunk-BjqDAkTL.js} +1 -1
  22. package/browser/{chunk-C-oYJ39L.js → chunk-BossQZF6.js} +1 -1
  23. package/browser/{chunk-CYC-I1Mg.js → chunk-BpllynbC.js} +1 -1
  24. package/browser/{chunk-DoJEGSbs.js → chunk-Btt7Zr2M.js} +1 -1
  25. package/browser/{chunk-sqGaEvm9.js → chunk-BvNxH5OS.js} +1 -1
  26. package/browser/{chunk-DSh1tjBw.js → chunk-BwDRO03X.js} +1 -1
  27. package/browser/{chunk-CiGypT43.js → chunk-BwTXpLZu.js} +1 -1
  28. package/browser/{chunk-LtCKJR0U.js → chunk-C-PGqagA.js} +1 -1
  29. package/browser/{chunk-C5_Zcy7N.js → chunk-C2chhSLr.js} +1 -1
  30. package/browser/{chunk-BatX6vs0.js → chunk-C7a54XFG.js} +1 -1
  31. package/browser/{chunk-Bk-0cIam.js → chunk-C93oAiDh.js} +1 -1
  32. package/browser/{chunk-CJaI0n6Y.js → chunk-CB_envwE.js} +1 -1
  33. package/browser/{chunk-ORbAjzgA.js → chunk-CCFqXl1j.js} +1 -1
  34. package/browser/{chunk-CjeED1ew.js → chunk-CKhgf7Wn.js} +1 -1
  35. package/browser/{chunk-BSRWEUf3.js → chunk-CM72Zsqv.js} +1 -1
  36. package/browser/{chunk-BuSX6FVc.js → chunk-CQEl2S8c.js} +1 -1
  37. package/browser/{chunk-Dl8oDumK.js → chunk-CVbM-LbT.js} +1 -1
  38. package/browser/{chunk-DnszH38I.js → chunk-CXU78-_W.js} +1 -1
  39. package/browser/{chunk-C0C_xi5w.js → chunk-CZ3MCbb4.js} +1 -1
  40. package/browser/{chunk-DF1nf97L.js → chunk-ClHl7eW-.js} +1 -1
  41. package/browser/{chunk-DLoICesN.js → chunk-Cn8ABj_T.js} +1 -1
  42. package/browser/{chunk-gFrPRGkc.js → chunk-CsZh-eL4.js} +1 -1
  43. package/browser/{chunk-BqZAHySB.js → chunk-CyI5KqTH.js} +1 -1
  44. package/browser/{chunk-C8UVOyhT.js → chunk-D-C39lLD.js} +1 -1
  45. package/browser/{chunk-prOpH6CY.js → chunk-D3hm7jI9.js} +1 -1
  46. package/browser/{chunk-Diew0ikf.js → chunk-D6ZadDnX.js} +1 -1
  47. package/browser/{chunk-BmZ9yw5t.js → chunk-DFV_94IQ.js} +1 -1
  48. package/browser/{chunk-C0d355eD.js → chunk-DKGIDAkY.js} +1 -1
  49. package/browser/{chunk-BxK6jZXt.js → chunk-DVQCKTyN.js} +1 -1
  50. package/browser/{chunk-BF54SE4Z.js → chunk-Dfxox4tZ.js} +1 -1
  51. package/browser/{chunk-BDCAzL3z.js → chunk-DgLRCX4w.js} +1 -1
  52. package/browser/{chunk-CQnXbo49.js → chunk-DgySCmsc.js} +1 -1
  53. package/browser/{chunk-eeMC5EPB.js → chunk-DnIQopma.js} +1 -1
  54. package/browser/{chunk-CKO-l3V9.js → chunk-DqTacE0P.js} +1 -1
  55. package/browser/{chunk-MZ4wRIEo.js → chunk-DregcDV6.js} +1 -1
  56. package/browser/{chunk-DAtwHi5G.js → chunk-DvgF2GEo.js} +1 -1
  57. package/browser/{chunk-DlGT7b2J.js → chunk-Ei51OvgQ.js} +1 -1
  58. package/browser/{chunk-DqnU1y0y.js → chunk-GLlIZOT9.js} +1 -1
  59. package/browser/{chunk-DYyjYklW.js → chunk-K3v_Owq7.js} +1 -1
  60. package/browser/{chunk-BTwVcLbP.js → chunk-KvVZUdz7.js} +1 -1
  61. package/browser/{chunk-CmObLvei.js → chunk-VgVDkZ4m.js} +1 -1
  62. package/browser/{chunk-Btndt-0_.js → chunk-WQPiAxqd.js} +1 -1
  63. package/browser/{chunk-waGtT2fH.js → chunk-YBI4hQOK.js} +1 -1
  64. package/browser/{chunk-BD1J-qMV.js → chunk-b2XDr4b4.js} +1 -1
  65. package/browser/{chunk-By7YGzD4.js → chunk-dY7-bZcz.js} +1 -1
  66. package/browser/chunk-fBYTYGxD.js +10 -0
  67. package/browser/{chunk-Cvyvj0DZ.js → chunk-ixCHaxFX.js} +1 -1
  68. package/browser/{chunk-B4imwkV0.js → chunk-yApl8vaa.js} +1 -1
  69. package/browser/{chunk-DJTNjd3B.js → chunk-zIMeg4Tv.js} +1 -1
  70. package/browser/{chunk-B4GToBYG.js → chunk-zVECqtqn.js} +1 -1
  71. package/browser/chunk-znO_jWPo.js +1 -0
  72. package/browser/index.html +1 -1
  73. package/browser/{main-EVOOW2CG.js → main-E674WB3K.js} +1 -1
  74. package/package.json +1 -1
  75. package/browser/chunk-Cfby0A0V.js +0 -1
  76. package/browser/chunk-pkNoeD9f.js +0 -10
@@ -1 +1 @@
1
- import {A,k as kt,b as bt}from'./chunk-Dl8oDumK.js';import {S as St}from'./chunk-sqGaEvm9.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-BF54SE4Z.js';import {g,F as F$1,P,U,N,p as pe$1,H as c,C as Ce$1,G as Gi,a as F$2,m as mT,b as U$1,e as xw,h as hr,i as pr,k as ws,n as GC,o as pl,q as Rg,J as Jw,s as rC,X as XE,u as bg,v as eC,y as oC,z as Ug,T as Tg,r as re,ca as _e$1,W as x,an as ue$1,ap as Cd,l as le$1,V,S as Sg,a9 as lC,aa as If,ac as gC,ab as wf,a8 as Yg,a5 as vl}from'./main-EVOOW2CG.js';import'./chunk-DF1nf97L.js';import'./chunk-BqZAHySB.js';import'./chunk-CJaI0n6Y.js';import'./chunk-DJTNjd3B.js';import {y as yt,w as wt}from'./chunk-FV8LaU7e.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$2(this.threadState.threadList$,{initialValue:[]});selectedThread=F$2(this.threadState.selectedThread$,{initialValue:null});isThinking=F$2(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$2(this.codayService.currentInviteEvent$.pipe(re(t=>t?.invite===_e$1?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ue$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Cd(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=le$1(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&Sg(0,"mat-spinner",6);}function me(n,t){n&1&&(ws(0,"mat-icon"),GC(1,"add"),pl());}function ue(n,t){if(n&1&&(ws(0,"span",16),GC(1),pl()),n&2){let e=gC().$implicit,r=gC();XE(),Yg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=lC();ws(0,"button",15),Rg("click",function(){let o=If(e).$implicit,i=gC();return wf(i.setFilter(o.key))}),ws(1,"mat-icon",10),GC(2),pl(),ws(3,"span"),GC(4),pl(),Jw(5,ue,2,1,"span",16),pl();}if(n&2){let e=t.$implicit,r=gC();Ug("active",r.activeFilter()===e.key),Tg("aria-selected",r.activeFilter()===e.key),XE(2),Yg(e.icon),XE(2),Yg(e.label),XE(),eC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(ws(0,"div",12),Sg(1,"mat-spinner",17),ws(2,"p"),GC(3,"Loading tasks\u2026"),pl()());}function fe(n,t){if(n&1){let e=lC();ws(0,"p"),GC(1,"No tasks yet. Start your first one!"),pl(),ws(2,"button",19),Rg("click",function(){If(e);let o=gC(2);return wf(o.createTask())}),ws(3,"mat-icon"),GC(4,"add"),pl(),GC(5," New Task "),pl();}}function he(n,t){n&1&&(ws(0,"p"),GC(1,"No tasks in this category."),pl());}function ke(n,t){if(n&1&&(ws(0,"div",13)(1,"mat-icon",18),GC(2,"rocket_launch"),pl(),Jw(3,fe,6,0)(4,he,2,0,"p"),pl()),n&2){let e=gC();XE(3),eC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=lC();ws(0,"app-task-card",25),Rg("stopRequested",function(o){If(e);let i=gC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=gC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=gC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=gC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=gC(3);return wf(i.onMarkActiveRequested(o))}),pl();}if(n&2){let e=t.$implicit;bg("task",e);}}function Ce(n,t){if(n&1&&(ws(0,"section",20)(1,"h2",21)(2,"mat-icon",22),GC(3),pl(),GC(4),ws(5,"span",23),GC(6),pl()(),ws(7,"div",14),rC(8,ve,1,1,"app-task-card",24,le),pl()()),n&2){let e=t.$implicit;XE(3),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length),XE(2),oC(e.tasks);}}function be(n,t){if(n&1&&rC(0,Ce,10,3,"section",20,de),n&2){let e=gC();oC(e.taskGroups());}}function ye(n,t){if(n&1){let e=lC();ws(0,"app-task-card",25),Rg("stopRequested",function(o){If(e);let i=gC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=gC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=gC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=gC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=gC(2);return wf(i.onMarkActiveRequested(o))}),pl();}if(n&2){let e=t.$implicit;bg("task",e);}}function xe(n,t){if(n&1&&(ws(0,"div",14),rC(1,ye,1,1,"app-task-card",24,le),pl()),n&2){let e=gC();XE(),oC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(F$1);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(pe$1);projectApi=g(c);destroyRef=g(Ce$1);_projectEventStream=g(F);filters=Te;activeFilter=Gi("all");starredOnly=Gi(false);isCreating=Gi(false);isLoadingList=F$2(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$2(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(ws(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),GC(6,"rocket_launch"),pl(),GC(7," Task Control "),pl(),ws(8,"button",5),Rg("click",function(){return r.createTask()}),Jw(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),GC(11," New Task "),pl()(),ws(12,"nav",7),rC(13,ge,6,6,"button",8,ce),ws(15,"button",9),Rg("click",function(){return r.toggleStarredFilter()}),ws(16,"mat-icon",10),GC(17,"star"),pl(),ws(18,"span"),GC(19,"Starred"),pl()()()(),ws(20,"main",11),Jw(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),pl()()()),e&2&&(XE(8),bg("disabled",r.isCreating()),XE(),eC(r.isCreating()?9:10),XE(4),oC(r.filters),XE(2),Ug("active",r.starredOnly()),Tg("aria-checked",r.starredOnly()),XE(6),eC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
1
+ import {A,k as kt,b as bt}from'./chunk-CVbM-LbT.js';import {S as St}from'./chunk-BvNxH5OS.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-Dfxox4tZ.js';import {g,F as F$1,P,U,N,p as pe$1,H as c,C as Ce$1,G as Gi,a as F$2,m as mT,b as U$1,e as xw,h as hr,i as pr,k as ws,n as GC,o as pl,q as Rg,J as Jw,s as rC,X as XE,u as bg,v as eC,y as oC,z as Ug,T as Tg,r as re,ca as _e$1,W as x,an as ue$1,ap as Cd,l as le$1,V,S as Sg,a9 as lC,aa as If,ac as gC,ab as wf,a8 as Yg,a5 as vl}from'./main-E674WB3K.js';import'./chunk-ClHl7eW-.js';import'./chunk-CyI5KqTH.js';import'./chunk-CB_envwE.js';import'./chunk-zIMeg4Tv.js';import {y as yt,w as wt}from'./chunk-B_SBnFI8.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$2(this.threadState.threadList$,{initialValue:[]});selectedThread=F$2(this.threadState.selectedThread$,{initialValue:null});isThinking=F$2(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$2(this.codayService.currentInviteEvent$.pipe(re(t=>t?.invite===_e$1?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ue$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Cd(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=le$1(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&Sg(0,"mat-spinner",6);}function me(n,t){n&1&&(ws(0,"mat-icon"),GC(1,"add"),pl());}function ue(n,t){if(n&1&&(ws(0,"span",16),GC(1),pl()),n&2){let e=gC().$implicit,r=gC();XE(),Yg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=lC();ws(0,"button",15),Rg("click",function(){let o=If(e).$implicit,i=gC();return wf(i.setFilter(o.key))}),ws(1,"mat-icon",10),GC(2),pl(),ws(3,"span"),GC(4),pl(),Jw(5,ue,2,1,"span",16),pl();}if(n&2){let e=t.$implicit,r=gC();Ug("active",r.activeFilter()===e.key),Tg("aria-selected",r.activeFilter()===e.key),XE(2),Yg(e.icon),XE(2),Yg(e.label),XE(),eC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(ws(0,"div",12),Sg(1,"mat-spinner",17),ws(2,"p"),GC(3,"Loading tasks\u2026"),pl()());}function fe(n,t){if(n&1){let e=lC();ws(0,"p"),GC(1,"No tasks yet. Start your first one!"),pl(),ws(2,"button",19),Rg("click",function(){If(e);let o=gC(2);return wf(o.createTask())}),ws(3,"mat-icon"),GC(4,"add"),pl(),GC(5," New Task "),pl();}}function he(n,t){n&1&&(ws(0,"p"),GC(1,"No tasks in this category."),pl());}function ke(n,t){if(n&1&&(ws(0,"div",13)(1,"mat-icon",18),GC(2,"rocket_launch"),pl(),Jw(3,fe,6,0)(4,he,2,0,"p"),pl()),n&2){let e=gC();XE(3),eC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=lC();ws(0,"app-task-card",25),Rg("stopRequested",function(o){If(e);let i=gC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=gC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=gC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=gC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=gC(3);return wf(i.onMarkActiveRequested(o))}),pl();}if(n&2){let e=t.$implicit;bg("task",e);}}function Ce(n,t){if(n&1&&(ws(0,"section",20)(1,"h2",21)(2,"mat-icon",22),GC(3),pl(),GC(4),ws(5,"span",23),GC(6),pl()(),ws(7,"div",14),rC(8,ve,1,1,"app-task-card",24,le),pl()()),n&2){let e=t.$implicit;XE(3),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length),XE(2),oC(e.tasks);}}function be(n,t){if(n&1&&rC(0,Ce,10,3,"section",20,de),n&2){let e=gC();oC(e.taskGroups());}}function ye(n,t){if(n&1){let e=lC();ws(0,"app-task-card",25),Rg("stopRequested",function(o){If(e);let i=gC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=gC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=gC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=gC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=gC(2);return wf(i.onMarkActiveRequested(o))}),pl();}if(n&2){let e=t.$implicit;bg("task",e);}}function xe(n,t){if(n&1&&(ws(0,"div",14),rC(1,ye,1,1,"app-task-card",24,le),pl()),n&2){let e=gC();XE(),oC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(F$1);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(pe$1);projectApi=g(c);destroyRef=g(Ce$1);_projectEventStream=g(F);filters=Te;activeFilter=Gi("all");starredOnly=Gi(false);isCreating=Gi(false);isLoadingList=F$2(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$2(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(ws(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),GC(6,"rocket_launch"),pl(),GC(7," Task Control "),pl(),ws(8,"button",5),Rg("click",function(){return r.createTask()}),Jw(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),GC(11," New Task "),pl()(),ws(12,"nav",7),rC(13,ge,6,6,"button",8,ce),ws(15,"button",9),Rg("click",function(){return r.toggleStarredFilter()}),ws(16,"mat-icon",10),GC(17,"star"),pl(),ws(18,"span"),GC(19,"Starred"),pl()()()(),ws(20,"main",11),Jw(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),pl()()()),e&2&&(XE(8),bg("disabled",r.isCreating()),XE(),eC(r.isCreating()?9:10),XE(4),oC(r.filters),XE(2),Ug("active",r.starredOnly()),Tg("aria-checked",r.starredOnly()),XE(6),eC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
@@ -1 +1 @@
1
- import {i}from'./chunk-Cfby0A0V.js';import {l}from'./chunk-pkNoeD9f.js';import {g,d9 as D,dk as xe,aJ as Tr,aD as Ly,bS as Ea,a7 as ya,Q as br,r as re,cE as Dd,bU as Td,W as x}from'./main-EVOOW2CG.js';var y="none",O="me",N=class f{nsController=g(D);exportService=g(xe);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(Ea(([e])=>{let n=this.loadPlatformConfigs().pipe(ya(()=>br([]))),t=this.loadUserConfigs("global").pipe(ya(()=>br([])));return e?Ly([n,this.loadNamespaceConfigs(e).pipe(ya(()=>br([]))),this.loadUserConfigs(e).pipe(ya(()=>br([]))),t]).pipe(re(([i,r,u,s])=>({platform:i,namespace:r,userOnNs:u,userGlobal:s}))):Ly([n,t]).pipe(re(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Dd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(y)}loadUserConfigs(e){let n=e==="global"?y:e;return this.nsController.listIntegrationConfig(n,O)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):br([])}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,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(s).pipe(Td(()=>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,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(s).pipe(Td(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let u={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,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u).pipe(Td(()=>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,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,r).pipe(Td(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Td(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||f)};static \u0275prov=x({token:f,factory:f.\u0275fac,providedIn:"root"})};export{N};
1
+ import {i}from'./chunk-znO_jWPo.js';import {l}from'./chunk-fBYTYGxD.js';import {g,d9 as D,dk as xe,aJ as Tr,aD as Ly,bS as Ea,a7 as ya,Q as br,r as re,cE as Dd,bU as Td,W as x}from'./main-E674WB3K.js';var y="none",O="me",N=class f{nsController=g(D);exportService=g(xe);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(Ea(([e])=>{let n=this.loadPlatformConfigs().pipe(ya(()=>br([]))),t=this.loadUserConfigs("global").pipe(ya(()=>br([])));return e?Ly([n,this.loadNamespaceConfigs(e).pipe(ya(()=>br([]))),this.loadUserConfigs(e).pipe(ya(()=>br([]))),t]).pipe(re(([i,r,u,s])=>({platform:i,namespace:r,userOnNs:u,userGlobal:s}))):Ly([n,t]).pipe(re(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Dd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(y)}loadUserConfigs(e){let n=e==="global"?y:e;return this.nsController.listIntegrationConfig(n,O)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):br([])}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,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(s).pipe(Td(()=>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,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(s).pipe(Td(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let u={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,autoGrant:e.autoGrant??false};return this.nsController.createIntegrationConfig(u).pipe(Td(()=>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,autoGrant:n.autoGrant??false};return this.nsController.updateIntegrationConfig(e,r).pipe(Td(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Td(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||f)};static \u0275prov=x({token:f,factory:f.\u0275fac,providedIn:"root"})};export{N};
@@ -1 +1 @@
1
- import {o}from'./chunk-BSRWEUf3.js';import {g,ao as W$1,F,C as Ce,G as Gi,b as U$1,x,w,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,v as eC,ac as gC,u as bg,a9 as lC,S as Sg,a3 as VI,a6 as UI,a5 as vl,s as rC,bo as tC,y as oC,aa as If,ab as wf}from'./main-EVOOW2CG.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Y as Ye,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-FV8LaU7e.js';function J(n,o){if(n&1&&(ws(0,"a",5),GC(1,"View skill \u2192"),pl()),n&2){let e=gC();bg("routerLink",e.inspectRoute());}}function K(n,o){n&1&&(ws(0,"span",6),GC(1,"Platform level"),pl());}function Q(n,o){n&1&&(ws(0,"p",7),GC(1,"Loading\u2026"),pl());}function W(n,o){n&1&&(ws(0,"p",14),GC(1," A valid, non-empty name is required. "),pl());}function X(n,o){if(n&1){let e=lC();ws(0,"li",26)(1,"div",27),Sg(2,"input",28),VI(),ws(3,"button",29),Rg("click",function(){let s=If(e).$implicit,H=gC(3);return wf(H.removeResource(s))}),GC(4," \xD7 "),pl()(),Sg(5,"textarea",30),VI(),pl();}if(n&2){let e=o.$implicit;XE(2),bg("formControl",e.path),UI(),XE(3),bg("formControl",e.content),UI();}}function Y(n,o){if(n&1&&(ws(0,"ul",20),rC(1,X,6,2,"li",26,tC),pl()),n&2){let e=gC(2);XE(),oC(e.resourceRows());}}function ee(n,o){if(n&1&&(ws(0,"p",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function te(n,o){if(n&1){let e=lC();ws(0,"form",9),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"div",10)(2,"label",11),GC(3,"Name"),pl(),Sg(4,"input",12),VI(),ws(5,"p",13),GC(6," The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max. "),pl(),Jw(7,W,2,0,"p",14),pl(),ws(8,"div",10)(9,"label",15),GC(10,"Description"),pl(),Sg(11,"textarea",16),VI(),ws(12,"p",13),GC(13," This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max. "),pl()(),ws(14,"div",10)(15,"label",17),GC(16,"Body"),pl(),Sg(17,"textarea",18),VI(),ws(18,"p",13),GC(19," Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill. "),pl()(),ws(20,"div",10)(21,"span",19),GC(22,"Resources"),pl(),ws(23,"p",13),GC(24," Optional files the agent can read with readSkillResource, by relative path. "),pl(),Jw(25,Y,3,0,"ul",20),ws(26,"button",21),Rg("click",function(){If(e);let s=gC();return wf(s.addResource())}),GC(27," + Add resource "),pl()(),Jw(28,ee,2,1,"p",22),ws(29,"div",23)(30,"button",24),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(31,"Cancel"),pl(),ws(32,"button",25),GC(33),pl()()();}if(n&2){let e=gC();bg("formGroup",e.form),XE(4),bg("formControl",e.nameControl),UI(),XE(3),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(4),bg("formControl",e.descriptionControl),UI(),XE(6),bg("formControl",e.bodyControl),UI(),XE(8),eC(e.resourceRows().length>0?25:-1),XE(3),eC(e.errorMessage()?28:-1),XE(4),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save":"Create"," ");}}var U=class n{route=g(W$1);router=g(F);destroyRef=g(Ce);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Gi(false);isLoading=Gi(false);isSubmitting=Gi(false);errorMessage=Gi(null);existingSkill=null;form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.maxLength(100),_e.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new _t("",{nonNullable:true,validators:[_e.required,_e.maxLength(500),_e.pattern(/\S/)]}),body:new _t("",{nonNullable:true,validators:[_e.required,_e.pattern(/\S/)]})});resourceRows=Gi([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let o=this.route.snapshot.paramMap.get("skillId");o&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(o).pipe(U$1(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([a,s])=>({path:new _t(a,{nonNullable:true}),content:new _t(s,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(o=>[...o,{path:new _t("",{nonNullable:true}),content:new _t("",{nonNullable:true})}]);}removeResource(o){this.resourceRows.update(e=>e.filter(a=>a!==o));}buildResourcesPayload(){let o=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(o)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let o=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",o):this.skillState.create(o)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:a=>{this.isSubmitting.set(false),a.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):a.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let o=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",o,"inspect"]:["/agentos",this.namespaceId,"skills",o,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-skill-form"]],decls:12,vars:4,consts:[[1,"skill-form"],[1,"skill-form__header"],["type","button","title","Back to skills",1,"skill-form__back",3,"click"],[1,"skill-form__back-icon"],[1,"skill-form__title"],[1,"skill-form__sibling-link",3,"routerLink"],[1,"skill-form__platform-badge"],[1,"skill-form__loading"],[1,"skill-form__form",3,"formGroup"],[1,"skill-form__form",3,"ngSubmit","formGroup"],[1,"skill-form__field"],["for","skill-name",1,"skill-form__label"],["id","skill-name","type","text","autocomplete","off",1,"skill-form__input",3,"formControl"],[1,"skill-form__field-hint"],["role","alert",1,"skill-form__field-hint","skill-form__field-hint--error"],["for","skill-description",1,"skill-form__label"],["id","skill-description","rows","2",1,"skill-form__input","skill-form__textarea",3,"formControl"],["for","skill-body",1,"skill-form__label"],["id","skill-body","rows","16",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"],[1,"skill-form__label"],[1,"skill-form__resource-list"],["type","button",1,"skill-form__resource-btn","skill-form__resource-btn--add",3,"click"],["role","alert",1,"skill-form__error"],[1,"skill-form__actions"],["type","button",1,"skill-form__btn",3,"click"],["type","submit",1,"skill-form__btn","skill-form__btn--primary",3,"disabled"],[1,"skill-form__resource-row"],[1,"skill-form__resource-head"],["type","text","placeholder","e.g. references/checklist.md","autocomplete","off",1,"skill-form__input","skill-form__resource-path",3,"formControl"],["type","button","title","Remove",1,"skill-form__resource-btn","skill-form__resource-btn--danger",3,"click"],["rows","4",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"]],template:function(e,a){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Skills "),pl(),ws(6,"h1",4),GC(7),pl(),Jw(8,J,2,1,"a",5),Jw(9,K,2,0,"span",6),pl(),Jw(10,Q,2,0,"p",7)(11,te,34,9,"form",8),pl()),e&2&&(XE(7),Yg(a.isEditMode()?"Edit skill":"New skill"),XE(),eC(a.isEditMode()?8:-1),XE(),eC(a.isPlatformMode?9:-1),XE(),eC(a.isLoading()?10:11));},dependencies:[ni,Jn,Ye,Zn,Xn,Cn,En,$t],styles:[".skill-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.skill-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.skill-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-primary, #007aff);font-family:inherit}.skill-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.skill-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.skill-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.skill-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__platform-badge[_ngcontent-%COMP%]{align-self:flex-start;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.15rem .5rem;border:1px solid var(--color-divider, rgba(0, 0, 0, .12));color:var(--color-neutral-600, #6e6e73)}.skill-form__loading[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.skill-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.skill-form__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:.5rem .75rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));border-radius:0;background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.9375rem}.skill-form__input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.skill-form__textarea[_ngcontent-%COMP%]{resize:vertical;line-height:1.5}.skill-form__textarea--code[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__field-hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__field-hint--error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.skill-form__resource-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.75rem}.skill-form__resource-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__resource-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.skill-form__resource-path[_ngcontent-%COMP%]{flex:1;font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__resource-btn[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:1px solid var(--color-border, rgba(0, 0, 0, .12));padding:.3rem .6rem;cursor:pointer;font-family:inherit;font-size:.8125rem;color:var(--color-text, #1d1d1f)}.skill-form__resource-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__resource-btn--danger[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);font-size:1rem;line-height:1;padding:.25rem .5rem}.skill-form__resource-btn--add[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}.skill-form__error[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-error, #ff3b30)}.skill-form__actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.skill-form__btn[_ngcontent-%COMP%]{padding:.5rem 1rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text, #1d1d1f)}.skill-form__btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.skill-form__btn--primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};export{U as SkillFormComponent};
1
+ import {o}from'./chunk-CM72Zsqv.js';import {g,ao as W$1,F,C as Ce,G as Gi,b as U$1,x,w,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,v as eC,ac as gC,u as bg,a9 as lC,S as Sg,a3 as VI,a6 as UI,a5 as vl,s as rC,bo as tC,y as oC,aa as If,ab as wf}from'./main-E674WB3K.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Y as Ye,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-B_SBnFI8.js';function J(n,o){if(n&1&&(ws(0,"a",5),GC(1,"View skill \u2192"),pl()),n&2){let e=gC();bg("routerLink",e.inspectRoute());}}function K(n,o){n&1&&(ws(0,"span",6),GC(1,"Platform level"),pl());}function Q(n,o){n&1&&(ws(0,"p",7),GC(1,"Loading\u2026"),pl());}function W(n,o){n&1&&(ws(0,"p",14),GC(1," A valid, non-empty name is required. "),pl());}function X(n,o){if(n&1){let e=lC();ws(0,"li",26)(1,"div",27),Sg(2,"input",28),VI(),ws(3,"button",29),Rg("click",function(){let s=If(e).$implicit,H=gC(3);return wf(H.removeResource(s))}),GC(4," \xD7 "),pl()(),Sg(5,"textarea",30),VI(),pl();}if(n&2){let e=o.$implicit;XE(2),bg("formControl",e.path),UI(),XE(3),bg("formControl",e.content),UI();}}function Y(n,o){if(n&1&&(ws(0,"ul",20),rC(1,X,6,2,"li",26,tC),pl()),n&2){let e=gC(2);XE(),oC(e.resourceRows());}}function ee(n,o){if(n&1&&(ws(0,"p",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function te(n,o){if(n&1){let e=lC();ws(0,"form",9),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"div",10)(2,"label",11),GC(3,"Name"),pl(),Sg(4,"input",12),VI(),ws(5,"p",13),GC(6," The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max. "),pl(),Jw(7,W,2,0,"p",14),pl(),ws(8,"div",10)(9,"label",15),GC(10,"Description"),pl(),Sg(11,"textarea",16),VI(),ws(12,"p",13),GC(13," This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max. "),pl()(),ws(14,"div",10)(15,"label",17),GC(16,"Body"),pl(),Sg(17,"textarea",18),VI(),ws(18,"p",13),GC(19," Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill. "),pl()(),ws(20,"div",10)(21,"span",19),GC(22,"Resources"),pl(),ws(23,"p",13),GC(24," Optional files the agent can read with readSkillResource, by relative path. "),pl(),Jw(25,Y,3,0,"ul",20),ws(26,"button",21),Rg("click",function(){If(e);let s=gC();return wf(s.addResource())}),GC(27," + Add resource "),pl()(),Jw(28,ee,2,1,"p",22),ws(29,"div",23)(30,"button",24),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(31,"Cancel"),pl(),ws(32,"button",25),GC(33),pl()()();}if(n&2){let e=gC();bg("formGroup",e.form),XE(4),bg("formControl",e.nameControl),UI(),XE(3),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(4),bg("formControl",e.descriptionControl),UI(),XE(6),bg("formControl",e.bodyControl),UI(),XE(8),eC(e.resourceRows().length>0?25:-1),XE(3),eC(e.errorMessage()?28:-1),XE(4),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save":"Create"," ");}}var U=class n{route=g(W$1);router=g(F);destroyRef=g(Ce);skillState=g(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=Gi(false);isLoading=Gi(false);isSubmitting=Gi(false);errorMessage=Gi(null);existingSkill=null;form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.maxLength(100),_e.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new _t("",{nonNullable:true,validators:[_e.required,_e.maxLength(500),_e.pattern(/\S/)]}),body:new _t("",{nonNullable:true,validators:[_e.required,_e.pattern(/\S/)]})});resourceRows=Gi([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let o=this.route.snapshot.paramMap.get("skillId");o&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(o).pipe(U$1(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([a,s])=>({path:new _t(a,{nonNullable:true}),content:new _t(s,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(o=>[...o,{path:new _t("",{nonNullable:true}),content:new _t("",{nonNullable:true})}]);}removeResource(o){this.resourceRows.update(e=>e.filter(a=>a!==o));}buildResourcesPayload(){let o=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(o)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let o=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",o):this.skillState.create(o)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:a=>{this.isSubmitting.set(false),a.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):a.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let o=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",o,"inspect"]:["/agentos",this.namespaceId,"skills",o,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-skill-form"]],decls:12,vars:4,consts:[[1,"skill-form"],[1,"skill-form__header"],["type","button","title","Back to skills",1,"skill-form__back",3,"click"],[1,"skill-form__back-icon"],[1,"skill-form__title"],[1,"skill-form__sibling-link",3,"routerLink"],[1,"skill-form__platform-badge"],[1,"skill-form__loading"],[1,"skill-form__form",3,"formGroup"],[1,"skill-form__form",3,"ngSubmit","formGroup"],[1,"skill-form__field"],["for","skill-name",1,"skill-form__label"],["id","skill-name","type","text","autocomplete","off",1,"skill-form__input",3,"formControl"],[1,"skill-form__field-hint"],["role","alert",1,"skill-form__field-hint","skill-form__field-hint--error"],["for","skill-description",1,"skill-form__label"],["id","skill-description","rows","2",1,"skill-form__input","skill-form__textarea",3,"formControl"],["for","skill-body",1,"skill-form__label"],["id","skill-body","rows","16",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"],[1,"skill-form__label"],[1,"skill-form__resource-list"],["type","button",1,"skill-form__resource-btn","skill-form__resource-btn--add",3,"click"],["role","alert",1,"skill-form__error"],[1,"skill-form__actions"],["type","button",1,"skill-form__btn",3,"click"],["type","submit",1,"skill-form__btn","skill-form__btn--primary",3,"disabled"],[1,"skill-form__resource-row"],[1,"skill-form__resource-head"],["type","text","placeholder","e.g. references/checklist.md","autocomplete","off",1,"skill-form__input","skill-form__resource-path",3,"formControl"],["type","button","title","Remove",1,"skill-form__resource-btn","skill-form__resource-btn--danger",3,"click"],["rows","4",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"]],template:function(e,a){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Skills "),pl(),ws(6,"h1",4),GC(7),pl(),Jw(8,J,2,1,"a",5),Jw(9,K,2,0,"span",6),pl(),Jw(10,Q,2,0,"p",7)(11,te,34,9,"form",8),pl()),e&2&&(XE(7),Yg(a.isEditMode()?"Edit skill":"New skill"),XE(),eC(a.isEditMode()?8:-1),XE(),eC(a.isPlatformMode?9:-1),XE(),eC(a.isLoading()?10:11));},dependencies:[ni,Jn,Ye,Zn,Xn,Cn,En,$t],styles:[".skill-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.skill-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.skill-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-primary, #007aff);font-family:inherit}.skill-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.skill-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.skill-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.skill-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__platform-badge[_ngcontent-%COMP%]{align-self:flex-start;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.15rem .5rem;border:1px solid var(--color-divider, rgba(0, 0, 0, .12));color:var(--color-neutral-600, #6e6e73)}.skill-form__loading[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.skill-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.skill-form__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:.5rem .75rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));border-radius:0;background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.9375rem}.skill-form__input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.skill-form__textarea[_ngcontent-%COMP%]{resize:vertical;line-height:1.5}.skill-form__textarea--code[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__field-hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__field-hint--error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.skill-form__resource-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.75rem}.skill-form__resource-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__resource-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.skill-form__resource-path[_ngcontent-%COMP%]{flex:1;font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__resource-btn[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:1px solid var(--color-border, rgba(0, 0, 0, .12));padding:.3rem .6rem;cursor:pointer;font-family:inherit;font-size:.8125rem;color:var(--color-text, #1d1d1f)}.skill-form__resource-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__resource-btn--danger[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);font-size:1rem;line-height:1;padding:.25rem .5rem}.skill-form__resource-btn--add[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}.skill-form__error[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-error, #ff3b30)}.skill-form__actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.skill-form__btn[_ngcontent-%COMP%]{padding:.5rem 1rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text, #1d1d1f)}.skill-form__btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.skill-form__btn--primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};export{U as SkillFormComponent};
@@ -1 +1 @@
1
- import {v}from'./chunk-LtCKJR0U.js';import {R}from'./chunk-BmZ9yw5t.js';import {N}from'./chunk-9t0dGUuC.js';import {g,ao as W,F,C as Ce,d8 as W$1,a as F$1,Q as br,G as Gi,m as mT,cd as Hf,b as U,e as xw,k as ws,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,v as eC,a9 as lC,q as Rg,s as rC,cH as Kw,a3 as VI,S as Sg,a4 as nC,ac as gC,u as bg,y as oC,a6 as UI,a5 as vl,aa as If,ab as wf}from'./main-EVOOW2CG.js';import'./chunk-pkNoeD9f.js';import {n as nt}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,a as wt,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-FV8LaU7e.js';import'./chunk-Cfby0A0V.js';import'./chunk-DAtwHi5G.js';function le(i,t){i&1&&(ws(0,"p",3),GC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(ws(0,"label",8),Sg(1,"input",27),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,n=gC(2);XE(),bg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),XE(2),Yg(e.label);}}function ce(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e.type),XE(),Yg(e.displayName);}}function me(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function pe(i,t){if(i&1&&(ws(0,"div",9)(1,"label",28),Sg(2,"input",29),VI(),ws(3,"span",7),GC(4,"Grant automatically"),pl()(),ws(5,"p",30),GC(6),pl()()),i&2){let e=gC(2);XE(2),bg("formControl",e.autoGrantControl),UI(),XE(4),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(i,t){if(i&1){let e=lC();ws(0,"div",22)(1,"ds-json-schema-form",31),Rg("valueChange",function(s){If(e);let m=gC(2);return wf(m.onParamsChange(s))}),pl()();}if(i&2){let e=gC(2);XE(),bg("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.exportYaml())}),GC(1),pl();}if(i&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=lC();ws(0,"form",5),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"fieldset",6)(2,"legend",7),GC(3,"Scope"),pl(),rC(4,se,4,4,"label",8,Kw().trackByScope,true),pl(),ws(6,"div",9)(7,"label",10),GC(8,"Type "),ws(9,"span",11),GC(10,"*"),pl()(),ws(11,"select",12)(12,"option",13),GC(13,"Select type"),pl(),rC(14,ce,2,2,"option",14,Kw().trackByType,true),pl(),VI(),pl(),ws(16,"div",9)(17,"label",15),GC(18,"Name "),ws(19,"span",11),GC(20,"*"),pl()(),Sg(21,"input",16),VI(),pl(),ws(22,"div",9)(23,"label",17),GC(24,"Description"),pl(),Sg(25,"textarea",18),VI(),pl(),ws(26,"div",9)(27,"label",19),GC(28,"Auth Setting"),pl(),ws(29,"select",20)(30,"option",21),GC(31,"None"),pl(),rC(32,me,2,2,"option",14,nC),pl(),VI(),pl(),Jw(34,pe,7,2,"div",9),Jw(35,de,2,2,"div",22),ws(36,"div",23)(37,"button",24),GC(38),pl(),Jw(39,ge,2,2,"button",25),ws(40,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(41,"Cancel"),pl()()();}if(i&2){let e,n=gC();bg("formGroup",n.form),XE(),bg("disabled",n.isEditMode()),XE(3),oC(n.scopeOptions),XE(7),bg("formControl",n.typeControl),UI(),XE(3),oC(n.integrationTypes()),XE(7),bg("formControl",n.nameControl),UI(),XE(4),bg("formControl",n.descriptionControl),UI(),XE(4),bg("formControl",n.authSettingNameControl),UI(),XE(),bg("ngValue",null),XE(2),oC(n.availableAuthSettings()),XE(2),eC(n.isAutoGrantable()?34:-1),XE(),eC((e=n.schema())?35:-1,e),XE(2),bg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),eC(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class i{route=g(W);router=g(F);destroyRef=g(Ce);state=g(N);integrationTypeController=g(W$1);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?br(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true}),autoGrant:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Gi([]);paramsValue=Gi(null);initialParams=Gi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=mT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Hf(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"header",1)(2,"h1",2),GC(3),pl()(),Jw(4,le,2,0,"p",3)(5,ue,42,12,"form",4),pl()),e&2&&(XE(3),Yg(n.isEditMode()?"Edit integration":"New integration"),XE(),eC(n.isLoading()?4:5));},dependencies:[ni,Jn,Qn,ei,Ye,wt,At,mn,Zn,Xn,Cn,En,nt],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-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}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-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}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
1
+ import {v}from'./chunk-C-PGqagA.js';import {R}from'./chunk-DFV_94IQ.js';import {N}from'./chunk-BHaCDZtZ.js';import {g,ao as W,F,C as Ce,d8 as W$1,a as F$1,Q as br,G as Gi,m as mT,cd as Hf,b as U,e as xw,k as ws,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,v as eC,a9 as lC,q as Rg,s as rC,cH as Kw,a3 as VI,S as Sg,a4 as nC,ac as gC,u as bg,y as oC,a6 as UI,a5 as vl,aa as If,ab as wf}from'./main-E674WB3K.js';import'./chunk-fBYTYGxD.js';import {n as nt}from'./chunk-D-C39lLD.js';import'./chunk-zIMeg4Tv.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,a as wt,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-B_SBnFI8.js';import'./chunk-znO_jWPo.js';import'./chunk-DvgF2GEo.js';function le(i,t){i&1&&(ws(0,"p",3),GC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(ws(0,"label",8),Sg(1,"input",27),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,n=gC(2);XE(),bg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),XE(2),Yg(e.label);}}function ce(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e.type),XE(),Yg(e.displayName);}}function me(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function pe(i,t){if(i&1&&(ws(0,"div",9)(1,"label",28),Sg(2,"input",29),VI(),ws(3,"span",7),GC(4,"Grant automatically"),pl()(),ws(5,"p",30),GC(6),pl()()),i&2){let e=gC(2);XE(2),bg("formControl",e.autoGrantControl),UI(),XE(4),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(i,t){if(i&1){let e=lC();ws(0,"div",22)(1,"ds-json-schema-form",31),Rg("valueChange",function(s){If(e);let m=gC(2);return wf(m.onParamsChange(s))}),pl()();}if(i&2){let e=gC(2);XE(),bg("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.exportYaml())}),GC(1),pl();}if(i&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=lC();ws(0,"form",5),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"fieldset",6)(2,"legend",7),GC(3,"Scope"),pl(),rC(4,se,4,4,"label",8,Kw().trackByScope,true),pl(),ws(6,"div",9)(7,"label",10),GC(8,"Type "),ws(9,"span",11),GC(10,"*"),pl()(),ws(11,"select",12)(12,"option",13),GC(13,"Select type"),pl(),rC(14,ce,2,2,"option",14,Kw().trackByType,true),pl(),VI(),pl(),ws(16,"div",9)(17,"label",15),GC(18,"Name "),ws(19,"span",11),GC(20,"*"),pl()(),Sg(21,"input",16),VI(),pl(),ws(22,"div",9)(23,"label",17),GC(24,"Description"),pl(),Sg(25,"textarea",18),VI(),pl(),ws(26,"div",9)(27,"label",19),GC(28,"Auth Setting"),pl(),ws(29,"select",20)(30,"option",21),GC(31,"None"),pl(),rC(32,me,2,2,"option",14,nC),pl(),VI(),pl(),Jw(34,pe,7,2,"div",9),Jw(35,de,2,2,"div",22),ws(36,"div",23)(37,"button",24),GC(38),pl(),Jw(39,ge,2,2,"button",25),ws(40,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(41,"Cancel"),pl()()();}if(i&2){let e,n=gC();bg("formGroup",n.form),XE(),bg("disabled",n.isEditMode()),XE(3),oC(n.scopeOptions),XE(7),bg("formControl",n.typeControl),UI(),XE(3),oC(n.integrationTypes()),XE(7),bg("formControl",n.nameControl),UI(),XE(4),bg("formControl",n.descriptionControl),UI(),XE(4),bg("formControl",n.authSettingNameControl),UI(),XE(),bg("ngValue",null),XE(2),oC(n.availableAuthSettings()),XE(2),eC(n.isAutoGrantable()?34:-1),XE(),eC((e=n.schema())?35:-1,e),XE(2),bg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),eC(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class i{route=g(W);router=g(F);destroyRef=g(Ce);state=g(N);integrationTypeController=g(W$1);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?br(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true}),autoGrant:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Gi([]);paramsValue=Gi(null);initialParams=Gi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=mT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Hf(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"header",1)(2,"h1",2),GC(3),pl()(),Jw(4,le,2,0,"p",3)(5,ue,42,12,"form",4),pl()),e&2&&(XE(3),Yg(n.isEditMode()?"Edit integration":"New integration"),XE(),eC(n.isLoading()?4:5));},dependencies:[ni,Jn,Qn,ei,Ye,wt,At,mn,Zn,Xn,Cn,En,nt],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-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}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-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}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
@@ -1 +1 @@
1
- import {F as F$1,E}from'./chunk-pkNoeD9f.js';import {g,ao as W,F,C as Ce,da as $,aJ as Tr,G as Gi,bS as Ea,M as By,a7 as ya,Q as br,b as U$1,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,s as rC,ac as gC,u as bg,y as oC,a8 as Yg,aa as If,ab as wf}from'./main-EVOOW2CG.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-C8UVOyhT.js';import'./chunk-DJTNjd3B.js';import'./chunk-FV8LaU7e.js';import'./chunk-DAtwHi5G.js';var q=(i,e)=>e.key;function j(i,e){i&1&&(ws(0,"p",2),GC(1,"Loading agent configs\u2026"),pl());}function z(i,e){i&1&&(ws(0,"p",3),GC(1,"No agent configs available."),pl());}function B(i,e){i&1&&(ws(0,"ds-tag",12),GC(1,"Read-only"),pl());}function H(i,e){if(i&1){let t=lC();ws(0,"button",14),Rg("click",function(){If(t);let c=gC().$implicit,g=gC(2);return wf(g.launch(c))}),GC(1,"Launch"),pl();}}function J(i,e){if(i&1){let t=lC();ws(0,"button",14),Rg("click",function(){If(t);let c=gC().$implicit,g=gC(2);return wf(g.edit(c))}),GC(1,"Edit"),pl(),ws(2,"button",16),Rg("click",function(){If(t);let c=gC().$implicit,g=gC(2);return wf(g.delete(c))}),GC(3,"Delete"),pl();}}function U(i,e){if(i&1){let t=lC();ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td"),GC(6),pl(),ws(7,"td")(8,"div",10)(9,"ds-tag",11),GC(10),pl(),Jw(11,B,2,0,"ds-tag",12),pl()(),ws(12,"td",13)(13,"button",14),Rg("click",function(){let c=If(t).$implicit,g=gC(2);return wf(g.inspect(c))}),GC(14,"Inspect"),pl(),Jw(15,H,2,0,"button",15),Jw(16,J,4,0),pl()();}if(i&2){let t=e.$implicit,r=gC(2);XE(2),Yg(t.config.name),XE(2),Yg(t.config.description||"\u2014"),XE(2),Yg(r.mode(t)),XE(3),bg("variant",t.scope==="platform"?"neutral":"accent"),XE(),Yg(t.scope==="platform"?"Platform":"Namespace"),XE(),eC(t.scope==="platform"?11:-1),XE(4),eC(r.canLaunch(t)?15:-1),XE(),eC(t.scope==="namespace"?16:-1);}}function G(i,e){if(i&1){let t=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(c){If(t);let g=gC();return wf(g.rowFilter.query.set(c))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"Description"),pl(),ws(9,"th"),GC(10,"Execution mode"),pl(),ws(11,"th"),GC(12,"Scope"),pl(),ws(13,"th")(14,"span",7),GC(15,"Actions"),pl()()()(),ws(16,"tbody"),rC(17,U,17,8,"tr",null,q),pl()()();}if(i&2){let t=gC();bg("query",t.rowFilter.query()),XE(17),oC(t.rowFilter.filteredRows());}}var L=class i{route=g(W);router=g(F);destroyRef=g(Ce);controller=g($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),By({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(ya(()=>br([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((r,c)=>({key:`platform:${r.id??c}`,config:r,scope:"platform"})),...e.map((r,c)=>({key:`namespace:${r.id??c}`,config:r,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}delete(e){e.scope==="platform"||!e.config.id||!confirm(`Delete agent config \u201C${e.config.name}\u201D?`)||this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-namespace-agent-configs"]],decls:6,vars:1,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["type","button",1,"agent-configs__new",3,"click"],["role","status",1,"agent-configs__status"],[1,"agent-configs__status"],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],[1,"agent-configs__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"agent-configs__name"],[1,"agent-configs__description"],[1,"agent-configs__tags"],[3,"variant"],["variant","outline"],[1,"agent-configs__actions"],["type","button",3,"click"],["type","button"],["type","button",1,"agent-configs__delete",3,"click"]],template:function(t,r){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return r.openCreateForm()}),GC(2," New agent config "),pl()(),Jw(3,j,2,0,"p",2)(4,z,2,0,"p",3)(5,G,19,1)),t&2&&(XE(3),eC(r.isLoading()?3:r.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".agent-configs__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.agent-configs__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.agent-configs__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-configs__name[_ngcontent-%COMP%]{font-weight:500}.agent-configs__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.agent-configs__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.agent-configs__actions[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle;text-align:center}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.agent-configs__actions[_ngcontent-%COMP%] .agent-configs__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{L as NamespaceAgentConfigsComponent};
1
+ import {F as F$1,E}from'./chunk-fBYTYGxD.js';import {g,ao as W,F,C as Ce,da as $,aJ as Tr,G as Gi,bS as Ea,M as By,a7 as ya,Q as br,b as U$1,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,s as rC,ac as gC,u as bg,y as oC,a8 as Yg,aa as If,ab as wf}from'./main-E674WB3K.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-D-C39lLD.js';import'./chunk-zIMeg4Tv.js';import'./chunk-B_SBnFI8.js';import'./chunk-DvgF2GEo.js';var q=(i,e)=>e.key;function j(i,e){i&1&&(ws(0,"p",2),GC(1,"Loading agent configs\u2026"),pl());}function z(i,e){i&1&&(ws(0,"p",3),GC(1,"No agent configs available."),pl());}function B(i,e){i&1&&(ws(0,"ds-tag",12),GC(1,"Read-only"),pl());}function H(i,e){if(i&1){let t=lC();ws(0,"button",14),Rg("click",function(){If(t);let c=gC().$implicit,g=gC(2);return wf(g.launch(c))}),GC(1,"Launch"),pl();}}function J(i,e){if(i&1){let t=lC();ws(0,"button",14),Rg("click",function(){If(t);let c=gC().$implicit,g=gC(2);return wf(g.edit(c))}),GC(1,"Edit"),pl(),ws(2,"button",16),Rg("click",function(){If(t);let c=gC().$implicit,g=gC(2);return wf(g.delete(c))}),GC(3,"Delete"),pl();}}function U(i,e){if(i&1){let t=lC();ws(0,"tr")(1,"td",8),GC(2),pl(),ws(3,"td",9),GC(4),pl(),ws(5,"td"),GC(6),pl(),ws(7,"td")(8,"div",10)(9,"ds-tag",11),GC(10),pl(),Jw(11,B,2,0,"ds-tag",12),pl()(),ws(12,"td",13)(13,"button",14),Rg("click",function(){let c=If(t).$implicit,g=gC(2);return wf(g.inspect(c))}),GC(14,"Inspect"),pl(),Jw(15,H,2,0,"button",15),Jw(16,J,4,0),pl()();}if(i&2){let t=e.$implicit,r=gC(2);XE(2),Yg(t.config.name),XE(2),Yg(t.config.description||"\u2014"),XE(2),Yg(r.mode(t)),XE(3),bg("variant",t.scope==="platform"?"neutral":"accent"),XE(),Yg(t.scope==="platform"?"Platform":"Namespace"),XE(),eC(t.scope==="platform"?11:-1),XE(4),eC(r.canLaunch(t)?15:-1),XE(),eC(t.scope==="namespace"?16:-1);}}function G(i,e){if(i&1){let t=lC();ws(0,"agentos-table-filter",4),Rg("queryChange",function(c){If(t);let g=gC();return wf(g.rowFilter.query.set(c))}),pl(),ws(1,"div",5)(2,"table",6)(3,"thead")(4,"tr")(5,"th"),GC(6,"Name"),pl(),ws(7,"th"),GC(8,"Description"),pl(),ws(9,"th"),GC(10,"Execution mode"),pl(),ws(11,"th"),GC(12,"Scope"),pl(),ws(13,"th")(14,"span",7),GC(15,"Actions"),pl()()()(),ws(16,"tbody"),rC(17,U,17,8,"tr",null,q),pl()()();}if(i&2){let t=gC();bg("query",t.rowFilter.query()),XE(17),oC(t.rowFilter.filteredRows());}}var L=class i{route=g(W);router=g(F);destroyRef=g(Ce);controller=g($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);rows=Gi([]);rowFilter=F$1(this.rows,e=>[e.config.name,e.config.description,this.mode(e),e.scope].filter(Boolean).join(" "));allConfigs$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),By({namespace:this.controller.listByParentAgentConfig(this.namespaceId),platform:this.controller.listPlatformAgentsAgentConfig().pipe(ya(()=>br([])))}))));constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:e,platform:t})=>{this.rows.set([...t.map((r,c)=>({key:`platform:${r.id??c}`,config:r,scope:"platform"})),...e.map((r,c)=>({key:`namespace:${r.id??c}`,config:r,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}inspect(e){e.config.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","agent-configs",e.config.id,"inspect"]:["/agentos",this.namespaceId,"agent-configs",e.config.id,"inspect"]);}launch(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"launch"]);}edit(e){e.scope==="platform"||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"agent-configs",e.config.id,"edit"]);}delete(e){e.scope==="platform"||!e.config.id||!confirm(`Delete agent config \u201C${e.config.name}\u201D?`)||this.controller.deleteAgentConfig(e.config.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}canLaunch(e){return e.scope==="namespace"&&e.config.executionMode==="LOOP"}mode(e){return e.config.executionMode??(e.config.advancedExecution?"ADVANCED":"SIMPLE")}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-namespace-agent-configs"]],decls:6,vars:1,consts:[["title","Agent configs","description","Agent configurations available in this namespace, including configurations inherited from the platform."],["type","button",1,"agent-configs__new",3,"click"],["role","status",1,"agent-configs__status"],[1,"agent-configs__status"],["label","Filter agent configs","placeholder","Filter agent configs\u2026",3,"queryChange","query"],[1,"agent-configs__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"agent-configs__name"],[1,"agent-configs__description"],[1,"agent-configs__tags"],[3,"variant"],["variant","outline"],[1,"agent-configs__actions"],["type","button",3,"click"],["type","button"],["type","button",1,"agent-configs__delete",3,"click"]],template:function(t,r){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return r.openCreateForm()}),GC(2," New agent config "),pl()(),Jw(3,j,2,0,"p",2)(4,z,2,0,"p",3)(5,G,19,1)),t&2&&(XE(3),eC(r.isLoading()?3:r.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn,E],styles:[".agent-configs__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.agent-configs__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.agent-configs__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-configs__name[_ngcontent-%COMP%]{font-weight:500}.agent-configs__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.agent-configs__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.agent-configs__actions[_ngcontent-%COMP%]{white-space:nowrap;vertical-align:middle;text-align:center}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.agent-configs__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.agent-configs__actions[_ngcontent-%COMP%] .agent-configs__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{L as NamespaceAgentConfigsComponent};
@@ -1,4 +1,4 @@
1
- import {s as se}from'./chunk-CJaI0n6Y.js';import {b as Fr,Q as Qi,F as Fn,K as Ki,h as ht,w as wr,k as kr}from'./chunk-C8UVOyhT.js';import {g,D as py,P,W as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,B as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,Q as br,r as re,bQ as Gy,bR as wd,bS as Ea,aF as R$1,bu as Ve$1,bT as pn,bU as Td,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,z as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-EVOOW2CG.js';import {D}from'./chunk-FV8LaU7e.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Ki,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:Qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
1
+ import {s as se}from'./chunk-CB_envwE.js';import {b as Fr,Q as Qi,F as Fn,K as Ki,h as ht,w as wr,k as kr}from'./chunk-D-C39lLD.js';import {g,D as py,P,W as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,B as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,Q as br,r as re,bQ as Gy,bR as wd,bS as Ea,aF as R$1,bu as Ve$1,bT as pn,bU as Td,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,z as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-E674WB3K.js';import {D}from'./chunk-B_SBnFI8.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Ki,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:Qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
2
2
  width: 100%;
3
3
  max-height: 256px;
4
4
  visibility: hidden;